26 NS_LOG_COMPONENT_DEFINE(
"SatUtMacState");
31 NS_OBJECT_ENSURE_REGISTERED(SatUtMacState);
37 TypeId(
"ns3::SatUtMacState")
39 .AddConstructor<SatUtMacState>()
40 .AddAttribute(
"NcrSyncTimeout",
41 "Time allowed before switching to NCR_RECOVERY state",
42 TimeValue(Seconds(1)),
45 .AddAttribute(
"NcrRecoveryTimeout",
46 "Time allowed before switching from NCR_RECOVERY to OFF_STANDBY",
47 TimeValue(Seconds(1)),
56 NS_LOG_FUNCTION(
this);
62 : m_rcstState(HOLD_STANDBY),
63 m_lastNcrDateReceived(Seconds(0)),
64 m_checkNcrRecoveryScheduled(Seconds(0)),
65 m_ncrSyncTimeout(Seconds(1)),
66 m_ncrRecoveryTimeout(Seconds(10))
68 NS_LOG_FUNCTION(
this);
73 NS_LOG_FUNCTION(
this);
79 NS_LOG_FUNCTION(
this);
87 NS_LOG_FUNCTION(
this);
95 NS_LOG_FUNCTION(
this);
104 NS_LOG_FUNCTION(
this);
113 NS_LOG_FUNCTION(
this);
123 NS_FATAL_ERROR(
"Cannot transition to READY_FOR_LOGON state");
130 NS_LOG_FUNCTION(
this);
139 NS_FATAL_ERROR(
"Cannot transition to READY_FOR_TDMA_SYNC state");
146 NS_LOG_FUNCTION(
this);
157 NS_FATAL_ERROR(
"Cannot transition to TDMA_SYNC state");
164 NS_LOG_FUNCTION(
this);
173 NS_FATAL_ERROR(
"Cannot transition to NCR_RECOVERY state");
180 NS_LOG_FUNCTION(
this);
193 NS_LOG_FUNCTION(
this);
201 NS_LOG_FUNCTION(
this);
224 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.