Skip to content

Commit 30e8e40

Browse files
committed
Fix server client read/write not returning when encryption is used.
When the client created by the server reads or writes to an attribute and it triggers a pairing action the task will not be released because the client does not get the event. This passes the event to the client to prevent the task from being hung.
1 parent c828e9d commit 30e8e40

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/NimBLEServer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,11 @@ int NimBLEServer::handleGapEvent(ble_gap_event* event, void* arg) {
530530
}
531531

532532
pServer->m_pServerCallbacks->onAuthenticationComplete(peerInfo);
533+
# if CONFIG_BT_NIMBLE_ROLE_CENTRAL
534+
if (pServer->m_pClient && pServer->m_pClient->m_connHandle == event->enc_change.conn_handle) {
535+
NimBLEClient::handleGapEvent(event, pServer->m_pClient);
536+
}
537+
# endif
533538
break;
534539
} // BLE_GAP_EVENT_ENC_CHANGE
535540

0 commit comments

Comments
 (0)