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 e62301fbbfcfe9dff38eab5a4f584e3482c475fb..832e0be3442b2604728f78c5fd64884705e6a55b 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 a9298cd5cdc71c6becaeb6736a9dc0a0d7c75573..8265f6b65d80bfefe00652dc233b8772afbe5452 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 1bd55245c768ce1de1561a79902b4d1354c2f0b3..856fe20bc80041d58ff4678dc878c36d58fed55e 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 c90044f316c5c1f635c81fb1d2a4099a1f2d17e6..a0a67f19288bc734f579982cb4cb19988b92d21d 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 3ded6188c11d53cb7adf2245dedb63c28b09da25..7bf6f3eaec5c4310876a0f4406c2111e36fc4552 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