Perfecting 4th benchmark; adding needed MySQL config files; maturing Zigbee drivers
[iot2.git] / benchmarks / drivers / MotionSensor / MotionSensor.java
index 6520de0ffaa7311366fa2dcdb0be6dc01db8492c..23e31b59ca8d8a3d4a94a24d5220a7d92e82b3ab 100644 (file)
@@ -42,12 +42,14 @@ public class MotionSensor implements IoTZigbeeCallback, SmartthingsSensor {
 
        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() {
@@ -59,20 +61,20 @@ public class MotionSensor implements IoTZigbeeCallback, SmartthingsSensor {
                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());