--- a/src/wifi/model/yans-wifi-channel.cc Wed Jul 08 00:09:46 2015 +0200
+++ b/src/wifi/model/yans-wifi-channel.cc Wed Jul 08 23:44:17 2015 +0200
@@ -27,7 +27,6 @@
#include "ns3/pointer.h"
#include "ns3/object-factory.h"
#include "yans-wifi-channel.h"
-#include "yans-wifi-phy.h"
#include "ns3/propagation-loss-model.h"
#include "ns3/propagation-delay-model.h"
@@ -80,7 +79,7 @@
void
YansWifiChannel::Send (Ptr<YansWifiPhy> sender, Ptr<const Packet> packet, double txPowerDbm,
- WifiTxVector txVector, WifiPreamble preamble, uint8_t packetType, Time duration) const
+ WifiTxVector txVector, WifiPreamble preamble, struct mpduInfo aMpdu, Time duration) const
{
Ptr<MobilityModel> senderMobility = sender->GetMobility ()->GetObject<MobilityModel> ();
NS_ASSERT (senderMobility != 0);
@@ -112,24 +111,24 @@
dstNode = dstNetDevice->GetObject<NetDevice> ()->GetNode ()->GetId ();
}
- double *atts = new double[3];
- *atts = rxPowerDbm;
- *(atts + 1) = packetType;
- *(atts + 2) = duration.GetNanoSeconds ();
+ struct Parameters parameters;
+ parameters.rxPowerDbm = rxPowerDbm;
+ parameters.aMpdu = aMpdu;
+ parameters.duration = duration;
+ parameters.txVector = txVector;
+ parameters.preamble = preamble;
Simulator::ScheduleWithContext (dstNode,
delay, &YansWifiChannel::Receive, this,
- j, copy, atts, txVector, preamble);
+ j, copy, parameters);
}
}
}
void
-YansWifiChannel::Receive (uint32_t i, Ptr<Packet> packet, double *atts,
- WifiTxVector txVector, WifiPreamble preamble) const
+YansWifiChannel::Receive (uint32_t i, Ptr<Packet> packet, struct Parameters parameters) const
{
- m_phyList[i]->StartReceivePreambleAndHeader (packet, *atts, txVector, preamble, *(atts + 1), NanoSeconds (*(atts + 2)));
- delete[] atts;
+ m_phyList[i]->StartReceivePreambleAndHeader (packet, parameters.rxPowerDbm, parameters.txVector, parameters.preamble, parameters.aMpdu, parameters.duration);
}
uint32_t