component/ble_mesh: Check if gatt proxy is enabled when DST is all proxies

This commit is contained in:
lly
2019-03-21 10:39:47 +08:00
parent c9e608432b
commit 999fa1986e
2 changed files with 7 additions and 3 deletions

View File

@@ -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:

View File

@@ -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));