Device key management. More...
Functions | |
| uint32_t | dsm_devkey_add (uint16_t raw_unicast_addr, dsm_handle_t subnet_handle, const uint8_t *p_key, dsm_handle_t *p_devkey_handle) |
| Adds a device key. More... | |
| uint32_t | dsm_devkey_delete (dsm_handle_t dev_handle) |
| Removes an existing device key from the device state storage. More... | |
| uint32_t | dsm_devkey_handle_get (uint16_t unicast_address, dsm_handle_t *p_devkey_handle) |
| Obtains the handle for a device key. More... | |
Detailed Description
Device key management.
Function Documentation
◆ dsm_devkey_add()
| uint32_t dsm_devkey_add | ( | uint16_t | raw_unicast_addr, |
| dsm_handle_t | subnet_handle, | ||
| const uint8_t * | p_key, | ||
| dsm_handle_t * | p_devkey_handle | ||
| ) |
Adds a device key.
- Note
- "A device key is implicitly bound to all network keys." see Bluetooth Mesh Profile Specification (MshPRFv1.0.1), section 3.8.6. An exception to this is the provisioner who stores all the device keys of the other nodes, see section 5.
- Parameters
-
[in] raw_unicast_addr Unicast address associated with this device key. [in] subnet_handle DSM handle for the subnet this device key is being added, must be a valid network handle. [in] p_key The device key, it must be NRF_MESH_KEY_SIZE bytes. [in,out] p_devkey_handle The handle for the device key.
- Return values
-
NRF_SUCCESS The device key has been added successfully. NRF_ERROR_NULL Unexpected NULL pointer is given. NRF_ERROR_FORBIDDEN The given device key has already been added before. NRF_ERROR_INVALID_PARAMS The given address isn't a unicast address. NRF_ERROR_NO_MEM The device key storage is out of space,
- See also
- DSM_DEVICE_MAX.
◆ dsm_devkey_delete()
| uint32_t dsm_devkey_delete | ( | dsm_handle_t | dev_handle | ) |
Removes an existing device key from the device state storage.
- Parameters
-
[in] dev_handle The handle for the existing device key.
- Return values
-
NRF_SUCCESS The given device handle has been freed successfully. NRF_ERROR_FORBIDDEN The given device key handle is the local device key, which cannot be deleted. NRF_ERROR_NOT_FOUND The given device handle is not valid.
◆ dsm_devkey_handle_get()
| uint32_t dsm_devkey_handle_get | ( | uint16_t | unicast_address, |
| dsm_handle_t * | p_devkey_handle | ||
| ) |
Obtains the handle for a device key.
- Parameters
-
[in] unicast_address Unicast address of the node to look up the device key for. [out] p_devkey_handle Pointer to a variable where the handle of the retrieved device key is stored.
- Return values
-
NRF_SUCCESS The device key handle was successfully found. NRF_ERROR_NULL An unexpected NULLpointer was passed for thep_devkey_handleparameter.NRF_ERROR_INVALID_ADDR The specified address was invalid. NRF_ERROR_NOT_FOUND The device key for the specified address was not found.