--- a/src/uan/model/uan-net-device.h Wed Dec 04 20:56:33 2013 +0100
+++ b/src/uan/model/uan-net-device.h Wed Dec 04 13:29:04 2013 -0800
@@ -41,69 +41,87 @@
/**
* \ingroup uan
- * \class UanNetDevice
*
- * \brief Net device for UAN models
+ * Net device for UAN models.
*/
class UanNetDevice : public NetDevice
{
public:
- /**
- * \brief UanPhyList is defined as a standard template lib list of UanPhy objects
- */
+ /** List of UanPhy objects. */
typedef std::list<Ptr<UanPhy> > UanPhyList;
- /**
- * \brief UanTransducerList is a standard template lib list of UanTransducer objects
- */
+ /** List of UanTransducer objects. */
typedef std::list<Ptr<UanTransducer> > UanTransducerList;
+ /**
+ * Register this type.
+ * \return The TypeId.
+ */
static TypeId GetTypeId (void);
+ /** Default constructor */
UanNetDevice ();
+ /** Dummy destructor, DoDispose. */
virtual ~UanNetDevice ();
/**
- * \param mac Set MAC layer for this device
+ * Set the MAC layer for this device.
+ *
+ * \param mac The MAC layer.
*/
void SetMac (Ptr<UanMac> mac);
/**
- * \param phy Set PHY layer for this device
+ * Set the Phy layer for this device.
+ *
+ * \param phy The PHY layer.
*/
void SetPhy (Ptr<UanPhy> phy);
/**
- * \param channel The channel this device is attached to
+ * Attach a channel.
+ *
+ * \param channel The channel.
*/
void SetChannel (Ptr<UanChannel> channel);
/**
- * \returns MAC this device is using
+ * Get the MAC used by this device.
+ *
+ * \return The MAC.
*/
Ptr<UanMac> GetMac (void) const;
/**
- * \returns PHY this device is using
+ * Get the Phy used by this device.
+ *
+ * \return The Phy.
*/
Ptr<UanPhy> GetPhy (void) const;
/**
- * \returns Transducer in net device
+ * Get the transducer associated with this device.
+ *
+ * \return The transducer.
*/
Ptr<UanTransducer> GetTransducer (void) const;
/**
- * \param trans Transducer to use in this net device
+ * Set the transdcuer used by this device.
+ *
+ * \param trans The transducer.
*/
void SetTransducer (Ptr<UanTransducer> trans);
- /**
- * Clears all pointer references
- */
+ /** Clear all pointer references. */
void Clear (void);
+ /**
+ * Set the Phy SLEEP mode.
+ *
+ * \param sleep SLEEP on or off.
+ */
void SetSleepMode (bool sleep);
- // Purely virtual functions from base class
+ // Inherited methods
virtual void SetIfIndex (const uint32_t index);
virtual uint32_t GetIfIndex (void) const;
virtual Ptr<Channel> GetChannel (void) const;
@@ -128,31 +146,44 @@
virtual bool SupportsSendFrom (void) const;
virtual void AddLinkChangeCallback (Callback<void> callback);
virtual void SetAddress (Address address);
+
private:
+ /**
+ * Forward the packet to a higher level, set with SetReceiveCallback.
+ *
+ * \param pkt The packet.
+ * \param src The source address.
+ */
virtual void ForwardUp (Ptr<Packet> pkt, const UanAddress &src);
+
+ /** \return The channel attached to this device. */
Ptr<UanChannel> DoGetChannel (void) const;
- Ptr<UanTransducer> m_trans;
- Ptr<Node> m_node;
- Ptr<UanChannel> m_channel;
- Ptr<UanMac> m_mac;
- Ptr<UanPhy> m_phy;
+ Ptr<UanTransducer> m_trans; //!< The Transducer attached to this device.
+ Ptr<Node> m_node; //!< The node hosting this device.
+ Ptr<UanChannel> m_channel; //!< The channel attached to this device.
+ Ptr<UanMac> m_mac; //!< The MAC layer attached to this device.
+ Ptr<UanPhy> m_phy; //!< The PHY layer attached to this device.
- std::string m_name;
- uint32_t m_ifIndex;
- uint16_t m_mtu;
- bool m_linkup;
- TracedCallback<> m_linkChanges;
- ReceiveCallback m_forwardUp;
+ //unused: std::string m_name;
+ uint32_t m_ifIndex; //!< The interface index of this device.
+ uint16_t m_mtu; //!< The device MTU value, in bytes.
+ bool m_linkup; //!< The link state, true if up.
+ TracedCallback<> m_linkChanges; //!< Callback to invoke when the link state changes to UP.
+ ReceiveCallback m_forwardUp; //!< The receive callback.
+ /** Trace source triggered when forwarding up received payload from the MAC layer. */
TracedCallback<Ptr<const Packet>, UanAddress> m_rxLogger;
+ /** Trace source triggered when sending to the MAC layer */
TracedCallback<Ptr<const Packet>, UanAddress> m_txLogger;
+ /** Flag when we've been cleared. */
bool m_cleared;
protected:
virtual void DoDispose ();
-};
+
+}; // class UanNetDevice
} // namespace ns3