Adjustments to ZigbeeTest and Python files to use just 1 port for shooting Zigbee...
authorrtrimana <rtrimana@uci.edu>
Thu, 5 Jan 2017 22:07:39 +0000 (14:07 -0800)
committerrtrimana <rtrimana@uci.edu>
Thu, 5 Jan 2017 22:07:39 +0000 (14:07 -0800)
benchmarks/other/ZigbeeTest/ZigbeeTest_motion.java
benchmarks/other/ZigbeeTest/ZigbeeTest_multipurpose.java
benchmarks/other/ZigbeeTest/ZigbeeTest_waterleak.java
iotjava/Makefile
iotjava/iotruntime/master/ZigbeeConfig.java
others/sslkey/192.168.2.108.jks [new file with mode: 0644]
others/sslkey/192.168.2.191.jks [new file with mode: 0644]
others/sslkey/192.168.2.192.jks [new file with mode: 0644]
others/sslkey/192.168.2.244.jks [new file with mode: 0644]

index e62301f..832e0be 100644 (file)
@@ -30,10 +30,13 @@ public class ZigbeeTest_motion implements SmartthingsSensorCallback {
         message += "port: " + "5956\n";  // port number
         message += "device_address_long: " + DEVIDE_MAC_ADDRESS + "\n";
         DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName("192.168.2.227"), 5005); // address and port of the gateway which means Raspberry PI's IP address
-        DatagramSocket socket = new DatagramSocket(11222);
+        //DatagramSocket socket = new DatagramSocket(11222);
+               DatagramSocket socket = new DatagramSocket(12345);
         socket.setSendBufferSize(4096);
         socket.setReceiveBufferSize(4096);
         socket.send(sendPacket);
+               socket.setReuseAddress(true);
+        socket.close();
 
         IoTDeviceAddress zigUdpAddr  = new IoTDeviceAddress("192.168.2.227", 5956, 5005,false,false);
         IoTZigbeeAddress zigAddrLong = new IoTZigbeeAddress(DEVIDE_MAC_ADDRESS);
index a9298cd..8265f6b 100644 (file)
@@ -28,10 +28,13 @@ public class ZigbeeTest_multipurpose implements SmartthingsSensorCallback {
         message += "port: " + "5957\n";  // port number
         message += "device_address_long: " + DEVIDE_MAC_ADDRESS + "\n";
         DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName("192.168.2.227"), 5005);
-        DatagramSocket socket = new DatagramSocket(11111);
+        //DatagramSocket socket = new DatagramSocket(11111);
+               DatagramSocket socket = new DatagramSocket(12345);
         socket.setSendBufferSize(4096);
         socket.setReceiveBufferSize(4096);
         socket.send(sendPacket);
+               socket.setReuseAddress(true);
+        socket.close();
 
         IoTDeviceAddress zigUdpAddr  = new IoTDeviceAddress("192.168.2.227", 5957, 5005,false,false);
         IoTZigbeeAddress zigAddrLong = new IoTZigbeeAddress(DEVIDE_MAC_ADDRESS);
index 1bd5524..856fe20 100644 (file)
@@ -29,10 +29,13 @@ public class ZigbeeTest_waterleak implements SmartthingsSensorCallback {
         message += "port: " + PORT_NUMBER + "\n";  // port number
         message += "device_address_long: " + DEVIDE_MAC_ADDRESS + "\n";
         DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName("192.168.2.227"), 5005); // address and port of the gateway which means Raspberry PI's IP address
-        DatagramSocket socket = new DatagramSocket(22222);
+        //DatagramSocket socket = new DatagramSocket(22222);
+               DatagramSocket socket = new DatagramSocket(12345);
         socket.setSendBufferSize(4096);
         socket.setReceiveBufferSize(4096);
         socket.send(sendPacket);
+               socket.setReuseAddress(true);
+        socket.close();
 
         IoTDeviceAddress zigUdpAddr  = new IoTDeviceAddress("192.168.2.227", PORT_NUMBER, 5005,false,false);
         IoTZigbeeAddress zigAddrLong = new IoTZigbeeAddress(DEVIDE_MAC_ADDRESS);
index c90044f..a0a67f1 100644 (file)
@@ -178,7 +178,7 @@ runtime:
        $(JAVAC) -classpath .:$(RUNTIMEJARS):$(PHONEJARS):$(ZIPJARS) iotruntime/*.java iotruntime/master/*.java iotruntime/slave/*.java iotruntime/messages/*.java iotruntime/stub/*.java iotruntime/zigbee/*.java -d $(BIN_DIR)
        cp ../localconfig/iotruntime/IoTMaster.config $(BIN_DIR)/iotruntime/
        cp ../localconfig/iotruntime/IoTSlave.config $(BIN_DIR)/iotruntime/
-       cp ../sslkey/*.jks $(BIN_DIR)/iotruntime/
+       cp ../others/sslkey/*.jks $(BIN_DIR)/iotruntime/
        cp -r ../localconfig/mysql $(BIN_DIR)/iotruntime/
 
 PHONY += doc
index 3ded618..7bf6f3e 100644 (file)
@@ -101,7 +101,8 @@ public final class ZigbeeConfig {
         *
         * @return  void
         */
-       public void closeConnection() {
+       public void closeConnection() throws IOException {
+               socket.setReuseAddress(true);
                socket.close();
        }
 }
diff --git a/others/sslkey/192.168.2.108.jks b/others/sslkey/192.168.2.108.jks
new file mode 100644 (file)
index 0000000..382855a
Binary files /dev/null and b/others/sslkey/192.168.2.108.jks differ
diff --git a/others/sslkey/192.168.2.191.jks b/others/sslkey/192.168.2.191.jks
new file mode 100644 (file)
index 0000000..24c90ac
Binary files /dev/null and b/others/sslkey/192.168.2.191.jks differ
diff --git a/others/sslkey/192.168.2.192.jks b/others/sslkey/192.168.2.192.jks
new file mode 100644 (file)
index 0000000..f231763
Binary files /dev/null and b/others/sslkey/192.168.2.192.jks differ
diff --git a/others/sslkey/192.168.2.244.jks b/others/sslkey/192.168.2.244.jks
new file mode 100644 (file)
index 0000000..120bdfe
Binary files /dev/null and b/others/sslkey/192.168.2.244.jks differ