A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
constant-rate-wifi-manager.cc
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 *
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
111 {
112  NS_LOG_FUNCTION (this << st << size);
113  return m_dataMode;
114 }
115 WifiMode
117 {
118  NS_LOG_FUNCTION (this << st);
119  return m_ctlMode;
120 }
121 
122 bool
124 {
125  NS_LOG_FUNCTION (this);
126  return true;
127 }
128 
129 } // namespace ns3
#define NS_LOG_FUNCTION(parameters)
Definition: log.h:311
virtual WifiMode DoGetDataMode(WifiRemoteStation *station, uint32_t size)
#define NS_LOG_COMPONENT_DEFINE(name)
Definition: log.h:122
virtual WifiRemoteStation * DoCreateStation(void) const
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:88
virtual WifiMode DoGetRtsMode(WifiRemoteStation *station)
virtual bool IsLowLatency(void) const
hold per-remote-station state.