Skip to main content
Yusuf
Associate II
December 20, 2023
Question

BLE Receiving Data

  • December 20, 2023
  • 1 reply
  • 1170 views

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.

 

This topic has been closed for replies.

1 reply

Visitor II
December 20, 2023

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.

Yusuf
YusufAuthor
Associate II
December 22, 2023

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.

 

 

 

STTwo-32
Technical Moderator
February 13, 2024

Hello @Yusuf 

I suggest you take a look at this post. I should be helpful.

Best Regards.

STTwo-32