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/fatal-error.h"
14
15
namespace
ns3
16
{
17
18
/**
19
* The state of the PHY layer.
20
*/
21
/// State enumeration
22
enum class
WifiPhyState
23
{
24
/**
25
* The PHY layer is IDLE.
26
*/
27
IDLE
= 0,
28
/**
29
* The PHY layer has sense the medium busy through the CCA mechanism
30
*/
31
CCA_BUSY
,
32
/**
33
* The PHY layer is sending a packet.
34
*/
35
TX
,
36
/**
37
* The PHY layer is receiving a packet.
38
*/
39
RX
,
40
/**
41
* The PHY layer is switching to other channel.
42
*/
43
SWITCHING
,
44
/**
45
* The PHY layer is sleeping.
46
*/
47
SLEEP
,
48
/**
49
* The PHY layer is switched off.
50
*/
51
OFF
52
};
53
54
/**
55
* @brief Stream insertion operator.
56
*
57
* @param os the stream
58
* @param state the state
59
* @returns a reference to the stream
60
*/
61
inline
std::ostream&
62
operator<<
(std::ostream& os,
WifiPhyState
state)
63
{
64
switch
(state)
65
{
66
case
WifiPhyState::IDLE
:
67
return
(os <<
"IDLE"
);
68
case
WifiPhyState::CCA_BUSY
:
69
return
(os <<
"CCA_BUSY"
);
70
case
WifiPhyState::TX
:
71
return
(os <<
"TX"
);
72
case
WifiPhyState::RX
:
73
return
(os <<
"RX"
);
74
case
WifiPhyState::SWITCHING
:
75
return
(os <<
"SWITCHING"
);
76
case
WifiPhyState::SLEEP
:
77
return
(os <<
"SLEEP"
);
78
case
WifiPhyState::OFF
:
79
return
(os <<
"OFF"
);
80
default
:
81
NS_FATAL_ERROR
(
"Invalid state"
);
82
return
(os <<
"INVALID"
);
83
}
84
}
85
86
}
// namespace ns3
87
88
#endif
/* WIFI_PHY_STATE_H */
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition
fatal-error.h:186
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:23
ns3::WifiPhyState::SWITCHING
@ SWITCHING
The PHY layer is switching to other channel.
Definition
wifi-phy-state.h:43
ns3::WifiPhyState::TX
@ TX
The PHY layer is sending a packet.
Definition
wifi-phy-state.h:35
ns3::WifiPhyState::OFF
@ OFF
The PHY layer is switched off.
Definition
wifi-phy-state.h:51
ns3::WifiPhyState::IDLE
@ IDLE
The PHY layer is IDLE.
Definition
wifi-phy-state.h:27
ns3::WifiPhyState::CCA_BUSY
@ CCA_BUSY
The PHY layer has sense the medium busy through the CCA mechanism.
Definition
wifi-phy-state.h:31
ns3::WifiPhyState::SLEEP
@ SLEEP
The PHY layer is sleeping.
Definition
wifi-phy-state.h:47
ns3::WifiPhyState::RX
@ RX
The PHY layer is receiving a packet.
Definition
wifi-phy-state.h:39
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
src
wifi
model
wifi-phy-state.h
Generated on Wed Oct 1 2025 18:22:44 for ns-3 by
1.13.2