How to Increase BLE data per packet from 23 to higher than 64 bytes on BLE GATT client (or BLE central) device using NCS?

I have a BLE GATT server or BLE peripheral device with the following configuration that works with a chromium webapp (which acts as a BLE central) and I can verify that the peripheral device can send data bytes more than 64 in one packet. 

CONFIG_BT_L2CAP_TX_MTU=498
CONFIG_BT_BUF_ACL_RX_SIZE=502
CONFIG_BT_BUF_ACL_TX_SIZE=502
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

Now, I'm creating a similar BLE central device on nRF52840 DK board, where I can only read data not more than 23 bytes. Please let me know how can I make the BLE central device to accept more than 23 bytes in one packet which is sent out by the BLE peripheral?

I have tried using the above configurations on the Central, but didn't work.

Please help!

NCS version: 2.0.2

Parents
  • Hi Jagadeep,

    My guess is that MTU negotiation didn't actually happen in your connection.

    The Kconfig you are setting will change the capabilities of the device, not necessarily the MTU in the connection itself.

    Your GATT Client, which is usually your GAP Central device, need to initiate the MTU negotiation at some point. Otherwise, after connection establishment, the actual MTU size will just be the default 23 bytes.

    To have MTU negotiation, in your Central application, either CONFIG_BT_GATT_AUTO_UPDATE_MTU has to be enabled, or bt_gatt_exchange_mtu() has to be manually called somewhere.

    Please check if you have one of those.

    Hieu

Reply
  • Hi Jagadeep,

    My guess is that MTU negotiation didn't actually happen in your connection.

    The Kconfig you are setting will change the capabilities of the device, not necessarily the MTU in the connection itself.

    Your GATT Client, which is usually your GAP Central device, need to initiate the MTU negotiation at some point. Otherwise, after connection establishment, the actual MTU size will just be the default 23 bytes.

    To have MTU negotiation, in your Central application, either CONFIG_BT_GATT_AUTO_UPDATE_MTU has to be enabled, or bt_gatt_exchange_mtu() has to be manually called somewhere.

    Please check if you have one of those.

    Hieu

Children
Related