summaryrefslogtreecommitdiff
path: root/extmod/nimble/modbluetooth_nimble.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2020-11-25 00:06:16 +1100
committerDamien George <damien@micropython.org>2020-12-02 14:41:26 +1100
commit801e8ffacff0d2ed15e82136db2a8a45afbfab7b (patch)
tree1102e234887e533f7a1933e7dfd6f7a8e33e0bda /extmod/nimble/modbluetooth_nimble.c
parentf822557cbb79decb6947e1e35b8cddce18f4c06f (diff)
extmod/modbluetooth: Add gap_pair(conn_handle) func to intiate pairing.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/nimble/modbluetooth_nimble.c')
-rw-r--r--extmod/nimble/modbluetooth_nimble.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/extmod/nimble/modbluetooth_nimble.c b/extmod/nimble/modbluetooth_nimble.c
index 852b9eac0..b1f13ee98 100644
--- a/extmod/nimble/modbluetooth_nimble.c
+++ b/extmod/nimble/modbluetooth_nimble.c
@@ -860,6 +860,13 @@ int mp_bluetooth_set_preferred_mtu(uint16_t mtu) {
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);
+ return ble_hs_err_to_errno(ble_gap_security_initiate(conn_handle));
+}
+#endif // MICROPY_PY_BLUETOOTH_ENABLE_PAIRING_BONDING
+
#if MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
STATIC void gattc_on_data_available(uint8_t event, uint16_t conn_handle, uint16_t value_handle, const struct os_mbuf *om) {