public interface ZCLCluster
Every asynchronous method defined in this interface returns back its result
through the use of a
|Modifier and Type||Field and Description|
Property key for the optional cluster domain.
Property key for the optional cluster id.
Property key for the optional cluster name.
|Modifier and Type||Method and Description|
Returns the cluster
Returns an array of
Returns an array of
Returns an array of all the commandIds of the ZCLCluster.
Returns the identifier of this cluster.
Invokes a command on this cluster with a
Invokes a command on this cluster.
Reads a list of attributes by issuing a ZCL Read Attributes command.
Writes a set of attributes on the cluster using the ZCL Write Attributes or the Write Attributes Undivided commands, according to the passed
static final String ID
static final String DOMAIN
Promise<ZCLAttribute> getAttribute(int attributeId)
ZCLAttributeidentifying that matches the given attributeId.
getAttribute(int, int)method retrieves manufacturer-specific attributes.
attributeId- the ZCL attribute identifier.
ZCLAttributeinstance. If attributeId do not exist in the cluster, then the promise fails with a
ZCLExceptionwith status code
Promise<ZCLAttribute> getAttribute(int attributeId, int code)
ZCLAttributeobject for a manufacturer specific attribute. If the
codeparameter is -1 it behaves like the
getAttribute(int)and retrieves the non-manufacturer specific attribute
attributeId- the ZCL attribute identifier
code- the manufacturer code of the attribute to be retrieved. If -1 is used, the method behaves exactly like
Promiserepresenting the completion of this asynchronous call. The promise will be resolved with the requested
ZCLAttribute. If a command such as ZCL Read Attributes or Discover Attributes has already been called once by the ZigBee host, the Promise can be quickly resolved. The resolution may be longer the first time one of the ZCLCluster methods to get one or all attributes is successfully called. If attributeId do not exist in the cluster, then the promise fails with a
ZCLExceptionwith status code
ZCLAttributeobjects representing all this cluster's attributes.
This method returns only standard attributes. To retrieve manufacturer
specific attributes use method
Promise<ZCLAttribute> getAttributes(int code)
ZCLAttributeobjects representing all the specific manufacturer attributes available on the cluster.
This method behaves like the
getAttributes() method if
the passed value is -1.
code- The the manufacturer code. Pass -1 to retrieve standard (that is, non-manufacturer specific) attributes.
Promiserepresenting the completion of this asynchronous call. The promise will be resolved with an array of
ZCLAttributeobjects. If a command such as ZCL Read Attributes or Discover Attributes has already been called once by the ZigBee host, the Promise can be quickly resolved. The resolution may be longer the first time one of the ZCLCluster methods to get one or all attributes is successfully called.
Promise<Map<Integer,ZCLReadStatusRecord>> readAttributes(ZCLAttributeInfo attributes)
As described in section 18.104.22.168 Effect on Receipt of the ZCL specification, a Read Attributes command results in a list of attribute status records comprising a mix of successful and unsuccessful attribute reads.
The method returns a promise. The object used to resolve the
Promise is a
ZCLReadStatusRecord>. For each Map entry, the key contains the attribute
identifier and the value, a ZigBee Read Attributes Status Record, which
is made of the status of the read of this attribute, the ZigBee data type
of the attribute and the attribute value in the corresponding Java
wrapper type (or null in case of an unsupported attribute or in case of
an invalid value). For attributes which data type serialization is not
supported (that is,
returns null), the value is of type byte.
When the list of attributes do not fit into a single ZCLFrame, ZigBee clusters truncate the list of attributes returned in the response. The client has to check the Map of results to send a new request for the attributes which values are missing. In export situations, the base driver may truncate the read attribute command response sent to networked devices in order to obey the rules.
NOTE: According to the ZigBee Specification all the attributes
must be standard attributes or belong to the same manufacturer code,
otherwise the promise must fail with a
attributes- An array of
IllegalArgumentExceptionif the array size is 0 or if one of the array entries is
nullor not valid. An
IllegalArgumentExceptionis also thrown if some of
ZCLAttributeInfoare manufacturer specific and other are standard, or even if there are mix of attributes with different manufacturer specific code. If the passed argument is
nullthe promise must fail with a
Promise<Map<Integer,Integer>> writeAttributes(boolean undivided, Map<? extends ZCLAttributeInfo,?> attributesAndValues)
The promise resolves with a
Map<Integer, Integer>. If all the
attributes have been written successfully, the map is empty. In case of
failure in writing specific attribute(s), the map is filled with entries
related to those attributes. Every key is set with the id of an attribute
that was not written successfully, every value with the status returned
in the associated write attribute response record accordingly
re-mapped to one of the constants defined in the
According to the ZigBee Specification all the attributes must be standard
attributes or, if manufacturer-specific they must have the same
manufacturer code, otherwise an
trueif an undivided write attributes command is requested,
Map<ZCLAttributeInfo, Object>of attributes and values to be written. For ZCLAttributeInfo objects which serialization is not supported (that is,
getDataType().getJavaDataType()returns null), the value must be of type byte.
Map<Integer, Integer>. Otherwise the map will be filled with the status information about the attributes that were not written. The key represents the attributeID and the value the status present in the corresponding attribute record returned by the ZCL Write Attributes response message. The original ZCL status values must be re-mapped to the list of status values listed in the
ZCLExceptionclass. The promise may fail with an
IllegalArgumentExceptionif some of
ZCLAttributeInfoare manufacturer specific and other are standard, or even if there are mix of attributes with different manufacturer specific code.
This method is implemented for ZCL devices compliant version equal or
later than 1.2 of the Home Automation Profile or other profiles that adds
a general command that enables discovery of command identifiers. When the
device implements a profile that does not support this feature, the
promise fails with a
ZCLException with code
Promiserepresenting the completion of this asynchronous call. The promise will be resolved with
shortcontaining the command identifiers supported by the cluster.
ZCLFrame. The returned promise provides the invocation response in an asynchronous way. The source endpoint is not specified in this method call. To send the appropriate message on the network, the base driver must generate a source endpoint. The latter must not correspond to any exported endpoint.
frame- The frame containing the command to issue.
exportedServicePID- : the source endpoint of the command request. In targeted situations, the source endpoint is the valid service PID of an exported endpoint.
Promise.getValue()returns the response