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

(-)a/src/spectrum/model/aloha-noack-net-device.cc (-3 / +4 lines)
 Lines 29-34    Link Here 
29
#include "ns3/trace-source-accessor.h"
29
#include "ns3/trace-source-accessor.h"
30
#include "aloha-noack-mac-header.h"
30
#include "aloha-noack-mac-header.h"
31
#include "aloha-noack-net-device.h"
31
#include "aloha-noack-net-device.h"
32
#include "spectrum-phy.h"
32
#include "ns3/llc-snap-header.h"
33
#include "ns3/llc-snap-header.h"
33
34
34
NS_LOG_COMPONENT_DEFINE ("AlohaNoackNetDevice");
35
NS_LOG_COMPONENT_DEFINE ("AlohaNoackNetDevice");
 Lines 82-88    Link Here 
82
                   PointerValue (),
83
                   PointerValue (),
83
                   MakePointerAccessor (&AlohaNoackNetDevice::GetPhy,
84
                   MakePointerAccessor (&AlohaNoackNetDevice::GetPhy,
84
                                        &AlohaNoackNetDevice::SetPhy),
85
                                        &AlohaNoackNetDevice::SetPhy),
85
                   MakePointerChecker<Object> ())
86
                   MakePointerChecker<SpectrumPhy> ())
86
    .AddTraceSource ("MacTx",
87
    .AddTraceSource ("MacTx",
87
                     "Trace source indicating a packet has arrived for transmission by this device",
88
                     "Trace source indicating a packet has arrived for transmission by this device",
88
                     MakeTraceSourceAccessor (&AlohaNoackNetDevice::m_macTxTrace))
89
                     MakeTraceSourceAccessor (&AlohaNoackNetDevice::m_macTxTrace))
 Lines 248-261    Link Here 
248
}
249
}
249
250
250
void
251
void
251
AlohaNoackNetDevice::SetPhy (Ptr<Object> phy)
252
AlohaNoackNetDevice::SetPhy (Ptr<SpectrumPhy> phy)
252
{
253
{
253
  NS_LOG_FUNCTION (this << phy);
254
  NS_LOG_FUNCTION (this << phy);
254
  m_phy = phy;
255
  m_phy = phy;
255
}
256
}
256
257
257
258
258
Ptr<Object>
259
Ptr<SpectrumPhy>
259
AlohaNoackNetDevice::GetPhy () const
260
AlohaNoackNetDevice::GetPhy () const
260
{
261
{
261
  NS_LOG_FUNCTION (this);
262
  NS_LOG_FUNCTION (this);
(-)a/src/spectrum/model/aloha-noack-net-device.h (-8 / +5 lines)
 Lines 40-45    Link Here 
40
class Channel;
40
class Channel;
41
class SpectrumErrorModel;
41
class SpectrumErrorModel;
42
class Queue;
42
class Queue;
43
class SpectrumPhy;
43
44
44
45
45
46
 Lines 131-148    Link Here 
131
   * This object is needed so that we can set/get attributes and
132
   * This object is needed so that we can set/get attributes and
132
   * connect to trace sources of the PHY from the net device.
133
   * connect to trace sources of the PHY from the net device.
133
   *
134
   *
134
   * @param phy the Phy object attached to the device.  Note that the
135
   * @param phy the Phy object attached to the device.  
135
   * API between the PHY and the above (this NetDevice which also
136
   * implements the MAC) is implemented entirely by
137
   * callbacks, so we do not require that the PHY inherits by any
138
   * specific class.
139
   */
136
   */
140
  void SetPhy (Ptr<Object> phy);
137
  void SetPhy (Ptr<SpectrumPhy> phy);
141
138
142
  /**
139
  /**
143
   * @return a reference to the PHY object embedded in this NetDevice.
140
   * @return a reference to the PHY object embedded in this NetDevice.
144
   */
141
   */
145
  Ptr<Object> GetPhy () const;
142
  Ptr<SpectrumPhy> GetPhy () const;
146
143
147
144
148
145
 Lines 221-227    Link Here 
221
218
222
  Ptr<Packet> m_currentPkt;
219
  Ptr<Packet> m_currentPkt;
223
220
224
  Ptr<Object> m_phy;
221
  Ptr<SpectrumPhy> m_phy;
225
};
222
};
226
223
227
224
(-)a/src/spectrum/model/non-communicating-net-device.cc (-3 / +4 lines)
 Lines 27-32    Link Here 
27
#include "ns3/pointer.h"
27
#include "ns3/pointer.h"
28
#include "ns3/channel.h"
28
#include "ns3/channel.h"
29
#include "non-communicating-net-device.h"
29
#include "non-communicating-net-device.h"
30
#include "spectrum-phy.h"
30
31
31
32
32
NS_LOG_COMPONENT_DEFINE ("NonCommunicatingNetDevice");
33
NS_LOG_COMPONENT_DEFINE ("NonCommunicatingNetDevice");
 Lines 48-54    Link Here 
48
                   PointerValue (),
49
                   PointerValue (),
49
                   MakePointerAccessor (&NonCommunicatingNetDevice::GetPhy,
50
                   MakePointerAccessor (&NonCommunicatingNetDevice::GetPhy,
50
                                        &NonCommunicatingNetDevice::SetPhy),
51
                                        &NonCommunicatingNetDevice::SetPhy),
51
                   MakePointerChecker<Object> ())
52
                   MakePointerChecker<SpectrumPhy> ())
52
  ;
53
  ;
53
  return tid;
54
  return tid;
54
}
55
}
 Lines 181-194    Link Here 
181
}
182
}
182
183
183
void
184
void
184
NonCommunicatingNetDevice::SetPhy (Ptr<Object> phy)
185
NonCommunicatingNetDevice::SetPhy (Ptr<SpectrumPhy> phy)
185
{
186
{
186
  NS_LOG_FUNCTION (this << phy);
187
  NS_LOG_FUNCTION (this << phy);
187
  m_phy = phy;
188
  m_phy = phy;
188
}
189
}
189
190
190
191
191
Ptr<Object>
192
Ptr<SpectrumPhy>
192
NonCommunicatingNetDevice::GetPhy () const
193
NonCommunicatingNetDevice::GetPhy () const
193
{
194
{
194
  NS_LOG_FUNCTION (this);
195
  NS_LOG_FUNCTION (this);
(-)a/src/spectrum/model/non-communicating-net-device.h (-3 / +4 lines)
 Lines 37-42    Link Here 
37
class Channel;
37
class Channel;
38
class SpectrumErrorModel;
38
class SpectrumErrorModel;
39
class Queue;
39
class Queue;
40
class SpectrumPhy;
40
41
41
42
42
43
 Lines 79-90    Link Here 
79
   *
80
   *
80
   * @param phy the Phy object embedded within this device.
81
   * @param phy the Phy object embedded within this device.
81
   */
82
   */
82
  void SetPhy (Ptr<Object> phy);
83
  void SetPhy (Ptr<SpectrumPhy> phy);
83
84
84
  /**
85
  /**
85
   * @return a reference to the PHY object embedded in this NetDevice.
86
   * @return a reference to the PHY object embedded in this NetDevice.
86
   */
87
   */
87
  Ptr<Object> GetPhy () const;
88
  Ptr<SpectrumPhy> GetPhy () const;
88
89
89
90
90
91
 Lines 128-134    Link Here 
128
129
129
  uint32_t m_ifIndex;
130
  uint32_t m_ifIndex;
130
131
131
  Ptr<Object> m_phy;
132
  Ptr<SpectrumPhy> m_phy;
132
};
133
};
133
134
134
135

Return to bug 962