-
Notifications
You must be signed in to change notification settings - Fork 305
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
BleakScanner service_uuids argument not working in BlueZ backend #1534
Comments
is this anyway related to the issue, i.e not able to list UUIDS of some LE devices? I have been facing this issue from a week. |
I am not able to reproduce this issue. I tried:
And I get no callbacks. BlueZ version: 5.64 |
Could it be a bug in bluez user space? |
I just gave that command a try. Found that the simple callback is only triggered for other service ids if home assistant is running (has a bleak based bluetooth integration). My guess is that home assistant somehow removes the service id filter. |
If another application is scanning, then yes the filter could be removed. I suppose that we could add an additional filter in Bleak to get the expected results even when this happens. |
It was noted that on Linux, if another app was scanning at the same time, BlueZ would trigger RSSI changes for all devices, even if they they didn't match the service_uuids filter. This change ensures that we always filter by service_uuids, even if the OS isn't doing it for us. On Windows, the OS wasn't filtering for us anyway, so we can just move that code to the shared call_detection_callbacks() so that all backends will make use of it. Fixes: #1534
It was noted that on Linux, if another app was scanning at the same time, BlueZ would trigger RSSI changes for all devices, even if they they didn't match the service_uuids filter. This change ensures that we always filter by service_uuids, even if the OS isn't doing it for us. On Windows, the OS wasn't filtering for us anyway, so we can just move that code to the shared call_detection_callbacks() so that all backends will make use of it. Fixes: #1534
So, service_uuid filtering does work in Windows?
(where Am I doing something wrong or do I misunderstand the concept of service UUID filtering? |
I found that on bluez the
service_uuids
argument is ignored and the callback is called on non-matching devices.uname -a
): Linux raspberrypi 6.1.21-v8+ add new permissions from android API 31 #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/LinuxExample:
Results:
This doesn't happen on Windows in my tests.
Originally posted by @filmkorn in #1447 (comment)
The text was updated successfully, but these errors were encountered: