...
Name | Type | Description |
---|---|---|
propertyToBind | String | The name of the Property to bind on. For example, OnOffonOff. |
parameters | List<Parameter> | A list of Parameter objects representing various configuration options. See below for a list of configuration parameters that are currently supported. |
Configuration Parameters:
...
various configuration options. See below for a list of configuration parameters that are currently supported. |
Configuration Parameters:
Configuration parameters vary depending on the "DIRECTION" parameter. Currently, only one value of the DIRECTION parameter is supported:
Name | Value | Description |
---|---|---|
ConfigureReportingParameter.DIRECTION | 0x00 | The receiver of the command should send reports to each destination, as resolved by the bindings for the cluster hosting the properties to be reported. |
ConfigureReportingParameter.MIN_REPORTING_INTERVAL | 0x0000 - 0xFFFF | The minimum interval, in seconds, between issuing reports of the specified property. |
ConfigureReportingParameter.MAX_REPORTING_INTERVAL | 0x0000 - 0xFFFF | The maximum interval, in seconds, between issuing reports of the specified property. |
ConfigureReportingParameter.REPORTABLE_CHANGE | Optional | The minimum change to the property that will result in a report being issued. This field is of variable length. For attributes with 'analog' data type (things that can be represented by integers, floats, etc.) the field has the same data type as the attribute. Discrete data types (such as boolean, arrays, strings, etc) can omit this field. |
Returns
Return Type | Description |
---|---|
Optional<CommandData> | An optional CommandData object, which contains 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 | ||
---|---|---|
| ||
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("OnOffonOff", onOffParams).get().getCommandResult(); String result = futureResult.get(30, TimeUnit.SECONDS); System.out.println("result: " + result); } catch (Exception e) { throw new CompletionException(e); } |
...