From 79a07095edcd2818516d3608302323e0c37d1f81 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Wed, 21 Jun 2017 10:51:49 -0700 Subject: [PATCH] Adding changes and files for doorlock driver --- .../Java/DoorlockSensor/DoorlockSensor.config | 7 + .../Java/DoorlockSensor/DoorlockSensor.java | 282 ++++++++++++++++++ .../SmartthingsSensorSmartCallback_Stub.java | 47 +++ .../SmartthingsSensor_Skeleton.java | 276 +++++++++++++++++ benchmarks/drivers/Java/Makefile | 12 + .../other/DoorlockAndOutlet/IoTZigbee.java | 2 + benchmarks/other/ZigbeeTest/IoTZigbee.java | 2 +- iotjava/gmon.out | Bin 0 -> 125838 bytes iotjava/iotruntime/zigbee/IoTZigbee.java | 9 +- ...igbeeMessageZclReadAttributesResponse.java | 2 +- 10 files changed, 635 insertions(+), 4 deletions(-) create mode 100644 benchmarks/drivers/Java/DoorlockSensor/DoorlockSensor.config create mode 100644 benchmarks/drivers/Java/DoorlockSensor/DoorlockSensor.java create mode 100644 benchmarks/drivers/Java/DoorlockSensor/SmartthingsSensorSmartCallback_Stub.java create mode 100644 benchmarks/drivers/Java/DoorlockSensor/SmartthingsSensor_Skeleton.java create mode 100644 iotjava/gmon.out diff --git a/benchmarks/drivers/Java/DoorlockSensor/DoorlockSensor.config b/benchmarks/drivers/Java/DoorlockSensor/DoorlockSensor.config new file mode 100644 index 0000000..73b43f1 --- /dev/null +++ b/benchmarks/drivers/Java/DoorlockSensor/DoorlockSensor.config @@ -0,0 +1,7 @@ +# Skeleton/original interface +INTERFACE_CLASS=SmartthingsSensor +# Stub +INTERFACE_STUB_CLASS=SmartthingsSensorSmart + +# Language +LANGUAGE=Java diff --git a/benchmarks/drivers/Java/DoorlockSensor/DoorlockSensor.java b/benchmarks/drivers/Java/DoorlockSensor/DoorlockSensor.java new file mode 100644 index 0000000..a3ea772 --- /dev/null +++ b/benchmarks/drivers/Java/DoorlockSensor/DoorlockSensor.java @@ -0,0 +1,282 @@ +package iotcode.DoorlockSensor; + +// Standard Java Packages +import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.Semaphore; + +// Checker annotations +//import iotchecker.qual.*; +import iotcode.annotation.*; + +// IoT Packages +import iotruntime.slave.*; +import iotcode.interfaces.*; +import iotruntime.zigbee.*; + +/** Class Smartthings sensor driver for Smartthings sensor devices. + * + * @author Changwoo Lee, Rahmadi Trimananda + * @version 1.0 + * @since 2016-12-01 + */ +public class DoorlockSensor implements IoTZigbeeCallback, SmartthingsSensor { + + private final int TIMEOUT_FOR_RESEND_MSEC = 900; + + private IoTZigbee zigConnection = null; + private boolean didClose; // make sure that the clean up was done correctly + private boolean detectStatus = false; + + private int detectedValue = 0; + private Date timestampOfLastDetecting = null; + + private AtomicBoolean didAlreadyClose = new AtomicBoolean(true); + private AtomicBoolean didAlreadyInit = new AtomicBoolean(false); + private AtomicBoolean didWriteAttrb = new AtomicBoolean(false); + private AtomicBoolean didMatchDscr = new AtomicBoolean(false); + private AtomicBoolean didBind = new AtomicBoolean(false); + private AtomicBoolean didDoorLockConfigureReporting = new AtomicBoolean(false); //made by Jiawei + static Semaphore gettingLatestDataMutex = new Semaphore(1); + + private List < SmartthingsSensorSmartCallback > callbackList = new CopyOnWriteArrayList < SmartthingsSensorSmartCallback > (); + + private int sensorId = 0; + + @config private IoTSet DoorlockSensorUdpAddress; + @config private IoTSet DoorlockSensorZigbeeAddress; + + public DoorlockSensor(IoTSet dSet, IoTSet zigSet) { + DoorlockSensorUdpAddress = dSet; + DoorlockSensorZigbeeAddress = zigSet; + } + + public DoorlockSensor() { + } + + public void init() { + + if (didAlreadyInit.compareAndSet(false, true) == false) { + return; // already init + } + + didAlreadyClose.set(false); + + try { + Iterator itrUdp = DoorlockSensorUdpAddress.iterator(); + Iterator itrZig = DoorlockSensorZigbeeAddress.iterator(); + + zigConnection = new IoTZigbee((IoTDeviceAddress)itrUdp.next(), (IoTZigbeeAddress)itrZig.next()); + + // DEBUG + System.out.println("DEBUG: Allocate iterators to print out addresses!"); + Iterator itrDebugUdp = DoorlockSensorUdpAddress.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 = DoorlockSensorZigbeeAddress.iterator(); + IoTZigbeeAddress iotzbaddDebug = (IoTZigbeeAddress)itrDebugZig.next(); + System.out.println("Zigbee address: " + iotzbaddDebug.getAddress()); + + zigConnection.registerCallback(this); + System.out.println("Register callback!"); + zigConnection.init(); + System.out.println("Initialized!"); + + + + //made by changwoo + sleep(10); + + // System.out.println("BroadcastingRouteRecordRequest "); + // zigConnection.sendBroadcastingRouteRecordRequest(0x0001); + // sleep(6); + + System.out.println("Sending Management Permit Joining Request"); + // for(int z=0; z<3; z++){ + zigConnection.sendManagementPermitJoiningRequest(0x0002, 0x0036, 0x00); + sleep(0); + // } + + + while(!didBind.get()){ + System.out.println("Sending Bind Request"); + zigConnection.sendBindRequest(0x0003, 0x0101, 0x02); + sleep(0); + } + + while(!didDoorLockConfigureReporting.get()){ + System.out.println("Sending Door Lock: Configure Reporting"); + zigConnection.sendConfigureReportingCommand(0x0004, 0x0101, 0x0104, 0x01, 0x02, 0x0000, 0x30, 0x0000, 0x100E, null); + sleep(0); + } + + while(true){ + Scanner in = new Scanner(System.in); + System.out.println("\nUnlock door: 0"); + System.out.println("Lock door: 1"); + System.out.println("Read status: 2 (or anything else)"); + String str = in.next(); + if(str.equals("1")) { + System.out.println("the doorlock sensor is locking"); + zigConnection.sendLockOrUnlockDoorRequest(0x0005, 0x0101, 0x0104, 0x02, 0); + sleep(0); + }else if(str.equals("0")){ + System.out.println("the doorlock sensor is unlocking"); + zigConnection.sendLockOrUnlockDoorRequest(0x0005, 0x0101, 0x0104, 0x02, 1); + sleep(0); + }else{ + System.out.println("Let's see the doorlock sensor's status currently"); + zigConnection.sendReadDoorStatusRequest(0x0005, 0x0101, 0x0104, 0x02, 0x10, 0x00, 0x0000); + sleep(0); + } + } + + + } catch (Exception e) { + e.printStackTrace(); + } + } + + //made by changwoo + private void sleep(int multipleTime){ + if(multipleTime<=0){ + multipleTime=1; + } + try{ + Thread.sleep(TIMEOUT_FOR_RESEND_MSEC*multipleTime); + } catch(Exception e){ + e.printStackTrace(); + } + } + + // made by Jiawei + //public int getStatus() { + public int getValue() { + int tmp = 0; + + try { + gettingLatestDataMutex.acquire(); + tmp = detectedValue; + + } catch (Exception e) { + e.printStackTrace(); + } + gettingLatestDataMutex.release(); + + return tmp; + } + + public boolean isActiveValue() { + + int tmp = getValue(); + if (tmp == 1) + detectStatus = true; // Door is locked + else + detectStatus = false; // Door is not locked/not fully locked + return detectStatus; + } + + public void close() { + + if (didAlreadyClose.compareAndSet(false, true) == false) { + return; // already init + } + + didAlreadyInit.set(false); + + + try { + zigConnection.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void Finalize() { + if (!didClose) { + close(); + } + } + + public void setId(int id) { + + sensorId = id; + + } + + public int getId() { + + return sensorId; + + } + + + public long getTimestampOfLastReading() { + + Date tmp = null; + try { + gettingLatestDataMutex.acquire(); + tmp = (Date)timestampOfLastDetecting.clone(); + + } catch (Exception e) { + e.printStackTrace(); + } + gettingLatestDataMutex.release(); + long retLong = tmp.getTime(); + + return retLong; + } + + public void newMessageAvailable(IoTZigbeeMessage _zm) { + + //made by yuting + if (_zm instanceof IoTZigbeeMessageZdoBindResponse) { + IoTZigbeeMessageZdoBindResponse message = (IoTZigbeeMessageZdoBindResponse)_zm; + if (message.getSucceeded()) { + didBind.set(true); + } + } + else if (_zm instanceof IoTZigbeeMessageZclConfigureReportingResponse){ + IoTZigbeeMessageZclConfigureReportingResponse message = (IoTZigbeeMessageZclConfigureReportingResponse)_zm; + if (message.getAllSuccess()) { + didDoorLockConfigureReporting.set(true); + } + } + else if (_zm instanceof IoTZigbeeMessageZclReadAttributesResponse) { + IoTZigbeeMessageZclReadAttributesResponse message = (IoTZigbeeMessageZclReadAttributesResponse)_zm; + List attrList = message.getAttributes(); + + if (attrList.size() == 1) { + if(attrList.get(0).getAttributeId() == 0) { + byte[] data = attrList.get(0).getData(); + int value = data[0]; + + try { + gettingLatestDataMutex.acquire(); + detectedValue = value; + timestampOfLastDetecting = new Date(); + } catch (Exception e) { + e.printStackTrace(); + } + gettingLatestDataMutex.release(); + + try { + for (SmartthingsSensorSmartCallback cb : callbackList) { + cb.newReadingAvailable(this.getId(), this.getValue(), this.isActiveValue()); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + } + + public void registerCallback(SmartthingsSensorSmartCallback _callbackTo) { + callbackList.add(_callbackTo); + } +} diff --git a/benchmarks/drivers/Java/DoorlockSensor/SmartthingsSensorSmartCallback_Stub.java b/benchmarks/drivers/Java/DoorlockSensor/SmartthingsSensorSmartCallback_Stub.java new file mode 100644 index 0000000..df26eb4 --- /dev/null +++ b/benchmarks/drivers/Java/DoorlockSensor/SmartthingsSensorSmartCallback_Stub.java @@ -0,0 +1,47 @@ +package iotcode.DoorlockSensor; + +import java.io.IOException; +import java.util.List; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import java.util.concurrent.atomic.AtomicBoolean; +import iotrmi.Java.IoTRMIComm; +import iotrmi.Java.IoTRMICommClient; +import iotrmi.Java.IoTRMICommServer; +import iotrmi.Java.IoTRMIUtil; + +import iotcode.interfaces.*; + +public class SmartthingsSensorSmartCallback_Stub implements SmartthingsSensorSmartCallback { + + private int objectId = 3; + private IoTRMIComm rmiComm; + // Synchronization variables + + + public SmartthingsSensorSmartCallback_Stub(int _localPortSend, int _localPortRecv, int _portSend, int _portRecv, String _skeletonAddress, int _rev) throws Exception { + if (_localPortSend != 0 && _localPortRecv != 0) { + rmiComm = new IoTRMICommClient(_localPortSend, _localPortRecv, _portSend, _portRecv, _skeletonAddress, _rev); + } else + { + rmiComm = new IoTRMICommClient(_portSend, _portRecv, _skeletonAddress, _rev); + } + IoTRMIUtil.mapStub.put(objectId, this); + } + + public SmartthingsSensorSmartCallback_Stub(IoTRMIComm _rmiComm, int _objectId) throws Exception { + rmiComm = _rmiComm; + objectId = _objectId; + } + + public void newReadingAvailable(int _sensorId, int _value, boolean _activeValue) { + int methodId = 0; + Class retType = void.class; + Class[] paramCls = new Class[] { int.class, int.class, boolean.class }; + Object[] paramObj = new Object[] { _sensorId, _value, _activeValue }; + rmiComm.remoteCall(objectId, methodId, paramCls, paramObj); + } + +} diff --git a/benchmarks/drivers/Java/DoorlockSensor/SmartthingsSensor_Skeleton.java b/benchmarks/drivers/Java/DoorlockSensor/SmartthingsSensor_Skeleton.java new file mode 100644 index 0000000..b64ea4e --- /dev/null +++ b/benchmarks/drivers/Java/DoorlockSensor/SmartthingsSensor_Skeleton.java @@ -0,0 +1,276 @@ +package iotcode.DoorlockSensor; + +import java.io.IOException; +import java.util.List; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import java.util.concurrent.atomic.AtomicBoolean; +import iotrmi.Java.IoTRMIComm; +import iotrmi.Java.IoTRMICommClient; +import iotrmi.Java.IoTRMICommServer; +import iotrmi.Java.IoTRMIUtil; + +import iotcode.interfaces.*; + +public class SmartthingsSensor_Skeleton implements SmartthingsSensor { + + private SmartthingsSensor mainObj; + private int objectId = 3; + // Communications and synchronizations + private IoTRMIComm rmiComm; + private AtomicBoolean didAlreadyInitWaitInvoke; + private AtomicBoolean methodReceived; + private byte[] methodBytes = null; + // Permissions + private static Integer[] object2Permission = { 3, 2, 5, 6, 1, 4, 0 }; + private static List set2Allowed; + + + public SmartthingsSensor_Skeleton(SmartthingsSensor _mainObj, int _portSend, int _portRecv) throws Exception { + mainObj = _mainObj; + rmiComm = new IoTRMICommServer(_portSend, _portRecv); + set2Allowed = new ArrayList(Arrays.asList(object2Permission)); + IoTRMIUtil.mapSkel.put(_mainObj, this); + IoTRMIUtil.mapSkelId.put(_mainObj, objectId); + didAlreadyInitWaitInvoke = new AtomicBoolean(false); + methodReceived = new AtomicBoolean(false); + rmiComm.registerSkeleton(objectId, methodReceived); + Thread thread1 = new Thread() { + public void run() { + try { + ___waitRequestInvokeMethod(); + } + catch (Exception ex) + { + ex.printStackTrace(); + } + } + }; + thread1.start(); + } + + public SmartthingsSensor_Skeleton(SmartthingsSensor _mainObj, IoTRMIComm _rmiComm, int _objectId) throws Exception { + mainObj = _mainObj; + rmiComm = _rmiComm; + objectId = _objectId; + set2Allowed = new ArrayList(Arrays.asList(object2Permission)); + didAlreadyInitWaitInvoke = new AtomicBoolean(false); + methodReceived = new AtomicBoolean(false); + rmiComm.registerSkeleton(objectId, methodReceived); + } + + public boolean didAlreadyInitWaitInvoke() { + return didAlreadyInitWaitInvoke.get(); + } + + public void init() { + mainObj.init(); + } + + public int getValue() { + return mainObj.getValue(); + } + + public boolean isActiveValue() { + return mainObj.isActiveValue(); + } + + public long getTimestampOfLastReading() { + return mainObj.getTimestampOfLastReading(); + } + + public void setId(int id) { + mainObj.setId(id); + } + + public int getId() { + return mainObj.getId(); + } + + public void registerCallback(SmartthingsSensorSmartCallback _callbackTo) { + mainObj.registerCallback(_callbackTo); + } + + public void ___init() { + byte[] localMethodBytes = methodBytes; + rmiComm.setGetMethodBytes(); + Object[] paramObj = rmiComm.getMethodParams(new Class[] { }, new Class[] { }, localMethodBytes); + init(); + } + + public void ___getValue() throws IOException { + byte[] localMethodBytes = methodBytes; + rmiComm.setGetMethodBytes(); + Object[] paramObj = rmiComm.getMethodParams(new Class[] { }, new Class[] { }, localMethodBytes); + Object retObj = getValue(); + rmiComm.sendReturnObj(retObj, localMethodBytes); + } + + public void ___isActiveValue() throws IOException { + byte[] localMethodBytes = methodBytes; + rmiComm.setGetMethodBytes(); + Object[] paramObj = rmiComm.getMethodParams(new Class[] { }, new Class[] { }, localMethodBytes); + Object retObj = isActiveValue(); + rmiComm.sendReturnObj(retObj, localMethodBytes); + } + + public void ___getTimestampOfLastReading() throws IOException { + byte[] localMethodBytes = methodBytes; + rmiComm.setGetMethodBytes(); + Object[] paramObj = rmiComm.getMethodParams(new Class[] { }, new Class[] { }, localMethodBytes); + Object retObj = getTimestampOfLastReading(); + rmiComm.sendReturnObj(retObj, localMethodBytes); + } + + public void ___setId() { + byte[] localMethodBytes = methodBytes; + rmiComm.setGetMethodBytes(); + Object[] paramObj = rmiComm.getMethodParams(new Class[] { int.class }, new Class[] { null }, localMethodBytes); + setId((int) paramObj[0]); + } + + public void ___getId() throws IOException { + byte[] localMethodBytes = methodBytes; + rmiComm.setGetMethodBytes(); + Object[] paramObj = rmiComm.getMethodParams(new Class[] { }, new Class[] { }, localMethodBytes); + Object retObj = getId(); + rmiComm.sendReturnObj(retObj, localMethodBytes); + } + + public void ___registerCallback() { + byte[] localMethodBytes = methodBytes; + rmiComm.setGetMethodBytes(); + Object[] paramObj = rmiComm.getMethodParams(new Class[] { int[].class }, new Class[] { null }, localMethodBytes); + try { + int[] stubIdArray0 = (int[]) paramObj[0]; + int objIdRecv0 = stubIdArray0[0]; + SmartthingsSensorSmartCallback newStub0 = null; + if(!IoTRMIUtil.mapStub.containsKey(objIdRecv0)) { + newStub0 = new SmartthingsSensorSmartCallback_Stub(rmiComm, objIdRecv0); + IoTRMIUtil.mapStub.put(objIdRecv0, newStub0); + rmiComm.setObjectIdCounter(objIdRecv0); + rmiComm.decrementObjectIdCounter(); + } + else { + newStub0 = (SmartthingsSensorSmartCallback_Stub) IoTRMIUtil.mapStub.get(objIdRecv0); + } + SmartthingsSensorSmartCallback stub0 = newStub0; + registerCallback(stub0); + } catch(Exception ex) { + ex.printStackTrace(); + throw new Error("Exception from callback object instantiation!"); + } + } + + public void ___waitRequestInvokeMethod() throws IOException { + didAlreadyInitWaitInvoke.compareAndSet(false, true); + while (true) { + if (!methodReceived.get()) { + continue; + } + methodBytes = rmiComm.getMethodBytes(); + methodReceived.set(false); + int _objectId = IoTRMIComm.getObjectId(methodBytes); + int methodId = IoTRMIComm.getMethodId(methodBytes); + if (_objectId == objectId) { + if (!set2Allowed.contains(methodId)) { + throw new Error("Object with object Id: " + _objectId + " is not allowed to access method: " + methodId); + } + } + else { + continue; + } + switch (methodId) { + case 0: + new Thread() { + public void run() { + try { + ___init(); + } + catch (Exception ex) { + ex.printStackTrace(); + } + } + }.start(); + break; + case 1: + new Thread() { + public void run() { + try { + ___getValue(); + } + catch (Exception ex) { + ex.printStackTrace(); + } + } + }.start(); + break; + case 2: + new Thread() { + public void run() { + try { + ___isActiveValue(); + } + catch (Exception ex) { + ex.printStackTrace(); + } + } + }.start(); + break; + case 3: + new Thread() { + public void run() { + try { + ___getTimestampOfLastReading(); + } + catch (Exception ex) { + ex.printStackTrace(); + } + } + }.start(); + break; + case 4: + new Thread() { + public void run() { + try { + ___setId(); + } + catch (Exception ex) { + ex.printStackTrace(); + } + } + }.start(); + break; + case 5: + new Thread() { + public void run() { + try { + ___getId(); + } + catch (Exception ex) { + ex.printStackTrace(); + } + } + }.start(); + break; + case 6: + new Thread() { + public void run() { + try { + ___registerCallback(); + } + catch (Exception ex) { + ex.printStackTrace(); + } + } + }.start(); + break; + default: + throw new Error("Method Id " + methodId + " not recognized!"); + } + } + } + +} diff --git a/benchmarks/drivers/Java/Makefile b/benchmarks/drivers/Java/Makefile index cc4b4a7..92ab192 100644 --- a/benchmarks/drivers/Java/Makefile +++ b/benchmarks/drivers/Java/Makefile @@ -115,6 +115,12 @@ waterleak: #cd $(BIN_DIR)/iotcode/WaterLeakSensor; $(JAR) $(JARFLAGS) WaterLeakSensor.jar ../../iotcode/WaterLeakSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class cd $(BIN_DIR)/iotcode/WaterLeakSensor; $(JAR) $(JARFLAGS) WaterLeakSensor.jar ../../iotcode/WaterLeakSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class +PHONY += doorlock +doorlock: + $(JAVAC) $(JFLAGS) DoorlockSensor/*.java + cp DoorlockSensor/DoorlockSensor.config $(BIN_DIR)/iotcode/DoorlockSensor + cd $(BIN_DIR)/iotcode/DoorlockSensor; $(JAR) $(JARFLAGS) DoorlockSensor.jar ../../iotcode/DoorlockSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class + # Compile - with checker # PHONY += check-light @@ -208,4 +214,10 @@ check-waterleak: cp WaterLeakSensor/WaterLeakSensor.config $(BIN_DIR)/iotcode/WaterLeakSensor cd $(BIN_DIR)/iotcode/WaterLeakSensor; $(JAR) $(JARFLAGS) WaterLeakSensor.jar ../../iotcode/WaterLeakSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class +PHONY += check-doorlock +check-doorlock: + $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) DoorlockSensor/*.java + cp DoorlockSensor/DoorlockSensor.config $(BIN_DIR)/iotcode/DoorlockSensor + cd $(BIN_DIR)/iotcode/DoorlockSensor; $(JAR) $(JARFLAGS) DoorlockSensor.jar ../../iotcode/DoorlockSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class + .PHONY: $(PHONY) diff --git a/benchmarks/other/DoorlockAndOutlet/IoTZigbee.java b/benchmarks/other/DoorlockAndOutlet/IoTZigbee.java index 6f0ad69..e3bb401 100644 --- a/benchmarks/other/DoorlockAndOutlet/IoTZigbee.java +++ b/benchmarks/other/DoorlockAndOutlet/IoTZigbee.java @@ -217,6 +217,8 @@ public class IoTZigbee { socket.send(sendPacket); } + public void sendConfigureReportingCommand(int packetId, int clusterId, int profileId, int src_endpoint, int dest_endpoint, int attributeId, int dataType, int minReportingInterval, int maxReportingInterval, byte[] reportableChange) throws IOException { + public void sendConfigureReportingCommand(int packetId, int clusterId, int profileId, int src_endpoint, int dest_endpoint, int attributeId, int dataType, int minReportingInterval, int maxReportingInterval, byte[] reportableChange) throws IOException { String message = "type: zcl_configure_reporting\n"; message += "packet_id: " + String.format("%04x", packetId) + "\n"; diff --git a/benchmarks/other/ZigbeeTest/IoTZigbee.java b/benchmarks/other/ZigbeeTest/IoTZigbee.java index 6f0ad69..dd12352 100644 --- a/benchmarks/other/ZigbeeTest/IoTZigbee.java +++ b/benchmarks/other/ZigbeeTest/IoTZigbee.java @@ -216,7 +216,7 @@ public class IoTZigbee { DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName(strHostAddress), iDstPort); socket.send(sendPacket); } - + public void sendConfigureReportingCommand(int packetId, int clusterId, int profileId, int src_endpoint, int dest_endpoint, int attributeId, int dataType, int minReportingInterval, int maxReportingInterval, byte[] reportableChange) throws IOException { String message = "type: zcl_configure_reporting\n"; message += "packet_id: " + String.format("%04x", packetId) + "\n"; diff --git a/iotjava/gmon.out b/iotjava/gmon.out new file mode 100644 index 0000000000000000000000000000000000000000..7d5b7b26e415270f6b4f02837a7451f6fa242991 GIT binary patch literal 125838 zcmeI(d$c9vnaA-ur_&^^yA$G0A>tanJ6VDVsiV^fgB`|9n+!I(kq9=8)}h%#Tt-kC z-AF`I7?Fh5g~pf_>?RozK_!BiAX_BD7?bUi$we~e)bo7bwVwB^`hWg;dab0?=REJF ze*3N3Rn@1DJ>jGi$C4?3(ycR*xd+UaZS`=H%$xkL1@n(S>BM;p#OmGfAHMYjJONL@ z6YvB)0Z+ga@B};oPrwuK1Uvyxz!UHUJONL@6YvB)0Z+ga@B};oPrwuK1Uvyxz!UHU zJONL@6YvB)0Z+ga@B};oPrwuK1Uvyxz!UHUJONL@6YvB)0Z+ga@B};oPrwuK1Uvyx zz!UHUJONL@6YvB)0Z+ga@B};oPrwuK1Uvyxz!UHUJONL@6YvB)0Z+ga@B};oPrwuK z1Uvyxz!UHUJONL@6YvB)0Z+ga@B};oPrwuK1Uvyxz!UHUJONL@6YvB)0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