Hi,
I'm getting the error when I try to trace the dropped packets or transmitted packets in ad hoc network.
It says:
msg="Incompatible types. (feed to "c++filt -t" if needed)
got=CallbackImpl<void,ns3::Ptr<ns3::Packet const>>
expected=CallbackImpl<void,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,ns3::Ptr<ns3::Packet const>>", file=./ns3/callback.h, line=1449
msg="when connecting to /NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Phy/PhyTxDrop", file=./ns3/traced-callback.h, line=280
terminate called without an active exception
Here is how I configure the node:
WifiHelper wifi;
wifi.SetStandard(WIFI_PHY_STANDARD_80211b);
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default();
wifiPhy.Set("RxGain", DoubleValue (0.0));
//error rate model for wifi.
wifiPhy.SetErrorRateModel("ns3::YansErrorRateModel");
wifiPhy.SetPcapDataLinkType (WifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss("ns3::RangePropagationLossModel",
"MaxRange", DoubleValue(100));
//wifiChannel.AddPropagationLoss ("ns3::FixedRssLossModel","Rss",DoubleValue (-80.0));
wifiPhy.SetChannel(wifiChannel.Create());
wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
"DataMode",StringValue ("DsssRate11Mbps"),
"ControlMode",StringValue ("DsssRate11Mbps"));
WifiMacHelper wifiMac;
wifiMac.SetType("ns3::AdhocWifiMac");
NetDeviceContainer devices = wifi.Install(wifiPhy, wifiMac, nodes);
When I do:
PcapHelper pcapHelper;
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile ("begin.pcap", std::ios::out, PcapHelper::DLT_IEEE802_11);
devices.Get(0)->TraceConnectWithoutContext("/NodeList/0/DeviceList/0/$ns3::WifiNetDevice/Phy/PhyTxBegin", MakeBoundCallback(&txBegin, file));
the generated pcap file is empty.
When I do:
std::ostringstream oss;
oss << "/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxDrop";
Config::Connect(oss.str(), MakeCallback(&txDrop));
it generates the runtime error.
The problem shouldn't be from call back signature or call back function itself.
I copied the function from the tutorial just for testing the tracesources.
When I test the CourseChange tracesource from mobility model, it works with following code:
std::ostringstream oss2;
//oss2 << "/NodeList/" << nodes.Get(0)->GetId() << "/$ns3::MobilityModel/CourseChange";
oss2 << "/NodeList/*/$ns3::MobilityModel/CourseChange";
Config::Connect(oss2.str(), MakeCallback(&CourseChange));
I've searched for some example codes, and I don't see much difference when setting up the configuration.
What could be wrong?
Thank you in advance.