Versions Compared

Key

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

...

Return TypeDescription
CompletableFuture<String>

A CompletableFuture containing a String with the result.

Will complete exceptionally on any errors with a RequestExeptionRequestException. The RequestException will contain an error message and code.

...

Return TypeDescription
CompletableFuture<String>

A CompletableFuture containing a String with the result.

Will complete exceptionally on any errors with a RequestExeptionRequestException. The RequestException will contain an error message and code.

...

Return TypeDescription
CompletableFuture<String>

A CompletableFuture containing a String with the result.

Will complete exceptionally on any errors with a RequestExeptionRequestException. The RequestException will contain an error message and code.

...

Returns

Return TypeDescription
Optional<CommandData>An optional CommandData object, which contains a CompletableFuture<String>

A CompletableFuture<String> of the future result, as well as a cached version of the result since the last call.

The result can contain error codes or messages. Usually, it will return a simple "success" if successful.

...

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
Device sourceDevice = gw.getDevice(sourceId);
String destinationDeviceId = sourceDevice.getConnectedGatewayId().get();
sourceDevice.bindDevice(destinationDeviceId, property)
			.get()
	        .getCommandResult()
	        .whenComplete((result, error) -> {
	            if (error != null) {
	                System.out.println("error calling bind: " + error.getMessage());
	            } else {
	            	System.out.println("bind device result: " + result);
	            }
			});

...

Returns

Return TypeDescription
Optional<CommandData>An optional CommandData object, which contains a CompletableFuture<String>

A CompletableFuture<String> of the future result, as well as a cached version of the result since the last call.

The result can contain error codes or messages. Usually, it will return a simple "success" if successful.

...

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
Device sourceDevice = gw.getDevice(sourceId);
String destinationDeviceId = sourceDevice.getConnectedGatewayId().get();
sourceDevice.unbindDevice(destinationDeviceId, property)
			.get()
	        .getCommandResult()
	        .whenComplete((result, error) -> {
	            if (error != null) {
	                System.out.println("error calling unbind: " + error.getMessage());
	            } else {
	            	System.out.println("unbind device result: " + result);
	            }
			});

...

Returns

Return TypeDescription
Optional<CommandData>An optional CommandData object, which contains a CompletableFuture<String>

A CompletableFuture<String> of the future result, as well as a cached version of the result since the last call.

The result can contain error codes or messages. Usually, it will return a simple "success" if successful.

...

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
final Device device = gw.getDevice(id);
List<Parameter> onOffParams = new ArrayList<>();
onOffParams.add(new Parameter(ConfigureReportingParameter.DIRECTION, "0x00"));
onOffParams.add(new Parameter(ConfigureReportingParameter.MIN_REPORTING_INTERVAL, "0x0000"));
onOffParams.add(new Parameter(ConfigureReportingParameter.MAX_REPORTING_INTERVAL, "0x012C")); // 5 minutes
try {
    CompletableFuture<String> futureResult = device.configureReporting("onOff", onOffParams).get().getCommandResult();
    String result = futureResult.get(30, TimeUnit.SECONDS);
    System.out.println("result: " + result);
} catch (Exception e) {
    throw new CompletionException(e);
}

...

Returns

Return TypeDescription
Optional<CommandData>An optional CommandData object, which contains a CompletableFuture<String>

A CompletableFuture<String> of the future result, as well as a cached version of the result since the last call.

The result can contain error codes or messages if any errors occurred.

...

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
Device device = gw.getDevice(id);
device.ping().ifPresent(data -> {
    data.getCommandResult().thenAccept( pingResult -> System.out.println(pingResult) );
});
...


leaveNetwork()

Usage

...