Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Bluetooth GATTSCharacteristic set permissions

    Scheduled Pinned Locked Moved Discussion
    bluetoothblecharacteristicpermission
    2 Posts 1 Posters 679 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      binux
      last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • B Offline
        binux
        last edited by

        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)

        1 Reply Last reply Reply Quote 1

        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
        • 1 / 1
        • First post
          Last post

        Pycom on Twitter

        Pycom