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?
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().