Handle legacy process event first on connection complete

pull/11718/head
desmond.chen 2019-10-21 15:57:09 +08:00
parent 70f3cf89a0
commit d9e6110577
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) {