Loading...
Searching...
No Matches
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.
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

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 70 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 55 of file satellite-ut-mac-state.cc.

References HOLD_STANDBY, m_checkNcrRecoveryScheduled, m_lastNcrDateReceived, m_ncrRecoveryTimeout, m_ncrSyncTimeout, and m_rcstState.

◆ ~SatUtMacState()

ns3::SatUtMacState::~SatUtMacState ( )

Destroy a SatUtMacState.

This is the destructor for the SatUtMacState.

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

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

◆ GetState()

SatUtMacState::RcstState_t ns3::SatUtMacState::GetState ( ) const

Get the current state.

Returns
The current state.

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

References m_rcstState.

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

Here is the caller graph for this function:

◆ GetTypeId()

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

Derived from Object.

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

References m_ncrRecoveryTimeout, and m_ncrSyncTimeout.

◆ 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 185 of file satellite-ut-mac-state.cc.

References m_lastNcrDateReceived, and m_ncrSyncTimeout.

◆ NcrControlMessageReceived()

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

Here is the call graph for this function:

◆ SetLogOffCallback()

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

Set logOff callback.

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

References m_logOffCallback.

◆ SwitchToHoldStandby()

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.

◆ SwitchToNcrRecovery()

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

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 96 of file satellite-ut-mac-state.cc.

References m_rcstState, and OFF_STANDBY.

◆ 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 105 of file satellite-ut-mac-state.cc.

References m_rcstState, NCR_RECOVERY, OFF_STANDBY, and READY_FOR_LOGON.

◆ 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 122 of file satellite-ut-mac-state.cc.

References m_rcstState, NCR_RECOVERY, READY_FOR_LOGON, and READY_FOR_TDMA_SYNC.

Referenced by NcrControlMessageReceived().

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 138 of file satellite-ut-mac-state.cc.

References CheckNcrTimeout(), m_ncrSyncTimeout, m_rcstState, READY_FOR_TDMA_SYNC, and TDMA_SYNC.

Here is the call graph for this function:

Member Data Documentation

◆ m_checkNcrRecoveryScheduled

Time ns3::SatUtMacState::m_checkNcrRecoveryScheduled
private

◆ m_lastNcrDateReceived

Time ns3::SatUtMacState::m_lastNcrDateReceived
private

◆ m_logOffCallback

LogOffCallback ns3::SatUtMacState::m_logOffCallback
private

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

Referenced by CheckNcrRecoveryTimeout(), and SetLogOffCallback().

◆ m_ncrRecoveryTimeout

Time ns3::SatUtMacState::m_ncrRecoveryTimeout
private

◆ m_ncrSyncTimeout

Time ns3::SatUtMacState::m_ncrSyncTimeout
private

◆ m_rcstState


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