Bluetooth GATTSCharacteristic set permissions
-
Hello everyone,
I'm currently trying to setup a characteristic which only allows reading, but not writing.
In the docs https://docs.pycom.io/chapter/firmwareapi/pycom/network/bluetooth/gattsservice.html it's described that this was possible, but it's sadly not stated which are the values and how I can put them.Does someone know more about this and can help me out?
Thanks already!
-
Got the issue sorted out myself.
The values are documented in the esp-idf: https://github.com/espressif/esp-idf/blob/master/components/bt/bluedroid/api/include/esp_gatt_defs.h#L267
just set the values corresponding to your needs. Be sure to set both permissions and properties. Example:
The below characteristic supports only READ and NOTIFY:
service.characteristic(uuid=0x2001, permissions=(1<<0), properties=(1 << 1) | (1 << 4), value=0)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register Login