...
Code Block |
---|
Device Event: ADD Device ID: 00244600000f1472_1 |
"ADD" means a new device has been added to the network.
Getting Properties
You can use the Device API to request properties of the connected device.
For example, to automatically discover the properties of a device the first time the GatewayClient becomes aware of it, you can run the following code from the DeviceEventListener callback:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
if (event.getStatus() == DeviceEventStatus.ADD) { final DeviceCollection<Property> dproperties = gwevent.getDevice("00244600000f1472_1"); d.getProperties();).getProperties(); for (Property p : properties) { System.out.println("name: " + p.getName() + ", value: " + p.getValue() + ", type: " + p.getType()); } } |
Updating Properties
...
Conclusion
...