nRF5 SDK for Mesh v4.0.0
Modules | Enumerations | Functions
Mesh config

Common interface for operating on all mesh states. More...

Modules

 Mesh config entry
 API for managing mesh configuration entries.
 
 Mesh config listener interface
 Change-listener interface for mesh config.
 

Enumerations

enum  mesh_config_load_failure_t { MESH_CONFIG_LOAD_FAILURE_INVALID_LENGTH, MESH_CONFIG_LOAD_FAILURE_INVALID_DATA, MESH_CONFIG_LOAD_FAILURE_INVALID_ID }
 

Functions

void mesh_config_init (void)
 Initialize the configuration module.
 
void mesh_config_load (void)
 Load all configuration data from persistent storage. More...
 
void mesh_config_clear (void)
 Clear all configuration data. More...
 
void mesh_config_power_down (void)
 Store all power-down state. More...
 
bool mesh_config_is_busy (void)
 Check whether the configuration is waiting for an operation to finish. More...
 
uint32_t mesh_config_power_down_time_get (void)
 Calculate the longest time required to store all power down state. More...
 

Detailed Description

Common interface for operating on all mesh states.

For more information about mesh config, see the Mesh configuration library document.

Enumeration Type Documentation

◆ mesh_config_load_failure_t

Enumerator
MESH_CONFIG_LOAD_FAILURE_INVALID_LENGTH 

The loaded entry was shorter than specified by the state owner.

MESH_CONFIG_LOAD_FAILURE_INVALID_DATA 

The state owner rejected the data.

MESH_CONFIG_LOAD_FAILURE_INVALID_ID 

The loaded ID was unknown to the configuration.

Definition at line 53 of file mesh_config.h.

Function Documentation

◆ mesh_config_load()

void mesh_config_load ( void  )

Load all configuration data from persistent storage.

If any of the loaded entries have issues, the mesh event handler will be called with a NRF_MESH_EVT_CONFIG_LOAD_FAILURE event. Loading will continue even if there's a load-failure, but the failing entry will be ignored. This should never happen unless the compile-time configuration is changed.

◆ mesh_config_clear()

void mesh_config_clear ( void  )

Clear all configuration data.

Note
The configuration data is not cleared until the mesh configuration module leaves the busy state, as indicated by the mesh_config_is_busy function or the NRF_MESH_EVT_CONFIG_STABLE event, or both.

◆ mesh_config_power_down()

void mesh_config_power_down ( void  )

Store all power-down state.

Note
The configuration data is not safely stored until the mesh config module goes out of the busy state, as indicated by mesh_config_is_busy or the NRF_MESH_EVT_CONFIG_STABLE event.

◆ mesh_config_is_busy()

bool mesh_config_is_busy ( void  )

Check whether the configuration is waiting for an operation to finish.

Returns
Whether an operation is pending.

◆ mesh_config_power_down_time_get()

uint32_t mesh_config_power_down_time_get ( void  )

Calculate the longest time required to store all power down state.

To ensure that all power-down state can be safely stored in persisent storage before running out of power, the user must call mesh_config_power_down some time before power loss. This function can be used to gather requirements for a brown-out detection module that can notify the application of an impending power loss.

The return value of this function will always be the same for a given configuration, as it always assumes a worst case scenario. It is strongly recommended to rerun this function for every recompilation, to ensure that there's always enough time left.

Returns
Required storage time in microseconds.

Documentation feedback | Developer Zone | Subscribe | Updated