This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

About MTU size when multiple connections

SDK: 15.3.0
SoftDevice: S132
Device: EYSHJNZWZ (nRF52832)

My device is a peripheral.
I want to connect with two smartphones.
At that time, I want to connect under the following conditions.
Smartphone A: MTU = 23byte
Smartphone B: MTU = 30byte (Exchange MTU Request)

Is it possible?
If possible, please tell me how.

Parents
  • My recommendation is that both links support 30bytes, the difference in RAM usage is very marginal. It is possible to have different MTU sizes, but then you would ideally need to decide MTU size before you start advertising, and since you may not know if it's smartphone A or smartphone B that will connect, it will be difficult to make logic that know which central role device that will connect. So by default set all links to support 30bytes.

    If you still want to support it, then I think I would recommend that you simply modify handling of BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST to respond with the desired MTU length when calling sd_ble_gatts_exchange_mtu_reply() or with the desired MTU length when initiating by calling sd_ble_gattc_exchange_mtu_request(). This is done while in a connection and give functionally the same result you want to achieve.

    Kenneth

Reply
  • My recommendation is that both links support 30bytes, the difference in RAM usage is very marginal. It is possible to have different MTU sizes, but then you would ideally need to decide MTU size before you start advertising, and since you may not know if it's smartphone A or smartphone B that will connect, it will be difficult to make logic that know which central role device that will connect. So by default set all links to support 30bytes.

    If you still want to support it, then I think I would recommend that you simply modify handling of BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST to respond with the desired MTU length when calling sd_ble_gatts_exchange_mtu_reply() or with the desired MTU length when initiating by calling sd_ble_gattc_exchange_mtu_request(). This is done while in a connection and give functionally the same result you want to achieve.

    Kenneth

Children
No Data
Related