diff --git a/components/bt/esp_ble_mesh/btc/btc_ble_mesh_prov.c b/components/bt/esp_ble_mesh/btc/btc_ble_mesh_prov.c index b0619d709..a60fa6c0f 100644 --- a/components/bt/esp_ble_mesh/btc/btc_ble_mesh_prov.c +++ b/components/bt/esp_ble_mesh/btc/btc_ble_mesh_prov.c @@ -266,8 +266,6 @@ static void btc_ble_mesh_model_free_req_data(btc_msg_t *msg) } } -extern u32_t mesh_opcode; - static void btc_ble_mesh_server_model_op_cb(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) @@ -276,7 +274,7 @@ static void btc_ble_mesh_server_model_op_cb(struct bt_mesh_model *model, btc_msg_t msg = {0}; bt_status_t ret; - mesh_param.model_operation.opcode = mesh_opcode; + mesh_param.model_operation.opcode = ctx->recv_op; mesh_param.model_operation.model = (esp_ble_mesh_model_t *)model; mesh_param.model_operation.ctx = (esp_ble_mesh_msg_ctx_t *)ctx; mesh_param.model_operation.length = buf->len; @@ -320,14 +318,14 @@ static void btc_ble_mesh_client_model_op_cb(struct bt_mesh_model *model, node = bt_mesh_is_client_recv_publish_msg(model, ctx, buf, false); if (node == NULL) { msg.act = ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT; - mesh_param.client_recv_publish_msg.opcode = mesh_opcode; + mesh_param.client_recv_publish_msg.opcode = ctx->recv_op; mesh_param.client_recv_publish_msg.model = (esp_ble_mesh_model_t *)model; mesh_param.client_recv_publish_msg.ctx = (esp_ble_mesh_msg_ctx_t *)ctx; mesh_param.client_recv_publish_msg.length = buf->len; mesh_param.client_recv_publish_msg.msg = buf->data; } else { msg.act = ESP_BLE_MESH_MODEL_OPERATION_EVT; - mesh_param.model_operation.opcode = mesh_opcode; + mesh_param.model_operation.opcode = ctx->recv_op; mesh_param.model_operation.model = (esp_ble_mesh_model_t *)model; mesh_param.model_operation.ctx = (esp_ble_mesh_msg_ctx_t *)ctx; mesh_param.model_operation.length = buf->len; diff --git a/components/bt/esp_ble_mesh/mesh_core/access.c b/components/bt/esp_ble_mesh/mesh_core/access.c index 8b04e926c..17f4b88e5 100644 --- a/components/bt/esp_ble_mesh/mesh_core/access.c +++ b/components/bt/esp_ble_mesh/mesh_core/access.c @@ -611,8 +611,6 @@ bool bt_mesh_fixed_group_match(u16_t addr) } } -u32_t mesh_opcode; - void bt_mesh_model_recv(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf) { struct bt_mesh_model *models, *model; @@ -632,8 +630,6 @@ void bt_mesh_model_recv(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf) BT_DBG("OpCode 0x%08x", opcode); - mesh_opcode = opcode; - for (i = 0; i < dev_comp->elem_count; i++) { struct bt_mesh_elem *elem = &dev_comp->elem[i];