diff --git a/src/spectrum/examples/adhoc-aloha-ideal-phy-matrix-propagation-loss-model.cc b/src/spectrum/examples/adhoc-aloha-ideal-phy-matrix-propagation-loss-model.cc index b9e8fb345..b8722d33b 100644 --- a/src/spectrum/examples/adhoc-aloha-ideal-phy-matrix-propagation-loss-model.cc +++ b/src/spectrum/examples/adhoc-aloha-ideal-phy-matrix-propagation-loss-model.cc @@ -80,7 +80,7 @@ public: * \param rxPhy the receiving PHY * \param lossDb the loss in dB */ - void UpdatePathloss (std::string context, Ptr txPhy, Ptr rxPhy, double lossDb); + void UpdatePathloss (std::string context, Ptr txPhy, Ptr rxPhy, double lossDb); /** * print the stored pathloss values to standard output @@ -94,10 +94,12 @@ private: void GlobalPathlossDatabase::UpdatePathloss (std::string context, - Ptr txPhy, - Ptr rxPhy, + Ptr txPhyConst, + Ptr rxPhyConst, double lossDb) { + Ptr txPhy = ConstCast (txPhyConst); + Ptr rxPhy = ConstCast (rxPhyConst); uint32_t txNodeId = txPhy->GetMobility ()->GetObject ()->GetId (); uint32_t rxNodeId = rxPhy->GetMobility ()->GetObject ()->GetId (); m_pathlossMap[txNodeId][rxNodeId] = lossDb; @@ -195,7 +197,7 @@ int main (int argc, char** argv) Config::Connect ("/NodeList/*/DeviceList/*/Phy/RxEndOk", MakeCallback (&PhyRxEndOkTrace)); GlobalPathlossDatabase globalPathlossDatabase; - Config::Connect ("/ChannelList/*/PropagationLoss", + Config::Connect ("/ChannelList/*/$ns3::SpectrumChannel/PathLoss", MakeCallback (&GlobalPathlossDatabase::UpdatePathloss, &globalPathlossDatabase)); g_rxBytes = 0;