--- a/src/devices/p2p/p2p-net-device.h Thu Jun 14 10:41:47 2007 +0200
+++ b/src/devices/p2p/p2p-net-device.h Fri Jun 15 13:19:57 2007 -0700
@@ -30,7 +30,6 @@
#include "ns3/callback-trace-source.h"
#include "ns3/nstime.h"
#include "ns3/data-rate.h"
-#include "ns3/default-value.h"
#include "ns3/ptr.h"
namespace ns3 {
@@ -81,8 +80,7 @@
* @see PointToPointTopology::AddPointToPointLink ()
* @param node the Node to which this device is connected.
*/
- PointToPointNetDevice (Ptr<Node> node,
- const DataRate& = g_defaultRate.GetValue());
+ PointToPointNetDevice (Ptr<Node> node);
/**
* Copy Construct a PointToPointNetDevice
*
@@ -107,7 +105,7 @@
*
* @param nd the object to be copied
*/
- PointToPointNetDevice& operator= (const PointToPointNetDevice& nd);
+ PointToPointNetDevice& operator= (PointToPointNetDevice nd);
/**
* Set the Data Rate used for transmission of packets. The data rate is
* set in the Attach () method from the corresponding field in the channel
@@ -116,7 +114,7 @@
* @see Attach ()
* @param bps the data rate at which this object operates
*/
- void SetDataRate(const DataRate& bps);
+ void SetDataRate(DataRate bps);
/**
* Set the inteframe gap used to separate packets. The interframe gap
* defines the minimum space required between packets sent by this device.
@@ -127,7 +125,7 @@
* @see Attach ()
* @param t the interframe gap time
*/
- void SetInterframeGap(const Time& t);
+ void SetInterframeGap(Time t);
/**
* Attach the device to a channel.
*
@@ -192,19 +190,6 @@
* @returns a pointer to the channel
*/
virtual Ptr<Channel> DoGetChannel(void) const;
- /**
- * Set a new default data rate
- * @param Data rate to set for new default
- */
- static void SetDefaultRate(const DataRate&);
-
- /**
- * Get the current default rate.
- * @returns a const reference to current default
- */
-
- static const DataRate& GetDefaultRate();
-
private:
/**
* Send a Packet Down the Wire.
@@ -238,11 +223,33 @@
/**
* Stop Sending a Packet Down the Wire and Begin the Interframe Gap.
*
- * The TransmitComplete method is used internally to finish the process
- * of sending a packet out on the channel.
+ * The TransmitCompleteEvent method is used internally to finish the process
+ * of sending a packet out on the channel. During execution of this method
+ * the TransmitEnd method is called on the channel to let it know that the
+ * physical device this class represents has virually finished sending
+ * signals. The channel uses this event to begin its speed of light delay
+ * timer after which it notifies the Net Device at the other end of the
+ * link that the bits have arrived. During this method, the net device
+ * also schedules the TransmitReadyEvent at which time the transmitter
+ * becomes ready to send the next packet.
*
+ * @see PointToPointChannel::TransmitEnd ()
+ * @see TransmitReadyEvent ()
+ * @returns true if success, false on failure
*/
- void TransmitComplete(void);
+ void TransmitCompleteEvent (void);
+ /**
+ * Cause the Transmitter to Become Ready to Send Another Packet.
+ *
+ * The TransmitReadyEvent method is used internally to re-enable the
+ * transmit machine of the net device. It is scheduled after a suitable
+ * interframe gap after the completion of the previous transmission.
+ * The queue is checked at this time, and if there is a packet waiting on
+ * the queue, the transmission process is begun.
+ *
+ * @see TransmitStart ()
+ */
+ void TransmitReadyEvent (void);
/**
* Create a Trace Resolver for events in the net device.
*
@@ -256,7 +263,8 @@
enum TxMachineState
{
READY, /**< The transmitter is ready to begin transmission of a packet */
- BUSY /**< The transmitter is busy transmitting a packet */
+ BUSY, /**< The transmitter is busy transmitting a packet */
+ GAP /**< The transmitter is in the interframe gap time */
};
/**
* The state of the Net Device transmit state machine.
@@ -297,11 +305,6 @@
* @see class TraceResolver
*/
CallbackTraceSource<Packet &> m_rxTrace;
- /**
- * Default data rate. Used for all newly created p2p net devices
- */
- static DataRateDefaultValue g_defaultRate;
-
};
}; // namespace ns3