The Device State Manager provides a means for storing and retrieving Bluetooth Mesh state during operation.
More...
|
| Defines |
| Device State Manager defines.
|
|
| Types |
| Device State Manager types.
|
|
| Address management |
| Functions for managing the set of addresses known to the device.
|
|
| Key management |
| Functions for managing the set of encryption keys known to the device.
|
|
The Device State Manager provides a means for storing and retrieving Bluetooth Mesh state during operation.
It handles:
- Address storage - both for subscription and publishing.
- Network key management - Generate and store network security material for mesh rx and tx, as well as beacon and connectable advertisements.
- Application key management - Generate and store application security material for mesh rx and tx.
◆ dsm_flash_config_load()
bool dsm_flash_config_load |
( |
void |
| ) |
|
Load DSM state from flash, to recover state.
If this fails, the device will be unable to join any network it has previously been part of.
- Returns
- Whether there was any valid data available for loading from flash.
◆ dsm_has_unflashed_data()
bool dsm_has_unflashed_data |
( |
void |
| ) |
|
Check whether there's data waiting to be flashed.
- Returns
- Whether there's data waiting to be flashed.
◆ dsm_flash_area_get()
const void* dsm_flash_area_get |
( |
void |
| ) |
|
Get a pointer to the flash area used by the device state manager.
- Returns
- A pointer to the device state manager flash area.
◆ dsm_tx_secmat_get()
Retrieves the necessary application and master network security material for sending a mesh packet.
It is possible to set the subnet_handle
to DSM_HANDLE_INVALID value. In this case, the DSM will try to find the network key bound to the application key.
- Parameters
-
[in] | subnet_handle | The subnet handle of the network key used in the transmission. |
[in] | app_handle | The application handle of the application key used in the transmission. |
[in,out] | p_secmat | Pointer to the structure for the application and master network security material for a mesh packet. |
- Return values
-
NRF_SUCCESS | The requested network and application security materials successfully populated the p_secmat . |
NRF_ERROR_NOT_FOUND | The given application handle is not valid. |
NRF_ERROR_NULL | An unexpected NULL pointer is given. |
NRF_ERROR_INVALID_STATE | There are no allocated subnets. |
◆ dsm_beacon_info_get()
Retrieves the necessary info for sending a mesh network beacon packet.
- Parameters
-
[in] | subnet_handle | The handle of the subnetwork the beacon represents. |
[in,out] | pp_beacon_info | Pointer to the beacon info structure pointer. |
- Return values
-
NRF_SUCCESS | The pp_beacon_info has been successfully populated. |
NRF_ERROR_NOT_FOUND | The given subnetwork handle is not valid. |
NRF_ERROR_NULL | An unexpected NULL pointer is given. |
◆ dsm_proxy_identity_get()
uint32_t dsm_proxy_identity_get |
( |
dsm_handle_t |
subnet_handle, |
|
|
const uint8_t ** |
pp_identity |
|
) |
| |
Retrieves the identity key for advertising with node identity, see section 7.2.2.2.3 in Bluetooth Mesh Profile Specification v1.0.
- Parameters
-
[in] | subnet_handle | The handle of the subnetwork the node identity key belongs to. |
[in,out] | pp_identity | Pointer to the identity key list pointer. |
- Return values
-
NRF_SUCCESS | The identity key for the given subnetwork is successfully returned via pp_identity . |
NRF_ERROR_NOT_FOUND | The given subnetwork handle is not valid. |
NRF_ERROR_NULL | An unexpected NULL pointer is given. |
NRF_ERROR_NOT_SUPPORTED | This function needs the GATT proxy feautre enabled. |
◆ dsm_net_secmat_from_keyindex_get()
Retrives the master network security material from the given netkey index.
- Parameters
-
[in] | net_key_index | Netkey index for which security material will be retrived. |
[out] | pp_net | Pointer to a variable where the security material pointer is stored. |
- Return values
-
NRF_SUCCESS | Security material is retrived successfully. |
NRF_ERROR_NULL | pp_net is a null pointer. |
NRF_ERROR_NOT_FOUND | Security material is not found for the given netkey index. |