From 157c54bfc77bfab24b4450c4a8ea0a6c288e6fbb Mon Sep 17 00:00:00 2001 From: Paul Szczeanek Date: Tue, 2 Jun 2020 09:05:41 +0100 Subject: [PATCH 1/2] fix inverted meaning of _user_manage_connection_parameter_requests --- .../FEATURE_BLE/source/generic/GenericGap.tpp | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/features/FEATURE_BLE/source/generic/GenericGap.tpp b/features/FEATURE_BLE/source/generic/GenericGap.tpp index 96dd9e1a8f..2cafaf4a2b 100644 --- a/features/FEATURE_BLE/source/generic/GenericGap.tpp +++ b/features/FEATURE_BLE/source/generic/GenericGap.tpp @@ -2391,29 +2391,24 @@ void GenericGaponUpdateConnectionParametersRequest( - UpdateConnectionParametersRequestEvent( - connection_handle, + if (_eventHandler) { + _eventHandler->onUpdateConnectionParametersRequest( + 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 ); } } From 8285ecdefbfd0e06bac9d4bf64ce4d01d6654670 Mon Sep 17 00:00:00 2001 From: Paul Szczeanek Date: Tue, 2 Jun 2020 10:01:10 +0100 Subject: [PATCH 2/2] connection update handled elsewhere --- .../TARGET_CORDIO/source/CordioPalGap.tpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp index 52b9cfa96d..4a72b58972 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp @@ -653,22 +653,6 @@ void Gap::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;