Completing ZigbeeTest with doorlock test
[iot2.git] / benchmarks / other / ZigbeeTest / ZigbeeTest_multipurpose.java
index bec2d37..bb5c836 100644 (file)
@@ -12,10 +12,10 @@ import java.rmi.RemoteException;
 public class ZigbeeTest_multipurpose implements SmartthingsSensorCallback {
        public final int SOCKET_SEND_BUFFER_SIZE = 1024;
        public final int SOCKET_RECEIVE_BUFFER_SIZE = 1024;
-       private static final String MY_IP_ADDRESS = "192.168.2.108";
+       private static final String MY_IP_ADDRESS = "192.168.1.198";
        public static final String DEVIDE_MAC_ADDRESS = "000d6f000bbd3413"; //Multipurpose sensor
 
-    public void newReadingAvailable(int _sensorId, int _value, boolean _activeValue) {
+    public void newReadingAvailable(int _value, boolean _activeValue) {
         System.out.println("New Message!!!!");
         System.out.println("multipurpose : "+ _value);
         System.out.println("active? : "+ _activeValue);
@@ -26,17 +26,19 @@ public class ZigbeeTest_multipurpose implements SmartthingsSensorCallback {
         String message = "type: policy_set\n";
         message += "ip_address: " + MY_IP_ADDRESS + "\n"; // local ip address
         message += "port: " + "5957\n";  // port number
+        //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);
+        DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName("192.168.1.192"), 5005);
         //DatagramSocket socket = new DatagramSocket(11111);
-               DatagramSocket socket = new DatagramSocket(12345);
+        DatagramSocket socket = new DatagramSocket(12345);
         socket.setSendBufferSize(4096);
         socket.setReceiveBufferSize(4096);
         socket.send(sendPacket);
-               socket.setReuseAddress(true);
-        socket.close();
+       socket.setReuseAddress(true);
+       socket.close();
 
-        IoTDeviceAddress zigUdpAddr  = new IoTDeviceAddress("192.168.2.227", 5957, 5005,false,false);
+        IoTDeviceAddress zigUdpAddr  = new IoTDeviceAddress("192.168.1.192", 5957, 5005,false,false);
+        //IoTDeviceAddress zigUdpAddr  = new IoTDeviceAddress("192.168.2.227", 5956, 5005,false,false);
         IoTZigbeeAddress zigAddrLong = new IoTZigbeeAddress(DEVIDE_MAC_ADDRESS);
 
         Set<IoTZigbeeAddress> zigSet = new HashSet<IoTZigbeeAddress>();