cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor

Is it okay to call CyBle_Stop() within the BLE stack handler?

   

Specifically, I would like to call CyBle_Stop() under the case CYBLE_EVT_GAP_DEVICE_DISCONNECTED, i.e. when the peripheral disconnects/gets disconnected from the central device. I am asking this because it does not feel right to stop the stack handler callback within it. I do not know what exactly happens when CyBle_Stop() is called (and I am not a expert programmer) but may be it could cause problems to the stack?

   

Thank you.

0 Likes
Reply
1 Solution
Anonymous
Not applicable

I wouldn't do that. Since it can't return from the interrupt if it is "stopped". I would recommend setting a flag in the BLE callback (interrupt) and stopping the BLESS based on that flag somewhere in main().

View solution in original post

0 Likes
Reply
1 Reply
Anonymous
Not applicable

I wouldn't do that. Since it can't return from the interrupt if it is "stopped". I would recommend setting a flag in the BLE callback (interrupt) and stopping the BLESS based on that flag somewhere in main().

View solution in original post

0 Likes
Reply