Skip to content

Commit 1081770

Browse files
event handler should not affect internal state
1 parent e2b87c6 commit 1081770

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

connectivity/FEATURE_BLE/source/generic/GapImpl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,13 +2238,14 @@ void Gap::on_enhanced_connection_complete(
22382238
clock_accuracy_t master_clock_accuracy
22392239
)
22402240
{
2241+
if (own_role == connection_role_t::CENTRAL) {
2242+
_initiating = false;
2243+
}
2244+
22412245
if (!_event_handler) {
22422246
return;
22432247
}
22442248

2245-
if (own_role == connection_role_t::CENTRAL) {
2246-
_initiating = false;
2247-
}
22482249

22492250
_event_handler->onConnectionComplete(
22502251
ConnectionCompleteEvent(

0 commit comments

Comments
 (0)