mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #13052 from paul-szczepanek-arm/connection-params-fix
BLE: fix conn params updatepull/13069/head
commit
3a8dc2b50a
|
@ -2391,29 +2391,24 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
|
|||
)
|
||||
{
|
||||
if (_user_manage_connection_parameter_requests) {
|
||||
// ignore for now as it is
|
||||
_pal_gap.accept_connection_parameter_request(
|
||||
connection_handle,
|
||||
connection_interval_min,
|
||||
connection_interval_max,
|
||||
connection_latency,
|
||||
supervision_timeout,
|
||||
/* connection event length min */ 0,
|
||||
/* connection event length max */ 0
|
||||
);
|
||||
} else {
|
||||
if (!_eventHandler) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_eventHandler) {
|
||||
_eventHandler->onUpdateConnectionParametersRequest(
|
||||
UpdateConnectionParametersRequestEvent(
|
||||
connection_handle,
|
||||
UpdateConnectionParametersRequestEvent(connection_handle,
|
||||
conn_interval_t(connection_interval_min),
|
||||
conn_interval_t(connection_interval_max),
|
||||
connection_latency,
|
||||
supervision_timeout_t(supervision_timeout)
|
||||
)
|
||||
supervision_timeout_t(supervision_timeout))
|
||||
);
|
||||
} else {
|
||||
MBED_ERROR(illegal_state_error, "Event handler required if connection params are user handled");
|
||||
}
|
||||
} else {
|
||||
_pal_gap.accept_connection_parameter_request(
|
||||
connection_handle,
|
||||
connection_interval_min, connection_interval_max,
|
||||
connection_latency, supervision_timeout,
|
||||
/* minimum_connection_event_length */0,
|
||||
/* maximum_connection_event_length */0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -653,22 +653,6 @@ void Gap<EventHandler>::gap_handler(const wsfMsgHdr_t *msg)
|
|||
#endif // BLE_FEATURE_EXTENDED_ADVERTISING && BLE_ROLE_OBSERVER
|
||||
|
||||
#if BLE_ROLE_CENTRAL || BLE_ROLE_PERIPHERAL
|
||||
case DM_CONN_UPDATE_IND: {
|
||||
if (!handler) {
|
||||
break;
|
||||
}
|
||||
|
||||
const hciLeConnUpdateCmplEvt_t *evt = (const hciLeConnUpdateCmplEvt_t *) msg;
|
||||
handler->on_connection_update_complete(
|
||||
(hci_error_code_t::type) evt->status,
|
||||
evt->hdr.param,
|
||||
evt->connInterval,
|
||||
evt->connLatency,
|
||||
evt->supTimeout
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case DM_REM_CONN_PARAM_REQ_IND: {
|
||||
if (!handler) {
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue