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

Changing MTU size in ble_peripheral problem

I'm using nRF5SDK V.12.2.0. In the app_ble_uart example, trying to change MTU size as below.

#define NRF_BLE_MAX_MTU_SIZE            103
...
#if (NRF_SD_BLE_API_VERSION == 3)
    ble_enable_params.gatt_enable_params.att_mtu = NRF_BLE_MAX_MTU_SIZE;
#endif

But, this doesn't work. So, I changed GATT_MTU_SIZE_DEFAULT in file "ble_gatt.h" as

#define GATT_MTU_SIZE_DEFAULT 103 // before this was 23

Then MTU size is modified as expected.

But, in search about MTU size negotiation, lots of answers say that modifying "ble_gatt.h" is not correct. How to change MTU size correctly?