From 999fa1986eb236b3c9ccbda1bb49ae4b99b7e25e Mon Sep 17 00:00:00 2001 From: lly Date: Thu, 21 Mar 2019 10:39:47 +0800 Subject: [PATCH] component/ble_mesh: Check if gatt proxy is enabled when DST is all proxies --- components/bt/ble_mesh/mesh_core/access.c | 7 +++++-- components/bt/ble_mesh/mesh_models/bt_mesh_client_common.c | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/bt/ble_mesh/mesh_core/access.c b/components/bt/ble_mesh/mesh_core/access.c index 5003a199aa..ca64b05106 100644 --- a/components/bt/ble_mesh/mesh_core/access.c +++ b/components/bt/ble_mesh/mesh_core/access.c @@ -307,6 +307,10 @@ static void mod_publish(struct k_work *work) pub->period_start = k_uptime_get_32(); + /* Callback the model publish update event to the application layer. + * In the event, users can update the context of the publish message + * which will be published in the next period. + */ err = pub->update(pub->mod); if (err) { BT_ERR("Failed to update publication message"); @@ -598,8 +602,7 @@ bool bt_mesh_fixed_group_match(u16_t addr) case BT_MESH_ADDR_ALL_NODES: return true; case BT_MESH_ADDR_PROXIES: - /* TODO: Proxy not yet supported */ - return false; + return (bt_mesh_gatt_proxy_get() == BT_MESH_GATT_PROXY_ENABLED); case BT_MESH_ADDR_FRIENDS: return (bt_mesh_friend_get() == BT_MESH_FRIEND_ENABLED); case BT_MESH_ADDR_RELAYS: diff --git a/components/bt/ble_mesh/mesh_models/bt_mesh_client_common.c b/components/bt/ble_mesh/mesh_models/bt_mesh_client_common.c index 1c0978048c..aecc17e464 100644 --- a/components/bt/ble_mesh/mesh_models/bt_mesh_client_common.c +++ b/components/bt/ble_mesh/mesh_models/bt_mesh_client_common.c @@ -189,12 +189,13 @@ int bt_mesh_client_send_msg(struct bt_mesh_model *model, } if (bt_mesh_client_check_node_in_list(&internal->queue, ctx->addr)) { + BT_ERR("%s, Busy sending message to DST 0x%04x", __func__, ctx->addr); err = -EBUSY; } else { /* Don't forget to free the node in the timeout (timer_handler) function. */ node = (bt_mesh_client_node_t *)osi_calloc(sizeof(bt_mesh_client_node_t)); if (!node) { - BT_ERR("%s: allocate memory fail", __func__); + BT_ERR("%s: Failed to allocate memory", __func__); return -ENOMEM; } memcpy(&node->ctx, ctx, sizeof(struct bt_mesh_msg_ctx));