cancel
Showing results for 
Search instead for 
Did you mean: 

BLE Receiving Data

Yusuf
Associate III

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.

 

3 REPLIES 3
liaifat85
Senior III

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.

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.

 

 

 

Hello @Yusuf 

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

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.