Skip to content

Commit bc2162a

Browse files
authored
Merge pull request #11718 from desmond-blue/fix-ex-sm-fail-nrf52840
Handle legacy process event first on connection complete
2 parents 83c4a80 + d9e6110 commit bc2162a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

features/FEATURE_BLE/source/generic/GenericGap.tpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,6 +1887,19 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
18871887
address = _pal_gap.get_random_address();
18881888
}
18891889

1890+
// legacy process event
1891+
processConnectionEvent(
1892+
e.connection_handle,
1893+
e.role.value() == e.role.CENTRAL ? LegacyGap::CENTRAL : LegacyGap::PERIPHERAL,
1894+
e.peer_address_type,
1895+
e.peer_address.data(),
1896+
_address_type,
1897+
address.data(),
1898+
&connection_params,
1899+
e.local_resolvable_private_address.data(),
1900+
e.peer_resolvable_private_address.data()
1901+
);
1902+
18901903
// new process event
18911904
if (_eventHandler) {
18921905
_eventHandler->onConnectionComplete(
@@ -1906,19 +1919,6 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
19061919
);
19071920
}
19081921

1909-
// legacy process event
1910-
processConnectionEvent(
1911-
e.connection_handle,
1912-
e.role.value() == e.role.CENTRAL ? LegacyGap::CENTRAL : LegacyGap::PERIPHERAL,
1913-
e.peer_address_type,
1914-
e.peer_address.data(),
1915-
_address_type,
1916-
address.data(),
1917-
&connection_params,
1918-
e.local_resolvable_private_address.data(),
1919-
e.peer_resolvable_private_address.data()
1920-
);
1921-
19221922
#if BLE_FEATURE_SECURITY
19231923
// Now starts pairing or authentication procedures if required
19241924
if (needs_pairing) {

0 commit comments

Comments
 (0)