Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to register AdvertisementMonitor not propagated to D-Bus #434

Open
bojanpotocnik opened this issue Nov 29, 2022 · 2 comments
Open

Comments

@bojanpotocnik
Copy link

As described in hbldh/bleak#1136, if kernel does not support Advertising Monitor, the failure to Add Advertisement Patterns Monitor is not propagated.

Example using btmgmt, where the error is detected because MGMT command is actually executed:

➜  ~ btmgmt          
[mgmt]# version
Version 5.66
[mgmt]# revision 
MGMT Version 1, revision 14
[mgmt]# menu monitor 
...
[mgmt]# features 
Reading adv monitor features failed with status 0x01 (Unknown Command)

btmon --mgmt output:

@ MGMT Command: Read Advertisement Monitor Features (0x0051) plen 0
@ MGMT Event: Command Status (0x0002) plen 3
      Read Advertisement Monitor Features (0x0051)
        Status: Unknown Command (0x01)

However, when executing "equivalent" D-Bus call, no MGMT commands are invoked at all (btmon output empty)

➜  ~ dbus-send --system --dest=org.bluez --print-reply /org/bluez/hci0 org.freedesktop.DBus.Properties.Get string:org.bluez.AdvertisementMonitorManager1 string:SupportedFeatures
method return time=1669724095.627868 sender=:1.95589 -> destination=:1.95986 serial=307 reply_serial=2
   variant       array [
      ]

Note that empty array is returned also on kernel 5.14, where using advertising monitor actually works.

This is not the same as #203 (monitor can be used there via btmgmt), however it probably has the same problems of errors not propagating to D-Bus.

@Vudentz
Copy link
Contributor

Vudentz commented Nov 29, 2022

@bojanpotocnik Im surprised the interface even exists if the kernel doesn't support it as it is probably useless to have it if none of the commands would work, that said perhaps the controller don't actually support the MSFT command to enable it on 5.14?

@bojanpotocnik
Copy link
Author

it is probably useless to have it if none of the commands would work

I agree, that would be even better way to solve it.

that said perhaps the controller don't actually support the MSFT command to enable it on 5.14?

I'm not sure what exactly you meant by this, but otherwise passive scanning on 5.14 works fine using the same BlueZ version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants