From 32a6d52861c5ccedafca3502d4e4b3132bc4ea10 Mon Sep 17 00:00:00 2001 From: Abhay Agarwal Date: Mon, 10 Aug 2020 18:38:00 +0530 Subject: [PATCH] Mesh: Fix provisioning and mesh message communication This patch fix - Mesh provisioning of multiple devices - Mesh model message response handler Change-Id: I13a909ddf796206c193af41da3fe85a5eb0a592e Signed-off-by: Abhay Agarwal --- bt-service/services/mesh/bt-service-mesh-model.c | 24 +--------------------- bt-service/services/mesh/bt-service-mesh-network.c | 2 +- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/bt-service/services/mesh/bt-service-mesh-model.c b/bt-service/services/mesh/bt-service-mesh-model.c index 89916b8..d38db10 100644 --- a/bt-service/services/mesh/bt-service-mesh-model.c +++ b/bt-service/services/mesh/bt-service-mesh-model.c @@ -309,7 +309,6 @@ void _bt_mesh_msg_handler(event_mesh_message_t *event) uint16_t data_len = event->data_len; uint8_t *data = event->data; int n; - const struct mesh_msg_cmd *cmd; struct mesh_pending_request *req; int result = BLUETOOTH_ERROR_NONE; @@ -332,11 +331,9 @@ void _bt_mesh_msg_handler(event_mesh_message_t *event) if (req) { BT_INFO("Mesh: Got Request"); - cmd = req->cmd; __mesh_request_remove(req); l_queue_remove(pending_msg_requests, req); - } else - cmd = NULL; + } bluetooth_mesh_model_msg_t param; memset(¶m, 0x00, sizeof(bluetooth_mesh_model_msg_t)); @@ -357,25 +354,6 @@ void _bt_mesh_msg_handler(event_mesh_message_t *event) param.opcode = opcode; BT_INFO("Send response"); - switch (opcode & ~MESH_OPCODE_UNRELIABLE) { - case MESH_OPCODE_MODEL_GENERIC_ONOFF_STATUS: { - BT_INFO("Received Generic On off status"); - - BT_INFO("Mesh: Node %4.4x", event->source); - if (!cmd) { - BT_INFO("No pending req for this status"); - break; - } - if (cmd->opcode == MESH_OPCODE_MODEL_GENERIC_ONOFF_GET) - BT_INFO("Mesh: Resp recvd: MESH_OPCODE_MODEL_GENERIC_ONOFF_GET"); - else if (cmd->opcode == MESH_OPCODE_MODEL_GENERIC_ONOFF_SET) - BT_INFO("Mesh: Resp recvd: MESH_OPCODE_MODEL_GENERIC_ONOFF_SET"); - else - BT_INFO("Request opcode do not match !"); - } - default: - return; - } __bt_mesh_handle_pending_msg_request_info(result, BT_MESH_MODEL_EXECUTE_MSG, ¶m, sizeof(bluetooth_mesh_model_msg_t)); diff --git a/bt-service/services/mesh/bt-service-mesh-network.c b/bt-service/services/mesh/bt-service-mesh-network.c index ccda8b5..7a7366a 100644 --- a/bt-service/services/mesh/bt-service-mesh-network.c +++ b/bt-service/services/mesh/bt-service-mesh-network.c @@ -174,7 +174,7 @@ int _bt_mesh_network_request_provisioning_data_request(uint8_t net_uuid[], unicast = _bt_mesh_node_get_next_unicast(net_uuid, MESH_DEFAULT_START_ADDRESS, - MESH_DEFAULT_START_ADDRESS, count); + MESH_DEFAULT_MAX_ADDRESS, count); BT_INFO("Mesh: Network: Got unicast [%4.4x]", unicast); memcpy(uuid.uuid, net_uuid, 16); -- 2.7.4