+ //made by Jiawei
+ public void sendLockOrUnlockDoorRequest(int packetId, int clusterId, int profileId, int deviceEndpoint, int value) throws IOException {
+ String message = "type: zcl_lock_or_unlock_door_request\n";
+ message += "packet_id: " + String.format("%04x", packetId) + "\n";
+ message += "value: " + String.format("%01x", value) + "\n";
+ message += "cluster_id: " + String.format("%04x", clusterId) + "\n";
+ message += "profile_id: " + String.format("%04x", profileId) + "\n";
+ message += "device_address_long: " + zigbeeAddress.getAddress() + "\n";
+ message += "device_endpoint: " + String.format("%02x", deviceEndpoint) + "\n";
+ DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName(strHostAddress), iDstPort);
+ socket.send(sendPacket);
+ }
+
+ //made by Jiawei
+ public void sendReadDoorStatusRequest(int packetId, int clusterId, int profileId, int deviceEndpoint, int framecontrol, int commandframe, int attribute_id) throws IOException {
+ String message = "type: zcl_read_door_status_request\n";
+ message += "packet_id: " + String.format("%04x", packetId) + "\n";
+ message += "framecontrol: " + String.format("%02x", framecontrol) + "\n";
+ message += "cluster_id: " + String.format("%04x", clusterId) + "\n";
+ message += "profile_id: " + String.format("%04x", profileId) + "\n";
+ message += "device_address_long: " + zigbeeAddress.getAddress() + "\n";
+ message += "device_endpoint: " + String.format("%02x", deviceEndpoint) + "\n";
+ message += "commandframe: " + String.format("%02x", commandframe) + "\n";
+ message += "attribute_id: " + String.format("%04x", attribute_id) + "\n";
+ DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName(strHostAddress), iDstPort);
+ socket.send(sendPacket);
+ }
+