Hi,
I'm using pc-ble-driver and a PCA10040 devkit. I'm having issues with using sd_ble_gap_data_length_update.
First, my configuration has ATT_MTU set to 247:
memset(&ble_cfg, 0x00, sizeof(ble_cfg)); ble_cfg.conn_cfg.conn_cfg_tag = conn_cfg_tag; ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = 247; error_code = sd_ble_cfg_set(m_adapter, BLE_CONN_CFG_GATT, &ble_cfg, ram_start)
Then some time later I run sd_ble_gap_data_length_update:
uint32_t SdSetMtu(unsigned int conn_handle, unsigned int data_len)
{
ble_gap_data_length_params_t params;
params.max_tx_octets = (uint16_t) data_len;
params.max_rx_octets = (uint16_t) data_len;
params.max_tx_time_us = BLE_GAP_DATA_LENGTH_AUTO;
params.max_rx_time_us = BLE_GAP_DATA_LENGTH_AUTO;
ble_gap_data_length_limitation_t p_dl_limitation;
uint32_t err_code = sd_ble_gap_data_length_update(
m_adapter,
conn_handle,
¶ms,
&p_dl_limitation
);
return err_code;
}
I'm receiving an error_code NRF_ERROR_RESOURCES when data_len > 151 which is unexpected. When I set ATT_MTU to 50 in the config, I get the same error code for data_len > 54, which is expected.
It seems like somewhere either in possibly the connectivity firmware or elsewhere that the max MTU is capped at 147? But as I understand it, the maximum MTU for NRF52382 should be 247+4=251?