@config private IoTSet<IoTDeviceAddress> motionSensorUdpAddress;
@config private IoTSet<IoTZigbeeAddress> motionSensorZigbeeAddress;
+ // TODO: Test constructor
//public MotionSensor(IoTSet<IoTDeviceAddress> dSet, IoTSet<IoTZigbeeAddress> zigSet) {
//motionSensorUdpAddress = dSet;
//motionSensorZigbeeAddress = zigSet;
//}
+
public MotionSensor() {
}
zigConnection.init();
System.out.println("Initialized!");
- //made by changwoo
+ // made by Changwoo
sleep(10);
System.out.println("Sending Management Permit Joining Request");
sleep(0);
}
- //made by changwoo
+ // made by Changwoo
while (!didWriteAttrb.get()) {
System.out.println("Sending Write Attribute Request");
zigConnection.sendWriteAttributesCommand(0x0002, 0x0500, 0x0104, 0x01);
sleep(0);
}
- //made by changwoo
+ // made by Changwoo
System.out.println("Sending Enrollment Reponse");
zigConnection.sendEnrollmentResponse(0x0003, 0x0500, 0x0104, 0x01);
sleep(0);
}
}
- //made by changwoo
+ // made by Changwoo
private void sleep(int multipleTime){
if(multipleTime<=0){
multipleTime=1;
public void newMessageAvailable(IoTZigbeeMessage _zm) {
- //made by changwoo
+ // made by Changwoo
if(_zm instanceof IoTZigbeeMessageZclZoneStatusChangeNotification){
IoTZigbeeMessageZclZoneStatusChangeNotification message = (IoTZigbeeMessageZclZoneStatusChangeNotification)_zm;
if(message.getSuccessOrFail()){
}
}//if
- //made by changwoo
+ // made by Changwoo
} else if (_zm instanceof IoTZigbeeMessageZclWriteAttributesResponse) {
IoTZigbeeMessageZclWriteAttributesResponse message = (IoTZigbeeMessageZclWriteAttributesResponse)_zm;
if (message.getSuccessOrFail()) {