From 801e8ffacff0d2ed15e82136db2a8a45afbfab7b Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Wed, 25 Nov 2020 00:06:16 +1100 Subject: extmod/modbluetooth: Add gap_pair(conn_handle) func to intiate pairing. Signed-off-by: Jim Mussared --- extmod/btstack/modbluetooth_btstack.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'extmod/btstack/modbluetooth_btstack.c') diff --git a/extmod/btstack/modbluetooth_btstack.c b/extmod/btstack/modbluetooth_btstack.c index ae4bac009..f6af664a4 100644 --- a/extmod/btstack/modbluetooth_btstack.c +++ b/extmod/btstack/modbluetooth_btstack.c @@ -1167,6 +1167,14 @@ int mp_bluetooth_gap_disconnect(uint16_t conn_handle) { return 0; } +#if MICROPY_PY_BLUETOOTH_ENABLE_PAIRING_BONDING +int mp_bluetooth_gap_pair(uint16_t conn_handle) { + DEBUG_printf("mp_bluetooth_gap_pair: conn_handle=%d\n", conn_handle); + sm_request_pairing(conn_handle); + return 0; +} +#endif // MICROPY_PY_BLUETOOTH_ENABLE_PAIRING_BONDING + #if MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE STATIC btstack_timer_source_t scan_duration_timeout; -- cgit v1.2.3