|
42 |
#include "ns3/wimax-mac-header.h" |
42 |
#include "ns3/wimax-mac-header.h" |
43 |
#include "ns3/wifi-net-device.h" |
43 |
#include "ns3/wifi-net-device.h" |
44 |
#include "ns3/wifi-mac.h" |
44 |
#include "ns3/wifi-mac.h" |
|
|
45 |
#include "ns3/wave-net-device.h" |
45 |
#include "ns3/constant-position-mobility-model.h" |
46 |
#include "ns3/constant-position-mobility-model.h" |
46 |
#include "ns3/lte-ue-phy.h" |
47 |
#include "ns3/lte-ue-phy.h" |
47 |
#include "ns3/lte-enb-phy.h" |
48 |
#include "ns3/lte-enb-phy.h" |
|
778 |
AnimPacketInfo pktInfo (ndev, Simulator::Now ()); |
779 |
AnimPacketInfo pktInfo (ndev, Simulator::Now ()); |
779 |
AddPendingPacket (protocolType, gAnimUid, pktInfo); |
780 |
AddPendingPacket (protocolType, gAnimUid, pktInfo); |
780 |
|
781 |
|
781 |
Ptr<WifiNetDevice> netDevice = DynamicCast<WifiNetDevice> (ndev); |
782 |
Ptr<WifiNetDevice> wifiNetDevice = DynamicCast<WifiNetDevice> (ndev); |
782 |
if (netDevice) |
783 |
Ptr<WaveNetDevice> waveNetDevice = DynamicCast<WaveNetDevice> (ndev); |
|
|
784 |
if (wifiNetDevice || waveNetDevice) |
783 |
{ |
785 |
{ |
784 |
Mac48Address nodeAddr = netDevice->GetMac ()->GetAddress (); |
786 |
Mac48Address nodeAddr = Mac48Address::ConvertFrom (ndev->GetAddress ()); |
|
|
787 |
Ptr<Node> n = wifiNetDevice->GetNode (); |
785 |
std::ostringstream oss; |
788 |
std::ostringstream oss; |
786 |
oss << nodeAddr; |
789 |
oss << nodeAddr; |
787 |
Ptr <Node> n = netDevice->GetNode (); |
|
|
788 |
NS_ASSERT (n); |
790 |
NS_ASSERT (n); |
789 |
m_macToNodeIdMap[oss.str ()] = n->GetId (); |
791 |
m_macToNodeIdMap[oss.str ()] = n->GetId (); |
790 |
NS_LOG_INFO ("Added Mac" << oss.str () << " node:" <<m_macToNodeIdMap[oss.str ()]); |
792 |
NS_LOG_INFO ("Added Mac" << oss.str () << " node:" <<m_macToNodeIdMap[oss.str ()]); |
|
1408 |
|
1410 |
|
1409 |
ConnectLte (); |
1411 |
ConnectLte (); |
1410 |
|
1412 |
|
|
|
1413 |
// Wave Mac |
1414 |
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/MacEntities/*/MacTx", |
1415 |
MakeCallback (&AnimationInterface::WifiMacTxTrace, this)); |
1416 |
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/MacEntities/*/MacTxDrop", |
1417 |
MakeCallback (&AnimationInterface::WifiMacTxDropTrace, this)); |
1418 |
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/MacEntities/*/MacRx", |
1419 |
MakeCallback (&AnimationInterface::WifiMacRxTrace, this)); |
1420 |
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/MacEntities/*/MacRxDrop", |
1421 |
MakeCallback (&AnimationInterface::WifiMacRxDropTrace, this)); |
1422 |
|
1423 |
// Wave Phy |
1424 |
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/PhyEntities/*/PhyTxBegin", |
1425 |
MakeCallback (&AnimationInterface::WifiPhyTxBeginTrace, this)); |
1426 |
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/PhyEntities/*/PhyTxDrop", |
1427 |
MakeCallback (&AnimationInterface::WifiPhyTxDropTrace, this)); |
1428 |
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/PhyEntities/*/PhyRxBegin", |
1429 |
MakeCallback (&AnimationInterface::WifiPhyRxBeginTrace, this)); |
1430 |
Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/PhyEntities/*/PhyRxDrop", |
1431 |
MakeCallback (&AnimationInterface::WifiPhyRxDropTrace, this)); |
1432 |
|
1411 |
Config::Connect ("/NodeList/*/$ns3::Ipv4L3Protocol/Tx", |
1433 |
Config::Connect ("/NodeList/*/$ns3::Ipv4L3Protocol/Tx", |
1412 |
MakeCallback (&AnimationInterface::Ipv4TxTrace, this)); |
1434 |
MakeCallback (&AnimationInterface::Ipv4TxTrace, this)); |
1413 |
Config::Connect ("/NodeList/*/$ns3::Ipv4L3Protocol/Rx", |
1435 |
Config::Connect ("/NodeList/*/$ns3::Ipv4L3Protocol/Rx", |