...
getNetworkStatus(ConnectionInfo c)
Usage
..Returns the network status of the specified network interface.
Parameters
Name | Type | Description |
---|
c | ConnectionInfo | ConnectionInfo of the network interface of interest (see getConnectionInfo() API). |
...
Return Type | Description |
---|
CompletableFuture<NetworkStatus> | A CompletableFuture that will contain the network status. |
Example
Code Block |
---|
|
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
for (ConnectionInfo c : gw.getConnectionInfo()) {
gw.getNetworkStatus(c);
} |
createNetwork(ConnectionInfo c)
Usage
Forms a network on the specified network interface...
Note that it isn't strictly necessary to use this method, as the GatewayClient will attempt to automatically form a network when first initialized.
Parameters
Name | Type | Description |
---|
c | ConnectionInfo | ConnectionInfo of the network interface of interest (see getConnectionInfo() API). |
...
Return Type | Description |
---|
CompletableFuture<NetworkStatus> | A CompletableFuture that will contain the network status. NETWORK_UP if the command succeeded (or a network was already formed); otherwise NETWORK_COMMAND_FAILED. |
Example
Code Block |
---|
|
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
for (ConnectionInfo c : gw.getConnectionInfo()) {
gw.createNetwork(c);
} |
dissolveNetwork(ConnectionInfo c)
Usage
..Dissolves the network on the specified network interface.
Parameters
Name | Type | Description |
---|
c | ConnectionInfo | ConnectionInfo of the network interface of interest (see getConnectionInfo() API). |
...
Return Type | Description |
---|
CompletableFuture<NetworkStatus> | A CompletableFuture that will contain the network status. NETWORK_DOWN if the command succeeded (or network was already down); otherwise, NETWORK_COMMAND_FAILED. |
Example
Code Block |
---|
|
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
for (ConnectionInfo c : gw.getConnectionInfo()) {
gw.dissolveNetwork(c);
} |
scanForDevices(ConnectionInfo c, int duration)
Usage
..Opens the permit join window on the specified network interface so that devices who are in pairing mode can join the network.
Parameters
Name | Type | Description |
---|
c | ConnectionInfo | ConnectionInfo of the network interface of interest (see getConnectionInfo() API). |
duration | int | The amount of time, between 0-254 seconds, to open the network permit join window for. |
Returns
Return Type | Description |
---|
CompletableFuture<NetworkStatus> | A CompletableFuture that will contain the network status. NETWORK_OPEN if the command succeeded; NETWORK_COMMAND_FAILED otherwise. |
Example
Code Block |
---|
|
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
for (ConnectionInfo c : gw.getConnectionInfo()) {
gw.scanForDevices(c, 30);
} |