Nordic BLE: Accept connection parameter update

A peer device that sends a connection parameter update may get block if it doesn't receive a response.

This patch accept the peer request unconditionnally. At some point this event will be managed by the application.
pull/7211/head
Vincent Coubard 2018-06-13 15:54:51 +01:00
parent 799ba08017
commit 92fa40b1c7
2 changed files with 17 additions and 0 deletions

View File

@ -215,6 +215,15 @@ void btle_handler(ble_evt_t *p_ble_evt)
break;
}
case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST: {
Gap::Handle_t connection = p_ble_evt->evt.gap_evt.conn_handle;
const ble_gap_evt_conn_param_update_request_t *update_request =
&p_ble_evt->evt.gap_evt.params.conn_param_update_request;
sd_ble_gap_conn_param_update(connection, &update_request->conn_params);
break;
}
case BLE_GAP_EVT_TIMEOUT:
gap.processTimeoutEvent(static_cast<Gap::TimeoutSource_t>(p_ble_evt->evt.gap_evt.params.timeout.src));
break;

View File

@ -376,6 +376,14 @@ void btle_handler(const ble_evt_t *p_ble_evt)
break;
}
#endif
case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST: {
Gap::Handle_t connection = p_ble_evt->evt.gap_evt.conn_handle;
const ble_gap_evt_conn_param_update_request_t *update_request =
&p_ble_evt->evt.gap_evt.params.conn_param_update_request;
sd_ble_gap_conn_param_update(connection, &update_request->conn_params);
break;
}
case BLE_GAP_EVT_TIMEOUT:
gap.processTimeoutEvent(static_cast<Gap::TimeoutSource_t>(p_ble_evt->evt.gap_evt.params.timeout.src));