Skip to main content
Associate III
December 3, 2024
Question

How to increase BLE payload size

  • December 3, 2024
  • 1 reply
  • 710 views

Hi,

I am using the example ble_p2pServer_ota with STm32WBA55. I would send a packet between a client and a server with more than 20 bytes.

Here is part of the code from p2p_server.c:

When i debug the code, the value of Attr_Data_Length is correct until i send up to 20 bytes. If i want to send 25 bytes, the value of Attr_Data_Length remains at 20.

 

case ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE:
 {
 /* USER CODE BEGIN EVT_BLUE_GATT_ATTRIBUTE_MODIFIED_BEGIN */
 	
 /* USER CODE END EVT_BLUE_GATT_ATTRIBUTE_MODIFIED_BEGIN */
 p_attribute_modified = (aci_gatt_attribute_modified_event_rp0*)p_blecore_evt->data;
 notification.ConnectionHandle = p_attribute_modified->Connection_Handle;
 notification.AttributeHandle = p_attribute_modified->Attr_Handle;
 notification.DataTransfered.Length = p_attribute_modified->Attr_Data_Length;
 notification.DataTransfered.p_Payload = p_attribute_modified->Attr_Data;

 

 Then i cheched the value of ATT_MTU size in file app_config.h. This value is 251 which is correct.

 

#define CFG_BLE_ATT_MTU_MAX (251)

 

Then i changed the default ATT_MTU size (minimum MTU value that GATT must support) from 23 to 50 in file ble_bufsize.h.

 

#define BLE_DEFAULT_ATT_MTU 50 //23

 

 But nothing has changed. Can anyone help?

1 reply

STTwo-32
Technical Moderator
December 25, 2024

Hello @ledi7 

To be able to send more then 20 bytes, you have to follow the Extended advertising feature. For more details, you may take a look at this Wiki. Also, the examples BLE_p2pClient_Ext and BLE_p2pServer_Ext may can help you to understand how to do that.

Best Regards.

STTwo-32