CONFIG_BT_L2CAP_TX_MTU fix size [ Bluetooth Peripheral UART NUS sample ]

Hello guys,

The size of my bluetooth packets that i want to receive is around 257-260 max.

Can i put CONFIG_BT_L2CAP_TX_MTU to 260 ? i don't want a large value for RAM optimization.

Thanks in advance

Iheb

  • Hello,

    Yes, it is possible to change the max. ATT MTU to 260. However, if you want to send/receive a payload of 260 bytes, you should increase it by 3 bytes to 263 to account for the packet header. 

    # Increase the ACL buffers to support the larger ATT MTU

    CONFIG_BT_BUF_ACL_RX_SIZE=267

    CONFIG_BT_BUF_ACL_TX_SIZE=267

    CONFIG_BT_L2CAP_TX_MTU=263

    You can also call bt_gatt_cb_register() after bt_enable() to register a callback for att mtu updated to monitor the outcome of the ATT MTU negotiation. 

    Best regards,

    Vidar

Related