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_load_config_apply()
uint32_t dsm_load_config_apply |
( |
void |
| ) |
|
Apply data loaded from the mesh configuration system into Device State Manager structures.
- Note
- Actual metadata is restored automatically if it was not found or if read out data is not equal configuration parameters.
- Return values
-
NRF_ERROR_NOT_FOUND | Device State Manager metadata was not found. |
NRF_ERROR_INVALID_DATA | Data stored in the persistent memory was corrupted. |
NRF_SUCCESS | Data was restored and applied successfully. |
◆ 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 Bluetooth Mesh Profile Specification (MshPRFv1.0.1) section 7.2.2.2.3.
- 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. |