- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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().