...
This is a non-blocking call.
Will complete exceptionally on all errors.
Parameters
None.
Returns
Return Type | Description |
---|---|
CompletableFuture<String> | A CompletableFuture<String> of the future result. The result can contain error codes or messages if any errors occurred. Will complete exceptionally on all errors. |
The result is a JSON string with 5 key/value pairs if it was successful
Code Block | ||
---|---|---|
| ||
{
"status":{"value":[0]}, // byte value: 0 = success, non-zero = failure
"latency":46, // in ms
"directOrIndirect":{"value":[1]}, // byte value: 0 = response received directly from target device, 1 = response received indirectly from target device
"lastHopLQI":255, // LQI of last responding hop
"lastHopRSSI":-13 // RSSI (in dBm) of last responding hop
} |
Throws
The CompletableFuture returned by this method will throw a TimeoutException if the request does not receive a response from the target node after 20 seconds.
Examples
Code Block | ||
---|---|---|
| ||
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0")); ... Device device = gw.getDevice(id); device.ping().thenAccept( pingResult -> System.out.println(pingResult) ); ... |
...