fix inverted meaning of _user_manage_connection_parameter_requests

pull/13052/head
Paul Szczeanek 2020-06-02 09:05:41 +01:00
parent ced3b1cf8e
commit 157c54bfc7
1 changed files with 15 additions and 20 deletions

View File

@ -2391,29 +2391,24 @@ void GenericGap<PalGapImpl, PalSecurityManager, ConnectionEventMonitorEventHandl
) )
{ {
if (_user_manage_connection_parameter_requests) { if (_user_manage_connection_parameter_requests) {
// ignore for now as it is if (_eventHandler) {
_pal_gap.accept_connection_parameter_request( _eventHandler->onUpdateConnectionParametersRequest(
connection_handle, UpdateConnectionParametersRequestEvent(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;
}
_eventHandler->onUpdateConnectionParametersRequest(
UpdateConnectionParametersRequestEvent(
connection_handle,
conn_interval_t(connection_interval_min), conn_interval_t(connection_interval_min),
conn_interval_t(connection_interval_max), conn_interval_t(connection_interval_max),
connection_latency, 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
); );
} }
} }