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

ScanFilter is not working #860

Open
piotrek-dosell opened this issue Sep 20, 2024 · 1 comment
Open

ScanFilter is not working #860

piotrek-dosell opened this issue Sep 20, 2024 · 1 comment
Labels
bug Bug that is caused by the library

Comments

@piotrek-dosell
Copy link

piotrek-dosell commented Sep 20, 2024

Describe the bug
ScanFilter is not working
Tested with setDeviceName() only
Tested with setServiceUuid() only

To Reproduce
Look at this branch: https://github.com/piotrek-dosell/RxAndroidBle/tree/scanfilter_issue

  1. Change lookFor to a Ble name present in your environment
    Line 73 val lookFor = "Dosell"

Expected behavior

  1. Now comment Line 75:
    .setDeviceName(lookFor)
    e1e2f64#diff-180e9e7bbbb041e547483ad7c95469f2010828f143aaf3643a82fe4fd3bf72e6R75
    Smartphone (please complete the following information):
  • Device: Samsung SM-G398FN (and another Sony device)
  • OS: Android 11
  • Library version: e35ae86 - (origin/master, origin/HEAD, master) Migrated BleCannotSetCharacteristicNotificationExceptionTest. (3 months ago)

Logs from the application when bug occurs (this will greatly help in quick understanding the problem)
Just run the sample and try with and without setDeviceName()
Screenshot from 2024-09-20 07-52-50

Additional context
Add any other context about the problem here.

@piotrek-dosell piotrek-dosell added the bug Bug that is caused by the library label Sep 20, 2024
@dariuszseweryn
Copy link
Owner

As discussed offline:

  • Offloaded ScanFilters may or may not work depending on the OS/vendor peculiarities. You could try using emulated scan filters.
  • Offloaded ScanFilters usually check only the primary Advertisement packet. If a name (or any other scan property) is transmitted in the Extended Advertisement Packet will most likely not work because the Android does not send Extended Advertisement Inquiry when doing scans with ScanFilters. If you control the peripheral you should be able to transmit the filter elements in the primary Advertisement Packet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is caused by the library
Projects
None yet
Development

No branches or pull requests

3 participants
@dariuszseweryn @piotrek-dosell and others