Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is a blocking call and is not thread-safe.

Parameters

None.

Returns

Return TypeDescription
BooleanTrue if the system shut down gracefully; false otherwise.

Example

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
gw.shutdown();
...

...

Gets a list of ConnectionInfo descriptors that the GatewayClient knows about.

Parameters

None.

Returns

...

Return TypeDescription
Collection<ConnetionInfo>A Collection that contains one ConnectionInfo object per network interface that the GatewayClient knows about.

Example

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
for (ConnectionInfo c : gw.getConnectionInfo()) {
    System.out.println("Connected to port: " + c.getValue());    
}

...

listDevices(Predicate<Device>)

Usage

..Get a filtered list of known devices on the network.

The method takes a Predicate, which is used to filter the device list.

Parameters

TypeDescription
Predicate<Device>A Predicate that can be used to query for certain types of devices.

Returns

Return Type

...

Description
Collection<Device>A collection of all the known Devices on the network that match the filter used.

Example

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
// get a list of all the lights on the network
Collection<Device> devices = gw.listDevices(d -> d.getDeviceType().equals(LightDevice.DEVICE_TYPE));

listDevices()

Usage

..Get a list of all known devices on the network.

Parameters

None.

Returns

...

Return TypeDescription
Collection<Device>A collection of all the known Devices on the network.

Example

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
Collection<Device> devices = gw.listDevices();

getDevice(String)

Usage

Gets the device with the corresponding id...

Assumes that id is unique, and there should only be one device per id.

* * @param id of the device * @returnĀ 

Parameters

TypeDescription
StringA unique identifier associated with the Device.

Returns

Return TypeDescription
DeviceDevice associated with the id; otherwise null on all errors, including if the ID was not found, or if there were duplicate Devices found (i.e. the ID was not unique).

Example

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
Device d = gw.getDevice("0123456789");

Upgrade API

upgradeFirmware(ConnectionInfo, File, ResultConsumer<SerialUploadResult>)

...