SimpleBLE icon indicating copy to clipboard operation
SimpleBLE copied to clipboard

Expose GATT Characteristic Properties in Characteristic class

Open jferdelyi opened this issue 2 years ago • 5 comments

I think it would be a good idea to have the GATT characteristic properties directly accessible in the Characteristic class.

jferdelyi avatar Aug 18 '22 14:08 jferdelyi

Hey @jferdelyi, thanks for the feedback!

Could you elaborate a bit more on what the desired API would look like? I'm not entirely sure I understood what you expect.

Thanks!

kdewald avatar Aug 18 '22 15:08 kdewald

Maybe I miss something, my idea is relatively simple: for each caracteristic be able to get all properties like Write, Notify, Read, etc.

In the actual implementation, as far as I know, the only way to know this is to try, and an exception is raised if the caracteristic doesn't have the propertie (or nullopt in the case of "safe" usage).

jferdelyi avatar Aug 18 '22 16:08 jferdelyi

Oh, I see! Yeah, that's a very reasonable request. Added to my list :)

kdewald avatar Aug 18 '22 16:08 kdewald

Thanks :)

jferdelyi avatar Aug 18 '22 19:08 jferdelyi

I would also love to have the library report the characteristic properties as my tool works with multiple peripherals. Currently, they all use write without response and notify to exchange data. I'd like my tool to be able to verify which characteristic properties the peripheral supports, and use the appropriate services or throw an error, as appropriate. Thanks Kevin for this great library!

Implemented in https://github.com/OpenBluetoothToolbox/SimpleBLE/pull/130

kdewald avatar Nov 14 '22 02:11 kdewald