2024-11-27 06:42 AM
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();
}
2024-12-23 07:10 AM
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
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.