From a0fbc2e22dac1cd3662f06fc3d8f83ed4228cfad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 14 Feb 2017 08:19:33 +0100 Subject: [PATCH] wifi: Doxygen updates for example files (thanks to Robert Ammon) --- src/wifi/examples/test-interference-helper.cc | 36 +++++--- src/wifi/examples/wifi-manager-example.cc | 34 +++++--- src/wifi/examples/wifi-phy-test.cc | 86 +++++++++++++------ 3 files changed, 104 insertions(+), 52 deletions(-) diff --git a/src/wifi/examples/test-interference-helper.cc b/src/wifi/examples/test-interference-helper.cc index 0d831f552..5b1474187 100644 --- a/src/wifi/examples/test-interference-helper.cc +++ b/src/wifi/examples/test-interference-helper.cc @@ -58,34 +58,42 @@ using namespace ns3; +/// InterferenceExperiment class InterferenceExperiment { public: + /// Input atructure struct Input { Input (); - Time interval; - double xA; - double xB; - std::string txModeA; - std::string txModeB; - uint32_t txPowerLevelA; - uint32_t txPowerLevelB; - uint32_t packetSizeA; - uint32_t packetSizeB; - WifiPhyStandard standard; - WifiPreamble preamble; + Time interval; ///< interval + double xA; ///< x A + double xB; ///< x B + std::string txModeA; ///< transmit mode A + std::string txModeB; ///< transmit mode B + uint32_t txPowerLevelA; ///< transmit power level A + uint32_t txPowerLevelB; ///< transmit power level B + uint32_t packetSizeA; ///< packet size A + uint32_t packetSizeB; ///< packet size B + WifiPhyStandard standard; ///< standard + WifiPreamble preamble; ///< preamble }; InterferenceExperiment (); + /** + * Run function + * \param input the interference experiment data + */ void Run (struct InterferenceExperiment::Input input); private: + /// Send A function void SendA (void) const; + /// Send B function void SendB (void) const; - Ptr m_txA; - Ptr m_txB; - struct Input m_input; + Ptr m_txA; ///< transmit A function + Ptr m_txB; ///< transmit B function + struct Input m_input; ///< input }; void diff --git a/src/wifi/examples/wifi-manager-example.cc b/src/wifi/examples/wifi-manager-example.cc index 62dbb21d3..b674d6928 100644 --- a/src/wifi/examples/wifi-manager-example.cc +++ b/src/wifi/examples/wifi-manager-example.cc @@ -76,18 +76,32 @@ RateChangeMinstrelHt (uint64_t newVal, Mac48Address dest) g_intervalRate = newVal; } +/// Step structure struct Step { - double stepSize; - double stepTime; + double stepSize; ///< step size in dBm + double stepTime; ///< step size in seconds }; +/// StandardInfo structure struct StandardInfo { StandardInfo () { m_name = "none"; } + /** + * Constructor + * + * \param name reference name + * \param standard wifi phy standard + * \param width channel width + * \param snrLow SNR low + * \param snrHigh SNR high + * \param xMin x minimum + * \param xMax x maximum + * \param yMax y maximum + */ StandardInfo (std::string name, enum WifiPhyStandard standard, uint16_t width, double snrLow, double snrHigh, double xMin, double xMax, double yMax) : m_name (name), m_standard (standard), @@ -99,14 +113,14 @@ struct StandardInfo m_yMax (yMax) { } - std::string m_name; - enum WifiPhyStandard m_standard; - uint16_t m_width; - double m_snrLow; - double m_snrHigh; - double m_xMin; - double m_xMax; - double m_yMax; + std::string m_name; ///< name + enum WifiPhyStandard m_standard; ///< standard + uint16_t m_width; ///< channel width + double m_snrLow; ///< lowest SNR + double m_snrHigh; ///< highest SNR + double m_xMin; ///< X minimum + double m_xMax; ///< X maximum + double m_yMax; ///< Y maximum }; void diff --git a/src/wifi/examples/wifi-phy-test.cc b/src/wifi/examples/wifi-phy-test.cc index 9d704474e..4b3ed27ba 100644 --- a/src/wifi/examples/wifi-phy-test.cc +++ b/src/wifi/examples/wifi-phy-test.cc @@ -29,32 +29,47 @@ using namespace ns3; +/// PsrExperiment class PsrExperiment { public: + /// Input structure struct Input { Input (); - double distance; - std::string txMode; - uint8_t txPowerLevel; - uint32_t packetSize; - uint32_t nPackets; + double distance; ///< distance + std::string txMode; ///< transmit mode + uint8_t txPowerLevel; ///< transmit power level + uint32_t packetSize; ///< packet size + uint32_t nPackets; ///< number of packets }; + /// Output structure struct Output { - uint32_t received; + uint32_t received; ///< received }; PsrExperiment (); + /** + * Run function + * \param input the PSR experiment + * \returns the PSR experiment output + */ struct PsrExperiment::Output Run (struct PsrExperiment::Input input); private: + /// Send function void Send (void); + /** + * Send receive function + * \param p the packet + * \param snr the SNR + * \param txVector the wifi transmit vector + */ void Receive (Ptr p, double snr, WifiTxVector txVector); - Ptr m_tx; - struct Input m_input; - struct Output m_output; + Ptr m_tx; ///< transmit + struct Input m_input; ///< input + struct Output m_output; ///< output }; void @@ -128,42 +143,57 @@ PsrExperiment::Run (struct PsrExperiment::Input input) return m_output; } - +/// CollisionExperiment class CollisionExperiment { public: + /// Input structure struct Input { Input (); - Time interval; - double xA; - double xB; - std::string txModeA; - std::string txModeB; - uint8_t txPowerLevelA; - uint8_t txPowerLevelB; - uint32_t packetSizeA; - uint32_t packetSizeB; - uint32_t nPackets; + Time interval; ///< interval + double xA; ///< x A + double xB; ///< x B + std::string txModeA; ///< transmit mode A + std::string txModeB; ///< transmit mode B + uint8_t txPowerLevelA; ///< transmit power level A + uint8_t txPowerLevelB; ///< transmit power level B + uint32_t packetSizeA; ///< packet size A + uint32_t packetSizeB; ///< packet size B + uint32_t nPackets; ///< number of packets }; + /// Output struture struct Output { - uint32_t receivedA; - uint32_t receivedB; + uint32_t receivedA; ///< received A + uint32_t receivedB; ///< received B }; CollisionExperiment (); + /** + * Run function + * \param input the collision experiment data + * \returns the experiment output + */ struct CollisionExperiment::Output Run (struct CollisionExperiment::Input input); private: + /// Send A function void SendA (void) const; + /// Send B function void SendB (void) const; + /** + * Receive function + * \param p the packet + * \param snr the SNR + * \param txVector the wifi transmit vector + */ void Receive (Ptr p, double snr, WifiTxVector txVector); - Ptr m_txA; - Ptr m_txB; - uint32_t m_flowIdA; - uint32_t m_flowIdB; - struct Input m_input; - struct Output m_output; + Ptr m_txA; ///< transmit A + Ptr m_txB; ///< transmit B + uint32_t m_flowIdA; ///< flow ID A + uint32_t m_flowIdB; ///< flow ID B + struct Input m_input; ///< input + struct Output m_output; ///< output }; void