bt_mesh_app_key_update() function
Update an Application key. Update an Application with a second Application key, as part of the Key Refresh procedure of the bound Subnet. The node will continue transmitting with the old application key (but receiving on both) until the Subnet enters Key Refresh phase 2. Once the Subnet enters Key Refresh phase 3, the old application key will be deleted.
Syntax
uint8_t bt_mesh_app_key_update(uint16_t app_idx,
uint16_t net_idx,
const uint8_t key[16]);
Arguments
app_idx
Application index.
net_idx
Network index the Application is bound to, or
BT_MESH_KEY_ANY
to skip the binding check.
Return value
STATUS_SUCCESS The Application key was successfully updated. STATUS_INVALID_NETKEY The NetIdx is unknown. STATUS_INVALID_BINDING This AppIdx is not bound to the given NetIdx. STATUS_CANNOT_UPDATE The Application key cannot be updated for some reason. STATUS_IDX_ALREADY_STORED This AppIdx is already updated with a different key value.
Notes
The Application key can only be updated if the bound Subnet is in Key Refresh phase 1.