A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
wifi-phy-tag.cc
Go to the documentation of this file.
1
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 CTTC
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
#include "
wifi-phy-tag.h
"
22
23
namespace
ns3
{
24
25
TypeId
26
WifiPhyTag::GetTypeId
(
void
)
27
{
28
static
TypeId
tid =
TypeId
(
"ns3::WifiPhyTag"
)
29
.
SetParent
<
Tag
> ()
30
;
31
return
tid;
32
}
33
34
TypeId
35
WifiPhyTag::GetInstanceTypeId
(
void
)
const
36
{
37
return
GetTypeId
();
38
}
39
40
uint32_t
41
WifiPhyTag::GetSerializedSize
(
void
)
const
42
{
43
return
(
sizeof
(
WifiTxVector
) + 2 + 1);
44
}
45
46
void
47
WifiPhyTag::Serialize
(
TagBuffer
i)
const
48
{
49
i.
Write
((uint8_t *)&
m_wifiTxVector
,
sizeof
(
WifiTxVector
));
50
i.
WriteU16
(
m_mpduType
);
51
i.
WriteU8
(
m_frameComplete
);
52
}
53
54
void
55
WifiPhyTag::Deserialize
(
TagBuffer
i)
56
{
57
i.
Read
((uint8_t *)&
m_wifiTxVector
,
sizeof
(
WifiTxVector
));
58
m_mpduType
=
static_cast<
MpduType
>
(i.
ReadU16
());
59
m_frameComplete
= i.
ReadU8
();
60
}
61
void
62
WifiPhyTag::Print
(std::ostream &os)
const
63
{
64
os <<
m_wifiTxVector
<<
" "
<<
m_mpduType
<<
" "
<<
m_frameComplete
;
65
}
66
67
WifiPhyTag::WifiPhyTag
()
68
{
69
}
70
71
WifiPhyTag::WifiPhyTag
(
WifiTxVector
txVector,
MpduType
mpdutype, uint8_t frameComplete)
72
: m_wifiTxVector (txVector),
73
m_mpduType (mpdutype),
74
m_frameComplete (frameComplete)
75
{
76
}
77
78
WifiTxVector
79
WifiPhyTag::GetWifiTxVector
(
void
)
const
80
{
81
return
m_wifiTxVector
;
82
}
83
84
MpduType
85
WifiPhyTag::GetMpduType
(
void
)
const
86
{
87
return
m_mpduType
;
88
}
89
90
uint8_t
91
WifiPhyTag::GetFrameComplete
(
void
)
const
92
{
93
return
m_frameComplete
;
94
}
95
96
}
// namespace ns3
ns3::WifiPhyTag::GetInstanceTypeId
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
wifi-phy-tag.cc:35
ns3::TagBuffer::Write
void Write(const uint8_t *buffer, uint32_t size)
Definition:
tag-buffer.cc:125
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition:
wifi-tx-vector.h:61
ns3::WifiPhyTag::GetFrameComplete
uint8_t GetFrameComplete(void) const
Getter for frameComplete parameter.
Definition:
wifi-phy-tag.cc:91
ns3::WifiPhyTag::m_mpduType
MpduType m_mpduType
MPDU type.
Definition:
wifi-phy-tag.h:81
ns3::TagBuffer::ReadU8
TAG_BUFFER_INLINE uint8_t ReadU8(void)
Definition:
tag-buffer.h:195
ns3::WifiPhyTag::m_wifiTxVector
WifiTxVector m_wifiTxVector
wifi transmit vector
Definition:
wifi-phy-tag.h:80
ns3::WifiPhyTag::WifiPhyTag
WifiPhyTag()
Constructor.
Definition:
wifi-phy-tag.cc:67
ns3::WifiPhyTag::m_frameComplete
uint8_t m_frameComplete
Used to indicate that TX stopped sending before the end of the frame.
Definition:
wifi-phy-tag.h:82
ns3::WifiPhyTag::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
wifi-phy-tag.cc:26
ns3::WifiPhyTag::Deserialize
void Deserialize(TagBuffer i)
Definition:
wifi-phy-tag.cc:55
wifi-phy-tag.h
ns3::TagBuffer::WriteU16
TAG_BUFFER_INLINE void WriteU16(uint16_t v)
Definition:
tag-buffer.h:180
ns3::WifiPhyTag::Print
void Print(std::ostream &os) const
Definition:
wifi-phy-tag.cc:62
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:36
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiPhyTag::GetSerializedSize
uint32_t GetSerializedSize(void) const
Definition:
wifi-phy-tag.cc:41
ns3::TagBuffer::WriteU8
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Definition:
tag-buffer.h:172
ns3::WifiPhyTag::GetWifiTxVector
WifiTxVector GetWifiTxVector(void) const
Getter for WifiTxVector parameter.
Definition:
wifi-phy-tag.cc:79
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:51
ns3::WifiPhyTag::Serialize
void Serialize(TagBuffer i) const
Definition:
wifi-phy-tag.cc:47
ns3::TagBuffer::Read
void Read(uint8_t *buffer, uint32_t size)
Definition:
tag-buffer.cc:176
ns3::TagBuffer::ReadU16
TAG_BUFFER_INLINE uint16_t ReadU16(void)
Definition:
tag-buffer.h:205
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::MpduType
MpduType
This enumeration defines the type of an MPDU.
Definition:
wifi-phy.h:61
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:914
ns3::WifiPhyTag::GetMpduType
MpduType GetMpduType(void) const
Getter for mpduType parameter.
Definition:
wifi-phy-tag.cc:85
src
wifi
model
wifi-phy-tag.cc
Generated on Wed Mar 21 2018 14:24:34 for ns-3 by
1.8.9.1