diff options
author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2020-11-04 18:21:59 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-12-02 14:40:15 +1100 |
commit | 05fef8c6a4113bc05dd09ddd8d0bf7d136d59f39 (patch) | |
tree | b2bb8f26199614ae31fa30aeccedc77ac023baa1 /extmod/modbluetooth.h | |
parent | ac89267fef8b2396cf46c6ba19ccbe3d10acff9a (diff) |
extmod/modbluetooth: Add _IRQ_ENCRYPTION_UPDATE event.
This allows the application to be notified if any of encrypted,
authenticated and bonded state change, as well as the encryption key size.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/modbluetooth.h')
-rw-r--r-- | extmod/modbluetooth.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/extmod/modbluetooth.h b/extmod/modbluetooth.h index 2cb2c709c..62ff6f2f9 100644 --- a/extmod/modbluetooth.h +++ b/extmod/modbluetooth.h @@ -145,6 +145,7 @@ #define MP_BLUETOOTH_IRQ_L2CAP_RECV (25) #define MP_BLUETOOTH_IRQ_L2CAP_SEND_READY (26) #define MP_BLUETOOTH_IRQ_CONNECTION_UPDATE (27) +#define MP_BLUETOOTH_IRQ_ENCRYPTION_UPDATE (28) #define MP_BLUETOOTH_ADDRESS_MODE_PUBLIC (0) #define MP_BLUETOOTH_ADDRESS_MODE_RANDOM (1) @@ -182,7 +183,8 @@ _IRQ_L2CAP_CONNECT = const(23) _IRQ_L2CAP_DISCONNECT = const(24) _IRQ_L2CAP_RECV = const(25) _IRQ_L2CAP_SEND_READY = const(26) -_IRQ_GATTS_CONN_UPDATE = const(27) +_IRQ_CONNECTION_UPDATE = const(27) +_IRQ_ENCRYPTION_UPDATE = const(28) _FLAG_BROADCAST = const(0x0001) _FLAG_READ = const(0x0002) @@ -339,6 +341,11 @@ void mp_bluetooth_gap_on_connected_disconnected(uint8_t event, uint16_t conn_han // Call this when any connection parameters have been changed. void mp_bluetooth_gap_on_connection_update(uint16_t conn_handle, uint16_t conn_interval, uint16_t conn_latency, uint16_t supervision_timeout, uint16_t status); +#if MICROPY_PY_BLUETOOTH_ENABLE_PAIRING_BONDING +// Call this when any connection encryption has been changed (e.g. during pairing). +void mp_bluetooth_gatts_on_encryption_update(uint16_t conn_handle, bool encrypted, bool authenticated, bool bonded, uint8_t key_size); +#endif + // Call this when a characteristic is written to. void mp_bluetooth_gatts_on_write(uint16_t conn_handle, uint16_t value_handle); |