Merge pull request #11718 from desmond-blue/fix-ex-sm-fail-nrf52840

Handle legacy process event first on connection complete
pull/11756/head
Martin Kojtal 2019-10-28 09:54:44 +01:00 committed by GitHub
commit bc2162ab19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 13 deletions

View File

@ -1887,6 +1887,19 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
address = _pal_gap.get_random_address();
}
// legacy process event
processConnectionEvent(
e.connection_handle,
e.role.value() == e.role.CENTRAL ? LegacyGap::CENTRAL : LegacyGap::PERIPHERAL,
e.peer_address_type,
e.peer_address.data(),
_address_type,
address.data(),
&connection_params,
e.local_resolvable_private_address.data(),
e.peer_resolvable_private_address.data()
);
// new process event
if (_eventHandler) {
_eventHandler->onConnectionComplete(
@ -1906,19 +1919,6 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
);
}
// legacy process event
processConnectionEvent(
e.connection_handle,
e.role.value() == e.role.CENTRAL ? LegacyGap::CENTRAL : LegacyGap::PERIPHERAL,
e.peer_address_type,
e.peer_address.data(),
_address_type,
address.data(),
&connection_params,
e.local_resolvable_private_address.data(),
e.peer_resolvable_private_address.data()
);
#if BLE_FEATURE_SECURITY
// Now starts pairing or authentication procedures if required
if (needs_pairing) {