Adjustments to ZigbeeTest and Python files to use just 1 port for shooting Zigbee...
[iot2.git] / benchmarks / other / ZigbeeTest / ZigbeeTest_waterleak.java
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);