how to set ble tx data length ?

software version :nrf connect SDK 1.6.1

hardware:nrf5340

ble stack:ble 5.0

ble central: iphone x app

ble client:nrf5340 kit

question:I was failure to set Tx len 251 bytes,this makes the Bluetooth communication rate extremely low.

According to throuthput example,  I added the following macro definition to Prj.conf and I added  bt_conn_le_data_len_update(default_conn, data_len) to code.

Please give me some advise, thinks too much.

CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n

CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_CONN_TX_MAX=10
CONFIG_BT_L2CAP_TX_BUF_COUNT=10
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_CTLR_RX_BUFFERS=2
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

  • Hi

    iOS devices are known to not play well with the maximum MTU sizes of 247 bytes I'm afraid. The highest allowed MTU by iOS devices is 184 bytes, so try setting the max to that, and data length to 187 bytes. Is your application based on the throughput sample, or is this a custom project?

    Did you see the note for nRF5340 devices in the Throughput sample? If you use nRF5340 DK, the additional configuration of the network core will be taken from the child_image directory. For more details see: Image-specific variables.

    Best regards,

    Simon

Related