diff --git a/src/lr-wpan/examples/lr-wpan-data.cc b/src/lr-wpan/examples/lr-wpan-data.cc index 371669355..12c0517e1 100644 --- a/src/lr-wpan/examples/lr-wpan-data.cc +++ b/src/lr-wpan/examples/lr-wpan-data.cc @@ -51,7 +51,7 @@ static void DataConfirm (McpsDataConfirmParams params) static void StateChangeNotification (std::string context, Time now, LrWpanPhyEnumeration oldState, LrWpanPhyEnumeration newState) { - NS_LOG_UNCOND (context << " state change at " << now.GetSeconds () + NS_LOG_UNCOND (context << " state change at " << now.As (Time::S) << " from " << LrWpanHelper::LrWpanPhyEnumerationPrinter (oldState) << " to " << LrWpanHelper::LrWpanPhyEnumerationPrinter (newState)); } @@ -91,8 +91,8 @@ int main (int argc, char *argv[]) } else { - Ptr mac0 = dev0->GetMac(); - Ptr mac1 = dev1->GetMac(); + Ptr mac0 = dev0->GetMac (); + Ptr mac1 = dev1->GetMac (); mac0->SetExtendedAddress (Mac64Address ("00:00:00:00:00:00:00:01")); mac1->SetExtendedAddress (Mac64Address ("00:00:00:00:00:00:00:02")); } diff --git a/src/lr-wpan/helper/lr-wpan-helper.cc b/src/lr-wpan/helper/lr-wpan-helper.cc index 26b0e6f1a..3587f83d3 100644 --- a/src/lr-wpan/helper/lr-wpan-helper.cc +++ b/src/lr-wpan/helper/lr-wpan-helper.cc @@ -47,7 +47,7 @@ AsciiLrWpanMacTransmitSinkWithContext ( std::string context, Ptr p) { - *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << context << " " << *p << std::endl; + *stream->GetStream () << "t " << Simulator::Now ().As (Time::S) << " " << context << " " << *p << std::endl; } /** @@ -60,7 +60,7 @@ AsciiLrWpanMacTransmitSinkWithoutContext ( Ptr stream, Ptr p) { - *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << *p << std::endl; + *stream->GetStream () << "t " << Simulator::Now ().As (Time::S) << " " << *p << std::endl; } LrWpanHelper::LrWpanHelper (void) diff --git a/src/lr-wpan/model/lr-wpan-csmaca.cc b/src/lr-wpan/model/lr-wpan-csmaca.cc index 30c13689c..f84a8ee0a 100644 --- a/src/lr-wpan/model/lr-wpan-csmaca.cc +++ b/src/lr-wpan/model/lr-wpan-csmaca.cc @@ -345,6 +345,7 @@ LrWpanCsmaCa::RandomBackoffDelay () { m_canProceedEvent = Simulator::Schedule (randomBackoff, &LrWpanCsmaCa::CanProceed, this); } + } } diff --git a/src/lr-wpan/model/lr-wpan-phy.cc b/src/lr-wpan/model/lr-wpan-phy.cc index a2c2745db..c7d680330 100644 --- a/src/lr-wpan/model/lr-wpan-phy.cc +++ b/src/lr-wpan/model/lr-wpan-phy.cc @@ -122,7 +122,7 @@ LrWpanPhy::GetTypeId (void) LrWpanPhy::LrWpanPhy (void) : m_edRequest (), - m_setTRXState () + m_setTRXState () { m_trxState = IEEE_802_15_4_PHY_TRX_OFF; m_trxStatePending = IEEE_802_15_4_PHY_IDLE; @@ -330,7 +330,7 @@ LrWpanPhy::StartRx (Ptr spectrumRxParams) // Add any incoming packet to the current interference before checking the // SINR. - NS_LOG_DEBUG (this << " receiving packet with power: " << 10 * log10(LrWpanSpectrumValueHelper::TotalAvgPower (lrWpanRxParams->psd, m_phyPIBAttributes.phyCurrentChannel)) + 30 << "dBm"); + NS_LOG_DEBUG (this << " receiving packet with power: " << 10 * log10 (LrWpanSpectrumValueHelper::TotalAvgPower (lrWpanRxParams->psd, m_phyPIBAttributes.phyCurrentChannel)) + 30 << "dBm"); m_signal->AddSignal (lrWpanRxParams->psd); Ptr interferenceAndNoise = m_signal->GetSignalPsd (); *interferenceAndNoise -= *lrWpanRxParams->psd; @@ -465,7 +465,7 @@ LrWpanPhy::EndRx (Ptr par) if (params == 0) { - NS_LOG_LOGIC ("Node: " << m_device->GetAddress() << " Removing interferent: " << *(par->psd)); + NS_LOG_LOGIC ("Node: " << m_device->GetAddress () << " Removing interferent: " << *(par->psd)); return; } diff --git a/src/lr-wpan/test/lr-wpan-cca-test.cc b/src/lr-wpan/test/lr-wpan-cca-test.cc index ceb4b07d4..ddae16a64 100644 --- a/src/lr-wpan/test/lr-wpan-cca-test.cc +++ b/src/lr-wpan/test/lr-wpan-cca-test.cc @@ -49,7 +49,6 @@ public: LrWpanCcaTestCase (); private: - /** * \brief Function called when PlmeCcaConfirm is hit. * \param testcase The TestCase. @@ -109,7 +108,7 @@ LrWpanCcaTestCase::LrWpanCcaTestCase () void LrWpanCcaTestCase::PlmeCcaConfirm (LrWpanCcaTestCase *testcase, Ptr device, LrWpanPhyEnumeration status) { - std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().GetSeconds () << "] " << device->GetMac ()->GetShortAddress () << " PlmeCcaConfirm: " << LrWpanHelper::LrWpanPhyEnumerationPrinter (status) << std::endl; + std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().As (Time::S) << "] " << device->GetMac ()->GetShortAddress () << " PlmeCcaConfirm: " << LrWpanHelper::LrWpanPhyEnumerationPrinter (status) << std::endl; testcase->m_status = status; } @@ -119,7 +118,7 @@ LrWpanCcaTestCase::PhyTxBegin (LrWpanCcaTestCase *testcase, Ptr { std::ostringstream os; packet->Print (os); - std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().GetSeconds () << "] " << device->GetMac ()->GetShortAddress () << " PhyTxBegin: " << os.str () << std::endl; + std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().As (Time::S) << "] " << device->GetMac ()->GetShortAddress () << " PhyTxBegin: " << os.str () << std::endl; } void @@ -127,7 +126,7 @@ LrWpanCcaTestCase::PhyTxEnd (LrWpanCcaTestCase *testcase, Ptr d { std::ostringstream os; packet->Print (os); - std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().GetSeconds () << "] " << device->GetMac ()->GetShortAddress () << " PhyTxEnd: " << os.str () << std::endl; + std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().As (Time::S) << "] " << device->GetMac ()->GetShortAddress () << " PhyTxEnd: " << os.str () << std::endl; } void @@ -135,7 +134,7 @@ LrWpanCcaTestCase::PhyRxBegin (LrWpanCcaTestCase *testcase, Ptr { std::ostringstream os; packet->Print (os); - std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().GetSeconds () << "] " << device->GetMac ()->GetShortAddress () << " PhyRxBegin: " << os.str () << std::endl; + std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().As (Time::S) << "] " << device->GetMac ()->GetShortAddress () << " PhyRxBegin: " << os.str () << std::endl; } void @@ -143,7 +142,7 @@ LrWpanCcaTestCase::PhyRxEnd (LrWpanCcaTestCase *testcase, Ptr d { std::ostringstream os; packet->Print (os); - std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().GetSeconds () << "] " << device->GetMac ()->GetShortAddress () << " PhyRxEnd (" << sinr << "): " << os.str () << std::endl; + std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().As (Time::S) << "] " << device->GetMac ()->GetShortAddress () << " PhyRxEnd (" << sinr << "): " << os.str () << std::endl; // The first packet was received. Now start a CCA, to try to detect the second packet which is still being transmitted. device->GetPhy ()->PlmeCcaRequest (); @@ -153,7 +152,7 @@ void LrWpanCcaTestCase::PhyRxDrop (LrWpanCcaTestCase *testcase, PtrPrint (os); - std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().GetSeconds () << "] " << device->GetMac ()->GetShortAddress () << " PhyRxDrop: " << os.str () << std::endl; + std::cout << std::setiosflags (std::ios::fixed) << std::setprecision (9) << "[" << Simulator::Now ().As (Time::S) << "] " << device->GetMac ()->GetShortAddress () << " PhyRxDrop: " << os.str () << std::endl; } void