Bluetooth: Mesh: Fix sending messages when not provisioned
The message sending APIs should fail cleanly if we are not yet provisioned. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
514cebcfe8
commit
9cbb979db7
1 changed files with 5 additions and 0 deletions
|
@ -454,6 +454,11 @@ static int model_send(struct bt_mesh_model *model,
|
|||
ctx->app_idx, ctx->addr);
|
||||
BT_DBG("len %u: %s", msg->len, bt_hex(msg->data, msg->len));
|
||||
|
||||
if (!bt_mesh_is_provisioned()) {
|
||||
BT_ERR("Local node is not yet provisioned");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (net_buf_simple_tailroom(msg) < 4) {
|
||||
BT_ERR("Not enough tailroom for TransMIC");
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue