diff options
author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2020-08-27 09:13:25 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-12-02 14:36:50 +1100 |
commit | 1697ff335db523ff0809051d42871beb9c86012d (patch) | |
tree | 1728bc84edc6ddf6cb759d575fc5fa604c99b891 /examples/bluetooth/ble_temperature.py | |
parent | 7a9aa49595e1c523a5765397db135ff8f00515b1 (diff) |
extmod/modbluetooth: Allow setting char/desc enc/auth options.
This widens the characteristic/descriptor flags to 16-bit, to allow setting
encryption/authentication requirements.
Sets the required flags for NimBLE and btstack implementations.
The BLE.FLAG_* constants will eventually be deprecated in favour of copy
and paste Python constants (like the IRQs).
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'examples/bluetooth/ble_temperature.py')
-rw-r--r-- | examples/bluetooth/ble_temperature.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/bluetooth/ble_temperature.py b/examples/bluetooth/ble_temperature.py index d375a62ff..e6378ebee 100644 --- a/examples/bluetooth/ble_temperature.py +++ b/examples/bluetooth/ble_temperature.py @@ -15,12 +15,16 @@ _IRQ_CENTRAL_CONNECT = const(1) _IRQ_CENTRAL_DISCONNECT = const(2) _IRQ_GATTS_INDICATE_DONE = const(20) +_FLAG_READ = const(0x0002) +_FLAG_NOTIFY = const(0x0010) +_FLAG_INDICATE = const(0x0020) + # org.bluetooth.service.environmental_sensing _ENV_SENSE_UUID = bluetooth.UUID(0x181A) # org.bluetooth.characteristic.temperature _TEMP_CHAR = ( bluetooth.UUID(0x2A6E), - bluetooth.FLAG_READ | bluetooth.FLAG_NOTIFY | bluetooth.FLAG_INDICATE, + _FLAG_READ | _FLAG_NOTIFY | _FLAG_INDICATE, ) _ENV_SENSE_SERVICE = ( _ENV_SENSE_UUID, |