Skip to content

Commit 02eaaca

Browse files
llyespressif-bot
authored andcommitted
ble_mesh: stack: Fix no events for some error conditions
1 parent 5f6f61f commit 02eaaca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/bt/esp_ble_mesh/btc/btc_ble_mesh_prov.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,7 @@ void btc_ble_mesh_model_call_handler(btc_msg_t *msg)
19831983
arg->model_publish.device_role);
19841984
if (err) {
19851985
BT_ERR("Failed to set client role");
1986+
btc_ble_mesh_model_publish_comp_cb(arg->model_publish.model, err);
19861987
break;
19871988
}
19881989
}
@@ -1995,10 +1996,14 @@ void btc_ble_mesh_model_call_handler(btc_msg_t *msg)
19951996
struct net_buf_simple *buf = bt_mesh_alloc_buf(arg->model_send.length + BLE_MESH_MIC_SHORT);
19961997
if (!buf) {
19971998
BT_ERR("%s, Out of memory", __func__);
1999+
btc_ble_mesh_model_send_comp_cb(arg->model_send.model, arg->model_send.ctx,
2000+
arg->model_send.opcode, -ENOMEM);
19982001
break;
19992002
}
2003+
20002004
net_buf_simple_add_mem(buf, arg->model_send.data, arg->model_send.length);
20012005
arg->model_send.ctx->srv_send = true;
2006+
20022007
err = bt_mesh_model_send((struct bt_mesh_model *)arg->model_send.model,
20032008
(struct bt_mesh_msg_ctx *)arg->model_send.ctx,
20042009
buf, NULL, NULL);
@@ -2012,8 +2017,11 @@ void btc_ble_mesh_model_call_handler(btc_msg_t *msg)
20122017
struct net_buf_simple *buf = bt_mesh_alloc_buf(arg->model_send.length + BLE_MESH_MIC_SHORT);
20132018
if (!buf) {
20142019
BT_ERR("%s, Out of memory", __func__);
2020+
btc_ble_mesh_model_send_comp_cb(arg->model_send.model, arg->model_send.ctx,
2021+
arg->model_send.opcode, -ENOMEM);
20152022
break;
20162023
}
2024+
20172025
net_buf_simple_add_mem(buf, arg->model_send.data, arg->model_send.length);
20182026
bt_mesh_client_common_param_t param = {
20192027
.opcode = arg->model_send.opcode,

0 commit comments

Comments
 (0)