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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
* Sébastien Deronne <sebastien.deronne@gmail.com>
8
*/
9
10
#ifndef WIFI_PHY_STATE_H
11
#define WIFI_PHY_STATE_H
12
13
#include "ns3/deprecated.h"
14
#include "ns3/fatal-error.h"
15
16
namespace
ns3
17
{
18
19
/**
20
* The state of the PHY layer.
21
*/
22
/// State enumeration
23
enum class
WifiPhyState
24
{
25
/**
26
* The PHY layer is IDLE.
27
*/
28
IDLE
= 0,
29
/**
30
* The PHY layer has sense the medium busy through the CCA mechanism
31
*/
32
CCA_BUSY
,
33
/**
34
* The PHY layer is sending a packet.
35
*/
36
TX
,
37
/**
38
* The PHY layer is receiving a packet.
39
*/
40
RX
,
41
/**
42
* The PHY layer is switching to other channel.
43
*/
44
SWITCHING
,
45
/**
46
* The PHY layer is sleeping.
47
*/
48
SLEEP
,
49
/**
50
* The PHY layer is switched off.
51
*/
52
OFF
53
};
54
55
/**
56
* @brief Stream insertion operator.
57
*
58
* @param os the stream
59
* @param state the state
60
* @returns a reference to the stream
61
*/
62
inline
std::ostream&
63
operator<<
(std::ostream& os,
WifiPhyState
state)
64
{
65
switch
(state)
66
{
67
case
WifiPhyState::IDLE
:
68
return
(os <<
"IDLE"
);
69
case
WifiPhyState::CCA_BUSY
:
70
return
(os <<
"CCA_BUSY"
);
71
case
WifiPhyState::TX
:
72
return
(os <<
"TX"
);
73
case
WifiPhyState::RX
:
74
return
(os <<
"RX"
);
75
case
WifiPhyState::SWITCHING
:
76
return
(os <<
"SWITCHING"
);
77
case
WifiPhyState::SLEEP
:
78
return
(os <<
"SLEEP"
);
79
case
WifiPhyState::OFF
:
80
return
(os <<
"OFF"
);
81
default
:
82
NS_FATAL_ERROR
(
"Invalid state"
);
83
return
(os <<
"INVALID"
);
84
}
85
}
86
87
}
// namespace ns3
88
89
/**
90
* Deprecated WifiPhyState enums.
91
*
92
* Use WifiPhyState class enum symbols instead.
93
* @{
94
*/
95
NS_DEPRECATED_3_42
(
"Use WifiPhyState::IDLE instead"
)
96
static constexpr auto
IDLE
=
ns3
::WifiPhyState::
IDLE
;
97
NS_DEPRECATED_3_42
("Use WifiPhyState::
CCA_BUSY
instead")
98
static constexpr auto
CCA_BUSY
=
ns3
::WifiPhyState::
CCA_BUSY
;
99
NS_DEPRECATED_3_42
("Use WifiPhyState::
TX
instead")
100
static constexpr auto
TX
=
ns3
::WifiPhyState::
TX
;
101
NS_DEPRECATED_3_42
("Use WifiPhyState::
RX
instead")
102
static constexpr auto
RX
=
ns3
::WifiPhyState::
RX
;
103
NS_DEPRECATED_3_42
("Use WifiPhyState::
SWITCHING
instead")
104
static constexpr auto
SWITCHING
=
ns3
::WifiPhyState::
SWITCHING
;
105
NS_DEPRECATED_3_42
("Use WifiPhyState::
SLEEP
instead")
106
static constexpr auto
SLEEP
=
ns3
::WifiPhyState::
SLEEP
;
107
NS_DEPRECATED_3_42
("Use WifiPhyState::
OFF
instead")
108
static constexpr auto
OFF
=
ns3
::WifiPhyState::
OFF
;
109
/**@}*/
110
111
#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:105
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition
fatal-error.h:168
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:24
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:148
ns3::IDLE
@ IDLE
Channel is IDLE, no packet is being transmitted.
Definition
csma-channel.h:65
SWITCHING
static constexpr auto SWITCHING
Definition
wifi-phy-state.h:104
TX
static constexpr auto TX
Definition
wifi-phy-state.h:100
SLEEP
static constexpr auto SLEEP
Definition
wifi-phy-state.h:106
CCA_BUSY
static constexpr auto CCA_BUSY
Definition
wifi-phy-state.h:98
RX
static constexpr auto RX
Definition
wifi-phy-state.h:102
IDLE
static constexpr auto IDLE
Deprecated WifiPhyState enums.
Definition
wifi-phy-state.h:96
OFF
static constexpr auto OFF
Definition
wifi-phy-state.h:108
src
wifi
model
wifi-phy-state.h
Generated on Tue Dec 10 2024 18:20:52 for ns-3 by
1.11.0