From 0e539c329baa2edef63c1a2d71af8ce034e2b71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 14 Feb 2017 08:18:25 +0100 Subject: [PATCH] wifi: Doxygen updates for helper files (thanks to Robert Ammon) --- src/wifi/helper/athstats-helper.h | 49 ++++++++++++++----- src/wifi/helper/nqos-wifi-mac-helper.h | 3 +- src/wifi/helper/qos-wifi-mac-helper.cc | 4 +- src/wifi/helper/qos-wifi-mac-helper.h | 18 ++++--- src/wifi/helper/spectrum-wifi-helper.h | 2 +- src/wifi/helper/vht-wifi-mac-helper.h | 9 +++- src/wifi/helper/wifi-helper.cc | 34 +++++++++++++ src/wifi/helper/wifi-helper.h | 22 ++++----- src/wifi/helper/wifi-mac-helper.h | 12 ++--- .../helper/wifi-radio-energy-model-helper.h | 9 ++-- src/wifi/helper/yans-wifi-helper.h | 7 +-- 11 files changed, 122 insertions(+), 47 deletions(-) diff --git a/src/wifi/helper/athstats-helper.h b/src/wifi/helper/athstats-helper.h index 370917c27..608cdd92f 100644 --- a/src/wifi/helper/athstats-helper.h +++ b/src/wifi/helper/athstats-helper.h @@ -38,13 +38,34 @@ class AthstatsHelper { public: AthstatsHelper (); + /** + * Enable athstats + * \param filename the file name + * \param nodeid the node ID + * \param deviceid the device ID + */ void EnableAthstats (std::string filename, uint32_t nodeid, uint32_t deviceid); + /** + * Enable athstats + * \param filename the file name + * \param nd the device + */ void EnableAthstats (std::string filename, Ptr nd); + /** + * Enable athstats + * \param filename the file name + * \param d the collection of devices + */ void EnableAthstats (std::string filename, NetDeviceContainer d); + /** + * Enable athstats + * \param filename the file name + * \param n the collection of nodes + */ void EnableAthstats (std::string filename, NodeContainer n); private: - Time m_interval; + Time m_interval; ///< interval }; @@ -72,6 +93,10 @@ private: class AthstatsWifiTraceSink : public Object { public: + /** + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); AthstatsWifiTraceSink (); virtual ~AthstatsWifiTraceSink (); @@ -183,21 +208,23 @@ public: private: + /// Write status function void WriteStats (); + /// Reset counters function void ResetCounters (); - uint32_t m_txCount; - uint32_t m_rxCount; - uint32_t m_shortRetryCount; - uint32_t m_longRetryCount; - uint32_t m_exceededRetryCount; - uint32_t m_phyRxOkCount; - uint32_t m_phyRxErrorCount; - uint32_t m_phyTxCount; + uint32_t m_txCount; ///< transmit count + uint32_t m_rxCount; ///< receive count + uint32_t m_shortRetryCount; ///< short retry count + uint32_t m_longRetryCount; ///< long retry count + uint32_t m_exceededRetryCount; ///< exceeded retry count + uint32_t m_phyRxOkCount; ///< phy receive ok count + uint32_t m_phyRxErrorCount; ///< phy receive error count + uint32_t m_phyTxCount; ///< phy transmit count - std::ofstream *m_writer; + std::ofstream *m_writer; ///< output stream - Time m_interval; + Time m_interval; ///< interval }; //class AthstatsWifiTraceSink diff --git a/src/wifi/helper/nqos-wifi-mac-helper.h b/src/wifi/helper/nqos-wifi-mac-helper.h index 02d80942b..3b4c11651 100644 --- a/src/wifi/helper/nqos-wifi-mac-helper.h +++ b/src/wifi/helper/nqos-wifi-mac-helper.h @@ -52,6 +52,7 @@ public: /** * Create a mac helper in a default working state. * i.e., this is an adhoc mac by default. + * \return NqosWifiMacHelper */ static NqosWifiMacHelper Default (void); /** @@ -95,7 +96,7 @@ public: std::string n9 = "", const AttributeValue &v9 = EmptyAttributeValue (), std::string n10 = "", const AttributeValue &v10 = EmptyAttributeValue ()); protected: - ObjectFactory m_mac; + ObjectFactory m_mac; ///< MAC object private: /** * \returns a newly-created MAC object. diff --git a/src/wifi/helper/qos-wifi-mac-helper.cc b/src/wifi/helper/qos-wifi-mac-helper.cc index 8e1e0c0c3..ece7ae821 100644 --- a/src/wifi/helper/qos-wifi-mac-helper.cc +++ b/src/wifi/helper/qos-wifi-mac-helper.cc @@ -149,10 +149,10 @@ QosWifiMacHelper::SetBlockAckInactivityTimeoutForAc (enum AcIndex ac, uint16_t t } void -QosWifiMacHelper::Setup (Ptr mac, enum AcIndex ac, std::string dcaAttrName) const +QosWifiMacHelper::Setup (Ptr mac, enum AcIndex ac, std::string edcaAttrName) const { PointerValue ptr; - mac->GetAttribute (dcaAttrName, ptr); + mac->GetAttribute (edcaAttrName, ptr); Ptr edca = ptr.Get (); std::map::const_iterator it_msdu = m_msduAggregators.find (ac); diff --git a/src/wifi/helper/qos-wifi-mac-helper.h b/src/wifi/helper/qos-wifi-mac-helper.h index 8fec68e44..b4750d275 100644 --- a/src/wifi/helper/qos-wifi-mac-helper.h +++ b/src/wifi/helper/qos-wifi-mac-helper.h @@ -170,7 +170,7 @@ public: protected: - ObjectFactory m_mac; + ObjectFactory m_mac; ///< MAC object private: @@ -180,16 +180,22 @@ private: * This method implements the pure virtual method defined in \ref ns3::WifiMacHelper. */ virtual Ptr Create (void) const; - void Setup (Ptr mac, enum AcIndex ac, std::string dcaAttrName) const; + /** + * Setup function + * \param mac the wifi MAC + * \param ac the access category + * \param edcaAttrName the EDCA attribute name (VO_EdcaTxopN, VI_EdcaTxopN, BE_EdcaTxopN, BK_EdcaTxopN) + */ + void Setup (Ptr mac, enum AcIndex ac, std::string edcaAttrName) const; - std::map m_msduAggregators; - std::map m_mpduAggregators; + std::map m_msduAggregators; ///< A-MSDU aggregators + std::map m_mpduAggregators; ///< A-MPDU aggregators /* * Next maps contain, for every access category, the values for * block ack threshold and block ack inactivity timeout. */ - std::map m_bAckThresholds; - std::map m_bAckInactivityTimeouts; + std::map m_bAckThresholds; ///< Block ACK thresholds + std::map m_bAckInactivityTimeouts; ///< Block ACK inactivity timeouts }; } //namespace ns3 diff --git a/src/wifi/helper/spectrum-wifi-helper.h b/src/wifi/helper/spectrum-wifi-helper.h index 15532c693..a61e3c120 100644 --- a/src/wifi/helper/spectrum-wifi-helper.h +++ b/src/wifi/helper/spectrum-wifi-helper.h @@ -71,7 +71,7 @@ private: */ virtual Ptr Create (Ptr node, Ptr device) const; - Ptr m_channel; + Ptr m_channel; ///< the channel }; } //namespace ns3 diff --git a/src/wifi/helper/vht-wifi-mac-helper.h b/src/wifi/helper/vht-wifi-mac-helper.h index 7ed34a1cb..59a365ca7 100644 --- a/src/wifi/helper/vht-wifi-mac-helper.h +++ b/src/wifi/helper/vht-wifi-mac-helper.h @@ -37,14 +37,14 @@ namespace ns3 { * \brief create VHT-enabled MAC layers for a ns3::WifiNetDevice. * * This class can create MACs of type ns3::ApWifiMac, ns3::StaWifiMac, - * and, ns3::AdhocWifiMac, with QosSupported, HTSupported and VHTSupported attributes set to True. + * and, ns3::AdhocWifiMac, with QosSupported, HTSupported and VHTSupported attributes set to True */ class VhtWifiMacHelper : public QosWifiMacHelper { public: /** * Create a VhtWifiMacHelper that is used to make life easier when working - * with Wifi devices using a QOS MAC layer. + * with Wifi devices using a QOS MAC layer */ VhtWifiMacHelper (); @@ -56,11 +56,16 @@ public: /** * Create a mac helper in a default working state. + * + * \returns VhtWifiMacHelper */ static VhtWifiMacHelper Default (void); /** * Converts a VHT MCS value into a DataRate value + * + * \param mcs MCS Value + * \return data rate value (StringValue) */ static StringValue DataRateForMcs (int mcs); }; diff --git a/src/wifi/helper/wifi-helper.cc b/src/wifi/helper/wifi-helper.cc index 2d696572f..3b7e839b7 100644 --- a/src/wifi/helper/wifi-helper.cc +++ b/src/wifi/helper/wifi-helper.cc @@ -35,6 +35,15 @@ namespace ns3 { NS_LOG_COMPONENT_DEFINE ("WifiHelper"); +/** + * ASCII trace Phy transmit sink with context + * \param stream the output stream + * \param context the context name + * \param p the packet + * \param mode the wifi mode + * \param preamble the wifi preamble + * \param txLevel the transmit power level + */ static void AsciiPhyTransmitSinkWithContext ( Ptr stream, @@ -48,6 +57,14 @@ AsciiPhyTransmitSinkWithContext ( *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << context << " " << *p << std::endl; } +/** + * ASCII trace Phy transmit sink without context + * \param stream the output stream + * \param p the packet + * \param mode the wifi mode + * \param preamble the wifi preamble + * \param txLevel the transmit power level + */ static void AsciiPhyTransmitSinkWithoutContext ( Ptr stream, @@ -60,6 +77,15 @@ AsciiPhyTransmitSinkWithoutContext ( *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << *p << std::endl; } +/** + * ASCII trace Phy receive sink with context + * \param stream the output stream + * \param context the context name + * \param p the packet + * \param snr the SNR + * \param mode the wifi mode + * \param preamble the wifi preamble + */ static void AsciiPhyReceiveSinkWithContext ( Ptr stream, @@ -73,6 +99,14 @@ AsciiPhyReceiveSinkWithContext ( *stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << context << " " << *p << std::endl; } +/** + * ASCII trace Phy receive sink without context + * \param stream the output stream + * \param p the packet + * \param snr the SNR + * \param mode the wifi mode + * \param preamble the wifi preamble + */ static void AsciiPhyReceiveSinkWithoutContext ( Ptr stream, diff --git a/src/wifi/helper/wifi-helper.h b/src/wifi/helper/wifi-helper.h index 076518c11..b9006be51 100644 --- a/src/wifi/helper/wifi-helper.h +++ b/src/wifi/helper/wifi-helper.h @@ -60,7 +60,7 @@ public: * by other Wifi device variants such as WaveNetDevice. */ virtual Ptr Create (Ptr node, Ptr device) const = 0; - + /** * \param name the name of the attribute to set * \param v the value of the attribute @@ -98,7 +98,7 @@ public: std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); - + /** * An enumeration of the pcap data link types (DLTs) which this helper * supports. See http://wiki.wireshark.org/Development/LibpcapFileFormat @@ -162,10 +162,10 @@ protected: WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise); - - ObjectFactory m_phy; - ObjectFactory m_errorRateModel; - + + ObjectFactory m_phy; ///< PHY object + ObjectFactory m_errorRateModel; ///< error rate model + private: /** * @brief Enable pcap output the indicated net device. @@ -198,8 +198,8 @@ private: std::string prefix, Ptr nd, bool explicitFilename); - - PcapHelper::DataLinkType m_pcapDlt; + + PcapHelper::DataLinkType m_pcapDlt; ///< PCAP data link type }; @@ -220,7 +220,7 @@ public: * must be set before calling ns3::WifiHelper::Install * * The default state is defined as being an Adhoc MAC layer with an ARF rate control algorithm - * and both objects using their default attribute values. + * and both objects using their default attribute values. * By default, configure MAC and PHY for 802.11a. */ WifiHelper (); @@ -342,8 +342,8 @@ public: protected: - ObjectFactory m_stationManager; - enum WifiPhyStandard m_standard; + ObjectFactory m_stationManager; ///< station manager + enum WifiPhyStandard m_standard; ///< wifi standard }; } //namespace ns3 diff --git a/src/wifi/helper/wifi-mac-helper.h b/src/wifi/helper/wifi-mac-helper.h index 7998d5a0c..8e548e0b7 100644 --- a/src/wifi/helper/wifi-mac-helper.h +++ b/src/wifi/helper/wifi-mac-helper.h @@ -31,11 +31,11 @@ class WifiMac; * \brief create MAC layers for a ns3::WifiNetDevice. * * This class can create MACs of type ns3::ApWifiMac, ns3::StaWifiMac and ns3::AdhocWifiMac. - * Its purpose is to allow a WifiHelper to configure and install WifiMac objects on a collection - * of nodes. The WifiMac objects themselves are mainly composed of TxMiddle, RxMiddle, DcfManager, - * MacLow, WifiRemoteStationManager, MpduAggregator and MsduAggregartor objects, so this helper - * offers the opportunity to configure attribute values away from their default values, on a - * per-NodeContainer basis. By default, it creates an Adhoc MAC layer without QoS. Typically, + * Its purpose is to allow a WifiHelper to configure and install WifiMac objects on a collection + * of nodes. The WifiMac objects themselves are mainly composed of TxMiddle, RxMiddle, DcfManager, + * MacLow, WifiRemoteStationManager, MpduAggregator and MsduAggregartor objects, so this helper + * offers the opportunity to configure attribute values away from their default values, on a + * per-NodeContainer basis. By default, it creates an Adhoc MAC layer without QoS. Typically, * it is used to set type and attribute values, then hand this object over to the WifiHelper that * finishes the job of installing. * @@ -111,7 +111,7 @@ public: protected: - ObjectFactory m_mac; + ObjectFactory m_mac; ///< MAC object factory }; } // namespace ns3 diff --git a/src/wifi/helper/wifi-radio-energy-model-helper.h b/src/wifi/helper/wifi-radio-energy-model-helper.h index 6fa414582..46279f95d 100644 --- a/src/wifi/helper/wifi-radio-energy-model-helper.h +++ b/src/wifi/helper/wifi-radio-energy-model-helper.h @@ -105,6 +105,7 @@ private: /** * \param device Pointer to the NetDevice to install DeviceEnergyModel. * \param source Pointer to EnergySource to install. + * \returns Ptr * * Implements DeviceEnergyModel::Install. */ @@ -112,10 +113,10 @@ private: Ptr source) const; private: - ObjectFactory m_radioEnergy; - WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback m_depletionCallback; - WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback m_rechargedCallback; - ObjectFactory m_txCurrentModel; + ObjectFactory m_radioEnergy; ///< radio energy + WifiRadioEnergyModel::WifiRadioEnergyDepletionCallback m_depletionCallback; ///< radio energy depletion callback + WifiRadioEnergyModel::WifiRadioEnergyRechargedCallback m_rechargedCallback; ///< radio energy recharged callback + ObjectFactory m_txCurrentModel; ///< transmit current model }; diff --git a/src/wifi/helper/yans-wifi-helper.h b/src/wifi/helper/yans-wifi-helper.h index 3ffa973b6..6ea625c4d 100644 --- a/src/wifi/helper/yans-wifi-helper.h +++ b/src/wifi/helper/yans-wifi-helper.h @@ -47,6 +47,7 @@ public: * a channel model with a propagation delay equal to a constant, the speed of light, * and a propagation loss based on a log distance model with a reference loss of 46.6777 dB * at reference distance of 1m. + * \returns YansWifiChannelHelper */ static YansWifiChannelHelper Default (void); @@ -141,8 +142,8 @@ public: private: - std::vector m_propagationLoss; - ObjectFactory m_propagationDelay; + std::vector m_propagationLoss; ///< vector of propagation loss models + ObjectFactory m_propagationDelay; ///< propagation delay model }; @@ -193,7 +194,7 @@ private: */ virtual Ptr Create (Ptr node, Ptr device) const; - Ptr m_channel; + Ptr m_channel; ///< yans wifi channel }; } //namespace ns3