Class handling UT Mac states and transitions. More...
#include "satellite-ut-mac-state.h"
Public Types | |
| typedef Callback< void > | LogOffCallback |
| LogOff callback. | |
| enum | RcstState_t { HOLD_STANDBY , OFF_STANDBY , READY_FOR_LOGON , READY_FOR_TDMA_SYNC , TDMA_SYNC , NCR_RECOVERY } |
Public Member Functions | |
| SatUtMacState () | |
| Default constructor, which is not used. | |
| ~SatUtMacState () | |
| Destroy a SatUtMacState. | |
| RcstState_t | GetState () const |
| Get the current state. | |
| bool | IsNcrTimeout () const |
| Check if NCR m_ncrSyncTimeout has been reached. | |
| void | NcrControlMessageReceived () |
| Inform the state diagram that a NCR message has been received. | |
| void | SetLogOffCallback (LogOffCallback cb) |
| Set logOff callback. | |
| void | SwitchToHoldStandby () |
| Change state to HOLD_STANDBY. | |
| void | SwitchToNcrRecovery () |
| Change state to NCR_RECOVERY. | |
| void | SwitchToOffStandby () |
| Change state to OFF_STANDBY. | |
| void | SwitchToReadyForLogon () |
| Change state to READY_FOR_LOGON. | |
| void | SwitchToReadyForTdmaSync () |
| Change state to READY_FOR_TDMA_SYNC. | |
| void | SwitchToTdmaSync () |
| Change state to TDMA_SYNC. | |
Static Public Member Functions | |
| static TypeId | GetTypeId (void) |
| Derived from Object. | |
Private Member Functions | |
| void | CheckNcrRecoveryTimeout () |
| Check if timeout reached in NCR_RECOVERY state. | |
| void | CheckNcrTimeout () |
| Check if NCR has been received before sending a timeout. | |
Private Attributes | |
| Time | m_checkNcrRecoveryScheduled |
| Time | m_lastNcrDateReceived |
| LogOffCallback | m_logOffCallback |
| Time | m_ncrRecoveryTimeout |
| Time | m_ncrSyncTimeout |
| RcstState_t | m_rcstState |
Class handling UT Mac states and transitions.
Definition at line 37 of file satellite-ut-mac-state.h.
| typedef Callback<void> ns3::SatUtMacState::LogOffCallback |
LogOff callback.
Definition at line 70 of file satellite-ut-mac-state.h.
| Enumerator | |
|---|---|
| HOLD_STANDBY | |
| OFF_STANDBY | |
| READY_FOR_LOGON | |
| READY_FOR_TDMA_SYNC | |
| TDMA_SYNC | |
| NCR_RECOVERY | |
Definition at line 40 of file satellite-ut-mac-state.h.
| ns3::SatUtMacState::SatUtMacState | ( | ) |
Default constructor, which is not used.
Definition at line 55 of file satellite-ut-mac-state.cc.
References HOLD_STANDBY, m_checkNcrRecoveryScheduled, m_lastNcrDateReceived, m_ncrRecoveryTimeout, m_ncrSyncTimeout, and m_rcstState.
| ns3::SatUtMacState::~SatUtMacState | ( | ) |
Destroy a SatUtMacState.
This is the destructor for the SatUtMacState.
Definition at line 65 of file satellite-ut-mac-state.cc.
|
private |
Check if timeout reached in NCR_RECOVERY state.
If yes, switching to OFF_STANDBY and logoff UT Mac.
Definition at line 216 of file satellite-ut-mac-state.cc.
References GetState(), m_checkNcrRecoveryScheduled, m_logOffCallback, m_ncrRecoveryTimeout, and NCR_RECOVERY.
Referenced by CheckNcrTimeout().
|
private |
Check if NCR has been received before sending a timeout.
Switching to NCR_RECOVERY if timeout reached.
Definition at line 193 of file satellite-ut-mac-state.cc.
References CheckNcrRecoveryTimeout(), CheckNcrTimeout(), GetState(), m_checkNcrRecoveryScheduled, m_lastNcrDateReceived, m_ncrRecoveryTimeout, m_ncrSyncTimeout, SwitchToNcrRecovery(), and TDMA_SYNC.
Referenced by CheckNcrTimeout(), and SwitchToTdmaSync().
| SatUtMacState::RcstState_t ns3::SatUtMacState::GetState | ( | ) | const |
Get the current state.
Definition at line 79 of file satellite-ut-mac-state.cc.
References m_rcstState.
Referenced by CheckNcrRecoveryTimeout(), CheckNcrTimeout(), and NcrControlMessageReceived().
|
static |
Derived from Object.
Definition at line 36 of file satellite-ut-mac-state.cc.
References m_ncrRecoveryTimeout, and m_ncrSyncTimeout.
| bool ns3::SatUtMacState::IsNcrTimeout | ( | ) | const |
Check if NCR m_ncrSyncTimeout has been reached.
Definition at line 185 of file satellite-ut-mac-state.cc.
References m_lastNcrDateReceived, and m_ncrSyncTimeout.
| void ns3::SatUtMacState::NcrControlMessageReceived | ( | ) |
Inform the state diagram that a NCR message has been received.
Reset timeouts.
Definition at line 172 of file satellite-ut-mac-state.cc.
References GetState(), m_lastNcrDateReceived, NCR_RECOVERY, and SwitchToReadyForTdmaSync().
| void ns3::SatUtMacState::SetLogOffCallback | ( | SatUtMacState::LogOffCallback | cb | ) |
Set logOff callback.
Definition at line 71 of file satellite-ut-mac-state.cc.
References m_logOffCallback.
| void ns3::SatUtMacState::SwitchToHoldStandby | ( | ) |
Change state to HOLD_STANDBY.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 87 of file satellite-ut-mac-state.cc.
References HOLD_STANDBY, and m_rcstState.
| void ns3::SatUtMacState::SwitchToNcrRecovery | ( | ) |
Change state to NCR_RECOVERY.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 156 of file satellite-ut-mac-state.cc.
References m_rcstState, NCR_RECOVERY, and TDMA_SYNC.
Referenced by CheckNcrTimeout().
| void ns3::SatUtMacState::SwitchToOffStandby | ( | ) |
Change state to OFF_STANDBY.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 96 of file satellite-ut-mac-state.cc.
References m_rcstState, and OFF_STANDBY.
| void ns3::SatUtMacState::SwitchToReadyForLogon | ( | ) |
Change state to READY_FOR_LOGON.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 105 of file satellite-ut-mac-state.cc.
References m_rcstState, NCR_RECOVERY, OFF_STANDBY, and READY_FOR_LOGON.
| void ns3::SatUtMacState::SwitchToReadyForTdmaSync | ( | ) |
Change state to READY_FOR_TDMA_SYNC.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 122 of file satellite-ut-mac-state.cc.
References m_rcstState, NCR_RECOVERY, READY_FOR_LOGON, and READY_FOR_TDMA_SYNC.
Referenced by NcrControlMessageReceived().
| void ns3::SatUtMacState::SwitchToTdmaSync | ( | ) |
Change state to TDMA_SYNC.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 138 of file satellite-ut-mac-state.cc.
References CheckNcrTimeout(), m_ncrSyncTimeout, m_rcstState, READY_FOR_TDMA_SYNC, and TDMA_SYNC.
|
private |
Definition at line 134 of file satellite-ut-mac-state.h.
Referenced by SatUtMacState(), CheckNcrRecoveryTimeout(), and CheckNcrTimeout().
|
private |
Definition at line 133 of file satellite-ut-mac-state.h.
Referenced by SatUtMacState(), CheckNcrTimeout(), IsNcrTimeout(), and NcrControlMessageReceived().
|
private |
Definition at line 139 of file satellite-ut-mac-state.h.
Referenced by CheckNcrRecoveryTimeout(), and SetLogOffCallback().
|
private |
Definition at line 137 of file satellite-ut-mac-state.h.
Referenced by SatUtMacState(), CheckNcrRecoveryTimeout(), CheckNcrTimeout(), and GetTypeId().
|
private |
Definition at line 136 of file satellite-ut-mac-state.h.
Referenced by SatUtMacState(), CheckNcrTimeout(), GetTypeId(), IsNcrTimeout(), and SwitchToTdmaSync().
|
private |
Definition at line 131 of file satellite-ut-mac-state.h.
Referenced by SatUtMacState(), GetState(), SwitchToHoldStandby(), SwitchToNcrRecovery(), SwitchToOffStandby(), SwitchToReadyForLogon(), SwitchToReadyForTdmaSync(), and SwitchToTdmaSync().