Versions Compared

Key

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

...

getNetworkStatus(ConnectionInfo c)

Usage

..Returns the network status of the specified network interface.

Parameters

NameTypeDescription
cConnectionInfoConnectionInfo of the network interface of interest (see getConnectionInfo() API).

...

Return TypeDescription
CompletableFuture<NetworkStatus>A CompletableFuture that will contain the network status.

Example

Code Block
languagejava
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

NameTypeDescription
cConnectionInfoConnectionInfo of the network interface of interest (see getConnectionInfo() API).

...

Return TypeDescription
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
languagejava
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

NameTypeDescription
cConnectionInfoConnectionInfo of the network interface of interest (see getConnectionInfo() API).

...

Return TypeDescription
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
languagejava
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

NameTypeDescription
cConnectionInfoConnectionInfo of the network interface of interest (see getConnectionInfo() API).
durationintThe amount of time, between 0-254 seconds, to open the network permit join window for.

Returns

Return TypeDescription
CompletableFuture<NetworkStatus>

A CompletableFuture that will contain the network status.

NETWORK_OPEN if the command succeeded; NETWORK_COMMAND_FAILED otherwise.

Example

Code Block
languagejava
GatewayClient gw = new GatewayClient(new ConnectionInfo(ConnectionType.ZIGBEE_UART, "/dev/ttyUSB0"));
...
for (ConnectionInfo c : gw.getConnectionInfo()) {
	gw.scanForDevices(c, 30);
}