diff --git a/src/lr-wpan/examples/lr-wpan-data.cc b/src/lr-wpan/examples/lr-wpan-data.cc index 4e0aafcc9..1c058d9c3 100644 --- a/src/lr-wpan/examples/lr-wpan-data.cc +++ b/src/lr-wpan/examples/lr-wpan-data.cc @@ -74,7 +74,7 @@ int main (int argc, char *argv[]) // Enable calculation of FCS in the trailers. Only necessary when interacting with real devices or wireshark. // GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true)); - + // Create 2 nodes, and a NetDevice for each one Ptr n0 = CreateObject (); Ptr n1 = CreateObject (); @@ -146,15 +146,15 @@ int main (int argc, char *argv[]) params.m_txOptions = TX_OPTION_ACK; // dev0->GetMac ()->McpsDataRequest (params, p0); Simulator::ScheduleWithContext (1, Seconds (0.0), - &LrWpanMac::McpsDataRequest, - dev0->GetMac (), params, p0); + &LrWpanMac::McpsDataRequest, + dev0->GetMac (), params, p0); // Send a packet back at time 2 seconds Ptr p2 = Create (60); // 60 bytes of dummy data params.m_dstAddr = Mac16Address ("00:01"); Simulator::ScheduleWithContext (2, Seconds (2.0), - &LrWpanMac::McpsDataRequest, - dev1->GetMac (), params, p2); + &LrWpanMac::McpsDataRequest, + dev1->GetMac (), params, p2); Simulator::Run (); diff --git a/src/lr-wpan/helper/lr-wpan-helper.h b/src/lr-wpan/helper/lr-wpan-helper.h index 1f2208420..b1f4f6617 100644 --- a/src/lr-wpan/helper/lr-wpan-helper.h +++ b/src/lr-wpan/helper/lr-wpan-helper.h @@ -82,7 +82,7 @@ public: /** * Assign a fixed random variable stream number to the random variables - * used by this model. Return the number of streams that have been + * used by this model. Return the number of streams that have been * assigned. The Install() method should have previously been * called by the user. * diff --git a/src/lr-wpan/model/lr-wpan-interference-helper.cc b/src/lr-wpan/model/lr-wpan-interference-helper.cc index f8e11925c..8b721be7d 100644 --- a/src/lr-wpan/model/lr-wpan-interference-helper.cc +++ b/src/lr-wpan/model/lr-wpan-interference-helper.cc @@ -27,8 +27,9 @@ NS_LOG_COMPONENT_DEFINE ("LrWpanInterferenceHelper"); namespace ns3 { -LrWpanInterferenceHelper::LrWpanInterferenceHelper (Ptr spectrumModel) : - m_spectrumModel (spectrumModel), m_dirty (false) +LrWpanInterferenceHelper::LrWpanInterferenceHelper (Ptr spectrumModel) + : m_spectrumModel (spectrumModel), + m_dirty (false) { m_signal = Create (m_spectrumModel); } diff --git a/src/lr-wpan/model/lr-wpan-interference-helper.h b/src/lr-wpan/model/lr-wpan-interference-helper.h index 2491288c9..6ce4a0314 100644 --- a/src/lr-wpan/model/lr-wpan-interference-helper.h +++ b/src/lr-wpan/model/lr-wpan-interference-helper.h @@ -86,7 +86,6 @@ public: */ Ptr GetSpectrumModel (void) const; private: - /** * The helpers SpectrumModel. */ diff --git a/src/lr-wpan/model/lr-wpan-lqi-tag.h b/src/lr-wpan/model/lr-wpan-lqi-tag.h index e4c44bb6f..bbd53e868 100644 --- a/src/lr-wpan/model/lr-wpan-lqi-tag.h +++ b/src/lr-wpan/model/lr-wpan-lqi-tag.h @@ -66,7 +66,6 @@ public: */ uint8_t Get (void) const; private: - /** * The current LQI value of the tag. */ diff --git a/src/lr-wpan/model/lr-wpan-mac-header.h b/src/lr-wpan/model/lr-wpan-mac-header.h index 968111154..0d6f03f0b 100644 --- a/src/lr-wpan/model/lr-wpan-mac-header.h +++ b/src/lr-wpan/model/lr-wpan-mac-header.h @@ -46,9 +46,9 @@ namespace ns3 { -/* +/* * \ingroup lr-wpan - * Represent the Mac Header with the Frame Control and Sequence Number fields + * Represent the Mac Header with the Frame Control and Sequence Number fields */ class LrWpanMacHeader : public Header { diff --git a/src/lr-wpan/model/lr-wpan-mac-trailer.cc b/src/lr-wpan/model/lr-wpan-mac-trailer.cc index 08bf9eab7..328de24e3 100644 --- a/src/lr-wpan/model/lr-wpan-mac-trailer.cc +++ b/src/lr-wpan/model/lr-wpan-mac-trailer.cc @@ -30,7 +30,8 @@ NS_OBJECT_ENSURE_REGISTERED (LrWpanMacTrailer); const uint16_t LrWpanMacTrailer::LR_WPAN_MAC_FCS_LENGTH = 2; LrWpanMacTrailer::LrWpanMacTrailer (void) - : m_fcs (0), m_calcFcs (false) + : m_fcs (0), + m_calcFcs (false) { } @@ -92,9 +93,9 @@ LrWpanMacTrailer::SetFcs (Ptr p) uint16_t size = p->GetSize (); uint8_t *serial_packet = new uint8_t[size]; - p->CopyData(serial_packet, size); + p->CopyData (serial_packet, size); - m_fcs = GenerateCrc16(serial_packet, size); + m_fcs = GenerateCrc16 (serial_packet, size); delete[] serial_packet; } } @@ -114,9 +115,9 @@ LrWpanMacTrailer::CheckFcs (Ptr p) uint16_t size = p->GetSize (); uint8_t *serial_packet = new uint8_t[size]; - p->CopyData(serial_packet, size); + p->CopyData (serial_packet, size); - checkFcs = GenerateCrc16(serial_packet, size); + checkFcs = GenerateCrc16 (serial_packet, size); delete[] serial_packet; return (checkFcs == GetFcs ()); } @@ -144,7 +145,7 @@ LrWpanMacTrailer::GenerateCrc16 (uint8_t *data, int length) int i; uint16_t accumulator = 0; - for(i = 0; i < length; ++i) + for (i = 0; i < length; ++i) { accumulator ^= *data; accumulator = (accumulator >> 8) | (accumulator << 8); diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 2e3346976..df732b905 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -291,7 +291,7 @@ LrWpanMac::McpsDataRequest (McpsDataRequestParams params, Ptr p) if (b0 == TX_OPTION_ACK) { // Set AckReq bit only if the destination is not the broadcast address. - if (!(macHdr.GetDstAddrMode () == SHORT_ADDR && macHdr.GetShortDstAddr() == "ff:ff")) + if (!(macHdr.GetDstAddrMode () == SHORT_ADDR && macHdr.GetShortDstAddr () == "ff:ff")) { macHdr.SetAckReq (); } @@ -465,7 +465,7 @@ LrWpanMac::PdDataIndication (uint32_t psduLength, Ptr p, uint8_t lqi) } // level 1 filtering - if(!receivedMacTrailer.CheckFcs (p)) + if (!receivedMacTrailer.CheckFcs (p)) { m_macRxDropTrace (originalPkt); } @@ -601,7 +601,7 @@ LrWpanMac::PdDataIndication (uint32_t psduLength, Ptr p, uint8_t lqi) } else if (receivedMacHdr.IsAcknowledgment () && m_txPkt && m_lrWpanMacState == MAC_ACK_PENDING) { - LrWpanMacHeader macHdr;; + LrWpanMacHeader macHdr; m_txPkt->PeekHeader (macHdr); if (receivedMacHdr.GetSeqNum () == macHdr.GetSeqNum ()) { @@ -687,7 +687,7 @@ LrWpanMac::RemoveFirstTxQElement (void) pkt->RemoveHeader (hdr); if (hdr.GetShortDstAddr () != Mac16Address ("ff:ff")) { - m_sentPktTrace (p, m_retransmission+1, m_numCsmacaRetry); + m_sentPktTrace (p, m_retransmission + 1, m_numCsmacaRetry); } txQElement->txQPkt = 0; @@ -741,7 +741,7 @@ LrWpanMac::PrepareRetransmission (void) else { m_retransmission++; - m_numCsmacaRetry += m_csmaCa->GetNB () +1; + m_numCsmacaRetry += m_csmaCa->GetNB () + 1; // Start next CCA process for this packet. return true; } @@ -767,7 +767,7 @@ LrWpanMac::PdDataConfirm (LrWpanPhyEnumeration status) // wait for the ack or the next retransmission timeout // start retransmission timer Time waitTime = MicroSeconds (GetMacAckWaitDuration () * 1000 * 1000 / m_phy->GetDataOrSymbolRate (false)); - NS_ASSERT (m_ackWaitTimeout.IsExpired()); + NS_ASSERT (m_ackWaitTimeout.IsExpired ()); m_ackWaitTimeout = Simulator::Schedule (waitTime, &LrWpanMac::AckWaitTimeout, this); m_setMacState.Cancel (); m_setMacState = Simulator::ScheduleNow (&LrWpanMac::SetLrWpanMacState, this, MAC_ACK_PENDING); @@ -994,7 +994,7 @@ uint64_t LrWpanMac::GetMacAckWaitDuration (void) const { return m_csmaCa->GetUnitBackoffPeriod () + m_phy->aTurnaroundTime + m_phy->GetPhySHRDuration () - + ceil (6 * m_phy->GetPhySymbolsPerOctet ()); + + ceil (6 * m_phy->GetPhySymbolsPerOctet ()); } uint8_t diff --git a/src/lr-wpan/model/lr-wpan-mac.h b/src/lr-wpan/model/lr-wpan-mac.h index eccc9aba5..d58f4c7a7 100644 --- a/src/lr-wpan/model/lr-wpan-mac.h +++ b/src/lr-wpan/model/lr-wpan-mac.h @@ -107,10 +107,15 @@ typedef enum struct McpsDataRequestParams { - McpsDataRequestParams () : - m_srcAddrMode (SHORT_ADDR), m_dstAddrMode (SHORT_ADDR), m_dstPanId (0), - m_dstAddr (), m_msduHandle (0), m_txOptions (0) - { }; + McpsDataRequestParams () + : m_srcAddrMode (SHORT_ADDR), + m_dstAddrMode (SHORT_ADDR), + m_dstPanId (0), + m_dstAddr (), + m_msduHandle (0), + m_txOptions (0) + { + } LrWpanAddressMode m_srcAddrMode; LrWpanAddressMode m_dstAddrMode; uint16_t m_dstPanId; @@ -388,7 +393,7 @@ public: * See IEEE 802.15.4-2006, section 7.4.1, Table 85. */ uint64_t m_aBaseSuperframeDuration; - + //MAC PIB attributes /** * The time that the device transmitted its last beacon frame, in symbol @@ -443,7 +448,7 @@ public: * See IEEE 802.15.4-2006, section 7.4.2, Table 86. */ uint8_t m_macMaxFrameRetries; - + /** * Indication of whether the MAC sublayer is to enable its receiver during * idle periods. diff --git a/src/lr-wpan/model/lr-wpan-net-device.cc b/src/lr-wpan/model/lr-wpan-net-device.cc index 9bc07ac76..7e6bb8cea 100644 --- a/src/lr-wpan/model/lr-wpan-net-device.cc +++ b/src/lr-wpan/model/lr-wpan-net-device.cc @@ -61,9 +61,9 @@ LrWpanNetDevice::GetTypeId (void) &LrWpanNetDevice::SetMac), MakePointerChecker ()) .AddAttribute ("UseAcks", "Request acknowledgments for data frames.", - BooleanValue (true), - MakeBooleanAccessor (&LrWpanNetDevice::m_useAcks), - MakeBooleanChecker ()) + BooleanValue (true), + MakeBooleanAccessor (&LrWpanNetDevice::m_useAcks), + MakeBooleanChecker ()) ; return tid; } diff --git a/src/lr-wpan/model/lr-wpan-phy.cc b/src/lr-wpan/model/lr-wpan-phy.cc index eae81ee4e..4cadd20a6 100644 --- a/src/lr-wpan/model/lr-wpan-phy.cc +++ b/src/lr-wpan/model/lr-wpan-phy.cc @@ -486,7 +486,7 @@ LrWpanPhy::PdDataRequest (const uint32_t psduLength, Ptr p) } // Prevent PHY from sending a packet while switching the transceiver state. - if (!m_setTRXState.IsRunning()) + if (!m_setTRXState.IsRunning ()) { if (m_trxState == IEEE_802_15_4_PHY_TX_ON) { @@ -657,7 +657,7 @@ LrWpanPhy::PlmeSetTRXStateRequest (LrWpanPhyEnumeration state) { NS_LOG_DEBUG ("Cancel m_setTRXState"); // Keep the transceiver state as the old state before the switching attempt. - m_setTRXState.Cancel(); + m_setTRXState.Cancel (); } } if (m_trxStatePending != IEEE_802_15_4_PHY_IDLE) @@ -1352,7 +1352,7 @@ LrWpanPhy::GetPhySHRDuration (void) const NS_ASSERT (m_phyOption < IEEE_802_15_4_INVALID_PHY_OPTION); return ppduHeaderSymbolNumbers[m_phyOption].shrPreamble - + ppduHeaderSymbolNumbers[m_phyOption].shrSfd; + + ppduHeaderSymbolNumbers[m_phyOption].shrSfd; } double diff --git a/src/lr-wpan/model/lr-wpan-phy.h b/src/lr-wpan/model/lr-wpan-phy.h index d63a216a1..7a34672a2 100644 --- a/src/lr-wpan/model/lr-wpan-phy.h +++ b/src/lr-wpan/model/lr-wpan-phy.h @@ -407,7 +407,7 @@ public: * @return pointer to LrWpanErrorModel in use */ Ptr GetErrorModel (void) const; - + /** * Get the duration of the SHR (preamble and SFD) in symbols, depending on * the currently selected channel. @@ -423,7 +423,7 @@ public: * \return the number of symbols per octet */ double GetPhySymbolsPerOctet (void) const; - + /** * Assign a fixed random variable stream number to the random variables * used by this model. Return the number of streams that have been assigned. diff --git a/src/lr-wpan/model/lr-wpan-spectrum-value-helper.cc b/src/lr-wpan/model/lr-wpan-spectrum-value-helper.cc index 64b5963a7..7bced9da1 100644 --- a/src/lr-wpan/model/lr-wpan-spectrum-value-helper.cc +++ b/src/lr-wpan/model/lr-wpan-spectrum-value-helper.cc @@ -90,7 +90,7 @@ LrWpanSpectrumValueHelper::CreateTxPowerSpectralDensity (double txPower, uint32_ (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 2 ] = txPowerDensity * 0.005; // If more power is allocated to more subbands in future revisions of - // this model, make sure to renormalize so that the integral of the + // this model, make sure to renormalize so that the integral of the // txPsd still equals txPower return txPsd; diff --git a/src/lr-wpan/test/lr-wpan-ack-test.cc b/src/lr-wpan/test/lr-wpan-ack-test.cc index cb7d17a96..5346c9906 100644 --- a/src/lr-wpan/test/lr-wpan-ack-test.cc +++ b/src/lr-wpan/test/lr-wpan-ack-test.cc @@ -114,7 +114,7 @@ LrWpanAckTestCase::DoRun (void) // Enable calculation of FCS in the trailers. Only necessary when interacting with real devices or wireshark. // GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true)); - + // Set the random seed and run number for this test RngSeedManager::SetSeed (1); RngSeedManager::SetRun (6); diff --git a/src/lr-wpan/test/lr-wpan-collision-test.cc b/src/lr-wpan/test/lr-wpan-collision-test.cc index 067b1bc35..550d51633 100644 --- a/src/lr-wpan/test/lr-wpan-collision-test.cc +++ b/src/lr-wpan/test/lr-wpan-collision-test.cc @@ -59,7 +59,7 @@ LrWpanCollisionTestCase::~LrWpanCollisionTestCase () void LrWpanCollisionTestCase::DataIndication (McpsDataIndicationParams params, Ptr p) { - m_rxPackets ++; + m_rxPackets++; } diff --git a/src/lr-wpan/test/lr-wpan-ed-test.cc b/src/lr-wpan/test/lr-wpan-ed-test.cc index 8fdec66f3..d3bbd7499 100644 --- a/src/lr-wpan/test/lr-wpan-ed-test.cc +++ b/src/lr-wpan/test/lr-wpan-ed-test.cc @@ -62,7 +62,7 @@ LrWpanEdTestCase::LrWpanEdTestCase () void LrWpanEdTestCase::PlmeEdConfirm (LrWpanPhyEnumeration status, uint8_t level) { - NS_LOG_UNCOND ("Energy Detection completed with status " << LrWpanHelper::LrWpanPhyEnumerationPrinter(status) << " and energy level " << static_cast (level)); + NS_LOG_UNCOND ("Energy Detection completed with status " << LrWpanHelper::LrWpanPhyEnumerationPrinter (status) << " and energy level " << static_cast (level)); m_status = status; m_level = level; } @@ -92,7 +92,7 @@ LrWpanEdTestCase::DoRun (void) // Set the random seed and run number for this test RngSeedManager::SetSeed (1); RngSeedManager::SetRun (6); - + // Create 2 nodes, and a NetDevice for each one Ptr n0 = CreateObject (); Ptr n1 = CreateObject ();