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

Inconsistent set_callback_on_scan_updated callback behavior. #333

Open
Jah-On opened this issue Aug 7, 2024 · 0 comments
Open

Inconsistent set_callback_on_scan_updated callback behavior. #333

Jah-On opened this issue Aug 7, 2024 · 0 comments

Comments

@Jah-On
Copy link

Jah-On commented Aug 7, 2024

When using SimpleBLE::Safe::Adapter and SimpleBLE::Safe::Peripheral, the callback exhibits different behavior on Linux and Windows. For starters, Linux updates far less frequently and seems to stop after one or two updates. It seems like changes in RSSI do not trigger the callback. However, on Windows, RSSI changes do trigger the callback with it getting called at least every second per device.

On a somewhat related issue, the behavior for indicating whether a discovered device is no longer connectable is inconsistent too. On Linux, not such indication is given in either via the callback which is never triggered or repeatedly checking the values of stored discovered devices whose member attributes never change including RSSI or is_connectable(). It is worth noting that I am using pass by reference and pointers to pass around and store the Peripherals fed into the callback in downstream classes and functions. On Windows, the RSSI does eventually become -127 after exactly one minute of the Bluetooth being powered off. While it's certainly an improvement over no indication, it's quite a long time. For applications that rely on user selection where the list needs to be updated to only show devices that are still connectable, a delay of five to ten seconds is approaching the upper limit of acceptable.

I'm sure there are OS specific quirks for each of these things but it'd be nice to have a proper understanding of these differences to handle them accordingly. Any ideas for how to work around them?

Thank you!

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

1 participant