diff --git a/docs/library/ubluetooth.rst b/docs/library/ubluetooth.rst index 73547c356a..434759b432 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