-
Notifications
You must be signed in to change notification settings - Fork 582
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
Enable ReportDelay/NumberOfMatches/MatchMode settings in ScanSettings.Builder #604
Comments
Hello @fonix232 Thank you for using the library.
A bit of background — this was not an oversight. There is a need to create (and test!) emulated versions of those commented out functionalities. There are some potential edge cases where different settings could interfere with each other. This may not be trivial. I also do lack knowledge about what is the exact logic behind I may include this background as a comment in the code so next people will not be surprised as you. As till now I have not seen any requests for this functionality — you are the first. I do not have enough time to do it all properly but I will happily help if someone would like to contribute. P.S. Batching updates is quite easy to do depending on your exact use-case using only |
Sorry for the late reply. I agree that on lower level APIs, the emulation of these properties (via manual filtering after the system returns the results?) would be the way to go - although I'm not sure how long you'd like to keep supporting low level APIs (specifically, <21), since the number of devices running such a low OS version is quite rare now, luckily. I can't say much about For me the most important of these three would be the report delay, as that would allow me to batch scan results - which is quite useful for purposes of displaying a list of results, without the list jumping around - by using the BT/BLE hardware instead of the CPU for this. I know it sounds like a stupid little optimisation, but one would do anything to ensure fluid UI :) Using RxJava is an option, yes, but then instead of |
Potentially there are also phones with API >=21 that do not support certain
I would need to have exact data/specification to be able to make an emulation equivalent
This may be a viable option. I do not remember all operators unfortunately. |
Summary
Currently,
ScanSettings
'smatchMode
,reportDelayinMillis
andmNumOfMatchesPerFilter
are all commented out (see here). This is a quite annoying oversight that has not been fixed for the past two years, and doesn't even require that much of a change.However the hindered functionality is quite high priority in quite a few cases, and makes timed updates impossible to create (e.g. if one wants low latency scan results, but batched so every update is delivered at a 2 second interval).
Library version
1.10.1
Preconditions
None, the code bits are intentionally commented out
Steps to reproduce actual result
1. Add RxAndroidBle to project
2. Try to create a ScanSettings instance with report delay
3. The call is not present on
ScanSettings.Builder
Actual result
The calls are not present on
ScanSettings.Builder
Expected result
The calls should be available
Solution
Uncomment the three mentioned
ScanSettings.Builder
methodsThe text was updated successfully, but these errors were encountered: