LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2006,2007 INRIA | 3 * Copyright (c) 2006,2007 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 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 | 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 | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Mathieu Lacage, <mathieu.lacage@sophia.inria.fr> | 18 * Author: Mathieu Lacage, <mathieu.lacage@sophia.inria.fr> |
19 */ | 19 */ |
20 | 20 |
| 21 #include "ns3/packet.h" |
21 #include "ns3/simulator.h" | 22 #include "ns3/simulator.h" |
22 #include "ns3/log.h" | 23 #include "ns3/log.h" |
23 #include "ns3/pointer.h" | 24 #include "ns3/pointer.h" |
24 #include "yans-wifi-channel.h" | 25 #include "ns3/net-device.h" |
| 26 #include "ns3/node.h" |
25 #include "ns3/propagation-loss-model.h" | 27 #include "ns3/propagation-loss-model.h" |
26 #include "ns3/propagation-delay-model.h" | 28 #include "ns3/propagation-delay-model.h" |
| 29 #include "ns3/mobility-model.h" |
| 30 #include "yans-wifi-channel.h" |
| 31 #include "yans-wifi-phy.h" |
27 #include "wifi-utils.h" | 32 #include "wifi-utils.h" |
28 | 33 |
29 namespace ns3 { | 34 namespace ns3 { |
30 | 35 |
31 NS_LOG_COMPONENT_DEFINE ("YansWifiChannel"); | 36 NS_LOG_COMPONENT_DEFINE ("YansWifiChannel"); |
32 | 37 |
33 NS_OBJECT_ENSURE_REGISTERED (YansWifiChannel); | 38 NS_OBJECT_ENSURE_REGISTERED (YansWifiChannel); |
34 | 39 |
35 TypeId | 40 TypeId |
36 YansWifiChannel::GetTypeId (void) | 41 YansWifiChannel::GetTypeId (void) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void | 124 void |
120 YansWifiChannel::Receive (Ptr<YansWifiPhy> phy, Ptr<Packet> packet, double rxPow
erDbm, Time duration) | 125 YansWifiChannel::Receive (Ptr<YansWifiPhy> phy, Ptr<Packet> packet, double rxPow
erDbm, Time duration) |
121 { | 126 { |
122 NS_LOG_FUNCTION (phy << packet << rxPowerDbm << duration.GetSeconds ()); | 127 NS_LOG_FUNCTION (phy << packet << rxPowerDbm << duration.GetSeconds ()); |
123 phy->StartReceivePreambleAndHeader (packet, DbmToW (rxPowerDbm + phy->GetRxGai
n ()), duration); | 128 phy->StartReceivePreambleAndHeader (packet, DbmToW (rxPowerDbm + phy->GetRxGai
n ()), duration); |
124 } | 129 } |
125 | 130 |
126 uint32_t | 131 uint32_t |
127 YansWifiChannel::GetNDevices (void) const | 132 YansWifiChannel::GetNDevices (void) const |
128 { | 133 { |
129 return static_cast<uint32_t> (m_phyList.size ()); | 134 return static_cast<uint32_t> (m_phyList.size ()); |
130 } | 135 } |
131 | 136 |
132 Ptr<NetDevice> | 137 Ptr<NetDevice> |
133 YansWifiChannel::GetDevice (uint32_t i) const | 138 YansWifiChannel::GetDevice (uint32_t i) const |
134 { | 139 { |
135 return m_phyList[i]->GetDevice ()->GetObject<NetDevice> (); | 140 return m_phyList[i]->GetDevice ()->GetObject<NetDevice> (); |
136 } | 141 } |
137 | 142 |
138 void | 143 void |
139 YansWifiChannel::Add (Ptr<YansWifiPhy> phy) | 144 YansWifiChannel::Add (Ptr<YansWifiPhy> phy) |
140 { | 145 { |
141 NS_LOG_FUNCTION (this << phy); | 146 NS_LOG_FUNCTION (this << phy); |
142 m_phyList.push_back (phy); | 147 m_phyList.push_back (phy); |
143 } | 148 } |
144 | 149 |
145 int64_t | 150 int64_t |
146 YansWifiChannel::AssignStreams (int64_t stream) | 151 YansWifiChannel::AssignStreams (int64_t stream) |
147 { | 152 { |
148 NS_LOG_FUNCTION (this << stream); | 153 NS_LOG_FUNCTION (this << stream); |
149 int64_t currentStream = stream; | 154 int64_t currentStream = stream; |
150 currentStream += m_loss->AssignStreams (stream); | 155 currentStream += m_loss->AssignStreams (stream); |
151 return (currentStream - stream); | 156 return (currentStream - stream); |
152 } | 157 } |
153 | 158 |
154 } //namespace ns3 | 159 } //namespace ns3 |
LEFT | RIGHT |