PhilipsHue / flutter_reactive_ble

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

flutter reactive ble takes time to fetch data when sending request #713

Closed adarshsinggh closed 1 year ago

adarshsinggh commented 1 year ago

Whenever i am sending the request it is taking a delay of 4 seconds approximately on every step, but sometimes it works smooth in release mode

To Reproduce Steps to reproduce the behavior: Stream manual(String deviceId) async* { List list = []; final r = flutterReactiveBle.subscribeToCharacteristic( qualifiedChar(Uuid.parse(ServiceIds.MANUAL_BUTTON), deviceId)); r.map((event) { list = event; }); yield convertAscii(list); }

Smartphone / tablet

Peripheral device

remonh87 commented 1 year ago

This is behaviour of Ble. What happens is that aomwrimwa it takes longer. What I would recommend is using to improve this behaviour: https://github.com/PhilipsHue/flutter_reactive_ble/blob/a8a0d6bce76dabf0cfc9a15e15bdb1a309e24ec8/packages/flutter_reactive_ble/lib/src/reactive_ble.dart#L211