From ced7e9e1fceccff71b1b15e258c7a12c48afa0f3 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Sun, 22 Jan 2017 01:59:10 +0100 Subject: [PATCH] lr-wpan: doxygen updates (thanks to Robert Ammon) --- src/lr-wpan/model/lr-wpan-csmaca.h | 2 + src/lr-wpan/model/lr-wpan-lqi-tag.h | 1 + src/lr-wpan/model/lr-wpan-mac-header.h | 2 +- src/lr-wpan/model/lr-wpan-net-device.h | 2 + src/lr-wpan/model/lr-wpan-phy.h | 1 + .../lr-wpan-spectrum-signal-parameters.h | 1 + src/lr-wpan/test/lr-wpan-ack-test.cc | 44 +++++++++++++--- src/lr-wpan/test/lr-wpan-cca-test.cc | 52 ++++++++++++++++++- src/lr-wpan/test/lr-wpan-collision-test.cc | 23 ++++++-- src/lr-wpan/test/lr-wpan-ed-test.cc | 21 +++++++- src/lr-wpan/test/lr-wpan-error-model-test.cc | 34 ++++++++++-- src/lr-wpan/test/lr-wpan-packet-test.cc | 16 ++++-- src/lr-wpan/test/lr-wpan-pd-plme-sap-test.cc | 29 ++++++++--- .../lr-wpan-spectrum-value-helper-test.cc | 15 +++++- 14 files changed, 213 insertions(+), 30 deletions(-) diff --git a/src/lr-wpan/model/lr-wpan-csmaca.h b/src/lr-wpan/model/lr-wpan-csmaca.h index a46e72ce9..ce1471274 100644 --- a/src/lr-wpan/model/lr-wpan-csmaca.h +++ b/src/lr-wpan/model/lr-wpan-csmaca.h @@ -32,6 +32,8 @@ namespace ns3 { class UniformRandomVariable; /** + * \ingroup lr-wpan + * * This method informs the MAC whether the channel is idle or busy. */ typedef Callback LrWpanMacStateCallback; diff --git a/src/lr-wpan/model/lr-wpan-lqi-tag.h b/src/lr-wpan/model/lr-wpan-lqi-tag.h index bbd53e868..c6ddfbb29 100644 --- a/src/lr-wpan/model/lr-wpan-lqi-tag.h +++ b/src/lr-wpan/model/lr-wpan-lqi-tag.h @@ -44,6 +44,7 @@ public: /** * Create a LrWpanLqiTag with the given LQI value. + * \param lqi The LQI. */ LrWpanLqiTag (uint8_t lqi); diff --git a/src/lr-wpan/model/lr-wpan-mac-header.h b/src/lr-wpan/model/lr-wpan-mac-header.h index 8b36591d6..dd5ee6ec4 100644 --- a/src/lr-wpan/model/lr-wpan-mac-header.h +++ b/src/lr-wpan/model/lr-wpan-mac-header.h @@ -470,7 +470,7 @@ private: { uint32_t m_auxKeyIdKeySrc32; //!< Auxiliary security header - Key Source (4 Octets) uint64_t m_auxKeyIdKeySrc64; //!< Auxiliary security header - Key Source (8 Octets) - }; + }; //!< Auxiliary security header uint8_t m_auxKeyIdKeyIndex; //!< Auxiliary security header - Key Index (1 Octet) diff --git a/src/lr-wpan/model/lr-wpan-net-device.h b/src/lr-wpan/model/lr-wpan-net-device.h index 491985c15..fd55f2d46 100644 --- a/src/lr-wpan/model/lr-wpan-net-device.h +++ b/src/lr-wpan/model/lr-wpan-net-device.h @@ -115,10 +115,12 @@ public: virtual Ptr GetChannel (void) const; /** * This method indirects to LrWpanMac::SetShortAddress () + * \param address The short address. */ virtual void SetAddress (Address address); /** * This method indirects to LrWpanMac::SetShortAddress () + * \returns The short address. */ virtual Address GetAddress (void) const; virtual bool SetMtu (const uint16_t mtu); diff --git a/src/lr-wpan/model/lr-wpan-phy.h b/src/lr-wpan/model/lr-wpan-phy.h index ad034dff8..f76be662f 100644 --- a/src/lr-wpan/model/lr-wpan-phy.h +++ b/src/lr-wpan/model/lr-wpan-phy.h @@ -595,6 +595,7 @@ private: /** * Calculate the time required for sending the PPDU header, that is the * preamble, SFD and PHR. + * \returns The time required for sending the PPDU header. */ Time GetPpduHeaderTxTime (void); diff --git a/src/lr-wpan/model/lr-wpan-spectrum-signal-parameters.h b/src/lr-wpan/model/lr-wpan-spectrum-signal-parameters.h index f8b00d16e..19d8ff82e 100644 --- a/src/lr-wpan/model/lr-wpan-spectrum-signal-parameters.h +++ b/src/lr-wpan/model/lr-wpan-spectrum-signal-parameters.h @@ -46,6 +46,7 @@ struct LrWpanSpectrumSignalParameters : public SpectrumSignalParameters /** * copy constructor + * \param p the object to copy from. */ LrWpanSpectrumSignalParameters (const LrWpanSpectrumSignalParameters& p); diff --git a/src/lr-wpan/test/lr-wpan-ack-test.cc b/src/lr-wpan/test/lr-wpan-ack-test.cc index 79f972301..92b3ad85d 100644 --- a/src/lr-wpan/test/lr-wpan-ack-test.cc +++ b/src/lr-wpan/test/lr-wpan-ack-test.cc @@ -34,26 +34,48 @@ using namespace ns3; -using namespace ns3; - NS_LOG_COMPONENT_DEFINE ("lr-wpan-ack-test"); +/** + * \ingroup lr-wpan + * \defgroup lr-wpan-test LrWpan module tests + */ + +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan ACK Test + */ class LrWpanAckTestCase : public TestCase { public: LrWpanAckTestCase (); + /** + * \brief Function called when DataIndication is hit. + * \param testCase The TestCase. + * \param dev The LrWpanNetDevice. + * \param params The MCPS params. + * \param p the packet. + */ static void DataIndication (LrWpanAckTestCase *testCase, Ptr dev, McpsDataIndicationParams params, Ptr p); + /** + * \brief Function called when DataConfirm is hit. + * \param testCase The TestCase. + * \param dev The LrWpanNetDevice. + * \param params The MCPS params. + */ static void DataConfirm (LrWpanAckTestCase *testCase, Ptr dev, McpsDataConfirmParams params); private: virtual void DoRun (void); - Time m_requestTime; - Time m_requestAckTime; - Time m_replyTime; - Time m_replyAckTime; - Time m_replyArrivalTime; + Time m_requestTime; //!< Request time. + Time m_requestAckTime; //!< Request ack time. + Time m_replyTime; //!< Reply time. + Time m_replyAckTime; //!< Reply ack time. + Time m_replyArrivalTime; //!< Reply arrival time. }; LrWpanAckTestCase::LrWpanAckTestCase () @@ -108,7 +130,7 @@ LrWpanAckTestCase::DoRun (void) // Test setup: // Two nodes well in communication range. // Node 1 sends a request packet to node 2 with ACK request bit set. Node 2 - // immediately answers with a reply packet on receiption of the request. + // immediately answers with a reply packet on reception of the request. // We expect the ACK of the request packet to always arrive at node 1 before // the reply packet sent by node 2. @@ -192,6 +214,12 @@ LrWpanAckTestCase::DoRun (void) Simulator::Destroy (); } +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan ACK TestSuite + */ class LrWpanAckTestSuite : public TestSuite { public: diff --git a/src/lr-wpan/test/lr-wpan-cca-test.cc b/src/lr-wpan/test/lr-wpan-cca-test.cc index 0ef73656c..4a4f3dfd2 100644 --- a/src/lr-wpan/test/lr-wpan-cca-test.cc +++ b/src/lr-wpan/test/lr-wpan-cca-test.cc @@ -39,22 +39,66 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE ("lr-wpan-clear-channel-assessment-test"); +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan CCA Test + */ class LrWpanCcaTestCase : public TestCase { public: LrWpanCcaTestCase (); private: + + /** + * \brief Function called when PlmeCcaConfirm is hit. + * \param testcase The TestCase. + * \param device The LrWpanNetDevice. + * \param status The device status. + */ static void PlmeCcaConfirm (LrWpanCcaTestCase *testcase, Ptr device, LrWpanPhyEnumeration status); + /** + * \brief Function called when PhyTxBegin is hit. + * \param testcase The TestCase. + * \param device The LrWpanNetDevice. + * \param packet The packet. + */ static void PhyTxBegin (LrWpanCcaTestCase *testcase, Ptr device, Ptr packet); + /** + * \brief Function called when PhyTxEnd is hit. + * \param testcase The TestCase. + * \param device The LrWpanNetDevice. + * \param packet The packet. + */ static void PhyTxEnd (LrWpanCcaTestCase *testcase, Ptr device, Ptr packet); + /** + * \brief Function called when PhyRxBegin is hit. + * \param testcase The TestCase. + * \param device The LrWpanNetDevice. + * \param packet The packet. + */ static void PhyRxBegin (LrWpanCcaTestCase *testcase, Ptr device, Ptr packet); + /** + * \brief Function called when PhyRxEnd is hit. + * \param testcase The TestCase. + * \param device The LrWpanNetDevice. + * \param packet The packet. + * \param sinr The received SINR. + */ static void PhyRxEnd (LrWpanCcaTestCase *testcase, Ptr device, Ptr packet, double sinr); + /** + * \brief Function called when PhyRxDrop is hit. + * \param testcase The TestCase. + * \param device The LrWpanNetDevice. + * \param packet The packet. + */ static void PhyRxDrop (LrWpanCcaTestCase *testcase, Ptr device, Ptr packet); virtual void DoRun (void); - LrWpanPhyEnumeration m_status; + LrWpanPhyEnumeration m_status; //!< PHY status. }; @@ -250,6 +294,12 @@ LrWpanCcaTestCase::DoRun (void) Simulator::Destroy (); } +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan ACK TestSuite + */ class LrWpanCcaTestSuite : public TestSuite { public: diff --git a/src/lr-wpan/test/lr-wpan-collision-test.cc b/src/lr-wpan/test/lr-wpan-collision-test.cc index 50af2f27c..71785ba07 100644 --- a/src/lr-wpan/test/lr-wpan-collision-test.cc +++ b/src/lr-wpan/test/lr-wpan-collision-test.cc @@ -33,18 +33,28 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE ("lr-wpan-collision-test"); -// This is an example TestCase. +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan Collision Test + */ class LrWpanCollisionTestCase : public TestCase { public: LrWpanCollisionTestCase (); virtual ~LrWpanCollisionTestCase (); - void DataIndication (McpsDataIndicationParams params, Ptr p); + /** + * \brief Function called when DataIndication is hit. + * \param params The MCPS params. + * \param p The packet. + */ + void DataIndication (McpsDataIndicationParams params, Ptr p); private: virtual void DoRun (void); - uint8_t m_rxPackets; + uint8_t m_rxPackets; //!< Rx packets counter. }; LrWpanCollisionTestCase::LrWpanCollisionTestCase () @@ -214,7 +224,12 @@ LrWpanCollisionTestCase::DoRun (void) Simulator::Destroy (); } -// ============================================================================== +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan Collision TestSuite + */ class LrWpanCollisionTestSuite : public TestSuite { public: diff --git a/src/lr-wpan/test/lr-wpan-ed-test.cc b/src/lr-wpan/test/lr-wpan-ed-test.cc index 18cdbfb9c..ad18ead9d 100644 --- a/src/lr-wpan/test/lr-wpan-ed-test.cc +++ b/src/lr-wpan/test/lr-wpan-ed-test.cc @@ -38,6 +38,12 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE ("lr-wpan-energy-detection-test"); +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan Energy Detection Test + */ class LrWpanEdTestCase : public TestCase { public: @@ -46,10 +52,15 @@ public: private: virtual void DoRun (void); + /** + * \brief Function called when PlmeEdConfirm is hit. + * \param status The PHY status. + * \param level The ED level. + */ void PlmeEdConfirm (LrWpanPhyEnumeration status, uint8_t level); - LrWpanPhyEnumeration m_status; - uint8_t m_level; + LrWpanPhyEnumeration m_status; //!< PHY status. + uint8_t m_level; //!< ED level. }; LrWpanEdTestCase::LrWpanEdTestCase () @@ -243,6 +254,12 @@ LrWpanEdTestCase::DoRun (void) Simulator::Destroy (); } +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan Energy Detection TestSuite + */ class LrWpanEdTestSuite : public TestSuite { public: diff --git a/src/lr-wpan/test/lr-wpan-error-model-test.cc b/src/lr-wpan/test/lr-wpan-error-model-test.cc index c25ea1db3..99995333f 100644 --- a/src/lr-wpan/test/lr-wpan-error-model-test.cc +++ b/src/lr-wpan/test/lr-wpan-error-model-test.cc @@ -37,11 +37,22 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE ("lr-wpan-error-model-test"); +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan Error Vs Distance Test + */ class LrWpanErrorDistanceTestCase : public TestCase { public: LrWpanErrorDistanceTestCase (); virtual ~LrWpanErrorDistanceTestCase (); + + /** + * \brief Get the number of received packets. + * \returns The number of received packets. + */ uint32_t GetReceived (void) const { return m_received; @@ -49,10 +60,22 @@ public: private: virtual void DoRun (void); + + /** + * \brief Function to be called when a packet is received. + * \param params MCPS params. + * \param p The packet. + */ void Callback (McpsDataIndicationParams params, Ptr p); - uint32_t m_received; + uint32_t m_received; //!< The number of received packets. }; +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan Error model Test + */ class LrWpanErrorModelTestCase : public TestCase { public: @@ -175,7 +198,12 @@ LrWpanErrorModelTestCase::DoRun (void) NS_TEST_ASSERT_MSG_EQ_TOL (ber, 0.175, 0.001, "Model fails for SNR = " << snr); } -// ============================================================================== +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan Error model TestSuite + */ class LrWpanErrorModelTestSuite : public TestSuite { public: @@ -189,4 +217,4 @@ LrWpanErrorModelTestSuite::LrWpanErrorModelTestSuite () AddTestCase (new LrWpanErrorDistanceTestCase, TestCase::QUICK); } -static LrWpanErrorModelTestSuite lrWpanErrorModelTestSuite; +static LrWpanErrorModelTestSuite g_lrWpanErrorModelTestSuite; diff --git a/src/lr-wpan/test/lr-wpan-packet-test.cc b/src/lr-wpan/test/lr-wpan-packet-test.cc index 825bada29..d88ca1629 100644 --- a/src/lr-wpan/test/lr-wpan-packet-test.cc +++ b/src/lr-wpan/test/lr-wpan-packet-test.cc @@ -30,7 +30,12 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE ("lr-wpan-packet-test"); -// This is an example TestCase. +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan header and trailer Test + */ class LrWpanPacketTestCase : public TestCase { public: @@ -104,7 +109,12 @@ LrWpanPacketTestCase::DoRun (void) } -// ============================================================================== +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan header and trailer TestSuite + */ class LrWpanPacketTestSuite : public TestSuite { public: @@ -117,4 +127,4 @@ LrWpanPacketTestSuite::LrWpanPacketTestSuite () AddTestCase (new LrWpanPacketTestCase, TestCase::QUICK); } -static LrWpanPacketTestSuite lrWpanPacketTestSuite; +static LrWpanPacketTestSuite g_lrWpanPacketTestSuite; diff --git a/src/lr-wpan/test/lr-wpan-pd-plme-sap-test.cc b/src/lr-wpan/test/lr-wpan-pd-plme-sap-test.cc index 8128db5c5..f9794cae6 100644 --- a/src/lr-wpan/test/lr-wpan-pd-plme-sap-test.cc +++ b/src/lr-wpan/test/lr-wpan-pd-plme-sap-test.cc @@ -27,7 +27,12 @@ using namespace ns3; -// This is an example TestCase. +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan PLME and PD Interfaces Test + */ class LrWpanPlmeAndPdInterfaceTestCase : public TestCase { public: @@ -36,7 +41,14 @@ public: private: virtual void DoRun (void); - void ReceivePdDataInndication (uint32_t psduLength, Ptr p, uint8_t lqi); + + /** + * \brief Receives a PdData indication + * \param psduLength The PSDU length. + * \param p The packet. + * \param lqi The LQI. + */ + void ReceivePdDataIndication (uint32_t psduLength, Ptr p, uint8_t lqi); }; LrWpanPlmeAndPdInterfaceTestCase::LrWpanPlmeAndPdInterfaceTestCase () @@ -49,7 +61,7 @@ LrWpanPlmeAndPdInterfaceTestCase::~LrWpanPlmeAndPdInterfaceTestCase () } void -LrWpanPlmeAndPdInterfaceTestCase::ReceivePdDataInndication (uint32_t psduLength, +LrWpanPlmeAndPdInterfaceTestCase::ReceivePdDataIndication (uint32_t psduLength, Ptr p, uint8_t lqi) { @@ -72,7 +84,7 @@ LrWpanPlmeAndPdInterfaceTestCase::DoRun (void) receiver->SetChannel (channel); receiver->SetPdDataIndicationCallback (MakeCallback ( - &LrWpanPlmeAndPdInterfaceTestCase::ReceivePdDataInndication, + &LrWpanPlmeAndPdInterfaceTestCase::ReceivePdDataIndication, this)); uint32_t n = 10; @@ -82,7 +94,12 @@ LrWpanPlmeAndPdInterfaceTestCase::DoRun (void) Simulator::Destroy (); } -// ============================================================================== +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan PLME and PD Interfaces TestSuite + */ class LrWpanPlmeAndPdInterfaceTestSuite : public TestSuite { public: @@ -96,4 +113,4 @@ LrWpanPlmeAndPdInterfaceTestSuite::LrWpanPlmeAndPdInterfaceTestSuite () } // Do not forget to allocate an instance of this TestSuite -static LrWpanPlmeAndPdInterfaceTestSuite lrWpanPlmeAndPdInterfaceTestSuite; +static LrWpanPlmeAndPdInterfaceTestSuite g_lrWpanPlmeAndPdInterfaceTestSuite; diff --git a/src/lr-wpan/test/lr-wpan-spectrum-value-helper-test.cc b/src/lr-wpan/test/lr-wpan-spectrum-value-helper-test.cc index 51539837a..b1a48d298 100644 --- a/src/lr-wpan/test/lr-wpan-spectrum-value-helper-test.cc +++ b/src/lr-wpan/test/lr-wpan-spectrum-value-helper-test.cc @@ -26,6 +26,12 @@ using namespace ns3; +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan SpectrumValue Helper TestSuite + */ class LrWpanSpectrumValueHelperTestCase : public TestCase { public: @@ -64,7 +70,12 @@ LrWpanSpectrumValueHelperTestCase::DoRun (void) } } -// ============================================================================== +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief LrWpan SpectrumValue Helper TestSuite + */ class LrWpanSpectrumValueHelperTestSuite : public TestSuite { public: @@ -77,4 +88,4 @@ LrWpanSpectrumValueHelperTestSuite::LrWpanSpectrumValueHelperTestSuite () AddTestCase (new LrWpanSpectrumValueHelperTestCase, TestCase::QUICK); } -static LrWpanSpectrumValueHelperTestSuite lrWpanSpectrumValueHelperTestSuite; +static LrWpanSpectrumValueHelperTestSuite g_lrWpanSpectrumValueHelperTestSuite;