quick_blue icon indicating copy to clipboard operation
quick_blue copied to clipboard

How to get characteristics by using serviceId

Open rohitsangwan01 opened this issue 3 years ago • 12 comments

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

rohitsangwan01 avatar Mar 30 '22 17:03 rohitsangwan01

Any usecase?

Sunbreak avatar Mar 30 '22 19:03 Sunbreak

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

rohitsangwan01 avatar Mar 30 '22 19:03 rohitsangwan01

Probably. But not on my roadmap

Busy doing pure Dart implementation on Windows

Sunbreak avatar Mar 30 '22 21:03 Sunbreak

Okk great , let me know if i can be helpful

rohitsangwan01 avatar Mar 31 '22 06:03 rohitsangwan01

I'd like to review your implementation on this

Sunbreak avatar Mar 31 '22 06:03 Sunbreak

Okk Will try

rohitsangwan01 avatar Mar 31 '22 06:03 rohitsangwan01

@Sunbreak done , added a PR #82

rohitsangwan01 avatar Mar 31 '22 17:03 rohitsangwan01

Could split this feature request into another PR?

Sunbreak avatar Mar 31 '22 23:03 Sunbreak

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

ext-danny avatar Jul 03 '22 16:07 ext-danny

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

rohitsangwan01 avatar Jul 03 '22 16:07 rohitsangwan01

@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<String>)' 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);

ext-danny avatar Jul 03 '22 16:07 ext-danny

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

rohitsangwan01 avatar Jul 03 '22 16:07 rohitsangwan01