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.
This commit is contained in:
h2zero
2025-06-02 15:59:22 -06:00
committed by Ryan Powell
parent 39f974625c
commit e2cee2d994

View File

@ -530,6 +530,11 @@ int NimBLEServer::handleGapEvent(ble_gap_event* event, void* arg) {
}
pServer->m_pServerCallbacks->onAuthenticationComplete(peerInfo);
# if CONFIG_BT_NIMBLE_ROLE_CENTRAL
if (pServer->m_pClient && pServer->m_pClient->m_connHandle == event->enc_change.conn_handle) {
NimBLEClient::handleGapEvent(event, pServer->m_pClient);
}
# endif
break;
} // BLE_GAP_EVENT_ENC_CHANGE