Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp665022pxb; Wed, 29 Sep 2021 07:16:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhmiROyXouSbRYflicOoAIYdZJxDwfwBFiGKYI1LESRG4s1FxWSw0x1iZ/JWKRhfd8XkG2 X-Received: by 2002:a17:902:740b:b0:13e:1d71:bc8b with SMTP id g11-20020a170902740b00b0013e1d71bc8bmr10457610pll.45.1632925015853; Wed, 29 Sep 2021 07:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632925015; cv=none; d=google.com; s=arc-20160816; b=nOIDx1XgEsH7uvbfGdsmMiXvp4JTxYCwOW9u1Lqxw8V9n8IPJNQFNTclzL9Oz7RJ8Y 6S9a8PB5H78bYGRVC3ufteMxBJIzc5+Zen7+KpKFYDAogJ2AGDfdtVlr4O5b9EfV83mK JoxYet0zk54rpHAaUXNTH+KRH6l4Lpls+ljF/XWLIBiIT8oxXtQlDL6gMi5+nIh5QvH3 /WxwtggH1mowioFUZEaxYLPkxUWTRkHrJb6g7ee2mt5QmSh4iHKRnXot5KimhJP8l+yg B2eC1woeN6JZsOW7sBMHdgRKEnqPDdbKNRyMxbKp2dV1dlHO5ZEKxxWmWuTrIboxXCya yqiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=0lFalIsxtZhAjnBSC0xjwwocghRAhLOTzx2sfjR0WFE=; b=XOerXs8dGUQKhWNUJLRT3rtbaFTBODbXRGDZkU0lu+zOgTxskG844tOI6Fnc8SvMWG JcOuPSLTBZNEaannAjN99vTWZdApkOVgmNGZjXmqEzcwImbrlYXhpC3yjiDKicSioWlU VYTADLGxZd84Z7/cQ7iIrFwxArnfUqv/1zIBM6Qy4rM4zE3lCNIY3E1UdINJ21bzepaJ eDbNNgPwJyQksHgyRadc3B4DKFmKL8cL57QakNAw6svfHXJQwPvX2uG1MoM+6Ueor5UM zxx6P9eAsNBS9E7N5u8Rt6bm9O7ujKTUP9RAer+U7tS9Gs09xJUiyGG1fK8Jx2kWagq/ PLUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si2814031pgu.517.2021.09.29.07.16.17; Wed, 29 Sep 2021 07:16:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344142AbhI2N2U convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 Sep 2021 09:28:20 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:40033 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242801AbhI2N2P (ORCPT ); Wed, 29 Sep 2021 09:28:15 -0400 Received: from smtpclient.apple (p5b3d2185.dip0.t-ipconnect.de [91.61.33.133]) by mail.holtmann.org (Postfix) with ESMTPSA id 6AFEECECF9; Wed, 29 Sep 2021 15:26:33 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [BlueZ PATCH v1 1/3] doc: Add Advertisement Monitor Device Tracking event From: Marcel Holtmann In-Reply-To: Date: Wed, 29 Sep 2021 15:26:32 +0200 Cc: Luiz Augusto von Dentz , linux-bluetooth , CrosBT Upstreaming , Miao-chen Chou , Yun-Hao Chung , Alain Michaud Content-Transfer-Encoding: 8BIT Message-Id: References: <20210927201657.593569-1-mmandlik@google.com> <20210927131456.BlueZ.v1.1.I7f6bdb9282c1e12ffc6c662674678f2b1cb69182@changeid> To: Manish Mandlik X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Manish, can we please stop top-posting and follow the general rules of this mailing list. > The controller sends advertising reports in addition to this event. This event is reported only when there are active and matched advertisement monitors. > > Whenever an advertisement matches a Monitor, the controller sends this event with Monitor_state set to 1, indicating that it has started monitoring that particular device. After that it may send one or more advertising reports based on the configured Sampling_period for that Monitor. Once the controller stops monitoring that device, it sends the same event again with Monitor_state set to 0 to notify the host that it has stopped monitoring that particular device. > > Since this event is sent only twice (at start and end of monitoring) per monitoring period [1], combining this with the Sampling_period - 0xFF (send only one advertisement report per monitoring period) [2], we can drastically reduce the number of events generated by the controller during background scanning but still have the DeviceFound/DeviceLost functionality in bluetoothd. > > So, it will be better to keep this event separate than the Device Found event as it is triggered only during monitoring. Please let me know what you think about this. > [1]: https://docs.microsoft.com/en-us/windows-hardware/drivers/bluetooth/microsoft-defined-bluetooth-hci-commands-and-events#hci_vs_msft_le_monitor_device_event > [2]: https://docs.microsoft.com/en-us/windows-hardware/drivers/bluetooth/microsoft-defined-bluetooth-hci-commands-and-events#hci_vs_msft_le_monitor_advertisement This is what I was thinking: diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt index 97d33e30a15d..fa9121c3bc87 100644 --- a/doc/mgmt-api.txt +++ b/doc/mgmt-api.txt @@ -4263,6 +4263,7 @@ Device Found Event 1 Legacy Pairing 2 Not Connectable 3 Reserved (not in use) + 4 Device Tracked For the RSSI field a value of 127 indicates that the RSSI is not available. That can happen with Bluetooth 1.1 and earlier @@ -4910,3 +4911,19 @@ Controller Resume Event Address_Type. Otherwise, Address and Address_Type will both be zero. This event will be sent to all management sockets. + +Device Lost Event +================= + + Event Code: 0x002f + Controller Index: + Event Parameters: Address (6 Octets) + Address_Type (1 Octet) + + This event indicates that a tracked device was no longer found + during monitoring. + + Possible values for the Address_Type parameter: + 0 BR/EDR + 1 LE Public + 2 LE Random I really don’t get why we would make it more complicated for mgmt-api and thus bluetoothd. Regards Marcel