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

Expose scan settings in centralScanning #336

Open
PietroGranati opened this issue Jan 31, 2023 · 2 comments
Open

Expose scan settings in centralScanning #336

PietroGranati opened this issue Jan 31, 2023 · 2 comments
Assignees

Comments

@PietroGranati
Copy link

PietroGranati commented Jan 31, 2023

After a bit of research and thanks to @m1ga I found out that in ScanManagerAPI21Onwards.java there is a hardcoded setting that can be useful:
scanBuilder.setScanMode(ScanSettings.SCAN_MODE_LOW_POWER);
In fact this prevent the module sto scan for beacon at maximum effort so I modified it in:
scanBuilder.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY);
And now it's much better, maybe you can expose the settings.

Ref:
https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_LOW_LATENCY

@PietroGranati PietroGranati changed the title Cannot make centralScanning work Expose scan settings in centralScanning Feb 1, 2023
@m1ga
Copy link
Contributor

m1ga commented Feb 1, 2023

Thanks for the note! I'll see if I can implement that soon

@m1ga m1ga self-assigned this Feb 1, 2023
@m1ga
Copy link
Contributor

m1ga commented Feb 1, 2023

untested but I added a scanMode property to initCentralManager. There you can pass in one of the constants.
Check the #294 PR

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