|
Z-Wave Protocol Controller Reference
|
zwave_controller callbacks registration system. More...
Classes | |
| struct | zwave_controller_callbacks_t |
| The following structure holds all the callbacks this module will emit. More... | |
Macros | |
| #define | ZWAVE_CONTROLLER_MAXIMUM_CALLBACK_SUBSCRIBERS 20 |
| Maximum number of callbacks structures which may be registered. More... | |
| #define | ZWAVE_CONTROLLER_RESET_STEP_MIN_PRIORITY 0 |
| Minimum Priority for a reset step. More... | |
| #define | ZWAVE_CONTROLLER_CLEAN_UP_ASSOCIATIONS_STEP_PRIORITY 1 |
| Clean-up Associations to ourselves in the network. More... | |
| #define | ZWAVE_CONTROLLER_DEVICE_RESET_LOCALLY_STEP_PRIORITY 2 |
| Notify the lifeline destinations that we are resetting. More... | |
| #define | ZWAVE_CONTROLLER_SMART_START_LIST_UPDATE_STEP_PRIORITY 3 |
| Clean up the SmartStart as we exit the network. More... | |
| #define | ZWAVE_CONTROLLER_TX_FLUSH_RESET_STEP_PRIORITY 4 |
| Empty and flush the Tx Queue. More... | |
| #define | ZWAVE_CONTROLLER_ZWAVE_NETWORK_MANAGEMENT_RESET_STEP_PRIORITY 5 |
| reset the network for the Z-Wave API. This should be last. More... | |
Typedefs | |
| typedef sl_status_t(* | zwave_controller_reset_step_t) (void) |
Functions | |
| sl_status_t | zwave_controller_register_callbacks (const zwave_controller_callbacks_t *callbacks) |
| Let another component register its callbacks for Z-Wave Controller events. More... | |
| sl_status_t | zwave_controller_deregister_callbacks (const zwave_controller_callbacks_t *callbacks) |
| Let another component deregister its callbacks for Z-Wave Controller events. More... | |
| sl_status_t | zwave_controller_register_reset_step (const zwave_controller_reset_step_t step_function, int32_t priority) |
| Let another component register a step to perform when being reset. More... | |
| void | zwave_controller_on_reset_step_complete (int32_t priority) |
| Informs the Z-Wave Controller that a Reset Step is completed. More... | |
| void | zwave_controller_callbacks_init () |
| Reset all callback structures. More... | |
zwave_controller callbacks registration system.
This modules routes events from the Z-Wave Controller sub-blocks (such as Z-Wave RX or network management) and dispatches them to other components that have registered a callback for this particular event. Refer to zwave_controller_register_callbacks
Example usage:
zwave_controller_callbacks_t my_callbacks = {NULL};
my_callbacks.on_new_suc = my_on_new_suc_function;
zwave_controller_register_callbacks(my_callbacks);
After this, my function will now be called when the SUC NodeID changes. Changing the list of functions to invoke can be done runtime:
my_callbacks.on_node_information = my_on_node_information_function;
my_callbacks.on_new_suc = NULL;
The user component must de-register callbacks if the variable is to be destroyed
zwave_controller_deregister_callbacks(my_callbacks);
// Now my_callbacks can be destroyed | #define ZWAVE_CONTROLLER_CLEAN_UP_ASSOCIATIONS_STEP_PRIORITY 1 |
Clean-up Associations to ourselves in the network.
| #define ZWAVE_CONTROLLER_DEVICE_RESET_LOCALLY_STEP_PRIORITY 2 |
Notify the lifeline destinations that we are resetting.
| #define ZWAVE_CONTROLLER_MAXIMUM_CALLBACK_SUBSCRIBERS 20 |
Maximum number of callbacks structures which may be registered.
| #define ZWAVE_CONTROLLER_RESET_STEP_MIN_PRIORITY 0 |
Minimum Priority for a reset step.
| #define ZWAVE_CONTROLLER_SMART_START_LIST_UPDATE_STEP_PRIORITY 3 |
Clean up the SmartStart as we exit the network.
| #define ZWAVE_CONTROLLER_TX_FLUSH_RESET_STEP_PRIORITY 4 |
Empty and flush the Tx Queue.
| #define ZWAVE_CONTROLLER_ZWAVE_NETWORK_MANAGEMENT_RESET_STEP_PRIORITY 5 |
reset the network for the Z-Wave API. This should be last.
| typedef sl_status_t(* zwave_controller_reset_step_t) (void) |
Function type for a Z-Wave Controller reset step The function MUST return SL_STATUS_OK if it will invoke the zwave_controller_on_reset_step_complete later. Any other status if it will not invoke the zwave_controller_on_reset_step_complete
| void zwave_controller_callbacks_init | ( | ) |
Reset all callback structures.
| sl_status_t zwave_controller_deregister_callbacks | ( | const zwave_controller_callbacks_t * | callbacks | ) |
Let another component deregister its callbacks for Z-Wave Controller events.
This function will deregister a pointer to a zwave_controller_callbacks_t array.
| callbacks | zwave_controller_callbacks_t callbacks pointer. |
| void zwave_controller_on_reset_step_complete | ( | int32_t | priority | ) |
Informs the Z-Wave Controller that a Reset Step is completed.
| priority | Priority of the step that was just completed. |
| sl_status_t zwave_controller_register_callbacks | ( | const zwave_controller_callbacks_t * | callbacks | ) |
Let another component register its callbacks for Z-Wave Controller events.
This function will register the pointer of a ' zwave_controller_callbacks_t variable passed by another component.
Another component registering callbacks must provide a valid/allocated pointer. zwave_controller_callbacks_t members left to NULL will not be called.
Callbacks must not take a long time. If they need further processing or to trigger a long procedure, they must copy the data to their respective component and/or trigger an asynchronous contiki event.
| callbacks | callbacks pointer for the zwave_controller component. All callbacks are executed in the context of the zwave_controller process. |
The caller may provide a callback struct pointer containing a set of NULL and valid functions. The Z-Wave Controller Component keeps the pointer value, so a component can subsequently deregister a function by changing it to NULL or a new value in its zwave_controller_callbacks_t variable.
If all functions are NULL in a zwave_controller_callbacks_t variable, the component should deregister its callback variable by calling zwave_controller_deregister_callbacks.
Components must deregister their callbacks before shutting down and destroying the zwave_controller_callbacks_t variables passed to this function.
| sl_status_t zwave_controller_register_reset_step | ( | const zwave_controller_reset_step_t | step_function, |
| int32_t | priority | ||
| ) |
Let another component register a step to perform when being reset.
This function will register a pointer to a zwave_controller_reset_step_t array.
| step_function | zwave_controller_reset_step_t function to invoke when being reset. |
| priority | Priority of the step. Step 0 is executed first, step 1 second, etc. This value MUST be between 0 and ZWAVE_CONTROLLER_MAXIMUM_CALLBACK_SUBSCRIBERS - 1 |