View | Details | Raw Unified | Return to bug 484
Collapse All | Expand All

(-)a/src/devices/point-to-point/point-to-point-channel.cc (-6 / +5 lines)
 Lines 34-43    Link Here 
34
  static TypeId tid = TypeId ("ns3::PointToPointChannel")
34
  static TypeId tid = TypeId ("ns3::PointToPointChannel")
35
    .SetParent<Channel> ()
35
    .SetParent<Channel> ()
36
    .AddConstructor<PointToPointChannel> ()
36
    .AddConstructor<PointToPointChannel> ()
37
    .AddAttribute ("Delay", "Transmission delay through the channel",
37
    .AddAttribute ("Delay", "Random variable giving transmission delay through the channel, in seconds.",
38
                   TimeValue (Seconds (0)),
38
                   RandomVariableValue (ConstantVariable (0)),
39
                   MakeTimeAccessor (&PointToPointChannel::m_delay),
39
                   MakeRandomVariableAccessor (&PointToPointChannel::m_delay),
40
                   MakeTimeChecker ())
40
                   MakeRandomVariableChecker ())
41
    ;
41
    ;
42
  return tid;
42
  return tid;
43
}
43
}
 Lines 48-54    Link Here 
48
PointToPointChannel::PointToPointChannel()
48
PointToPointChannel::PointToPointChannel()
49
: 
49
: 
50
  Channel ("PointToPoint Channel"), 
50
  Channel ("PointToPoint Channel"), 
51
  m_delay (Seconds (0.)),
52
  m_nDevices (0)
51
  m_nDevices (0)
53
{
52
{
54
  NS_LOG_FUNCTION_NOARGS ();
53
  NS_LOG_FUNCTION_NOARGS ();
 Lines 89-95    Link Here 
89
88
90
  uint32_t wire = src == m_link[0].m_src ? 0 : 1;
89
  uint32_t wire = src == m_link[0].m_src ? 0 : 1;
91
90
92
  Simulator::Schedule (txTime + m_delay, &PointToPointNetDevice::Receive,
91
  Simulator::Schedule (txTime + Seconds (m_delay.GetValue ()), &PointToPointNetDevice::Receive,
93
    m_link[wire].m_dst, p);
92
    m_link[wire].m_dst, p);
94
  return true;
93
  return true;
95
}
94
}
(-)a/src/devices/point-to-point/point-to-point-channel.h (-2 / +3 lines)
 Lines 24-29    Link Here 
24
#include "ns3/ptr.h"
24
#include "ns3/ptr.h"
25
#include "ns3/nstime.h"
25
#include "ns3/nstime.h"
26
#include "ns3/data-rate.h"
26
#include "ns3/data-rate.h"
27
#include "ns3/random-variable.h"
27
28
28
namespace ns3 {
29
namespace ns3 {
29
30
 Lines 94-101    Link Here 
94
  // Each point to point link has exactly two net devices
95
  // Each point to point link has exactly two net devices
95
  static const int N_DEVICES = 2;
96
  static const int N_DEVICES = 2;
96
97
97
  Time          m_delay;
98
  RandomVariable m_delay;
98
  int32_t       m_nDevices;
99
  int32_t        m_nDevices;
99
100
100
  enum WireState
101
  enum WireState
101
    {
102
    {

Return to bug 484