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

    LoPy4 BLE GATTS Write only

    Scheduled Pinned Locked Moved Firmware
    2 Posts 1 Posters 24 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.
    • P Offline
      Piotr S
      last edited by

      Hi, I`m trying to enhance my connection with android by adding some security.
      Now I have GATT Service running on lopy4 and GATT client app on android.

      My idea is to send command code on first byte, and bytes 2 & 3 reserved for security key.
      Command run only when security code bytes are the same that defined on lopy.

      The problem is that anybody can see this key by reading characteristic, so disable read for this characteristic is required.

      I found topic https://forum.pycom.io/topic/2953/bluetooth-gattscharacteristic-set-permissions/2
      where is the line

      'The below characteristic supports only READ and NOTIFY:
      service.characteristic(uuid=0x2001, permissions=(1<<0), properties=(1 << 1) | (1 << 4), value=0)'

      I was trying to make write only in a similar way but, it doesn't work, is possible to make write only characteristic? Or any other way to verify the characteristic writer?

      1 Reply Last reply Reply Quote 0
      • P Offline
        Piotr S
        last edited by

        write only finally done with code:

        chr2 = srv2.characteristic(uuid=1234,permissions=0x02 | 0x10,properties=0x08 | 0x04, value=11)

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

        Pycom on Twitter

        Pycom