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
erp-information.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Sébastien Deronne
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7
*/
8
9
#include "
erp-information.h
"
10
11
namespace
ns3
12
{
13
14
ErpInformation::ErpInformation
()
15
: m_erpInformation(0)
16
{
17
}
18
19
WifiInformationElementId
20
ErpInformation::ElementId
()
const
21
{
22
return
IE_ERP_INFORMATION
;
23
}
24
25
void
26
ErpInformation::SetBarkerPreambleMode
(uint8_t barkerPreambleMode)
27
{
28
m_erpInformation
|= (barkerPreambleMode & 0x01) << 2;
29
}
30
31
void
32
ErpInformation::SetUseProtection
(uint8_t useProtection)
33
{
34
m_erpInformation
|= (useProtection & 0x01) << 1;
35
}
36
37
void
38
ErpInformation::SetNonErpPresent
(uint8_t nonErpPresent)
39
{
40
m_erpInformation
|= nonErpPresent & 0x01;
41
}
42
43
uint8_t
44
ErpInformation::GetBarkerPreambleMode
()
const
45
{
46
return
((
m_erpInformation
>> 2) & 0x01);
47
}
48
49
uint8_t
50
ErpInformation::GetUseProtection
()
const
51
{
52
return
((
m_erpInformation
>> 1) & 0x01);
53
}
54
55
uint8_t
56
ErpInformation::GetNonErpPresent
()
const
57
{
58
return
(
m_erpInformation
& 0x01);
59
}
60
61
uint16_t
62
ErpInformation::GetInformationFieldSize
()
const
63
{
64
return
1;
65
}
66
67
void
68
ErpInformation::SerializeInformationField
(
Buffer::Iterator
start)
const
69
{
70
start.WriteU8(
m_erpInformation
);
71
}
72
73
uint16_t
74
ErpInformation::DeserializeInformationField
(
Buffer::Iterator
start, uint16_t length)
75
{
76
Buffer::Iterator
i = start;
77
m_erpInformation
= i.
ReadU8
();
78
return
length;
79
}
80
81
std::ostream&
82
operator<<
(std::ostream& os,
const
ErpInformation
& erpInformation)
83
{
84
os << bool(erpInformation.
GetBarkerPreambleMode
()) <<
"|"
85
<< bool(erpInformation.
GetUseProtection
()) <<
"|"
<< bool(erpInformation.
GetNonErpPresent
());
86
87
return
os;
88
}
89
90
}
// namespace ns3
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Buffer::Iterator::ReadU8
uint8_t ReadU8()
Definition
buffer.h:1016
ns3::ErpInformation
The ErpInformation Information Element.
Definition
erp-information.h:24
ns3::ErpInformation::m_erpInformation
uint8_t m_erpInformation
ERP information.
Definition
erp-information.h:74
ns3::ErpInformation::SetBarkerPreambleMode
void SetBarkerPreambleMode(uint8_t barkerPreambleMode)
Set the Barker_Preamble_Mode field in the ErpInformation information element.
Definition
erp-information.cc:26
ns3::ErpInformation::ElementId
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
Definition
erp-information.cc:20
ns3::ErpInformation::GetNonErpPresent
uint8_t GetNonErpPresent() const
Return the Non_Erp_Present field in the ErpInformation information element.
Definition
erp-information.cc:56
ns3::ErpInformation::DeserializeInformationField
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition
erp-information.cc:74
ns3::ErpInformation::GetBarkerPreambleMode
uint8_t GetBarkerPreambleMode() const
Return the Barker_Preamble_Mode field in the ErpInformation information element.
Definition
erp-information.cc:44
ns3::ErpInformation::SetUseProtection
void SetUseProtection(uint8_t useProtection)
Set the Use_Protection field in the ErpInformation information element.
Definition
erp-information.cc:32
ns3::ErpInformation::SerializeInformationField
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition
erp-information.cc:68
ns3::ErpInformation::ErpInformation
ErpInformation()
Definition
erp-information.cc:14
ns3::ErpInformation::GetUseProtection
uint8_t GetUseProtection() const
Return the Use_Protection field in the ErpInformation information element.
Definition
erp-information.cc:50
ns3::ErpInformation::SetNonErpPresent
void SetNonErpPresent(uint8_t nonErpPresent)
Set the Non_Erp_Present field in the ErpInformation information element.
Definition
erp-information.cc:38
ns3::ErpInformation::GetInformationFieldSize
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Definition
erp-information.cc:62
erp-information.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition
angles.cc:148
ns3::WifiInformationElementId
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
Definition
wifi-information-element.h:34
IE_ERP_INFORMATION
#define IE_ERP_INFORMATION
Definition
wifi-information-element.h:69
src
wifi
model
non-ht
erp-information.cc
Generated on Fri Nov 8 2024 13:59:07 for ns-3 by
1.11.0