rymanluk commented on a change in pull request #540:
URL: https://github.com/apache/mynewt-nimble/pull/540#discussion_r455007886



##########
File path: nimble/host/src/ble_gap.c
##########
@@ -5309,6 +5309,29 @@ ble_gap_identity_event(uint16_t conn_handle)
     ble_gap_call_conn_event_cb(&event, conn_handle);
 }
 
+int
+ble_gap_pairing_req_event(const struct ble_gap_pairing_req *req)
+{
+#if !NIMBLE_BLE_SM
+    return 0;
+#endif
+
+    struct ble_gap_event event;
+    int rc;
+
+    memset(&event, 0, sizeof event);
+    event.type = BLE_GAP_EVENT_PAIRING_REQUEST;
+    event.pairing_req.io_cap = req->io_cap;
+    event.pairing_req.oob_data_flag = req->oob_data_flag;
+    event.pairing_req.authreq = req->authreq;
+    event.pairing_req.max_enc_key_size = req->max_enc_key_size;
+    event.pairing_req.init_key_dist = req->init_key_dist;
+    event.pairing_req.resp_key_dist = req->resp_key_dist;
+
+    rc = ble_gap_call_conn_event_cb(&event, req->conn_handle);

Review comment:
       @prasad-alatkar I think this PR will not work. I can't see where pairing 
is paused when waiting for user inject action.
   Please have a look on how  BLE_GAP_EVENT_PASSKEY_ACTION works, as what you 
are trying  to do is something similar.
   
   Maybe as a starting point you could add new actions as a part of that event?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to