Get MTU size

Hey,

is there a way to get the current negotiated MTU size of a connection?

The NRF52 acts as BLE peripheral. My PC connects to it (I use python bleak library).
On my NRF52, I have set 

CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_ACL_RX_SIZE=251

However, reading the supported MTU size with bleak returns 20. The doc mentions, that this could be a bug for linux? Is that related to zephyr? Because I use Windows 11. Or do I have to set the length somewhere specific to my characteristic?
https://bleak.readthedocs.io/en/latest/api/index.html#bleak.backends.characteristic.BleakGATTCharacteristic.max_write_without_response_size

And I also noticed, that the maximum length I can write is 243 bytes, not 247 as I was expected from CONFIG_BT_L2CAP_TX_MTU?

Another question, I have read that the max length is 512bytes, is it enough to set the following parameters accordingly, or is there more to it?

CONFIG_BT_L2CAP_TX_MTU=512
CONFIG_BT_BUF_ACL_TX_SIZE=516
CONFIG_BT_BUF_ACL_RX_SIZE=516


I am using Connect SDK 2.5.1

Thanks

Parents Reply Children
No Data
Related