Change-listener interface for mesh config. More...
Data Structures | |
struct | mesh_config_listener_t |
Macros | |
#define | MESH_CONFIG_LISTENER(NAME, ID, CALLBACK) |
Define an entry listener. More... | |
Typedefs | |
typedef void(* | mesh_config_listener_on_change_t) (mesh_config_change_reason_t reason, mesh_config_entry_id_t id, const void *p_entry) |
Mesh config change-listener function type. More... | |
Enumerations | |
enum | mesh_config_change_reason_t { MESH_CONFIG_CHANGE_REASON_SET, MESH_CONFIG_CHANGE_REASON_DELETE } |
Reason for the listener invocation. More... | |
Change-listener interface for mesh config.
Lets any module passively observe new values for a given config entry. Called after the state owner has accepted the value.
Usage: Define a function of the mesh_config_listener_on_change_t type, and register it with the MESH_CONFIG_LISTENER macro. The listener is registered at link-time, and cannot be added or removed at runtime.
#define MESH_CONFIG_LISTENER | ( | NAME, | |
ID, | |||
CALLBACK | |||
) |
Define an entry listener.
[in] | NAME | Name of listener variable. |
[in] | ID | Unique mesh config id to listen for. |
[in] | CALLBACK | Callback to call when the entry changes. |
Definition at line 64 of file mesh_config_listener.h.
typedef void(* mesh_config_listener_on_change_t) (mesh_config_change_reason_t reason, mesh_config_entry_id_t id, const void *p_entry) |
Mesh config change-listener function type.
[in] | reason | Reason for the change. |
[in] | id | ID of the changed entry. |
[in] | p_entry | Data for the changed entry, or NULL if the reason is MESH_CONFIG_CHANGE_REASON_DELETE. |
Definition at line 82 of file mesh_config_listener.h.
Reason for the listener invocation.
Enumerator | |
---|---|
MESH_CONFIG_CHANGE_REASON_SET | The entry was changed by a user. |
MESH_CONFIG_CHANGE_REASON_DELETE | The entry was deleted. |
Definition at line 69 of file mesh_config_listener.h.