diff options
author | Jonathan Hogg <me@jonathanhogg.com> | 2021-07-12 08:46:29 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-12-01 11:56:37 +1100 |
commit | 851ecb2da178fff0b60aefdb5af502f28787a7ec (patch) | |
tree | 16eafbe443a7c34a791ed4a06d17469da1d597ef /extmod/btstack/modbluetooth_btstack.c | |
parent | de7e3cd792d1d4cf6c4b3895d431fc8bc516b51b (diff) |
extmod/modbluetooth: Support gap_connect(None) to cancel a connection.
Allow cancellation of in-progress peripheral connections.
Diffstat (limited to 'extmod/btstack/modbluetooth_btstack.c')
-rw-r--r-- | extmod/btstack/modbluetooth_btstack.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/extmod/btstack/modbluetooth_btstack.c b/extmod/btstack/modbluetooth_btstack.c index cd2ba83d5..e56e488b1 100644 --- a/extmod/btstack/modbluetooth_btstack.c +++ b/extmod/btstack/modbluetooth_btstack.c @@ -1284,6 +1284,11 @@ int mp_bluetooth_gap_peripheral_connect(uint8_t addr_type, const uint8_t *addr, return btstack_error_to_errno(gap_connect(btstack_addr, addr_type)); } +int mp_bluetooth_gap_peripheral_connect_cancel(void) { + DEBUG_printf("mp_bluetooth_gap_peripheral_connect_cancel\n"); + return btstack_error_to_errno(gap_connect_cancel()); +} + #endif // MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE #if MICROPY_PY_BLUETOOTH_ENABLE_GATT_CLIENT |