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
namespace
ns3 {
30
31
NS_OBJECT_ENSURE_REGISTERED
(ConstantRateWifiManager);
32
33
TypeId
34
ConstantRateWifiManager::GetTypeId
(
void
)
35
{
36
static
TypeId
tid =
TypeId
(
"ns3::ConstantRateWifiManager"
)
37
.
SetParent
<
WifiRemoteStationManager
> ()
38
.AddConstructor<ConstantRateWifiManager> ()
39
.AddAttribute (
"DataMode"
,
"The transmission mode to use for every data packet transmission"
,
40
StringValue
(
"OfdmRate6Mbps"
),
41
MakeWifiModeAccessor (&
ConstantRateWifiManager::m_dataMode
),
42
MakeWifiModeChecker ())
43
.AddAttribute (
"ControlMode"
,
"The transmission mode to use for every control packet transmission."
,
44
StringValue
(
"OfdmRate6Mbps"
),
45
MakeWifiModeAccessor (&
ConstantRateWifiManager::m_ctlMode
),
46
MakeWifiModeChecker ())
47
;
48
return
tid;
49
}
50
51
ConstantRateWifiManager::ConstantRateWifiManager
()
52
{
53
NS_LOG_FUNCTION
(
this
);
54
}
55
ConstantRateWifiManager::~ConstantRateWifiManager
()
56
{
57
NS_LOG_FUNCTION
(
this
);
58
}
59
60
61
WifiRemoteStation
*
62
ConstantRateWifiManager::DoCreateStation
(
void
)
const
63
{
64
NS_LOG_FUNCTION
(
this
);
65
WifiRemoteStation
*station =
new
WifiRemoteStation
();
66
return
station;
67
}
68
69
70
void
71
ConstantRateWifiManager::DoReportRxOk
(
WifiRemoteStation
*station,
72
double
rxSnr,
WifiMode
txMode)
73
{
74
NS_LOG_FUNCTION
(
this
<< station << rxSnr << txMode);
75
}
76
void
77
ConstantRateWifiManager::DoReportRtsFailed
(
WifiRemoteStation
*station)
78
{
79
NS_LOG_FUNCTION
(
this
<< station);
80
}
81
void
82
ConstantRateWifiManager::DoReportDataFailed
(
WifiRemoteStation
*station)
83
{
84
NS_LOG_FUNCTION
(
this
<< station);
85
}
86
void
87
ConstantRateWifiManager::DoReportRtsOk
(
WifiRemoteStation
*st,
88
double
ctsSnr,
WifiMode
ctsMode,
double
rtsSnr)
89
{
90
NS_LOG_FUNCTION
(
this
<< st << ctsSnr << ctsMode << rtsSnr);
91
}
92
void
93
ConstantRateWifiManager::DoReportDataOk
(
WifiRemoteStation
*st,
94
double
ackSnr,
WifiMode
ackMode,
double
dataSnr)
95
{
96
NS_LOG_FUNCTION
(
this
<< st << ackSnr << ackMode << dataSnr);
97
}
98
void
99
ConstantRateWifiManager::DoReportFinalRtsFailed
(
WifiRemoteStation
*station)
100
{
101
NS_LOG_FUNCTION
(
this
<< station);
102
}
103
void
104
ConstantRateWifiManager::DoReportFinalDataFailed
(
WifiRemoteStation
*station)
105
{
106
NS_LOG_FUNCTION
(
this
<< station);
107
}
108
109
WifiMode
110
ConstantRateWifiManager::DoGetDataMode
(
WifiRemoteStation
*st, uint32_t size)
111
{
112
NS_LOG_FUNCTION
(
this
<< st << size);
113
return
m_dataMode
;
114
}
115
WifiMode
116
ConstantRateWifiManager::DoGetRtsMode
(
WifiRemoteStation
*st)
117
{
118
NS_LOG_FUNCTION
(
this
<< st);
119
return
m_ctlMode
;
120
}
121
122
bool
123
ConstantRateWifiManager::IsLowLatency
(
void
)
const
124
{
125
NS_LOG_FUNCTION
(
this
);
126
return
true
;
127
}
128
129
}
// namespace ns3
src
wifi
model
constant-rate-wifi-manager.cc
Generated on Tue May 14 2013 11:08:35 for ns-3 by
1.8.1.2