Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Detect MTU and Interval during connection?

Is there an easy way to check what the current connection's agreed upon MTU is?

I'm connecting to random devices that all have different intervals and MTUs. I can't be sure that this device supports more than 20 byte read/writes, but so I'd like to check with the softdevice and see what was established at connection.

Likewise, I'd like to know the current connection interval. But I haven't been able to find getter functions for these things.

Seems like it should be obvious, perhaps in a struct somewhere?

Thanks!

  • All these data length parameters come in the BLE_GAP_EVENT_DATA_LENGTH_UPDATE events. You can start by assuming any connection has the default and then, if you get one of those events after the procedure has been performed, update the value. 

  • and the other connection parameters are in the original connection event and the connection parameter update events. 

  • Would you mind showing WHERE they are available? "In the event" doesn't entirely point me to the structure they are available in. Any example code by chance?

  • In example ble_app_hrs (and many others), this is reported via the nrf_ble_gatt module:

     

    Best regards,

    Håkon

  • Håkon, great, that works if there is a re-negotiation but we're still not clear on how to pick up the MTU at initial connection... or is it always default (20ish) and has to run through the update to make it longer?

1 2