Hello,
How can I send a norification that is more than 20 bytes ? I read that it is related to the MTU size and the possible notification length is MTU - 3
I am using theSW Example: DA1468x BLE customer serviceas a start for my application and in the ble task there is a code segment where you can change the MTU size. I tried that but still I can only send 20 bytes with a notification.
Is it possible to extend the length of the notification ? and how to do that if it is possible
Thanks
amine_benamor
Device:
Hi amine_benamor,
In order to receive/send more than 20 bytes as you have mentioned, you should use the ble_gap_mtu_size_set() API, and set the appropriate mtu_size. Please note that this API function should be called prior to creating the attribute database of the device. This is because the device configuration is going to be modified, which will result in clearing the current attribute database (if it exists). Also, in the ble_config.h header file define the data length:
#define dg_configBLE_DATA_LENGTH_RX_MAX(251)
#define dg_configBLE_DATA_LENGTH_TX_MAX(251)
Thanks, PM_Dialog
Hello PM_Dialog,
I tried that but it did not work.
PS:I am talking about sending data as a notifications not when answering read/ write requests
Thanks
amine_benamor
Hi amine_benamor,
Let me check it and I’ll get back to you as soon as possible.
Thanks, PM_Dialog
Hi amine_benamor,
Can you please try to follow again the steps below? Which example of the SDK are you using and which SDK version?
In the ble_config.h header file:
#define dg_configBLE_DATA_LENGTH_RX_MAX(251)
#define dg_configBLE_DATA_LENGTH_TX_MAX(251)
According to the BLE specifications, you are able to send 251 bytes max in one packet. Be aware that the maximum size of the packet is related to SIG specifications and power consumption.
Use the ble_gap_mtu_size_set() API from ble_gap.h header file in order to set the MTU size that you want. Be aware that you have to call this function before the initialization of the attributes database. Otherwise, the database will be erased.
Thanks, PM_Dialog