|
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 |
|
26 namespace ns3 { |
|
27 |
|
28 ConstantRateWifiRemoteStation::ConstantRateWifiRemoteStation (Ptr<ConstantRateWifiManager> manager) |
|
29 : m_manager (manager) |
|
30 {} |
|
31 ConstantRateWifiRemoteStation::~ConstantRateWifiRemoteStation () |
|
32 {} |
|
33 |
|
34 void |
|
35 ConstantRateWifiRemoteStation::ReportRxOk (double rxSnr, WifiMode txMode) |
|
36 {} |
|
37 void |
|
38 ConstantRateWifiRemoteStation::ReportRtsFailed (void) |
|
39 {} |
|
40 void |
|
41 ConstantRateWifiRemoteStation::ReportDataFailed (void) |
|
42 {} |
|
43 void |
|
44 ConstantRateWifiRemoteStation::ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr) |
|
45 {} |
|
46 void |
|
47 ConstantRateWifiRemoteStation::ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr) |
|
48 {} |
|
49 void |
|
50 ConstantRateWifiRemoteStation::ReportFinalRtsFailed (void) |
|
51 {} |
|
52 void |
|
53 ConstantRateWifiRemoteStation::ReportFinalDataFailed (void) |
|
54 {} |
|
55 |
|
56 WifiMode |
|
57 ConstantRateWifiRemoteStation::DoGetDataMode (uint32_t size) |
|
58 { |
|
59 return m_manager->GetDataMode (); |
|
60 } |
|
61 WifiMode |
|
62 ConstantRateWifiRemoteStation::DoGetRtsMode (void) |
|
63 { |
|
64 return m_manager->GetCtlMode (); |
|
65 } |
|
66 Ptr<WifiRemoteStationManager> |
|
67 ConstantRateWifiRemoteStation::GetManager (void) const |
|
68 { |
|
69 return m_manager; |
|
70 } |
|
71 |
|
72 NS_OBJECT_ENSURE_REGISTERED (ConstantRateWifiManager); |
|
73 |
|
74 TypeId |
|
75 ConstantRateWifiManager::GetTypeId (void) |
|
76 { |
|
77 static TypeId tid = TypeId ("ConstantRateWifiManager") |
|
78 .SetParent<WifiRemoteStationManager> () |
|
79 .AddConstructor<ConstantRateWifiManager> () |
|
80 .AddAttribute ("DataMode", "XXX", |
|
81 String ("wifia-6mbs"), |
|
82 MakeWifiModeAccessor (&ConstantRateWifiManager::m_dataMode), |
|
83 MakeWifiModeChecker ()) |
|
84 .AddAttribute ("ControlMode", "XXX", |
|
85 String ("wifia-6mbs"), |
|
86 MakeWifiModeAccessor (&ConstantRateWifiManager::m_ctlMode), |
|
87 MakeWifiModeChecker ()) |
|
88 ; |
|
89 return tid; |
|
90 } |
|
91 |
|
92 ConstantRateWifiManager::ConstantRateWifiManager () |
|
93 {} |
|
94 ConstantRateWifiManager::~ConstantRateWifiManager () |
|
95 {} |
|
96 |
|
97 WifiMode |
|
98 ConstantRateWifiManager::GetDataMode (void) const |
|
99 { |
|
100 return m_dataMode; |
|
101 } |
|
102 WifiMode |
|
103 ConstantRateWifiManager::GetCtlMode (void) const |
|
104 { |
|
105 return m_ctlMode; |
|
106 } |
|
107 |
|
108 |
|
109 WifiRemoteStation * |
|
110 ConstantRateWifiManager::CreateStation (void) |
|
111 { |
|
112 return new ConstantRateWifiRemoteStation (this); |
|
113 } |
|
114 |
|
115 } // namespace ns3 |