summaryrefslogtreecommitdiff
path: root/mesh/manager.c
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2020-02-23 10:47:37 -0800
committerBrian Gix <brian.gix@intel.com>2020-02-26 11:20:08 -0800
commit6a6fe856a900fb53ce38dd3584d5d1d417d8aede (patch)
tree365d79ac9d3557d2d8fef133b2e516f8efc1cf48 /mesh/manager.c
parent4ec7da4037ac59102b70e9edb34d429f8af42f4f (diff)
downloadbluez-6a6fe856a900fb53ce38dd3584d5d1d417d8aede.tar.gz
mesh: rework incoming advertisement filtering
Future versions of Mesh will introduce new advertising packets, which do not fit in the limited and rigid filtering currently used. This minor rewrite allows registering and receiving of *any* AD types, including the filtering on multiple octets of the incoming AD parts.
Diffstat (limited to 'mesh/manager.c')
-rw-r--r--mesh/manager.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesh/manager.c b/mesh/manager.c
index e4a7deaeb..0909c7e16 100644
--- a/mesh/manager.c
+++ b/mesh/manager.c
@@ -52,6 +52,7 @@ static uint8_t scan_uuid[16];
static struct mesh_node *scan_node;
static struct l_timeout *scan_timeout;
static struct add_data *add_pending;
+static const uint8_t prvb[2] = {MESH_AD_TYPE_BEACON, 0x00};
static void scan_cancel(struct l_timeout *timeout, void *user_data)
{
@@ -66,7 +67,7 @@ static void scan_cancel(struct l_timeout *timeout, void *user_data)
net = node_get_net(node);
io = mesh_net_get_io(net);
- mesh_io_deregister_recv_cb(io, MESH_IO_FILTER_PROV_BEACON);
+ mesh_io_deregister_recv_cb(io, prvb, sizeof(prvb));
scan_node = NULL;
scan_timeout = NULL;
}
@@ -397,7 +398,7 @@ static struct l_dbus_message *start_scan_call(struct l_dbus *dbus,
net = node_get_net(node);
io = mesh_net_get_io(net);
scan_node = node;
- mesh_io_register_recv_cb(io, MESH_IO_FILTER_PROV_BEACON,
+ mesh_io_register_recv_cb(io, prvb, sizeof(prvb),
prov_beacon_recv, node);
if (duration)