summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2020-11-24 22:40:14 +1100
committerDamien George <damien@micropython.org>2020-12-02 14:37:45 +1100
commit89553997b8496aca96b46274c81fa6413d58f6bd (patch)
tree291dc05d2eea386a71e8d2db434dc3d84f214fb2
parent1697ff335db523ff0809051d42871beb9c86012d (diff)
docs/library/ubluetooth.rst: Update char/desc flags.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rw-r--r--docs/library/ubluetooth.rst33
1 files changed, 22 insertions, 11 deletions
diff --git a/docs/library/ubluetooth.rst b/docs/library/ubluetooth.rst
index 73547c356..434759b43 100644
--- a/docs/library/ubluetooth.rst
+++ b/docs/library/ubluetooth.rst
@@ -375,9 +375,9 @@ writes from a client to a given characteristic, use
Each **descriptor** is a two-element tuple containing a UUID and a **flags**
value.
- The **flags** are a bitwise-OR combination of the
- :data:`ubluetooth.FLAG_READ`, :data:`ubluetooth.FLAG_WRITE` and
- :data:`ubluetooth.FLAG_NOTIFY` values defined below.
+ The **flags** are a bitwise-OR combination of the flags defined below. These
+ set both the behaviour of the characteristic (or descriptor) as well as the
+ security and privacy requirements.
The return value is a list (one element per service) of tuples (each element
is a value handle). Characteristics and descriptor handles are flattened
@@ -401,6 +401,25 @@ writes from a client to a given characteristic, use
**Note:** Advertising must be stopped before registering services.
+ Available flags for characteristics and descriptors are::
+
+ from micropython import const
+ _FLAG_BROADCAST = const(0x0001)
+ _FLAG_READ = const(0x0002)
+ _FLAG_WRITE_NO_RESPONSE = const(0x0004)
+ _FLAG_WRITE = const(0x0008)
+ _FLAG_NOTIFY = const(0x0010)
+ _FLAG_INDICATE = const(0x0020)
+ _FLAG_AUTHENTICATED_SIGNED_WRITE = const(0x0040)
+
+ _FLAG_AUX_WRITE = const(0x0100)
+ _FLAG_READ_ENCRYPTED = const(0x0200)
+ _FLAG_READ_AUTHENTICATED = const(0x0400)
+ _FLAG_READ_AUTHORIZED = const(0x0800)
+ _FLAG_WRITE_ENCRYPTED = const(0x1000)
+ _FLAG_WRITE_AUTHENTICATED = const(0x2000)
+ _FLAG_WRITE_AUTHORIZED = const(0x4000)
+
.. method:: BLE.gatts_read(value_handle, /)
Reads the local value for this handle (which has either been written by
@@ -618,11 +637,3 @@ Constructor
- A 16-bit integer. e.g. ``0x2908``.
- A 128-bit UUID string. e.g. ``'6E400001-B5A3-F393-E0A9-E50E24DCCA9E'``.
-
-
-Constants
----------
-
-.. data:: ubluetooth.FLAG_READ
- ubluetooth.FLAG_WRITE
- ubluetooth.FLAG_NOTIFY