Bug 2466

Summary: a small bug in the AnimationInterface::ConnectCallbacks method
Product: ns-3 Reporter: Junling Bu <linlinjavaer>
Component: netanimAssignee: John Abraham <john.abraham.in>
Status: NEW ---    
Severity: minor CC: ns-bugs, riley
Priority: P5    
Version: unspecified   
Hardware: PC   
OS: Linux   

Description Junling Bu 2016-08-07 09:33:05 EDT
Hi, 
   I think this is really a small bug in the AnimationInterface::ConnectCallbacks method

  1374 void 
  1375 AnimationInterface::ConnectCallbacks ()
  1376 {
  1377   // Connect the callbacks
  1378   Config::Connect ("/ChannelList/*/TxRxPointToPoint",
  1379                    MakeCallback (&AnimationInterface::DevTxTrace, this));
  1380   Config::Connect ("NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxBegin",
  1381                    MakeCallback (&AnimationInterface::WifiPhyTxBeginTrace, this));
  1382   Config::Connect ("NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxBegin",
  1383                    MakeCallback (&AnimationInterface::WifiPhyRxBeginTrace, this));
  1384   Config::ConnectWithoutContext ("/NodeList/*/$ns3::MobilityModel/CourseChange",
  1385                    MakeCallback (&AnimationInterface::MobilityCourseChangeTrace, this));
  1386   Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WimaxNetDevice/Tx",

At the line 1380 and 1382, I think we miss '/' which should be "/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxBegin" and "/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxBegin".

Another point I noticed  is that Config::ConnectWithoutContext at line 1384. 
Since all callbacks use Config::Connect except for "CourseChange", is there any special reason that we cannot use it for "CourseChange".

Thanks.

Junling
Comment 1 John Abraham 2016-08-09 22:01:32 EDT
It doesn't seem to make a difference for some reason. With/without the change the I get the same number for below

#ns-3-dev john$ ./waf --run wireless-animation &> out
#ns-3-dev john$ grep WifiPhyTxBegin out | wc -l
    1482

But I pushed it anyway

http://code.nsnam.org/ns-3-dev/rev/b7f2dfe39e02
Comment 2 John Abraham 2016-08-09 22:17:37 EDT
I think it is because the mobility model is aggregated to a node (optionally) much later than the  the other models, which are aggregated closer to the creation of the stack.

But I'm not sure at this point