Discovering Command Sets
The commands supported by a remote cluster instance can be discovered as described below.
Discovering commands that can be received
The commands that can be received by an instance of a cluster on a remote device can be discovered using the function
eZCL_SendDiscoverCommandReceivedRequest()
This function sends a request to the remote cluster instance, which responds with a list of commands (identified by their Command IDs). On receiving this response, the following events are generated on the local device:
E_ZCL_CBET_DISCOVER_INDIVIDUAL_COMMAND_RECEIVED_RESPONSE
This event is generated for each individual command reported in the response. The reported information is contained in a structure of the type
tsZCL_CommandDiscoveryIndividualResponse
(see Section 6.1.17).
E_ZCL_CBET_DISCOVER_COMMAND_RECEIVED_RESPONSE
This event is generated after all the above individual events, in order to indicate the end of these events. The reported information is contained in a structure of the type
tsZCL_CommandDiscoveryResponse
(see Section 6.1.18).
Discovering commands that can be generated
The commands that can be generated by an instance of a cluster on a remote device can be discovered using the function
eZCL_SendDiscoverCommandGeneratedRequest()
This function sends a request to the remote cluster instance, which responds with a list of commands (identified by their Command IDs). On receiving this response, the following events are generated on the local device:
E_ZCL_CBET_DISCOVER_INDIVIDUAL_COMMAND_GENERATED_RESPONSE
This event is generated for each individual command reported in the response. The reported information is contained in a structure of the type
tsZCL_CommandDiscoveryIndividualResponse
(see Section 6.1.17).
E_ZCL_CBET_DISCOVER_COMMAND_GENERATED_RESPONSE
This event is generated after all the above individual events, in order to indicate the end of these events. The reported information is contained in a structure of the type
tsZCL_CommandDiscoveryResponse
(see Section 6.1.18).
Note: The above functions can be called multiple times to discover the commands in stages. After each call, the tsZCL_CommandDiscoveryResponse
structure contains a Boolean flag which indicates whether there are more commands to be discovered (see Section 6.1.18). For complete details, refer to the function descriptions in Section 5.3.
Parent topic:Command Discovery