houss red
/
Master_F
Master Implementation of WANOT
SuperSlot.cpp
- Committer:
- semsem
- Date:
- 2016-05-23
- Revision:
- 0:8b449140caa2
File content as of revision 0:8b449140caa2:
#include "WANOT.h" /* * Global variables declarations */ volatile SuperSlotStates SuperSlotState = SetUp_Beacon_Phase; Timeout SwitchState; void SwitchState_Fn(void) { switch(SuperSlotState) { case SetUp_Beacon_Phase: debug("Switching to SetUp Phase State !!\n\r"); SuperSlotState = SetUp_Phase; SwitchState.attach(&SwitchState_Fn,SET_UP_INTERVAL); break; case SetUp_Phase: debug("Switching to TDMA Phase State !!\n\r"); SuperSlotState = TDMA_Phase; SwitchState.attach(&SwitchState_Fn,TDMA_INTERVAL); break; case TDMA_Phase: debug("SuperSlot States finished\n\r\n\r\n\r"); debug("Switching to SetUp Beacon State !! \n\r"); SuperSlotState = SetUp_Beacon_Phase; SwitchState.attach(&SwitchState_Fn, BEACON_SET_UP_INTERVAL); break; } } void SuperSlotInit () { debug("Switching to SetUp Beacon State !! \n\r"); SuperSlotState = SetUp_Beacon_Phase; SwitchState.attach(&SwitchState_Fn, BEACON_SET_UP_INTERVAL); }