woodemi / quick_blue

A cross-platform (Android/iOS/macOS/Windows/Linux) BluetoothLE plugin for Flutter
135 stars 70 forks source link

How to get characteristics by using serviceId #81

Open rohitsangwan01 opened 2 years ago

rohitsangwan01 commented 2 years ago

Hey , as title suggests can we have a method like , discover characteristics

Sunbreak commented 2 years ago

Any usecase?

rohitsangwan01 commented 2 years ago

Yes i was implementing a feature where i have to list out all services and their characteristics Something similar to nRF connect app Not urgent feature for now, but just asking in case if its possible As we are already discovering characterics , so just an api to get list of it, or maybe in discoverServices methods Instead of getting services , we can get an object containing serviceId and characteristicList

Sunbreak commented 2 years ago

Probably. But not on my roadmap

Busy doing pure Dart implementation on Windows

rohitsangwan01 commented 2 years ago

Okk great , let me know if i can be helpful

Sunbreak commented 2 years ago

I'd like to review your implementation on this

rohitsangwan01 commented 2 years ago

Okk Will try

rohitsangwan01 commented 2 years ago

@Sunbreak done , added a PR #82

Sunbreak commented 2 years ago

Could split this feature request into another PR?

ext-danny commented 2 years ago

Is this api be available already, because I can see this on the example.

rohitsangwan01 commented 2 years ago

@ext-danny You can recieve Characteristics from the Service Handler , call discover services and it will return serviceId and Characteristics list

ext-danny commented 2 years ago

@rohitsangwan01 I'm using the latest version i.e, quick_blue: ^0.4.1+1 but the third parameter is missing. if I follow the example like you said I get the error

The argument type 'void Function(String, String, List)' can't be assigned to the parameter type 'void Function(String, String)?'.

checking on the plugin code I can't see the third parameter

typedef OnServiceDiscovered = void Function(String deviceId, String serviceId);

rohitsangwan01 commented 2 years ago

@ext-danny try version 5 , check on Pub dev , its in bera version currently