Closed oooluwa closed 9 months ago
how are you reading the data? are you using setNotifyValue
? or are you manually calling read
?
how are you reading the data? are you using
setNotifyValue
? or are you manually callingread
?
Not sure I understand that. This is the function that listens to the devices:
Stream<BleDeviceModel> get advertisingDevices async* {
try {
await for (List<ScanResult> results in FlutterBluePlus.scanResults) {
for (ScanResult result in results) {
if (result.advertisementData.manufacturerData.isEmpty) {
continue;
}
var mfgId = result.advertisementData.manufacturerData.entries.first.key;
if (mfgId == _kOurId) {
if (_minRssiThreshold == null || result.rssi > _minRssiThreshold!) {
_logger.d("BLE Service: ${result.timeStamp}");
yield result;
}
}
}
}
} on Exception catch (e) {
_logger.e(e.toString());
throw AppException(e.toString());
}
}
I see.
scan results come straight from the operating system
i'm not aware of anything FBP could change to improve your situation
if you figure it out, please report back
it could be a problem with your device.
try different ios version also if possible
To achieve our goal, we set the continuousUpdates flag to true and set a timer to start the scanner every 5 seconds. It seems a little hacky but this is the only way to achieve our use case.
Requirements
Have you checked this problem on the example app?
Yes
FlutterBluePlus Version
1.31.15
Flutter Version
3.19.0
What OS?
iOS
OS Version
iPadOS 16.6, 17.3
Bluetooth Module
Nordic nRF52
What is your problem?
Our app listens to peripheral devices advertising data over BLE. We noticed that the app was missing some data packets and discovered that the BLE data being received from the flutter_blue_plus package slows down for about 1-3 seconds occasionally. The delay can be up to 5 or more seconds in some cases.
Here are the other things we have tried:
Has any other person experienced this issue? How can we solve it?
Logs