Dynamic broadcaster does establish any connection.
When it is in advertising mode you won;t get to know whether some other central is scanning or not.
Your code snippet doesn;t work.
-->case CYBLE_EVT_GAP_DEVICE_DISCONNECTED will never trigger as it doesn;t establish connection
if(CyBle_GetState() == [State if scanned]) or if (isScanned)
isScanned = FALSE;
Hibernate or Sleep
Code is wrong. This event triggers only when advertisement is started or stopped.
When advertisement is stopped you can go to hibernate and wakeup on external GPIO interrupts.
As in hibernate all clocks are OFF. So if you want to wakeup after some time you need to use DEEPSLEEP mode and use WDT timers to triggers an interrupt after some time.