From patchwork Mon Oct 25 19:18:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Mandlik X-Patchwork-Id: 12582655 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2F03C43217 for ; Mon, 25 Oct 2021 19:27:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8FF18610F8 for ; Mon, 25 Oct 2021 19:27:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234855AbhJYT3X (ORCPT ); Mon, 25 Oct 2021 15:29:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235191AbhJYT1A (ORCPT ); Mon, 25 Oct 2021 15:27:00 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FCEBC043182 for ; Mon, 25 Oct 2021 12:18:32 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id w5-20020a654105000000b002692534afceso6812923pgp.8 for ; Mon, 25 Oct 2021 12:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=GadM25GyCQsUcLWDoGrNQ7kgJjqimAr+mqriDFRUSME=; b=C0yS2882OBq7SwhFmxAiqnCDkwtQNbjVnzdwwzBcaRcaisaAUaAeW/jIistLO7HCOy Rh/dqASRA8yPDOgrPKW0cBW6to08F5cOp7EAzQozHrEGOdZFCTYT3p2MfVVY9kchnCkH Dx523kamjoDWn/jF5HLNcte8jVSbGiJFDBufi5SMpHgjM2qbhbtQPLjgUZY91DTUgIZd DsOKwAOt1I64g9SWcxZrPwQM6VQb6lcHs5OOcnQ38ABVIr1wO0DcgAy2CM3OzQqU2uKU 5Y5crr67F2GOFk+H62Ymx0jtyvCvxVvNliXODxU5rzFEXCGwsJx8KMbWX2rFCuDr6Z8s TNwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=GadM25GyCQsUcLWDoGrNQ7kgJjqimAr+mqriDFRUSME=; b=mhNt1w7GhOXSaUbSYDXB9ZhMZSafSwgcAQ5u9e0MsvRvYI96BNFCO2cejJbBtpo3FM AnWba+H0xpv1FtW2I6puDQuWeVK3YmUdqv0qhJ4cx3juCmPAnOF6Igx4UbAo5rw0Xs6R OFQDwcARiDtPmYoL2FPHzmLVfT9Kp6sgwSELiI/T2SHppIhpiV0Mpc1iHZGSvENcbBr0 2fL8I0PdphMxARUX7UBl2/z+9AKG681RoWwGEOCnL2vGF9VrZFHstGGN8gD7KR89amte BSWWHpA9VFimWpSnP+au3SJ3abuZKg0pfVfi2w/U3TFo0PCWmCp5PDjwmtRg+KKujeQW AZ3A== X-Gm-Message-State: AOAM5326XhpXyQDwSCX4b2Sqtd5GPsvyDd/L2EzQZDgcqcJR/z8CpX/9 /tE/+YihJbqnmK8mD6ln7IDWy+zbJsyUSQ== X-Google-Smtp-Source: ABdhPJwB9FPeB/IN6eRA7FMc5jF9e5Pc3CdijHdYwXACBNWJzPUTgzaji/sgdUltc4YFhsToGc57bf5QHy5Hbg== X-Received: from mmandlik.mtv.corp.google.com ([2620:15c:202:201:e7c3:c740:ce43:5358]) (user=mmandlik job=sendgmr) by 2002:a17:902:708a:b0:140:e30:a48b with SMTP id z10-20020a170902708a00b001400e30a48bmr17910858plk.54.1635189511507; Mon, 25 Oct 2021 12:18:31 -0700 (PDT) Date: Mon, 25 Oct 2021 12:18:09 -0700 In-Reply-To: <20211025191811.3575708-1-mmandlik@google.com> Message-Id: <20211025121343.BlueZ.v4.1.I7f6bdb9282c1e12ffc6c662674678f2b1cb69182@changeid> Mime-Version: 1.0 References: <20211025191811.3575708-1-mmandlik@google.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [BlueZ PATCH v4 1/3] doc: Introduce the Adv Monitor Device Found/Lost events From: Manish Mandlik To: marcel@holtmann.org, luiz.dentz@gmail.com Cc: linux-bluetooth@vger.kernel.org, chromeos-bluetooth-upstreaming@chromium.org, Manish Mandlik Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch introduces new MGMT events to indicate that the controller has started/stopped tracking a particular device matching one of the already added Advertisement Monitor. --- Changes in v4: - Add Advertisement Monitor Device Found event, make Address_Type 0 as reserved. Changes in v3: - Discard changes to the Device Found event and notify bluetoothd only when the controller stops monitoring the device via new Device Lost event. Changes in v2: - Instead of creating a new 'Device Tracking' event, add a flag 'Device Tracked' in the existing 'Device Found' event and add a new 'Device Lost' event to indicate that the controller has stopped tracking that device. doc/mgmt-api.txt | 50 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt index 5355fedb0..32dd8c0f2 100644 --- a/doc/mgmt-api.txt +++ b/doc/mgmt-api.txt @@ -107,7 +107,8 @@ Configuration command, Default Runtime Configuration Changed event, Get Device Flags command, Set Device Flags command, Device Flags Changed event, Read Advertisement Monitor Features command, Add Advertisement Patterns Monitor command, Remove Advertisement Monitor command, Advertisement Monitor -Added event and Advertisement Monitor Removed event. +Added event, Advertisement Monitor Removed event, Advertisement Monitor Device +Found event and Advertisement Monitor Device Lost event. Example @@ -4910,3 +4911,50 @@ Controller Resume Event Address_Type. Otherwise, Address and Address_Type will both be zero. This event will be sent to all management sockets. + + +Advertisement Monitor Device Found Event +======================================== + + Event code: 0x002f + Controller Index: + Event Parameters: Monitor_Handle (2 Octets) + Address (6 Octets) + Address_Type (1 Octet) + + This event indicates that the controller has started tracking a device + matching an Advertisement Monitor with handle Monitor_Handle. + + The address of the device being tracked will be shared in Address and + Address_Type. + + Possible values for the Address_Type parameter: + 0 Reserved (not in use) + 1 LE Public + 2 LE Random + + This event will be sent to all management sockets. + + +Advertisement Monitor Device Lost Event +======================================= + + Event code: 0x0030 + Controller Index: + Event Parameters: Monitor_Handle (2 Octets) + Address (6 Octets) + Address_Type (1 Octet) + + This event indicates that the controller has stopped tracking a device + that was being tracked by an Advertisement Monitor with handle + Monitor_Handle. + + The address of the device being tracked will be shared in Address and + Address_Type. + + Possible values for the Address_Type parameter: + 0 Reserved (not in use) + 1 LE Public + 2 LE Random + + This event will be sent to all management sockets. From patchwork Mon Oct 25 19:18:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Mandlik X-Patchwork-Id: 12582657 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC797C433EF for ; Mon, 25 Oct 2021 19:27:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4BB0604AC for ; Mon, 25 Oct 2021 19:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234934AbhJYT3Z (ORCPT ); Mon, 25 Oct 2021 15:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235193AbhJYT1A (ORCPT ); Mon, 25 Oct 2021 15:27:00 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98E39C043183 for ; Mon, 25 Oct 2021 12:18:34 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id g18-20020a631112000000b00299f5f53824so6817281pgl.2 for ; Mon, 25 Oct 2021 12:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=2O13I+eCaUQoEjOsTHL0aOiW+ClxYsgJIdDs3MHPtIs=; b=DR0eTKRNcGfnz3qorL/3gXAzhdxRO9axeVLJ2sXd46sR1j6BYZ30dhxxzTASm7RCps ZSEKImJZeCrNshcWtNT3y/MvEzy8NewVyLUX2eY5vgkuItU89E8uaV6FaeCfuXwA4UQt 0R9gJal6dvKUTzcOHi/Ps4qNrfNeoxye6q6NAnOGBmBnXl+5VV8u8eLXmik3akIJWu88 5SqdWLf4758MbqTI3F/1QHnz4tOicB67BQAu8RwDEIS4Ya7pNduUKkFV3Wd+SSRCmm1r stEVTNyTrj/fc6BpG6sNQTD6c4P/dnZktldN8RadW6BAQ4NgUWPNto3i9lWT/gXc29Ue iuXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=2O13I+eCaUQoEjOsTHL0aOiW+ClxYsgJIdDs3MHPtIs=; b=3yxqbf6ucarj40MkMG61NjoeOh94A0sBdIP/NduXqYvNBokfKTw//M5cnIl9i63//r knOYqrrxJpSOEKOwfNSoP8+6sSLxg0yJm+Z1/OE4pRVlL1Kx4exp1Wy6WuL2Ue76Ixz3 E75iaruzTNYPXwkEhiVk6tq9KwPpnaje3/Qd2R367RsOPogd0eQJdu3ZHrLEN2b2qaQX qc709c/0nI7hV7IJU4o9yk4bDL99ZidwQ/w/Kauo2AITqJGxU90UUEE004zXnjslVU3v EzGlsp7lwXGiLutP5k2XUCgO8e/dvhE13E7c5B7AEqwGxQvpQuRPKZFwf8QtO6/YCtOn EfkA== X-Gm-Message-State: AOAM531SRycuuRZsE7bOuyZHuU/D50Uw14kdzn1EeOZBce6Y4PsXySQC 8a3kX1gWRT9TindXzPdfy7c0sMAanfs2WQ== X-Google-Smtp-Source: ABdhPJwaAfmX44YNKzsczCJuPcv8lIPKyf6z1nmdLOAveaXh/Npq/gh6o7ehynyBIQKn1sEyRnxm5Xst22HcFA== X-Received: from mmandlik.mtv.corp.google.com ([2620:15c:202:201:e7c3:c740:ce43:5358]) (user=mmandlik job=sendgmr) by 2002:a17:90a:644d:: with SMTP id y13mr23129735pjm.10.1635189514013; Mon, 25 Oct 2021 12:18:34 -0700 (PDT) Date: Mon, 25 Oct 2021 12:18:10 -0700 In-Reply-To: <20211025191811.3575708-1-mmandlik@google.com> Message-Id: <20211025121343.BlueZ.v4.2.Ied4afb8c4c882e573f4a23670fc060cbc3e319c9@changeid> Mime-Version: 1.0 References: <20211025191811.3575708-1-mmandlik@google.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [BlueZ PATCH v4 2/3] lib: Add definitions of the Adv Monitor Device Found/Lost events From: Manish Mandlik To: marcel@holtmann.org, luiz.dentz@gmail.com Cc: linux-bluetooth@vger.kernel.org, chromeos-bluetooth-upstreaming@chromium.org, Manish Mandlik Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch adds definitions of the new Advertisement Monitor Device Found and Device Lost events to indicate that the controller has started/stopped tracking a particular device. --- Changes in v4: - Add Advertisement Monitor Device Found event. Changes in v3: - Discard changes to the Device Found event and notify bluetoothd only when the controller stops monitoring the device via new Device Lost event. Changes in v2: - Instead of creating a new 'Device Tracking' event, add a flag 'Device Tracked' in the existing 'Device Found' event and add a new 'Device Lost' event to indicate that the controller has stopped tracking that device. lib/mgmt.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/mgmt.h b/lib/mgmt.h index 0a6349321..50519c065 100644 --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -1014,6 +1014,18 @@ struct mgmt_ev_controller_resume { uint8_t wake_reason; } __packed; +#define MGMT_EV_ADV_MONITOR_DEVICE_FOUND 0x002f +struct mgmt_ev_adv_monitor_device_found { + uint16_t monitor_handle; + struct mgmt_addr_info addr; +} __packed; + +#define MGMT_EV_ADV_MONITOR_DEVICE_LOST 0x0030 +struct mgmt_ev_adv_monitor_device_lost { + uint16_t monitor_handle; + struct mgmt_addr_info addr; +} __packed; + static const char *mgmt_op[] = { "<0x0000>", "Read Version", @@ -1152,6 +1164,8 @@ static const char *mgmt_ev[] = { "Advertisement Monitor Removed", "Controller Suspend", "Controller Resume", + "Advertisement Monitor Device Found", /* 0x002f */ + "Advertisement Monitor Device Lost", }; static const char *mgmt_status[] = { From patchwork Mon Oct 25 19:18:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Mandlik X-Patchwork-Id: 12582659 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4186C433EF for ; Mon, 25 Oct 2021 19:27:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF50B60273 for ; Mon, 25 Oct 2021 19:27:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235008AbhJYT30 (ORCPT ); Mon, 25 Oct 2021 15:29:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235205AbhJYT1U (ORCPT ); Mon, 25 Oct 2021 15:27:20 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEA1EC043184 for ; Mon, 25 Oct 2021 12:18:36 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id q6-20020a17090a178600b001a272c28654so169685pja.8 for ; Mon, 25 Oct 2021 12:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=KA0vcFs8GMNeJbdjaa0VOz2jygYh3Ceu3BJ2ggMcAVk=; b=TphYencw+erf8SWCQNvltwUVqR7FohLGcs0NwDDiT8dnsXFz4VAPs7+beR7I5auKrm Sxze54ddoYGt+yW8Zsv8udGRaKXB8dIENh0LjR2uKA/qa/Q0nINDvXhJh0ZmYkZ730pF tCD4PeAha5iAm82ZcCQLT6LoWeOK1Yf/LJC4nmH9OxxzRVrXh5HKZ0sZGq71rdgTomnC CO4WFjutBWiYq11qHvwbSJoTLYh2TPUsbZCzx7/H4M96+1R14fFRMj6bh5iaqG/69VA6 LcfQulK82k5ATWpNnHUOUYxxO+9SWn+rHoPZRjWr7SkH5iKyZvFv/y8vkoGzEjqPeM7I A5WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=KA0vcFs8GMNeJbdjaa0VOz2jygYh3Ceu3BJ2ggMcAVk=; b=NT5ON3eIGjOpPcDPTLPk+22dEEs7qhUqJonEm1eKyS370jhbRgdVqHwcALlPjE1dpP ZEK/H/SeIh2EJxOSiq3X2hsl4VScxE8wm/X2UfGwH1pX3AACdEkqWiWHm7AgFkP5U3DS ++yV1bULdGXNR8prwscj+dBbsG6GLhrpoVesS123GQ3rafPaPTKaouiqX0XvImSJvJJJ dqdzPjXJPRhaI/GD8k10vcWZ6rIQMubufl0T6RxArRBE2Qns7o+lBAr+k55J7LxW4BYH Lr/9lbG5le5ZOBkBGgwcqs9jJBYDMJLz9U93A8YKFPd7eS/ytJ2N9mStbcezLq7Sv/Q6 cRfg== X-Gm-Message-State: AOAM532NdPaV0uoj3OMGH9Gzp6gvsa2VSqwssGKgejjC0gZk7StiUHw1 mTuGQMzE4GbVQUSD2UTf8obrVlPL0BYKPA== X-Google-Smtp-Source: ABdhPJzbz19X3XGnB05TX1hu6AbLUk50BIqnqaIj10zH00r8BSzPHijZLJ9A9E9LH4/ZihivjT3svoJo+HpFNQ== X-Received: from mmandlik.mtv.corp.google.com ([2620:15c:202:201:e7c3:c740:ce43:5358]) (user=mmandlik job=sendgmr) by 2002:a63:2cf:: with SMTP id 198mr15131067pgc.274.1635189516170; Mon, 25 Oct 2021 12:18:36 -0700 (PDT) Date: Mon, 25 Oct 2021 12:18:11 -0700 In-Reply-To: <20211025191811.3575708-1-mmandlik@google.com> Message-Id: <20211025121343.BlueZ.v4.3.I68039747acc3c63f758278452889d6ed2bfff065@changeid> Mime-Version: 1.0 References: <20211025191811.3575708-1-mmandlik@google.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [BlueZ PATCH v4 3/3] adv_monitor: Receive the Device Found/Lost events From: Manish Mandlik To: marcel@holtmann.org, luiz.dentz@gmail.com Cc: linux-bluetooth@vger.kernel.org, chromeos-bluetooth-upstreaming@chromium.org, Manish Mandlik Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch registers callback finctions to receive the Advertisement Monitor Device Found and Device Lost events. Test performed: - verified by logs that the MSFT Monitor Device is received from the controller and the bluetoothd is notified whenever the controller starts/stops monitoring a device. --- Changes in v4: - Add Advertisement Monitor Device Found event. Changes in v3: - Fix indentation of the adv_monitor_device_lost_callback() name and it's arguments. Changes in v2: - Update function name adv_monitor_tracking_callback() to adv_monitor_device_lost_callback() as it will receive only Device Lost event. src/adv_monitor.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/adv_monitor.c b/src/adv_monitor.c index 715ac5904..2aae5d372 100644 --- a/src/adv_monitor.c +++ b/src/adv_monitor.c @@ -1531,6 +1531,48 @@ static void adv_monitor_removed_callback(uint16_t index, uint16_t length, ev->monitor_handle); } +/* Processes Adv Monitor Device Found event from kernel */ +static void adv_monitor_device_found_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + struct btd_adv_monitor_manager *manager = user_data; + const struct mgmt_ev_adv_monitor_device_found *ev = param; + uint16_t handle = le16_to_cpu(ev->monitor_handle); + const uint16_t adapter_id = manager->adapter_id; + char addr[18]; + + if (length < sizeof(*ev)) { + btd_error(adapter_id, + "Wrong size of Adv Monitor Device Found event"); + return; + } + + ba2str(&ev->addr.bdaddr, addr); + DBG("Adv Monitor with handle 0x%04x started tracking the device %s", + handle, addr); +} + +/* Processes Adv Monitor Device Lost event from kernel */ +static void adv_monitor_device_lost_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + struct btd_adv_monitor_manager *manager = user_data; + const struct mgmt_ev_adv_monitor_device_lost *ev = param; + uint16_t handle = le16_to_cpu(ev->monitor_handle); + const uint16_t adapter_id = manager->adapter_id; + char addr[18]; + + if (length < sizeof(*ev)) { + btd_error(adapter_id, + "Wrong size of Adv Monitor Device Lost event"); + return; + } + + ba2str(&ev->addr.bdaddr, addr); + DBG("Adv Monitor with handle 0x%04x stopped tracking the device %s", + handle, addr); +} + /* Allocates a manager object */ static struct btd_adv_monitor_manager *manager_new( struct btd_adapter *adapter, @@ -1555,6 +1597,14 @@ static struct btd_adv_monitor_manager *manager_new( manager->adapter_id, adv_monitor_removed_callback, manager, NULL); + mgmt_register(manager->mgmt, MGMT_EV_ADV_MONITOR_DEVICE_FOUND, + manager->adapter_id, adv_monitor_device_found_callback, + manager, NULL); + + mgmt_register(manager->mgmt, MGMT_EV_ADV_MONITOR_DEVICE_LOST, + manager->adapter_id, adv_monitor_device_lost_callback, + manager, NULL); + return manager; }