A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
wifi-phy-state.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005,2006 INRIA
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
* Sébastien Deronne <sebastien.deronne@gmail.com>
19
*/
20
21
#ifndef WIFI_PHY_STATE_H
22
#define WIFI_PHY_STATE_H
23
24
#include "ns3/deprecated.h"
25
#include "ns3/fatal-error.h"
26
27
namespace
ns3
28
{
29
30
/**
31
* The state of the PHY layer.
32
*/
33
/// State enumeration
34
enum class
WifiPhyState
35
{
36
/**
37
* The PHY layer is IDLE.
38
*/
39
IDLE
= 0,
40
/**
41
* The PHY layer has sense the medium busy through the CCA mechanism
42
*/
43
CCA_BUSY
,
44
/**
45
* The PHY layer is sending a packet.
46
*/
47
TX
,
48
/**
49
* The PHY layer is receiving a packet.
50
*/
51
RX
,
52
/**
53
* The PHY layer is switching to other channel.
54
*/
55
SWITCHING
,
56
/**
57
* The PHY layer is sleeping.
58
*/
59
SLEEP
,
60
/**
61
* The PHY layer is switched off.
62
*/
63
OFF
64
};
65
66
/**
67
* \brief Stream insertion operator.
68
*
69
* \param os the stream
70
* \param state the state
71
* \returns a reference to the stream
72
*/
73
inline
std::ostream&
74
operator<<
(std::ostream& os,
WifiPhyState
state)
75
{
76
switch
(state)
77
{
78
case
WifiPhyState::IDLE
:
79
return
(os <<
"IDLE"
);
80
case
WifiPhyState::CCA_BUSY
:
81
return
(os <<
"CCA_BUSY"
);
82
case
WifiPhyState::TX
:
83
return
(os <<
"TX"
);
84
case
WifiPhyState::RX
:
85
return
(os <<
"RX"
);
86
case
WifiPhyState::SWITCHING
:
87
return
(os <<
"SWITCHING"
);
88
case
WifiPhyState::SLEEP
:
89
return
(os <<
"SLEEP"
);
90
case
WifiPhyState::OFF
:
91
return
(os <<
"OFF"
);
92
default
:
93
NS_FATAL_ERROR
(
"Invalid state"
);
94
return
(os <<
"INVALID"
);
95
}
96
}
97
98
}
// namespace ns3
99
100
NS_DEPRECATED_3_42
(
"Use WifiPhyState::IDLE instead"
)
101
static constexpr auto
IDLE
=
ns3
::WifiPhyState::
IDLE
;
//!< \deprecated See WifiPhyState::IDLE
102
NS_DEPRECATED_3_42
("Use WifiPhyState::
CCA_BUSY
instead")
103
static constexpr auto
CCA_BUSY
=
104
ns3
::WifiPhyState::
CCA_BUSY
;
//!< \deprecated See WifiPhyState::CCA_BUSY
105
NS_DEPRECATED_3_42
("Use WifiPhyState::
TX
instead")
106
static constexpr auto
TX
=
ns3
::WifiPhyState::
TX
;
//!< \deprecated See WifiPhyState::TX
107
NS_DEPRECATED_3_42
("Use WifiPhyState::
RX
instead")
108
static constexpr auto
RX
=
ns3
::WifiPhyState::
RX
;
//!< \deprecated See WifiPhyState::RX
109
NS_DEPRECATED_3_42
("Use WifiPhyState::
SWITCHING
instead")
110
static constexpr auto
SWITCHING
=
111
ns3
::WifiPhyState::
SWITCHING
;
//!< \deprecated See WifiPhyState::SWITCHING
112
NS_DEPRECATED_3_42
("Use WifiPhyState::
SLEEP
instead")
113
static constexpr auto
SLEEP
=
ns3
::WifiPhyState::
SLEEP
;
//!< \deprecated See WifiPhyState::SLEEP
114
NS_DEPRECATED_3_42
("Use WifiPhyState::
OFF
instead")
115
static constexpr auto
OFF
=
ns3
::WifiPhyState::
OFF
;
//!< \deprecated See WifiPhyState::OFF
116
117
#endif
/* WIFI_PHY_STATE_H */
NS_DEPRECATED_3_42
#define NS_DEPRECATED_3_42(msg)
Tag for things deprecated in version ns-3.42.
Definition:
deprecated.h:102
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition:
fatal-error.h:179
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiPhyState
WifiPhyState
The state of the PHY layer.
Definition:
wifi-phy-state.h:35
ns3::WifiPhyState::SWITCHING
@ SWITCHING
The PHY layer is switching to other channel.
ns3::WifiPhyState::TX
@ TX
The PHY layer is sending a packet.
ns3::WifiPhyState::OFF
@ OFF
The PHY layer is switched off.
ns3::WifiPhyState::IDLE
@ IDLE
The PHY layer is IDLE.
ns3::WifiPhyState::CCA_BUSY
@ CCA_BUSY
The PHY layer has sense the medium busy through the CCA mechanism.
ns3::WifiPhyState::SLEEP
@ SLEEP
The PHY layer is sleeping.
ns3::WifiPhyState::RX
@ RX
The PHY layer is receiving a packet.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:159
ns3::IDLE
@ IDLE
Channel is IDLE, no packet is being transmitted.
Definition:
csma-channel.h:76
SWITCHING
static constexpr auto SWITCHING
Definition:
wifi-phy-state.h:110
TX
static constexpr auto TX
Definition:
wifi-phy-state.h:106
SLEEP
static constexpr auto SLEEP
Definition:
wifi-phy-state.h:113
CCA_BUSY
static constexpr auto CCA_BUSY
Definition:
wifi-phy-state.h:103
RX
static constexpr auto RX
Definition:
wifi-phy-state.h:108
IDLE
static constexpr auto IDLE
Definition:
wifi-phy-state.h:101
OFF
static constexpr auto OFF
Definition:
wifi-phy-state.h:115
src
wifi
model
wifi-phy-state.h
Generated on Tue May 28 2024 23:40:41 for ns-3 by
1.9.6