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... | |
| void | mesh_config_file_clear (uint16_t file_id) |
| Clean up the file area. 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
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.
- Warning
- Mesh stack assertion will occur if this API is called when flash manager area of any of the mesh config files is not in
FM_STATE_READYstate. To ensure no assertions are generated this API should be called only when mesh config is not in busy state.
◆ 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 persistent 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.
◆ mesh_config_file_clear()
| void mesh_config_file_clear | ( | uint16_t | file_id | ) |
Clean up the file area.
It removes all stored file entries. Deleter of all active entries will be called.
- Note
- The file data is not safely removed 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.
- If the file identified by given file_id is not found the API returns silently and no events should be expected.
- Parameters
-
[in] file_id The unique file identifier.