Hi everyone,
I want to send packets via notifications to a central. While searching through the forum I found some posts saying that the maximum data size per notification using the sd_ble_gatts_hvx() is limited to 20bytes...
After searching a little bit a found that I was able to change both the NRF_SDH_BLE_GATT_MAX_MTU_SIZE and the NRF_SDH_BLE_GAP_DATA_LENGTH. After changing the prementioned variables with NRF_SDH_BLE_GATT_MAX_MTU_SIZE = 247 and NRF_SDH_BLE_GAP_DATA_LENGTH = 251 respectively and re-adjusting the RAM memory size, I was able to transmit more than 20bytes with a single notification and receive at both nRF Connect for Desktop & Mobile without any problem (actually I transmitted 34bytes, that is my current payload).
I changed both variables from the sdk_config.h file. Also, the reason I set NRF_SDH_BLE_GAP_DATA_LENGTH = 251 was to avoid data fragmentation.
So, my questions are:
1. Is this approach correct and robust? Do I have to take any other parameter into consideration?
2. In ble_gatt.h there is also a variable BLE_GATT_ATT_MTU_DEFAULT which default size is 23. I've noticed that my firmware runs without changing this variable. What is its purpose? Do I have to set BLE_GATT_ATT_MTU_DEFAULT = NRF_SDH_BLE_GATT_MAX_MTU_SIZE ?
3. My payload at the moment is 34 bytes but I preferred to set MTU=247 and DLE=251 because I may need to increase the payload in the near future. Is there any drawback in terms of energy consumption by setting MTU and DLE to its maximum value since I design a low power application?
Thanks in advance
Nick