Loading...
Searching...
No Matches
satellite-ut-mac-state.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013 Magister Solutions Ltd
4 * Copyright (c) 2018 CNES
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Bastien Tauran <bastien.tauran@viveris.fr>
20 */
21
22#ifndef SATELLITE_UT_MAC_STATE_H
23#define SATELLITE_UT_MAC_STATE_H
24
25#include "ns3/nstime.h"
26#include "ns3/object.h"
27#include "ns3/simulator.h"
28
29namespace ns3
30{
31
37class SatUtMacState : public Object
38{
39 public:
49
53 static TypeId GetTypeId(void);
54
59
66
70 typedef Callback<void> LogOffCallback;
71
76
82 RcstState_t GetState() const;
83
89
94 void SwitchToOffStandby();
95
101
107
111 void SwitchToTdmaSync();
112
117 void SwitchToNcrRecovery();
118
123
128 bool IsNcrTimeout() const;
129
130 private:
131 RcstState_t m_rcstState; // Current state
132
133 Time m_lastNcrDateReceived; // Last time a NCR control message was received
134 Time m_checkNcrRecoveryScheduled; // Last time state switched to NCR_RECOVERY
135
136 Time m_ncrSyncTimeout; // Timeout to switch from TDMA_SYNC to NCR_RECOVERY
137 Time m_ncrRecoveryTimeout; // Timeout to switch from NCR_RECOVERY to OFF_STANDBY
138
139 LogOffCallback m_logOffCallback; // Callback to call LogOff of SatUtMac
140
145 void CheckNcrTimeout();
146
152};
153
154} // namespace ns3
155
156#endif /* SATELLITE_UT_MAC_STATE_H */
void SwitchToReadyForTdmaSync()
Change state to READY_FOR_TDMA_SYNC.
void SwitchToNcrRecovery()
Change state to NCR_RECOVERY.
void SetLogOffCallback(LogOffCallback cb)
Set logOff callback.
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.
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.
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.
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.