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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
constant-rate-wifi-manager.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2004,2005 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
21
#include "
constant-rate-wifi-manager.h
"
22
23
#include "ns3/string.h"
24
#include "ns3/assert.h"
25
#include "ns3/log.h"
26
27
NS_LOG_COMPONENT_DEFINE
(
"ConstantRateWifiManager"
);
28
29
#define Min(a,b) ((a < b) ? a : b)
30
31
namespace
ns3 {
32
33
NS_OBJECT_ENSURE_REGISTERED
(ConstantRateWifiManager);
34
35
TypeId
36
ConstantRateWifiManager::GetTypeId
(
void
)
37
{
38
static
TypeId
tid =
TypeId
(
"ns3::ConstantRateWifiManager"
)
39
.
SetParent
<
WifiRemoteStationManager
> ()
40
.AddConstructor<ConstantRateWifiManager> ()
41
.AddAttribute (
"DataMode"
,
"The transmission mode to use for every data packet transmission"
,
42
StringValue
(
"OfdmRate6Mbps"
),
43
MakeWifiModeAccessor (&
ConstantRateWifiManager::m_dataMode
),
44
MakeWifiModeChecker ())
45
.AddAttribute (
"ControlMode"
,
"The transmission mode to use for every control packet transmission."
,
46
StringValue
(
"OfdmRate6Mbps"
),
47
MakeWifiModeAccessor (&
ConstantRateWifiManager::m_ctlMode
),
48
MakeWifiModeChecker ())
49
;
50
return
tid;
51
}
52
53
ConstantRateWifiManager::ConstantRateWifiManager
()
54
{
55
NS_LOG_FUNCTION
(
this
);
56
}
57
ConstantRateWifiManager::~ConstantRateWifiManager
()
58
{
59
NS_LOG_FUNCTION
(
this
);
60
}
61
62
63
WifiRemoteStation
*
64
ConstantRateWifiManager::DoCreateStation
(
void
)
const
65
{
66
NS_LOG_FUNCTION
(
this
);
67
WifiRemoteStation
*station =
new
WifiRemoteStation
();
68
return
station;
69
}
70
71
72
void
73
ConstantRateWifiManager::DoReportRxOk
(
WifiRemoteStation
*station,
74
double
rxSnr,
WifiMode
txMode)
75
{
76
NS_LOG_FUNCTION
(
this
<< station << rxSnr << txMode);
77
}
78
void
79
ConstantRateWifiManager::DoReportRtsFailed
(
WifiRemoteStation
*station)
80
{
81
NS_LOG_FUNCTION
(
this
<< station);
82
}
83
void
84
ConstantRateWifiManager::DoReportDataFailed
(
WifiRemoteStation
*station)
85
{
86
NS_LOG_FUNCTION
(
this
<< station);
87
}
88
void
89
ConstantRateWifiManager::DoReportRtsOk
(
WifiRemoteStation
*st,
90
double
ctsSnr,
WifiMode
ctsMode,
double
rtsSnr)
91
{
92
NS_LOG_FUNCTION
(
this
<< st << ctsSnr << ctsMode << rtsSnr);
93
}
94
void
95
ConstantRateWifiManager::DoReportDataOk
(
WifiRemoteStation
*st,
96
double
ackSnr,
WifiMode
ackMode,
double
dataSnr)
97
{
98
NS_LOG_FUNCTION
(
this
<< st << ackSnr << ackMode << dataSnr);
99
}
100
void
101
ConstantRateWifiManager::DoReportFinalRtsFailed
(
WifiRemoteStation
*station)
102
{
103
NS_LOG_FUNCTION
(
this
<< station);
104
}
105
void
106
ConstantRateWifiManager::DoReportFinalDataFailed
(
WifiRemoteStation
*station)
107
{
108
NS_LOG_FUNCTION
(
this
<< station);
109
}
110
111
WifiTxVector
112
ConstantRateWifiManager::DoGetDataTxVector
(
WifiRemoteStation
*st, uint32_t size)
113
{
114
NS_LOG_FUNCTION
(
this
<< st << size);
115
return
WifiTxVector
(
m_dataMode
,
GetDefaultTxPowerLevel
(),
GetLongRetryCount
(st),
GetShortGuardInterval
(st),
Min
(
GetNumberOfReceiveAntennas
(st),
GetNumberOfTransmitAntennas
()),
GetNumberOfTransmitAntennas
(st),
GetStbc
(st));
116
}
117
WifiTxVector
118
ConstantRateWifiManager::DoGetRtsTxVector
(
WifiRemoteStation
*st)
119
{
120
NS_LOG_FUNCTION
(
this
<< st);
121
return
WifiTxVector
(
m_ctlMode
,
GetDefaultTxPowerLevel
(),
GetShortRetryCount
(st),
GetShortGuardInterval
(st),
Min
(
GetNumberOfReceiveAntennas
(st),
GetNumberOfTransmitAntennas
()),
GetNumberOfTransmitAntennas
(st),
GetStbc
(st));
122
}
123
124
bool
125
ConstantRateWifiManager::IsLowLatency
(
void
)
const
126
{
127
NS_LOG_FUNCTION
(
this
);
128
return
true
;
129
}
130
131
}
// namespace ns3
src
wifi
model
constant-rate-wifi-manager.cc
Generated on Fri Aug 30 2013 01:43:04 for ns-3 by
1.8.1.2