mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2026-01-27 09:32:19 +01:00
Add server and client onIdentity callback.
Adds a callback that is called when the identity address of the peer is resolved, this is useful for adding it to a whitelist.
This commit is contained in:
@@ -528,6 +528,16 @@ int NimBLEServer::handleGapEvent(struct ble_gap_event *event, void *arg) {
|
||||
return 0;
|
||||
} // BLE_GAP_EVENT_ENC_CHANGE
|
||||
|
||||
case BLE_GAP_EVENT_IDENTITY_RESOLVED: {
|
||||
rc = ble_gap_conn_find(event->identity_resolved.conn_handle, &peerInfo.m_desc);
|
||||
if(rc != 0) {
|
||||
return BLE_ATT_ERR_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
pServer->m_pServerCallbacks->onIdentity(peerInfo);
|
||||
return 0;
|
||||
} // BLE_GAP_EVENT_IDENTITY_RESOLVED
|
||||
|
||||
case BLE_GAP_EVENT_PASSKEY_ACTION: {
|
||||
struct ble_sm_io pkey = {0,0};
|
||||
|
||||
@@ -864,6 +874,10 @@ void NimBLEServerCallbacks::onConfirmPIN(const NimBLEConnInfo& connInfo, uint32_
|
||||
NimBLEDevice::injectConfirmPIN(connInfo, true);
|
||||
} // onConfirmPIN
|
||||
|
||||
void NimBLEServerCallbacks::onIdentity(const NimBLEConnInfo& connInfo){
|
||||
NIMBLE_LOGD("NimBLEServerCallbacks", "onIdentity: default");
|
||||
} // onIdentity
|
||||
|
||||
void NimBLEServerCallbacks::onAuthenticationComplete(const NimBLEConnInfo& connInfo){
|
||||
NIMBLE_LOGD("NimBLEServerCallbacks", "onAuthenticationComplete: default");
|
||||
} // onAuthenticationComplete
|
||||
|
||||
Reference in New Issue
Block a user