@@ -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}
0 commit comments