From 1a506b5f54edef6f4c3ca3fa10352be635f04411 Mon Sep 17 00:00:00 2001 From: ogatatsu Date: Sun, 11 Oct 2020 13:48:56 +0900 Subject: [PATCH] Remove the process that automatically negotiates when connecting Better to use the BLEConnection::requestConnectionParameter() function --- libraries/Bluefruit52Lib/src/BLEPeriph.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/libraries/Bluefruit52Lib/src/BLEPeriph.cpp b/libraries/Bluefruit52Lib/src/BLEPeriph.cpp index 5a632842..c096253d 100644 --- a/libraries/Bluefruit52Lib/src/BLEPeriph.cpp +++ b/libraries/Bluefruit52Lib/src/BLEPeriph.cpp @@ -134,22 +134,13 @@ void BLEPeriph::setDisconnectCallback( ble_disconnect_callback_t fp ) void BLEPeriph::_eventHandler(ble_evt_t* evt) { - uint16_t const conn_hdl = evt->evt.common_evt.conn_handle; + // uint16_t const conn_hdl = evt->evt.common_evt.conn_handle; // BLEConnection* conn = Bluefruit.Connection(conn_hdl); switch ( evt->header.evt_id ) { case BLE_GAP_EVT_CONNECTED: - { - ble_gap_evt_connected_t* para = &evt->evt.gap_evt.params.connected; - // Connection interval set by Central is out of preferred range - // Try to negotiate with Central using our preferred values - if ( !is_within(_ppcp.min_conn_interval, para->conn_params.min_conn_interval, _ppcp.max_conn_interval) ) - { - VERIFY_STATUS( sd_ble_gap_conn_param_update(conn_hdl, &_ppcp), ); - } - } break; case BLE_GAP_EVT_DISCONNECTED: