Application Command Class handler framework, dispatching incoming Z-Wave Commands to the corresponding handler.
More...
Application Command Class handler framework, dispatching incoming Z-Wave Commands to the corresponding handler.
This component takes care of keeping track of the list of supported and controlled Command Classes.
When a frame is received, it is in charge of verifying the security at which the frame has been received and forward the Z-Wave Command accordingly.
◆ zwave_command_class_handler_t
This is the function which will be executed when the frame of a given Command Class is received.
The handler MUST return a sl_status_t status code.
- Parameters
-
| connection | Info about the connection properties of this frame. |
| frame_data | The data payload of this frame. |
| frame_length | The length of this frame. |
- Returns
- SL_STATUS_OK The command was handled by the command handler. Supervision will return SUCCESS in this case
-
SL_STATUS_FAIL The command handler was unable to parse the command or was busy carring another operation. Supervision Command Class returns FAIL.
-
SL_STATUS_IN_PROGRESS The command handler is processing the command Supervision Command Class returns WORKING.
-
SL_STATUS_NOT_SUPPORTED The command handler does not support this Command or Command Class. Supervision Command Class returns NO_SUPPORT.
-
Any other status: Supervision Command Class returns FAIL.
◆ zwave_command_handler_controls()
Check if we control a given command class.
- Parameters
-
- Returns
- true if we control this command classs
◆ zwave_command_handler_dispatch()
Dispatches a frame to its respective Command Class handler.
- Parameters
-
| connection_info | The connection information for the received Z-Wave Frame |
| frame_data | The payload of the Z-Wave Frame |
| frame_length | The length of the payload (in bytes) contained in the frame_data pointer. |
- Returns
- The handler return code
◆ zwave_command_handler_get_version()
Get the version of Command Class that the handler handles.
- Parameters
-
| command_class | Command class to query with. |
- Returns
- The version number of the indicated Command Class. If the Command Class is neither supported not controlled, it will be 0. 0 if no Command Class handler is registered for the Command Class identifier.
◆ zwave_command_handler_init()
Initialize the command handlers.
- Returns
- SL_STATUS_OK, it will always be considered as successful.
◆ zwave_command_handler_print_info()
| void zwave_command_handler_print_info |
( |
int |
fd | ) |
|
Print Command Class Version info.
- Parameters
-
| fd | File descriptor to print to, if fd < 0 it will use sl_log_info |
◆ zwave_command_handler_register_handler()
Register a command class handler.
This API replaces the legacy REGISTER_HANDLER() macro. Command handlers should perform their own initialization and register themselves to the command handler framework.
There is no sequence/order requirement, meaning that this function can be invoked before the Command Class handler framework is initialized.
- Parameters
-
| new_command_class_handler | A struct that contains the zwave_command_handler_t info that will be used for registering a Command Class handler. |
Command class handlers can be fully disabled by setting both support and control to false.
- Returns
- SL_STATUS_OK If the Command Class handler was successfully registered
-
SL_STATUS_FAIL Otherwise
◆ zwave_command_handler_teardown()
| int zwave_command_handler_teardown |
( |
void |
| ) |
|
Teardown of the Z-Wave command handler.
- Returns
- 0 in case of success.