Hello Bt-Maintainers,
Bluetooth Advertisement Monitor API was introduced to support background
scanning and proximity detection based on the application specified RSSI
thresholds and content filters on LE advertisement packets.
To optimize the power consumption, the API offloads the content
filtering and RSSI tracking to the controller if the controller
offloading support is available. However, this monitoring is not
completely offloaded as the bluetoothd also handles RSSI thresholds and
timeouts in order to fulfill high/low thresholds/timeouts filtering with
D-bus clients.
There is further room to achieve better power optimization by supporting
the controller event HCI_VS_MSFT_LE_Monitor_Device_Event to fulfill true
monitor offloading. This is currently not supported as it was originally
desired to minimize the changes to the MGMT interface and reuse the
existing MGMT event - MGMT_EV_DEVICE_FOUND to pass advertisements to
bluetoothd and let bluetoothd handle the RSSI thresholds and timeouts in
order to fulfill the D-bus API requirements for the client.
This patch series introduces a new MGMT interface -
MGMT_EV_ADV_MONITOR_TRACKING to deliver the Monitor Device event
received from the controller to the bluetoothd.
Please let me know what you think about this or if you have any further
questions.
Thanks,
Manish.
Manish Mandlik (3):
doc: Add Advertisement Monitor Device Tracking event
lib: Add definition of AdvMonitor Tracking event
adv_monitor: Receive Device Tracking event
doc/mgmt-api.txt | 27 ++++++++++++++++++++++++++-
lib/mgmt.h | 8 ++++++++
src/adv_monitor.c | 25 +++++++++++++++++++++++++
3 files changed, 59 insertions(+), 1 deletion(-)
--
2.33.0.685.g46640cef36-goog
This patch adds the Advertisement Monitor Device Traching event. This
event indicates that the controller has stated/stopped tracking a
particular device matching one of the already added Advertisement
Monitor.
Reviewed-by: Miao-chen Chou <redacted>
Reviewed-by: Yun-Hao Chung <redacted>
---
doc/mgmt-api.txt | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
@@ -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 and Advertisement Monitor+Device Tracking event. Example
@@ -4910,3 +4911,27 @@ 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 Tracking Event+===========================================++ Event code: 0x002f+ Controller Index: <controller_id>+ Event Parameters: Monitor_Handle (2 octets)+ Monitor_State (1 octet)+ Address (6 octets)+ Address_Type (1 octet)++ This event indicates that the controller has started/stopped tracking+ a particular device matching the Advertisement Monitor with handle+ Monitor_Handle.++ Possible values for the Monitor_State parameter:+ 0 The controller has stopped tracking a device+ 1 The controller has started tracking a device++ The address of the device being tracked will be shared in Address and+ Address_Type.++ This event will be sent to all management sockets.
This patch registers a callback function to receive Advertisement
Monitor Device Tracking event.
Test performed:
- verified by logs that Monitor Device is received from the controller
and sent to the bluetoothd when the controller starts/stops monitoring
a bluetooth device.
---
src/adv_monitor.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> Date: 2021-09-27 20:23:42
Hi Manish,
On Mon, Sep 27, 2021 at 1:17 PM Manish Mandlik [off-list ref] wrote:
quoted hunk
This patch adds the Advertisement Monitor Device Traching event. This
event indicates that the controller has stated/stopped tracking a
particular device matching one of the already added Advertisement
Monitor.
Reviewed-by: Miao-chen Chou <redacted>
Reviewed-by: Yun-Hao Chung <redacted>
---
doc/mgmt-api.txt | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
@@ -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 and Advertisement Monitor+Device Tracking event. Example
@@ -4910,3 +4911,27 @@ 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 Tracking Event+===========================================++ Event code: 0x002f+ Controller Index: <controller_id>+ Event Parameters: Monitor_Handle (2 octets)+ Monitor_State (1 octet)+ Address (6 octets)+ Address_Type (1 octet)++ This event indicates that the controller has started/stopped tracking+ a particular device matching the Advertisement Monitor with handle+ Monitor_Handle.++ Possible values for the Monitor_State parameter:+ 0 The controller has stopped tracking a device+ 1 The controller has started tracking a device++ The address of the device being tracked will be shared in Address and+ Address_Type.++ This event will be sent to all management sockets.
I wonder if wouldn't it be better to indicate this over Device Found?
Or the controller will indicate the advertising report in addition to
this event? Btw, I think it is about time we introduce these commands
to the emulator in order to have proper CI tests, without it cannot
become a stable API.
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=553715
---Test result---
Test Summary:
CheckPatch PASS 4.10 seconds
GitLint PASS 2.72 seconds
Prep - Setup ELL PASS 50.41 seconds
Build - Prep PASS 0.47 seconds
Build - Configure PASS 9.43 seconds
Build - Make PASS 219.41 seconds
Make Check PASS 9.73 seconds
Make Distcheck PASS 263.95 seconds
Build w/ext ELL - Configure PASS 9.43 seconds
Build w/ext ELL - Make PASS 203.37 seconds
---
Regards,
Linux Bluetooth
This patch adds the Advertisement Monitor Device Traching event. This
event indicates that the controller has stated/stopped tracking a
particular device matching one of the already added Advertisement
Monitor.
Reviewed-by: Miao-chen Chou <redacted>
Reviewed-by: Yun-Hao Chung <redacted>
---
doc/mgmt-api.txt | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
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 and Advertisement Monitor
+Device Tracking event.
Example
@@ -4910,3 +4911,27 @@ 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 Tracking Event
+===========================================
+
+ Event code: 0x002f
+ Controller Index: <controller_id>
+ Event Parameters: Monitor_Handle (2 octets)
+ Monitor_State (1 octet)
+ Address (6 octets)
+ Address_Type (1 octet)
+
+ This event indicates that the controller has started/stopped tracking
+ a particular device matching the Advertisement Monitor with handle
+ Monitor_Handle.
+
+ Possible values for the Monitor_State parameter:
+ 0 The controller has stopped tracking a device
+ 1 The controller has started tracking a device
+
+ The address of the device being tracked will be shared in Address and
+ Address_Type.
+
+ This event will be sent to all management sockets.
I have to echo Luiz's comment here. How is this suppose to work. We now get a Device Found and Device Tracked event?
Wouldn’t it be really better to have a “I am tracked” flag in the Device Found event?
Regards
Marcel