28 NS_LOG_COMPONENT_DEFINE(
"SatUtMacState");
33 NS_OBJECT_ENSURE_REGISTERED(SatUtMacState);
39 TypeId(
"ns3::SatUtMacState")
41 .AddConstructor<SatUtMacState>()
42 .AddAttribute(
"NcrSyncTimeout",
43 "Time allowed before switching to NCR_RECOVERY state",
44 TimeValue(Seconds(1)),
47 .AddAttribute(
"NcrRecoveryTimeout",
48 "Time allowed before switching from NCR_RECOVERY to OFF_STANDBY",
49 TimeValue(Seconds(1)),
58 NS_LOG_FUNCTION(
this);
64 : m_rcstState(HOLD_STANDBY),
65 m_lastNcrDateReceived(Seconds(0)),
66 m_checkNcrRecoveryScheduled(Seconds(0)),
67 m_ncrSyncTimeout(Seconds(1)),
68 m_ncrRecoveryTimeout(Seconds(10))
70 NS_LOG_FUNCTION(
this);
75 NS_LOG_FUNCTION(
this);
81 NS_LOG_FUNCTION(
this);
89 NS_LOG_FUNCTION(
this);
97 NS_LOG_FUNCTION(
this);
106 NS_LOG_FUNCTION(
this);
115 NS_LOG_FUNCTION(
this);
125 NS_FATAL_ERROR(
"Cannot transition to READY_FOR_LOGON state");
132 NS_LOG_FUNCTION(
this);
141 NS_FATAL_ERROR(
"Cannot transition to READY_FOR_TDMA_SYNC state");
148 NS_LOG_FUNCTION(
this);
159 NS_FATAL_ERROR(
"Cannot transition to TDMA_SYNC state");
166 NS_LOG_FUNCTION(
this);
175 NS_FATAL_ERROR(
"Cannot transition to NCR_RECOVERY state");
182 NS_LOG_FUNCTION(
this);
195 NS_LOG_FUNCTION(
this);
203 NS_LOG_FUNCTION(
this);
226 NS_LOG_FUNCTION(
this);
void SwitchToReadyForTdmaSync()
Change state to READY_FOR_TDMA_SYNC.
void SwitchToNcrRecovery()
Change state to NCR_RECOVERY.
void SetLogOffCallback(LogOffCallback cb)
Set logOff callback.
LogOffCallback m_logOffCallback
void SwitchToOffStandby()
Change state to OFF_STANDBY.
void NcrControlMessageReceived()
Inform the state diagram that a NCR message has been received.
void SwitchToReadyForLogon()
Change state to READY_FOR_LOGON.
Time m_lastNcrDateReceived
RcstState_t GetState() const
Get the current state.
~SatUtMacState()
Destroy a SatUtMacState.
void SwitchToTdmaSync()
Change state to TDMA_SYNC.
SatUtMacState()
Default constructor, which is not used.
Time m_checkNcrRecoveryScheduled
virtual TypeId GetInstanceTypeId(void) const
Derived from Object.
void SwitchToHoldStandby()
Change state to HOLD_STANDBY.
Callback< void > LogOffCallback
LogOff callback.
void CheckNcrTimeout()
Check if NCR has been received before sending a timeout.
void CheckNcrRecoveryTimeout()
Check if timeout reached in NCR_RECOVERY state.
Time m_ncrRecoveryTimeout
bool IsNcrTimeout() const
Check if NCR m_ncrSyncTimeout has been reached.
static TypeId GetTypeId(void)
Derived from Object.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.