Bluetooth: Mesh: RPR cli @ mod elem 0 check
Add check to the Remote Provisioning Client model init call that verifies that the model is located at the root element. Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
This commit is contained in:
parent
7ad7402f8e
commit
09a32928aa
1 changed files with 6 additions and 0 deletions
|
@ -372,6 +372,12 @@ static void link_timeout(struct k_work *work)
|
||||||
|
|
||||||
static int rpr_cli_init(struct bt_mesh_model *mod)
|
static int rpr_cli_init(struct bt_mesh_model *mod)
|
||||||
{
|
{
|
||||||
|
if (mod->elem_idx) {
|
||||||
|
LOG_ERR("Remote provisioning client must be initialized "
|
||||||
|
"on first element");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
struct bt_mesh_rpr_cli *cli = mod->user_data;
|
struct bt_mesh_rpr_cli *cli = mod->user_data;
|
||||||
|
|
||||||
cli->mod = mod;
|
cli->mod = mod;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue