bt_mesh_app_key_add() function
Add an Application key. Adds the Application with the given index to the list of known applications. Allows the node to send and receive model messages encrypted with this Application key. Every Application is bound to a specific Subnet. The node must know the Subnet the Application is bound to before it can add the Application.
Syntax
uint8_t bt_mesh_app_key_add(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.
key
Application key value.
Return value
STATUS_SUCCESS The Application was successfully added. STATUS_INVALID_NETKEY The NetIdx is unknown. STATUS_INSUFF_RESOURCES There's no room for storing this Application. STATUS_INVALID_BINDING This AppIdx is already bound to another Subnet. STATUS_IDX_ALREADY_STORED This AppIdx is already stored with a different key value. STATUS_CANNOT_SET Cannot set the Application key for some reason.