private int sensorId = 0;
- @config private IoTSet<IoTDeviceAddress> devUdpAddress;
- @config private IoTSet<IoTZigbeeAddress> devZigbeeAddress;
-
- public MotionSensor(IoTSet<IoTDeviceAddress> dSet, IoTSet<IoTZigbeeAddress> zigSet) {
- //devUdpAddress = dSet;
- //devZigbeeAddress = zigSet;
+ @config private IoTSet<IoTDeviceAddress> motionSensorUdpAddress;
+ @config private IoTSet<IoTZigbeeAddress> motionSensorZigbeeAddress;
+
+ //public MotionSensor(IoTSet<IoTDeviceAddress> dSet, IoTSet<IoTZigbeeAddress> zigSet) {
+ //motionSensorUdpAddress = dSet;
+ //motionSensorZigbeeAddress = zigSet;
+ //}
+ public MotionSensor() {
}
public void init() {
didAlreadyClose.set(false);
try {
- Iterator itrUdp = devUdpAddress.iterator();
- Iterator itrZig = devZigbeeAddress.iterator();
+ Iterator itrUdp = motionSensorUdpAddress.iterator();
+ Iterator itrZig = motionSensorZigbeeAddress.iterator();
zigConnection = new IoTZigbee((IoTDeviceAddress)itrUdp.next(), (IoTZigbeeAddress)itrZig.next());
// DEBUG
System.out.println("DEBUG: Allocate iterators to print out addresses!");
- Iterator itrDebugUdp = devUdpAddress.iterator();
+ Iterator itrDebugUdp = motionSensorUdpAddress.iterator();
IoTDeviceAddress iotaddDebug = (IoTDeviceAddress)itrDebugUdp.next();
System.out.println("IP address: " + iotaddDebug.getCompleteAddress());
System.out.println("Source port: " + iotaddDebug.getSourcePortNumber());
System.out.println("Destination port: " + iotaddDebug.getDestinationPortNumber());
- Iterator itrDebugZig = devZigbeeAddress.iterator();
+ Iterator itrDebugZig = motionSensorZigbeeAddress.iterator();
IoTZigbeeAddress iotzbaddDebug = (IoTZigbeeAddress)itrDebugZig.next();
System.out.println("Zigbee address: " + iotzbaddDebug.getAddress());