Skip to content

Commit 3a8dc2b

Browse files
authored
Merge pull request #13052 from paul-szczepanek-arm/connection-params-fix
BLE: fix conn params update
2 parents 7ae621e + 8285ecd commit 3a8dc2b

File tree

2 files changed

+15
-36
lines changed

2 files changed

+15
-36
lines changed

features/FEATURE_BLE/source/generic/GenericGap.tpp

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,29 +2391,24 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
23912391
)
23922392
{
23932393
if (_user_manage_connection_parameter_requests) {
2394-
// ignore for now as it is
2395-
_pal_gap.accept_connection_parameter_request(
2396-
connection_handle,
2397-
connection_interval_min,
2398-
connection_interval_max,
2399-
connection_latency,
2400-
supervision_timeout,
2401-
/* connection event length min */ 0,
2402-
/* connection event length max */ 0
2403-
);
2404-
} else {
2405-
if (!_eventHandler) {
2406-
return;
2407-
}
2408-
2409-
_eventHandler->onUpdateConnectionParametersRequest(
2410-
UpdateConnectionParametersRequestEvent(
2411-
connection_handle,
2394+
if (_eventHandler) {
2395+
_eventHandler->onUpdateConnectionParametersRequest(
2396+
UpdateConnectionParametersRequestEvent(connection_handle,
24122397
conn_interval_t(connection_interval_min),
24132398
conn_interval_t(connection_interval_max),
24142399
connection_latency,
2415-
supervision_timeout_t(supervision_timeout)
2416-
)
2400+
supervision_timeout_t(supervision_timeout))
2401+
);
2402+
} else {
2403+
MBED_ERROR(illegal_state_error, "Event handler required if connection params are user handled");
2404+
}
2405+
} else {
2406+
_pal_gap.accept_connection_parameter_request(
2407+
connection_handle,
2408+
connection_interval_min, connection_interval_max,
2409+
connection_latency, supervision_timeout,
2410+
/* minimum_connection_event_length */0,
2411+
/* maximum_connection_event_length */0
24172412
);
24182413
}
24192414
}

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -653,22 +653,6 @@ void Gap<EventHandler>::gap_handler(const wsfMsgHdr_t *msg)
653653
#endif // BLE_FEATURE_EXTENDED_ADVERTISING && BLE_ROLE_OBSERVER
654654

655655
#if BLE_ROLE_CENTRAL || BLE_ROLE_PERIPHERAL
656-
case DM_CONN_UPDATE_IND: {
657-
if (!handler) {
658-
break;
659-
}
660-
661-
const hciLeConnUpdateCmplEvt_t *evt = (const hciLeConnUpdateCmplEvt_t *) msg;
662-
handler->on_connection_update_complete(
663-
(hci_error_code_t::type) evt->status,
664-
evt->hdr.param,
665-
evt->connInterval,
666-
evt->connLatency,
667-
evt->supTimeout
668-
);
669-
}
670-
break;
671-
672656
case DM_REM_CONN_PARAM_REQ_IND: {
673657
if (!handler) {
674658
break;

0 commit comments

Comments
 (0)