diff options
author | Damien George <damien.p.george@gmail.com> | 2020-03-06 12:37:37 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-03-10 01:53:42 +1100 |
commit | d7259f6b1c746d352c658bf94a4e0d4c92712ba5 (patch) | |
tree | ac1cb0f2ef7c2eb7574c1f8a9b345384206f6828 /extmod/btstack/modbluetooth_btstack.h | |
parent | 018ce122ca6c073c0a9ed11b5ab4ca2f5e629350 (diff) |
extmod/btstack: Implement notifications/indications for GATT clients.
Work done in collaboration with Jim Mussared aka @jimmo.
Diffstat (limited to 'extmod/btstack/modbluetooth_btstack.h')
-rw-r--r-- | extmod/btstack/modbluetooth_btstack.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/extmod/btstack/modbluetooth_btstack.h b/extmod/btstack/modbluetooth_btstack.h index 50e690fd4..ba1d9591d 100644 --- a/extmod/btstack/modbluetooth_btstack.h +++ b/extmod/btstack/modbluetooth_btstack.h @@ -27,8 +27,12 @@ #ifndef MICROPY_INCLUDED_EXTMOD_BTSTACK_MODBLUETOOTH_BTSTACK_H #define MICROPY_INCLUDED_EXTMOD_BTSTACK_MODBLUETOOTH_BTSTACK_H +#if MICROPY_PY_BLUETOOTH && MICROPY_BLUETOOTH_BTSTACK + #include "extmod/modbluetooth.h" +#include "lib/btstack/src/btstack.h" + typedef struct _mp_bluetooth_btstack_root_pointers_t { // This stores both the advertising data and the scan response data, concatenated together. uint8_t *adv_data; @@ -37,6 +41,11 @@ typedef struct _mp_bluetooth_btstack_root_pointers_t { // Characteristic (and descriptor) value storage. mp_gatts_db_t gatts_db; + + #if MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE + // Registration for notify/indicate events. + gatt_client_notification_t notification; + #endif } mp_bluetooth_btstack_root_pointers_t; enum { @@ -51,4 +60,6 @@ void mp_bluetooth_btstack_port_init(void); void mp_bluetooth_btstack_port_deinit(void); void mp_bluetooth_btstack_port_start(void); +#endif // MICROPY_PY_BLUETOOTH && MICROPY_BLUETOOTH_BTSTACK + #endif // MICROPY_INCLUDED_EXTMOD_BTSTACK_MODBLUETOOTH_BTSTACK_H |