PhilipsHue / flutter_reactive_ble

Flutter library that handles BLE operations for multiple devices.
https://developers.meethue.com/
Other
662 stars 326 forks source link

Enable quick-setup by default #773

Closed Klievan closed 10 months ago

Klievan commented 1 year ago

Fixes https://github.com/PhilipsHue/flutter_reactive_ble/issues/211

Setting the NotificationSetupMode to QUICK_SETUP makes it so the notification-observable stream gets opened BEFORE writing the descriptor on the peripheral. This makes it so that if the peripheral starts sending notifications instantly upon subscribing, no data is lost. Otherwise, the couple of milliseconds between writing the notification-descriptor and propagating the observable stream to the Flutter app, notifications can be received by the phone that are missed by the app.

Other BLE-libraries seem to be also using AndroidRxBle but did not have this issue, so I can only assume they were using the same mode.

wcoder commented 1 year ago

@Klievan please exclude the last commit from the PR

Klievan commented 1 year ago

@wcoder Fixed the PR

remonh87 commented 1 year ago

@Klievan thanks for the pr I think it is still best to use default mode however let's add a setting in the library where you can override it. How does that sound?

Klievan commented 1 year ago

That sounds perfect, though I'm wondering what the drawbacks are from quick setup?