extmod/modbluetooth: Support gap_connect(None) to cancel a connection.

Allow cancellation of in-progress peripheral connections.
This commit is contained in:
Jonathan Hogg
2021-07-12 08:46:29 +01:00
committed by Damien George
parent de7e3cd792
commit 851ecb2da1
5 changed files with 32 additions and 2 deletions

View File

@@ -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