nRF5 SDK for Mesh v5.0.0
Data Structures | Macros | Typedefs | Enumerations
Mesh config listener interface

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...
 

Detailed Description

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.

Note
: The listener will not be triggered for the inital recovery from flash.

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.

Macro Definition Documentation

◆ MESH_CONFIG_LISTENER

#define MESH_CONFIG_LISTENER (   NAME,
  ID,
  CALLBACK 
)
Value:
NRF_MESH_SECTION_ITEM_REGISTER_FLASH(mesh_config_entry_listeners, \
const mesh_config_listener_t NAME) = {&(ID), CALLBACK}

Define an entry listener.

Parameters
[in]NAMEName of listener variable.
[in]IDUnique mesh config id to listen for.
[in]CALLBACKCallback to call when the entry changes.

Definition at line 64 of file mesh_config_listener.h.

Typedef Documentation

◆ mesh_config_listener_on_change_t

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.

Parameters
[in]reasonReason for the change.
[in]idID of the changed entry.
[in]p_entryData 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.

Enumeration Type Documentation

◆ mesh_config_change_reason_t

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.


Documentation feedback | Developer Zone | Subscribe | Updated