74 m_delay = delay; |
74 m_delay = delay; |
75 } |
75 } |
76 |
76 |
77 void |
77 void |
78 YansWifiChannel::Send (Ptr<YansWifiPhy> sender, Ptr<const Packet> packet, double txPowerDbm, |
78 YansWifiChannel::Send (Ptr<YansWifiPhy> sender, Ptr<const Packet> packet, double txPowerDbm, |
79 WifiMode wifiMode, WifiPreamble preamble) const |
79 WifiTxVector txVector, WifiPreamble preamble) const |
80 { |
80 { |
81 Ptr<MobilityModel> senderMobility = sender->GetMobility ()->GetObject<MobilityModel> (); |
81 Ptr<MobilityModel> senderMobility = sender->GetMobility ()->GetObject<MobilityModel> (); |
82 NS_ASSERT (senderMobility != 0); |
82 NS_ASSERT (senderMobility != 0); |
83 uint32_t j = 0; |
83 uint32_t j = 0; |
|
84 WifiMode wifiMode=txVector.GetMode(); |
84 for (PhyList::const_iterator i = m_phyList.begin (); i != m_phyList.end (); i++, j++) |
85 for (PhyList::const_iterator i = m_phyList.begin (); i != m_phyList.end (); i++, j++) |
85 { |
86 { |
86 if (sender != (*i)) |
87 if (sender != (*i)) |
87 { |
88 { |
88 // For now don't account for inter channel interference |
89 // For now don't account for inter channel interference |
107 { |
108 { |
108 dstNode = dstNetDevice->GetObject<NetDevice> ()->GetNode ()->GetId (); |
109 dstNode = dstNetDevice->GetObject<NetDevice> ()->GetNode ()->GetId (); |
109 } |
110 } |
110 Simulator::ScheduleWithContext (dstNode, |
111 Simulator::ScheduleWithContext (dstNode, |
111 delay, &YansWifiChannel::Receive, this, |
112 delay, &YansWifiChannel::Receive, this, |
112 j, copy, rxPowerDbm, wifiMode, preamble); |
113 j, copy, rxPowerDbm, txVector, preamble); |
113 } |
114 } |
114 } |
115 } |
115 } |
116 } |
116 |
117 |
117 void |
118 void |
118 YansWifiChannel::Receive (uint32_t i, Ptr<Packet> packet, double rxPowerDbm, |
119 YansWifiChannel::Receive (uint32_t i, Ptr<Packet> packet, double rxPowerDbm, |
119 WifiMode txMode, WifiPreamble preamble) const |
120 WifiTxVector txVector, WifiPreamble preamble) const |
120 { |
121 { |
121 m_phyList[i]->StartReceivePacket (packet, rxPowerDbm, txMode, preamble); |
122 m_phyList[i]->StartReceivePacket (packet, rxPowerDbm, txVector, preamble); |
122 } |
123 } |
123 |
124 |
124 uint32_t |
125 uint32_t |
125 YansWifiChannel::GetNDevices (void) const |
126 YansWifiChannel::GetNDevices (void) const |
126 { |
127 { |