getsenic / gatt-python

Bluetooth GATT SDK for Python
MIT License
318 stars 86 forks source link

writing a value to the client characteristics configuration descriptor #26

Closed sitikanthaz closed 6 years ago

sitikanthaz commented 6 years ago

I am writing an app to enable notification on glucose measurement characteristics but it will only work if I enable the CCCD. unable to write a value to that descriptor. plz help

Snevzor commented 6 years ago

On your Characteristic instance you can use .enable_notifications().

sitikanthaz commented 6 years ago

I am doing that but it's not receiving anything from the server i.e. glucometer. the characteristic_value_updated() is not showing any values. do I have to write anything to the descriptor handle 2902 to enable this notification?

sitikanthaz commented 6 years ago

Any info or example on this? how to write to a descriptor handle? when I try to write using write.value() it shows "operation not supported" error. and from the documentations of bluetooth glucose profile I found out that i have to pass '01' to this uuid 2902 which is a descriptor after which notifications will be enabled. Any development on this plz share.

sitikanthaz commented 6 years ago

I got it resolved now. the bluez program does enable the CCCD for notifications by default and you don't have to write anything to the CCCD handle anymore. I got confused by the old documentation of bluetooth profile. My bad :) . closing this