A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
dsss-parameter-set.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 Sébastien Deronne
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
* Author: Sébastien Deronne <sebastien.deronne@gmail.com>
18
*/
19
20
#include "
dsss-parameter-set.h
"
21
22
namespace
ns3
23
{
24
25
DsssParameterSet::DsssParameterSet
()
26
: m_currentChannel(0)
27
{
28
}
29
30
WifiInformationElementId
31
DsssParameterSet::ElementId
()
const
32
{
33
return
IE_DSSS_PARAMETER_SET
;
34
}
35
36
void
37
DsssParameterSet::SetCurrentChannel
(uint8_t currentChannel)
38
{
39
m_currentChannel
= currentChannel;
40
}
41
42
uint16_t
43
DsssParameterSet::GetInformationFieldSize
()
const
44
{
45
return
1;
46
}
47
48
void
49
DsssParameterSet::SerializeInformationField
(
Buffer::Iterator
start
)
const
50
{
51
start
.WriteU8(
m_currentChannel
);
52
}
53
54
uint16_t
55
DsssParameterSet::DeserializeInformationField
(
Buffer::Iterator
start
, uint16_t length)
56
{
57
Buffer::Iterator
i =
start
;
58
m_currentChannel
= i.
ReadU8
();
59
return
length;
60
}
61
62
}
// namespace ns3
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:100
ns3::Buffer::Iterator::ReadU8
uint8_t ReadU8()
Definition:
buffer.h:1027
ns3::DsssParameterSet::m_currentChannel
uint8_t m_currentChannel
current channel number
Definition:
dsss-parameter-set.h:54
ns3::DsssParameterSet::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:
dsss-parameter-set.cc:55
ns3::DsssParameterSet::SetCurrentChannel
void SetCurrentChannel(uint8_t currentChannel)
Set the Current Channel field in the DsssParameterSet information element.
Definition:
dsss-parameter-set.cc:37
ns3::DsssParameterSet::DsssParameterSet
DsssParameterSet()
Definition:
dsss-parameter-set.cc:25
ns3::DsssParameterSet::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:
dsss-parameter-set.cc:43
ns3::DsssParameterSet::ElementId
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
Definition:
dsss-parameter-set.cc:31
ns3::DsssParameterSet::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:
dsss-parameter-set.cc:49
dsss-parameter-set.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiInformationElementId
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
Definition:
wifi-information-element.h:45
two-ray-to-three-gpp-ch-calibration.start
start
Definition:
two-ray-to-three-gpp-ch-calibration.py:520
IE_DSSS_PARAMETER_SET
#define IE_DSSS_PARAMETER_SET
Definition:
wifi-information-element.h:55
src
wifi
model
non-ht
dsss-parameter-set.cc
Generated on Sun Mar 3 2024 17:11:11 for ns-3 by
1.9.1