Class handling UT Mac states and transitions. More...
#include "satellite-ut-mac-state.h"
Public Types | |
typedef Callback< void > | LogOffCallback |
LogOff callback. More... | |
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. More... | |
~SatUtMacState () | |
Destroy a SatUtMacState. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Derived from Object. More... | |
RcstState_t | GetState () const |
Get the current state. More... | |
bool | IsNcrTimeout () const |
Check if NCR m_ncrSyncTimeout has been reached. More... | |
void | NcrControlMessageReceived () |
Inform the state diagram that a NCR message has been received. More... | |
void | SetLogOffCallback (LogOffCallback cb) |
Set logOff callback. More... | |
void | SwitchToHoldStandby () |
Change state to HOLD_STANDBY. More... | |
void | SwitchToNcrRecovery () |
Change state to NCR_RECOVERY. More... | |
void | SwitchToOffStandby () |
Change state to OFF_STANDBY. More... | |
void | SwitchToReadyForLogon () |
Change state to READY_FOR_LOGON. More... | |
void | SwitchToReadyForTdmaSync () |
Change state to READY_FOR_TDMA_SYNC. More... | |
void | SwitchToTdmaSync () |
Change state to TDMA_SYNC. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Derived from Object. More... | |
Private Member Functions | |
void | CheckNcrRecoveryTimeout () |
Check if timeout reached in NCR_RECOVERY state. More... | |
void | CheckNcrTimeout () |
Check if NCR has been received before sending a timeout. More... | |
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 74 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 63 of file satellite-ut-mac-state.cc.
ns3::SatUtMacState::~SatUtMacState | ( | ) |
Destroy a SatUtMacState.
This is the destructor for the SatUtMacState.
Definition at line 73 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 224 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 201 of file satellite-ut-mac-state.cc.
References CheckNcrRecoveryTimeout(), GetState(), m_checkNcrRecoveryScheduled, m_lastNcrDateReceived, m_ncrRecoveryTimeout, m_ncrSyncTimeout, SwitchToNcrRecovery(), and TDMA_SYNC.
Referenced by SwitchToTdmaSync().
|
virtual |
Derived from Object.
Definition at line 56 of file satellite-ut-mac-state.cc.
References GetTypeId().
SatUtMacState::RcstState_t ns3::SatUtMacState::GetState | ( | ) | const |
Get the current state.
Definition at line 87 of file satellite-ut-mac-state.cc.
References m_rcstState.
Referenced by CheckNcrRecoveryTimeout(), CheckNcrTimeout(), ns3::SatUtMac::DoFrameStart(), ns3::SatUtMac::DoRandomAccess(), ns3::SatUtMac::DoTransmit(), ns3::SatUtMac::GetRcstState(), ns3::SatUtMac::LogonMsgTransmissionPossible(), NcrControlMessageReceived(), ns3::SatUtMac::ReceiveSignalingPacket(), ns3::SatUtMac::ScheduleTimeSlots(), and ns3::SatUtMac::TransmitPackets().
|
static |
Derived from Object.
Definition at line 36 of file satellite-ut-mac-state.cc.
References m_ncrRecoveryTimeout, and m_ncrSyncTimeout.
Referenced by GetInstanceTypeId().
bool ns3::SatUtMacState::IsNcrTimeout | ( | ) | const |
Check if NCR m_ncrSyncTimeout has been reached.
Definition at line 193 of file satellite-ut-mac-state.cc.
References m_lastNcrDateReceived, and m_ncrSyncTimeout.
Referenced by ns3::SatUtMac::LogonMsgTransmissionPossible().
void ns3::SatUtMacState::NcrControlMessageReceived | ( | ) |
Inform the state diagram that a NCR message has been received.
Reset timeouts.
Definition at line 180 of file satellite-ut-mac-state.cc.
References GetState(), m_lastNcrDateReceived, NCR_RECOVERY, and SwitchToReadyForTdmaSync().
Referenced by ns3::SatUtMac::ReceiveSignalingPacket().
void ns3::SatUtMacState::SetLogOffCallback | ( | SatUtMacState::LogOffCallback | cb | ) |
Set logOff callback.
Definition at line 79 of file satellite-ut-mac-state.cc.
References m_logOffCallback.
Referenced by ns3::SatUtMac::ReceiveSignalingPacket().
void ns3::SatUtMacState::SwitchToHoldStandby | ( | ) |
Change state to HOLD_STANDBY.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 95 of file satellite-ut-mac-state.cc.
References HOLD_STANDBY, and m_rcstState.
Referenced by ns3::SatUtMac::DoFrameStart(), and ns3::SatUtMac::DoTransmit().
void ns3::SatUtMacState::SwitchToNcrRecovery | ( | ) |
Change state to NCR_RECOVERY.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 164 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 104 of file satellite-ut-mac-state.cc.
References m_rcstState, and OFF_STANDBY.
Referenced by ns3::SatUtMac::DoFrameStart(), ns3::SatUtMac::LogOff(), and ns3::SatUtMac::TransmitPackets().
void ns3::SatUtMacState::SwitchToReadyForLogon | ( | ) |
Change state to READY_FOR_LOGON.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 113 of file satellite-ut-mac-state.cc.
References m_rcstState, NCR_RECOVERY, OFF_STANDBY, and READY_FOR_LOGON.
Referenced by ns3::SatUtMac::DoFrameStart(), and ns3::SatUtMac::ReceiveSignalingPacket().
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 130 of file satellite-ut-mac-state.cc.
References m_rcstState, NCR_RECOVERY, READY_FOR_LOGON, and READY_FOR_TDMA_SYNC.
Referenced by NcrControlMessageReceived(), and ns3::SatUtMac::ReceiveSignalingPacket().
void ns3::SatUtMacState::SwitchToTdmaSync | ( | ) |
Change state to TDMA_SYNC.
Raise a FATAL_ERROR if transition not possible from current state.
Definition at line 146 of file satellite-ut-mac-state.cc.
References CheckNcrTimeout(), m_ncrSyncTimeout, m_rcstState, READY_FOR_TDMA_SYNC, and TDMA_SYNC.
Referenced by ns3::SatUtMac::TransmitPackets().
|
private |
Definition at line 138 of file satellite-ut-mac-state.h.
Referenced by CheckNcrRecoveryTimeout(), and CheckNcrTimeout().
|
private |
Definition at line 137 of file satellite-ut-mac-state.h.
Referenced by CheckNcrTimeout(), IsNcrTimeout(), and NcrControlMessageReceived().
|
private |
Definition at line 143 of file satellite-ut-mac-state.h.
Referenced by CheckNcrRecoveryTimeout(), and SetLogOffCallback().
|
private |
Definition at line 141 of file satellite-ut-mac-state.h.
Referenced by CheckNcrRecoveryTimeout(), CheckNcrTimeout(), and GetTypeId().
|
private |
Definition at line 140 of file satellite-ut-mac-state.h.
Referenced by CheckNcrTimeout(), GetTypeId(), IsNcrTimeout(), and SwitchToTdmaSync().
|
private |
Definition at line 135 of file satellite-ut-mac-state.h.
Referenced by GetState(), SwitchToHoldStandby(), SwitchToNcrRecovery(), SwitchToOffStandby(), SwitchToReadyForLogon(), SwitchToReadyForTdmaSync(), and SwitchToTdmaSync().