@@ -1205,9 +1205,12 @@ int NimBLEClient::handleGapEvent(struct ble_gap_event* event, void* arg) {
12051205 // pClient->onOobPairingRequest(pkey.oob);
12061206 // rc = ble_sm_inject_io(event->passkey.conn_handle, &pkey);
12071207 // NIMBLE_LOGD(LOG_TAG, "ble_sm_inject_io result: %d", rc);
1208- } else if (event->passkey .params .action == BLE_SM_IOACT_INPUT || event-> passkey . params . action == BLE_SM_IOACT_DISP ) {
1208+ } else if (event->passkey .params .action == BLE_SM_IOACT_INPUT) {
12091209 NIMBLE_LOGD (LOG_TAG, " Enter the passkey" );
12101210 pClient->m_pClientCallbacks ->onPassKeyEntry (peerInfo);
1211+ } else if (event->passkey .params .action == BLE_SM_IOACT_DISP) {
1212+ NIMBLE_LOGD (LOG_TAG, " Display the passkey" );
1213+ pClient->m_pClientCallbacks ->onPassKeyDisplay (peerInfo);
12111214 } else if (event->passkey .params .action == BLE_SM_IOACT_NONE) {
12121215 NIMBLE_LOGD (LOG_TAG, " No passkey action required" );
12131216 }
@@ -1298,6 +1301,11 @@ void NimBLEClientCallbacks::onPassKeyEntry(NimBLEConnInfo& connInfo) {
12981301 NimBLEDevice::injectPassKey (connInfo, 123456 );
12991302} // onPassKeyEntry
13001303
1304+ void NimBLEClientCallbacks::onPassKeyDisplay (NimBLEConnInfo& connInfo) { // @@hjlee
1305+ NIMBLE_LOGD (CB_TAG, " onPassKeyEntry: default: 123456" );
1306+ NimBLEDevice::injectPassKey (connInfo, 123456 );
1307+ } // onPassKeyEntry
1308+
13011309void NimBLEClientCallbacks::onAuthenticationComplete (NimBLEConnInfo& connInfo) {
13021310 NIMBLE_LOGD (CB_TAG, " onAuthenticationComplete: default" );
13031311} // onAuthenticationComplete
0 commit comments