ns3::SatUtMacState Class Reference

Class handling UT Mac states and transitions. More...

#include "satellite-ut-mac-state.h"

+ Inheritance diagram for ns3::SatUtMacState:
+ Collaboration diagram for ns3::SatUtMacState:

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
 

Detailed Description

Class handling UT Mac states and transitions.

Definition at line 37 of file satellite-ut-mac-state.h.

Member Typedef Documentation

◆ LogOffCallback

typedef Callback<void> ns3::SatUtMacState::LogOffCallback

LogOff callback.

Definition at line 74 of file satellite-ut-mac-state.h.

Member Enumeration Documentation

◆ RcstState_t

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.

Constructor & Destructor Documentation

◆ SatUtMacState()

ns3::SatUtMacState::SatUtMacState ( )

Default constructor, which is not used.

Definition at line 61 of file satellite-ut-mac-state.cc.

◆ ~SatUtMacState()

ns3::SatUtMacState::~SatUtMacState ( )

Destroy a SatUtMacState.

This is the destructor for the SatUtMacState.

Definition at line 71 of file satellite-ut-mac-state.cc.

Member Function Documentation

◆ CheckNcrRecoveryTimeout()

void ns3::SatUtMacState::CheckNcrRecoveryTimeout ( )
private

Check if timeout reached in NCR_RECOVERY state.

If yes, switching to OFF_STANDBY and logoff UT Mac.

Definition at line 222 of file satellite-ut-mac-state.cc.

References GetState(), m_checkNcrRecoveryScheduled, m_logOffCallback, m_ncrRecoveryTimeout, and NCR_RECOVERY.

Referenced by CheckNcrTimeout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckNcrTimeout()

void ns3::SatUtMacState::CheckNcrTimeout ( )
private

Check if NCR has been received before sending a timeout.

Switching to NCR_RECOVERY if timeout reached.

Definition at line 199 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::SatUtMacState::GetInstanceTypeId ( void  ) const
virtual

Derived from Object.

Definition at line 54 of file satellite-ut-mac-state.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetState()

◆ GetTypeId()

TypeId ns3::SatUtMacState::GetTypeId ( void  )
static

Derived from Object.

Definition at line 34 of file satellite-ut-mac-state.cc.

References m_ncrRecoveryTimeout, and m_ncrSyncTimeout.

Referenced by GetInstanceTypeId().

+ Here is the caller graph for this function:

◆ IsNcrTimeout()

bool ns3::SatUtMacState::IsNcrTimeout ( ) const

Check if NCR m_ncrSyncTimeout has been reached.

Returns
true if Now () > m_lastNcrDateReceived + m_ncrSyncTimeout

Definition at line 191 of file satellite-ut-mac-state.cc.

References m_lastNcrDateReceived, and m_ncrSyncTimeout.

Referenced by ns3::SatUtMac::LogonMsgTransmissionPossible().

+ Here is the caller graph for this function:

◆ NcrControlMessageReceived()

void ns3::SatUtMacState::NcrControlMessageReceived ( )

Inform the state diagram that a NCR message has been received.

Reset timeouts.

Definition at line 178 of file satellite-ut-mac-state.cc.

References GetState(), m_lastNcrDateReceived, NCR_RECOVERY, and SwitchToReadyForTdmaSync().

Referenced by ns3::SatUtMac::ReceiveSignalingPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetLogOffCallback()

void ns3::SatUtMacState::SetLogOffCallback ( SatUtMacState::LogOffCallback  cb)

Set logOff callback.

Definition at line 77 of file satellite-ut-mac-state.cc.

References m_logOffCallback.

Referenced by ns3::SatUtMac::ReceiveSignalingPacket().

+ Here is the caller graph for this function:

◆ SwitchToHoldStandby()

void ns3::SatUtMacState::SwitchToHoldStandby ( )

Change state to HOLD_STANDBY.

Raise a FATAL_ERROR if transition not possible from current state.

Definition at line 93 of file satellite-ut-mac-state.cc.

References HOLD_STANDBY, and m_rcstState.

Referenced by ns3::SatUtMac::DoFrameStart(), and ns3::SatUtMac::DoTransmit().

+ Here is the caller graph for this function:

◆ SwitchToNcrRecovery()

void ns3::SatUtMacState::SwitchToNcrRecovery ( )

Change state to NCR_RECOVERY.

Raise a FATAL_ERROR if transition not possible from current state.

Definition at line 162 of file satellite-ut-mac-state.cc.

References m_rcstState, NCR_RECOVERY, and TDMA_SYNC.

Referenced by CheckNcrTimeout().

+ Here is the caller graph for this function:

◆ SwitchToOffStandby()

void ns3::SatUtMacState::SwitchToOffStandby ( )

Change state to OFF_STANDBY.

Raise a FATAL_ERROR if transition not possible from current state.

Definition at line 102 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().

+ Here is the caller graph for this function:

◆ SwitchToReadyForLogon()

void ns3::SatUtMacState::SwitchToReadyForLogon ( )

Change state to READY_FOR_LOGON.

Raise a FATAL_ERROR if transition not possible from current state.

Definition at line 111 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().

+ Here is the caller graph for this function:

◆ SwitchToReadyForTdmaSync()

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 128 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().

+ Here is the caller graph for this function:

◆ SwitchToTdmaSync()

void ns3::SatUtMacState::SwitchToTdmaSync ( )

Change state to TDMA_SYNC.

Raise a FATAL_ERROR if transition not possible from current state.

Definition at line 144 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_checkNcrRecoveryScheduled

Time ns3::SatUtMacState::m_checkNcrRecoveryScheduled
private

Definition at line 138 of file satellite-ut-mac-state.h.

Referenced by CheckNcrRecoveryTimeout(), and CheckNcrTimeout().

◆ m_lastNcrDateReceived

Time ns3::SatUtMacState::m_lastNcrDateReceived
private

◆ m_logOffCallback

LogOffCallback ns3::SatUtMacState::m_logOffCallback
private

Definition at line 143 of file satellite-ut-mac-state.h.

Referenced by CheckNcrRecoveryTimeout(), and SetLogOffCallback().

◆ m_ncrRecoveryTimeout

Time ns3::SatUtMacState::m_ncrRecoveryTimeout
private

Definition at line 141 of file satellite-ut-mac-state.h.

Referenced by CheckNcrRecoveryTimeout(), CheckNcrTimeout(), and GetTypeId().

◆ m_ncrSyncTimeout

Time ns3::SatUtMacState::m_ncrSyncTimeout
private

◆ m_rcstState


The documentation for this class was generated from the following files: