Skip to main content
ledi001
Associate III
November 27, 2024
Question

Problems with the size of the payload with STM32WBA55

  • November 27, 2024
  • 1 reply
  • 925 views

Hi,

I use the example BLE_p2pServer_ota and want to transfer 20 bytes of data to UART2 within a characteristic. But i only get the value 1 for sizeof(p_Notification->DataTransfered.Length)

 case P2P_SERVER_UART_C_WRITE_NO_RESP_EVT:
 /* USER CODE BEGIN Service1Char3_WRITE_NO_RESP_EVT */
 sizeOfPayload = sizeof(p_Notification->DataTransfered.p_Payload);
 	 if(HAL_UART_Transmit_DMA(&huart2, p_Notification->DataTransfered.p_Payload, sizeof(p_Notification->DataTransfered.Length)) != HAL_OK)
 	 {
 		Error_Handler();
 	 }

 

1 reply

STTwo-32
Technical Moderator
December 23, 2024

Hello @ledi001 

I'm not able to understand the relation between the code that you are sharing and the transfer of a characteristic data. I may suggest you take a look at the 

at the BLE_HeartRate  example, which sends a heart rate notification every second to the central device.

In the hrs_app.c file > HRSAPP_Measurement(), manage the value to be notified and call aci_gatt_update_char_value (hrs.c file) to notify the central unit of a new value.

You can do the same with your char.

Best Regards.

STTwo-32