From fc1f22a097ac2c6eb418605f36b53936e5138451 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Thu, 25 Jun 2020 23:06:00 +0200 Subject: [PATCH] nrf/bluetooth: Handle data length update request. The Bluetooth link gets disconnected when connecting from a PC after 30-40 seconds. This commit adds handling of the data length update request. The data length parameter pointer is set to NULL in the reply, letting the SoftDevice automatically set values and use them in the data length update procedure. --- ports/nrf/drivers/bluetooth/ble_drv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/nrf/drivers/bluetooth/ble_drv.c b/ports/nrf/drivers/bluetooth/ble_drv.c index 47f7f98885..1a64cdfbd2 100644 --- a/ports/nrf/drivers/bluetooth/ble_drv.c +++ b/ports/nrf/drivers/bluetooth/ble_drv.c @@ -1131,6 +1131,12 @@ static void ble_evt_handler(ble_evt_t * p_ble_evt) { BLE_DRIVER_LOG("GATTS EVT EXCHANGE MTU REQUEST\n"); (void)sd_ble_gatts_exchange_mtu_reply(p_ble_evt->evt.gatts_evt.conn_handle, 23); // MAX MTU size break; + + case BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST: + BLE_DRIVER_LOG("BLE GAP EVT DATA LENGTH UPDATE REQUEST\n"); + sd_ble_gap_data_length_update(p_ble_evt->evt.gap_evt.conn_handle, NULL, NULL); + break; + #endif // (BLUETOOTH_SD == 132) || (BLUETOOTH_SD == 140) default: