A Discrete-Event Network Simulator
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
11namespace ns3
12{
13
15 : m_erpInformation(0)
16{
17}
18
24
25void
30
31void
36
37void
42
43uint8_t
45{
46 return ((m_erpInformation >> 2) & 0x01);
47}
48
49uint8_t
51{
52 return ((m_erpInformation >> 1) & 0x01);
53}
54
55uint8_t
57{
58 return (m_erpInformation & 0x01);
59}
60
61uint16_t
63{
64 return 1;
65}
66
67void
72
73uint16_t
75{
76 Buffer::Iterator i = start;
77 m_erpInformation = i.ReadU8();
78 return length;
79}
80
81std::ostream&
82operator<<(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
iterator in a Buffer instance
Definition buffer.h:89
The ErpInformation Information Element.
uint8_t m_erpInformation
ERP information.
void SetBarkerPreambleMode(uint8_t barkerPreambleMode)
Set the Barker_Preamble_Mode field in the ErpInformation information element.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint8_t GetNonErpPresent() const
Return the Non_Erp_Present field in the ErpInformation information element.
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)
uint8_t GetBarkerPreambleMode() const
Return the Barker_Preamble_Mode field in the ErpInformation information element.
void SetUseProtection(uint8_t useProtection)
Set the Use_Protection field in the ErpInformation information element.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t GetUseProtection() const
Return the Use_Protection field in the ErpInformation information element.
void SetNonErpPresent(uint8_t nonErpPresent)
Set the Non_Erp_Present field in the ErpInformation information element.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
#define IE_ERP_INFORMATION