Perfecting 4th benchmark; adding needed MySQL config files; maturing Zigbee drivers
[iot2.git] / iotjava / iotruntime / zigbee / IoTZigbee.java
index a7729188d89fc7c685581e9b774e257278e8bfde..b4f2a3fcd50bc7f84a7cfd971b767c4b4b9ff36b 100644 (file)
@@ -287,7 +287,28 @@ public class IoTZigbee {
                                } else {
                                        IoTZigbeeMessage callbackMessage = null;
 
-                                       if (packetData.get("type").equals("zcl_read_attributes_response")) {
+                                       //made by changwoo
+                                       if (packetData.get("type").equals("zcl_zone_status_change_notification")){
+                                               int packetId = Integer.parseInt(packetData.get("packet_id"), 16);
+                                               int clusterId = Integer.parseInt(packetData.get("cluster_id"), 16);
+                                               int profileId = Integer.parseInt(packetData.get("profile_id"), 16);
+                                               int status = Integer.parseInt(packetData.get("status"), 10);
+                                               boolean successOrFail = false;
+                                               if(packetData.get("attributes").equals("success")) successOrFail=true;
+                                               callbackMessage = new IoTZigbeeMessageZclZoneStatusChangeNotification(packetId, clusterId, profileId, status, successOrFail);
+
+                                       //made by changwoo
+                                       } else if (packetData.get("type").equals("zcl_write_attributes_response")) {
+
+                                               int packetId = Integer.parseInt(packetData.get("packet_id"), 16);
+                                               int clusterId = Integer.parseInt(packetData.get("cluster_id"), 16);
+                                               int profileId = Integer.parseInt(packetData.get("profile_id"), 16);
+                                               boolean successOrFail = false;
+                                               if(packetData.get("attributes").equals("success")) successOrFail=true;
+                                               
+                                               callbackMessage = new IoTZigbeeMessageZclWriteAttributesResponse(packetId, clusterId, profileId, successOrFail);
+
+                                       } else if (packetData.get("type").equals("zcl_read_attributes_response")) {
                                                int packetId = Integer.parseInt(packetData.get("packet_id"), 16);
                                                int clusterId = Integer.parseInt(packetData.get("cluster_id"), 16);
                                                int profileId = Integer.parseInt(packetData.get("profile_id"), 16);