Skip to content

Error calling descriptorsForCharacteristic when there is no descriptor for that characteristic #492

Open
@pagind92

Description

@pagind92

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions