From 74d0bd3134ddf2a3878da9c90efb9ce13dc731b2 Mon Sep 17 00:00:00 2001 From: lly Date: Mon, 4 Nov 2019 18:08:03 +0800 Subject: [PATCH] ble_mesh: Proxy forwards ALL_NODES addr Unless explicitly blacklisted, the Proxy node will forward all messages for the ALL_NODES address to the GATT proxy client. --- .../bt/esp_ble_mesh/mesh_core/proxy_server.c | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/components/bt/esp_ble_mesh/mesh_core/proxy_server.c b/components/bt/esp_ble_mesh/mesh_core/proxy_server.c index f5d361e8fe..319f0ad2f7 100644 --- a/components/bt/esp_ble_mesh/mesh_core/proxy_server.c +++ b/components/bt/esp_ble_mesh/mesh_core/proxy_server.c @@ -917,16 +917,6 @@ static bool client_filter_match(struct bt_mesh_proxy_client *client, BT_DBG("filter_type %u addr 0x%04x", client->filter_type, addr); - if (client->filter_type == WHITELIST) { - for (i = 0; i < ARRAY_SIZE(client->filter); i++) { - if (client->filter[i] == addr) { - return true; - } - } - - return false; - } - if (client->filter_type == BLACKLIST) { for (i = 0; i < ARRAY_SIZE(client->filter); i++) { if (client->filter[i] == addr) { @@ -937,6 +927,18 @@ static bool client_filter_match(struct bt_mesh_proxy_client *client, return true; } + if (addr == BLE_MESH_ADDR_ALL_NODES) { + return true; + } + + if (client->filter_type == WHITELIST) { + for (i = 0; i < ARRAY_SIZE(client->filter); i++) { + if (client->filter[i] == addr) { + return true; + } + } + } + return false; }