About configure GATT_MAX_MTU_SIZE

Hi all:

on my project,i set 

define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1

define NRF_SDH_BLE_CENTRAL_LINK_COUNT       6

on my peripheral , i need mtu = 185

on my central, mtu 23 Enough

but set NRF_SDH_BLE_GATT_MAX_MTU_SIZE Will simultaneously affect peripheral and central

when set 23,peripheral will communication slowly(use NUS)

when set 185,show RAM not enough, like the following figure

But I don't have more RAM

Is there a way to set the MTU of peripheral and central separately?

  • Hi 

    By default the SDK examples will apply the same MAX_MTU setting to all the connections, but this is not a limitation in the SoftDevice. 

    What you can do is to copy and replace the nrf_sdh_ble_default_cfg_set(..) function from nrf_sdh_ble.c, and change it to configure different GAP and GATT settings for the different links. 

    In order to support multiple configurations you need to use more than one conn_cfg_tag value, and then you will use the different tags to refer to different connection configuration settings (one with small MTU and one with large MTU for instance). 

    You can see in the original implementation where the sdk_config.h parameters are used, and here you can change this to support other parameters. 

    Best regards
    Torbjørn

Related