FlutterBleLib icon indicating copy to clipboard operation
FlutterBleLib copied to clipboard

Error calling descriptorsForCharacteristic when there is no descriptor for that characteristic

Open pagind92 opened this issue 5 years ago • 1 comments

Hi, i am testing FlutterBleLib (2.2.5) using Android and iOS environment and a Ble device. I found that the peripheral method descriptorsForCharacteristic throws error with iOS environment if there is no descriptor for the given characteristic. The error is caused by the method descriptorsForPeripheral of file discovery_mixin.dart, in particular when the JSON string must be mapped. If there is no descriptor, the JSON string returned by Android invoke method is:

{"descriptors":[]}

The JSON string returned by iOS invoke method is:

[

]

So the lib cannot map to Map<String, dynamic>. I confirm that the method descriptorsForPeripheral works well if there is a descriptor with both environments.

pagind92 avatar Jul 14 '20 08:07 pagind92

Thanks! I'll fix that when I have the time.

mikolak avatar Jul 14 '20 09:07 mikolak