2023-12-20 06:17 AM
Hello everybody,
I am currently building a STM32 BLE software and in this software I got a very long custom loop. My problem is I want to continously check whether there is data received with BLE, if there is, process the data, and return to main loop. How can I do that?
Sincerely,
Yusuf.
2023-12-20 06:26 AM
Utilize the STM32 HAL (Hardware Abstraction Layer) to set up interrupt handlers for BLE data reception. This allows the microcontroller to trigger an interrupt whenever data is received.
2023-12-22 03:25 AM
Hello,
Thank you for your reply. When I looked into BLE library, I understood that data reception is handled as an event by Event Handler rather than an interrupt. As far as I know, data reception event has an callback function void aci_gatt_attribute_modified_event . Can I use this event callback like an interrupt callback? If no, I could use the flag in lowest layer that is set when an data is received. Is there any flag like that?
/* ACI_GATT_ATTRIBUTE_MODIFIED_EVENT callback function */
__WEAK void aci_gatt_attribute_modified_event( uint16_t Connection_Handle,
uint16_t Attr_Handle,
uint16_t Offset,
uint16_t Attr_Data_Length,
const uint8_t* Attr_Data )
{
}
Sincerely,
Yusuf.
2024-02-13 12:44 AM