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

(-)file_not_specified_in_diff (-97 / +47 lines)
Line     Link Here 
0
-- a/src/uan/model/uan-transducer-hd.cc
0
++ b/src/uan/model/uan-transducer-hd.cc
 Lines 25-31    Link Here 
25
#include "uan-channel.h"
25
#include "uan-channel.h"
26
#include "ns3/log.h"
26
#include "ns3/log.h"
27
#include "ns3/pointer.h"
27
#include "ns3/pointer.h"
28
28
#include "ns3/double.h"
29
29
30
namespace ns3 {
30
namespace ns3 {
31
31
 Lines 37-43    Link Here 
37
  : UanTransducer (),
37
  : UanTransducer (),
38
    m_state (RX),
38
    m_state (RX),
39
    m_endTxTime (Seconds (0)),
39
    m_endTxTime (Seconds (0)),
40
    m_cleared (false)
40
    m_cleared (false),
41
    m_rxGainDb (0)
41
{
42
{
42
}
43
}
43
44
 Lines 91-96    Link Here 
91
    .SetParent<UanTransducer> ()
92
    .SetParent<UanTransducer> ()
92
    .SetGroupName ("Uan")
93
    .SetGroupName ("Uan")
93
    .AddConstructor<UanTransducerHd> ()
94
    .AddConstructor<UanTransducerHd> ()
95
    .AddAttribute ("RxGain",
96
                   "Gain added to incoming signal at receiver.",
97
                   DoubleValue (0),
98
                   MakeDoubleAccessor (&UanTransducerHd::m_rxGainDb),
99
                   MakeDoubleChecker<double> ())
94
  ;
100
  ;
95
  return tid;
101
  return tid;
96
}
102
}
 Lines 119-124    Link Here 
119
UanTransducerHd::GetArrivalList (void) const
125
UanTransducerHd::GetArrivalList (void) const
120
{
126
{
121
  return m_arrivalList;
127
  return m_arrivalList;
128
}
129
130
double
131
UanTransducerHd::GetRxGainDb (void)
132
{
133
  return m_rxGainDb;
134
}
135
136
double
137
UanTransducerHd::ApplyRxGain(double rxPowerDb, UanTxMode mode)
138
{
139
	rxPowerDb += GetRxGainDb ();
140
	NS_LOG_DEBUG ( "Rx power after RX gain = " << rxPowerDb << " db re uPa");
141
	return rxPowerDb;
122
}
142
}
123
143
124
void
144
void
 Lines 127-133    Link Here 
127
                          UanTxMode txMode,
147
                          UanTxMode txMode,
128
                          UanPdp pdp)
148
                          UanPdp pdp)
129
{
149
{
130
  UanPacketArrival arrival (packet,
150
	//Apply receiver gain
151
	rxPowerDb = ApplyRxGain(rxPowerDb, txMode);
152
153
154
	UanPacketArrival arrival (packet,
131
                            rxPowerDb,
155
                            rxPowerDb,
132
                            txMode,
156
                            txMode,
133
                            pdp,
157
                            pdp,
134
-- a/src/uan/model/uan-transducer-hd.h
158
++ b/src/uan/model/uan-transducer-hd.h
 Lines 52-57    Link Here 
52
  virtual bool IsRx (void) const;
52
  virtual bool IsRx (void) const;
53
  virtual bool IsTx (void) const;
53
  virtual bool IsTx (void) const;
54
  virtual const ArrivalList &GetArrivalList (void) const;
54
  virtual const ArrivalList &GetArrivalList (void) const;
55
  virtual double ApplyRxGain(double rxPowerDb, UanTxMode mode);
56
  virtual double GetRxGainDb (void);
55
  virtual void Receive (Ptr<Packet> packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
57
  virtual void Receive (Ptr<Packet> packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
56
  virtual void Transmit (Ptr<UanPhy> src, Ptr<Packet> packet, double txPowerDb, UanTxMode txMode);
58
  virtual void Transmit (Ptr<UanPhy> src, Ptr<Packet> packet, double txPowerDb, UanTxMode txMode);
57
  virtual void SetChannel (Ptr<UanChannel> chan);
59
  virtual void SetChannel (Ptr<UanChannel> chan);
 Lines 68-73    Link Here 
68
  EventId m_endTxEvent;       //!< Event scheduled for end of transmission.
70
  EventId m_endTxEvent;       //!< Event scheduled for end of transmission.
69
  Time m_endTxTime;           //!< Time at which transmission will be completed.
71
  Time m_endTxTime;           //!< Time at which transmission will be completed.
70
  bool m_cleared;             //!< Flab when we've been cleared.
72
  bool m_cleared;             //!< Flab when we've been cleared.
73
  double m_rxGainDb;          //!< Receive gain.
71
74
72
  /**
75
  /**
73
   * Remove an entry from the arrival list.
76
   * Remove an entry from the arrival list.
74
-- a/src/uan/model/uan-transducer.h
77
++ b/src/uan/model/uan-transducer.h
 Lines 182-187    Link Here 
182
   */
182
   */
183
  virtual const ArrivalList &GetArrivalList (void) const = 0;
183
  virtual const ArrivalList &GetArrivalList (void) const = 0;
184
  /**
184
  /**
185
   * Apply receiver gain to the received power.
186
   *
187
   * \return Updated receive power with gain applied.
188
   */
189
  virtual double ApplyRxGain(double rxPowerDb, UanTxMode mode) = 0;
190
  /**
185
   * Notify this object that a new packet has arrived at this nodes location
191
   * Notify this object that a new packet has arrived at this nodes location
186
   *
192
   *
187
   * \param packet Packet arriving.
193
   * \param packet Packet arriving.
188
-- a/src/uan/model/uan-phy-gen.cc
194
++ b/src/uan/model/uan-phy-gen.cc
 Lines 353-359    Link Here 
353
    m_transducer (0),
359
    m_transducer (0),
354
    m_device (0),
360
    m_device (0),
355
    m_mac (0),
361
    m_mac (0),
356
    m_rxGainDb (0),
357
    m_txPwrDb (0),
362
    m_txPwrDb (0),
358
    m_rxThreshDb (0),
363
    m_rxThreshDb (0),
359
    m_ccaThreshDb (0),
364
    m_ccaThreshDb (0),
 Lines 451-461    Link Here 
451
                   "Transmission output power in dB.",
456
                   "Transmission output power in dB.",
452
                   DoubleValue (190),
457
                   DoubleValue (190),
453
                   MakeDoubleAccessor (&UanPhyGen::m_txPwrDb),
458
                   MakeDoubleAccessor (&UanPhyGen::m_txPwrDb),
454
                   MakeDoubleChecker<double> ())
455
    .AddAttribute ("RxGain",
456
                   "Gain added to incoming signal at receiver.",
457
                   DoubleValue (0),
458
                   MakeDoubleAccessor (&UanPhyGen::m_rxGainDb),
459
                   MakeDoubleChecker<double> ())
459
                   MakeDoubleChecker<double> ())
460
    .AddAttribute ("SupportedModes",
460
    .AddAttribute ("SupportedModes",
461
                   "List of modes supported by this PHY.",
461
                   "List of modes supported by this PHY.",
 Lines 780-791    Link Here 
780
783
781
784
782
void
785
void
783
UanPhyGen::SetRxGainDb (double gain)
784
{
785
  m_rxGainDb = gain;
786
787
}
788
void
789
UanPhyGen::SetTxPowerDb (double txpwr)
786
UanPhyGen::SetTxPowerDb (double txpwr)
790
{
787
{
791
  m_txPwrDb = txpwr;
788
  m_txPwrDb = txpwr;
 Lines 800-816    Link Here 
800
{
797
{
801
  m_ccaThreshDb = thresh;
798
  m_ccaThreshDb = thresh;
802
}
799
}
803
double
800
804
UanPhyGen::GetRxGainDb (void)
805
{
806
  return m_rxGainDb;
807
}
808
double
801
double
809
UanPhyGen::GetTxPowerDb (void)
802
UanPhyGen::GetTxPowerDb (void)
810
{
803
{
811
  return m_txPwrDb;
804
  return m_txPwrDb;
812
805
813
}
806
}
807
814
double
808
double
815
UanPhyGen::GetRxThresholdDb (void)
809
UanPhyGen::GetRxThresholdDb (void)
816
{
810
{
817
-- a/src/uan/model/uan-phy-gen.h
811
++ b/src/uan/model/uan-phy-gen.h
 Lines 253-263    Link Here 
253
  virtual bool IsStateRx (void);
261
  virtual bool IsStateRx (void);
254
  virtual bool IsStateTx (void);
262
  virtual bool IsStateTx (void);
255
  virtual bool IsStateCcaBusy (void);
263
  virtual bool IsStateCcaBusy (void);
256
  virtual void SetRxGainDb (double gain);
257
  virtual void SetTxPowerDb (double txpwr);
264
  virtual void SetTxPowerDb (double txpwr);
258
  virtual void SetRxThresholdDb (double thresh);
265
  virtual void SetRxThresholdDb (double thresh);
259
  virtual void SetCcaThresholdDb (double thresh);
266
  virtual void SetCcaThresholdDb (double thresh);
260
  virtual double GetRxGainDb (void);
261
  virtual double GetTxPowerDb (void);
267
  virtual double GetTxPowerDb (void);
262
  virtual double GetRxThresholdDb (void);
268
  virtual double GetRxThresholdDb (void);
263
  virtual double GetCcaThresholdDb (void);
269
  virtual double GetCcaThresholdDb (void);
 Lines 294-300    Link Here 
294
  Ptr<UanPhyPer> m_per;             //!< Error model.
300
  Ptr<UanPhyPer> m_per;             //!< Error model.
295
  Ptr<UanPhyCalcSinr> m_sinr;       //!< SINR calculator.
301
  Ptr<UanPhyCalcSinr> m_sinr;       //!< SINR calculator.
296
302
297
  double m_rxGainDb;                //!< Receive gain.
298
  double m_txPwrDb;                 //!< Transmit power.
303
  double m_txPwrDb;                 //!< Transmit power.
299
  double m_rxThreshDb;              //!< Receive SINR threshold.
304
  double m_rxThreshDb;              //!< Receive SINR threshold.
300
  double m_ccaThreshDb;             //!< CCA busy threshold.
305
  double m_ccaThreshDb;             //!< CCA busy threshold.
 Lines 304-310    Link Here 
304
  double m_minRxSinrDb;             //!< Minimum receive SINR during packet reception.
309
  double m_minRxSinrDb;             //!< Minimum receive SINR during packet reception.
305
  double m_rxRecvPwrDb;             //!< Receiver power.
310
  double m_rxRecvPwrDb;             //!< Receiver power.
306
  Time m_pktRxArrTime;              //!< Packet arrival time.
311
  Time m_pktRxArrTime;              //!< Packet arrival time.
307
  UanPdp m_pktRxPdp;                //!< Power delay profile of pakket.
312
  UanPdp m_pktRxPdp;                //!< Power delay profile of packet.
308
  UanTxMode m_pktRxMode;            //!< Packet transmission mode at receiver.
313
  UanTxMode m_pktRxMode;            //!< Packet transmission mode at receiver.
309
314
310
  bool m_cleared;                   //!< Flag when we've been cleared.
315
  bool m_cleared;                   //!< Flag when we've been cleared.
311
316
312
-- a/src/uan/model/uan-phy-dual.cc
317
++ b/src/uan/model/uan-phy-dual.cc
 Lines 181-196    Link Here 
181
                   "Transmission output power in dB of Phy2.",
181
                   "Transmission output power in dB of Phy2.",
182
                   DoubleValue (190),
182
                   DoubleValue (190),
183
                   MakeDoubleAccessor (&UanPhyDual::GetTxPowerDbPhy2, &UanPhyDual::SetTxPowerDbPhy2),
183
                   MakeDoubleAccessor (&UanPhyDual::GetTxPowerDbPhy2, &UanPhyDual::SetTxPowerDbPhy2),
184
                   MakeDoubleChecker<double> ())
185
    .AddAttribute ("RxGainPhy1",
186
                   "Gain added to incoming signal at receiver of Phy1.",
187
                   DoubleValue (0),
188
                   MakeDoubleAccessor (&UanPhyDual::GetRxGainDbPhy1, &UanPhyDual::SetRxGainDbPhy1),
189
                   MakeDoubleChecker<double> ())
190
    .AddAttribute ("RxGainPhy2",
191
                   "Gain added to incoming signal at receiver of Phy2.",
192
                   DoubleValue (0),
193
                   MakeDoubleAccessor (&UanPhyDual::GetRxGainDbPhy2, &UanPhyDual::SetRxGainDbPhy2),
194
                   MakeDoubleChecker<double> ())
184
                   MakeDoubleChecker<double> ())
195
    .AddAttribute ("SupportedModesPhy1",
185
    .AddAttribute ("SupportedModesPhy1",
196
                   "List of modes supported by Phy1.",
186
                   "List of modes supported by Phy1.",
 Lines 302-324    Link Here 
302
  m_phy2->SetReceiveErrorCallback (cb);
292
  m_phy2->SetReceiveErrorCallback (cb);
303
}
293
}
304
294
305
void
306
UanPhyDual::SetRxGainDb (double gain)
307
{
308
  m_phy1->SetRxGainDb (gain);
309
  m_phy2->SetRxGainDb (gain);
310
}
311
void
312
UanPhyDual::SetRxGainDbPhy1 (double gain)
313
{
314
  m_phy1->SetRxGainDb (gain);
315
}
316
317
void
318
UanPhyDual::SetRxGainDbPhy2 (double gain)
319
{
320
  m_phy2->SetRxGainDb (gain);
321
}
322
295
323
void
296
void
324
UanPhyDual::SetTxPowerDb (double txpwr)
297
UanPhyDual::SetTxPowerDb (double txpwr)
 Lines 363-384    Link Here 
363
  m_phy2->SetCcaThresholdDb (thresh);
336
  m_phy2->SetCcaThresholdDb (thresh);
364
}
337
}
365
338
366
double
367
UanPhyDual::GetRxGainDb (void)
368
{
369
  NS_LOG_WARN ("Warning: UanPhyDual::GetRxGainDb returns RxGain of Phy 1");
370
  return m_phy1->GetRxGainDb ();
371
}
372
double
373
UanPhyDual::GetRxGainDbPhy1 (void) const
374
{
375
  return m_phy1->GetRxGainDb ();
376
}
377
double
378
UanPhyDual::GetRxGainDbPhy2 (void) const
379
{
380
  return m_phy2->GetRxGainDb ();
381
}
382
339
383
double
340
double
384
UanPhyDual::GetTxPowerDb (void)
341
UanPhyDual::GetTxPowerDb (void)
385
-- a/src/uan/model/uan-phy-dual.h
342
++ b/src/uan/model/uan-phy-dual.h
 Lines 112-122    Link Here 
112
  virtual void StartRxPacket (Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
112
  virtual void StartRxPacket (Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
113
  virtual void SetReceiveOkCallback (RxOkCallback cb);
113
  virtual void SetReceiveOkCallback (RxOkCallback cb);
114
  virtual void SetReceiveErrorCallback (RxErrCallback cb);
114
  virtual void SetReceiveErrorCallback (RxErrCallback cb);
115
  virtual void SetRxGainDb (double gain);
116
  virtual void SetTxPowerDb (double txpwr);
115
  virtual void SetTxPowerDb (double txpwr);
117
  NS_DEPRECATED virtual void SetRxThresholdDb (double thresh);
116
  NS_DEPRECATED virtual void SetRxThresholdDb (double thresh);
118
  virtual void SetCcaThresholdDb (double thresh);
117
  virtual void SetCcaThresholdDb (double thresh);
119
  virtual double GetRxGainDb (void);
120
  virtual double GetTxPowerDb (void);
118
  virtual double GetTxPowerDb (void);
121
  virtual double GetRxThresholdDb (void);
119
  virtual double GetRxThresholdDb (void);
122
  virtual double GetCcaThresholdDb (void);
120
  virtual double GetCcaThresholdDb (void);
 Lines 178-191    Link Here 
178
  /** \copydoc UanPhy::SetTxPowerDb */
176
  /** \copydoc UanPhy::SetTxPowerDb */
179
  void SetTxPowerDbPhy2 (double txpwr);
177
  void SetTxPowerDbPhy2 (double txpwr);
180
178
181
  /** \copydoc UanPhy::GetRxGainDb */
182
  double GetRxGainDbPhy1 (void) const;
183
  /** \copydoc UanPhy::GetRxGainDb */
184
  double GetRxGainDbPhy2 (void) const;
185
  /** \copydoc UanPhy::SetRxGainDb */
186
  void SetRxGainDbPhy1 (double gain);
187
  /** \copydoc UanPhy::SetRxGainDb */
188
  void SetRxGainDbPhy2 (double gain);
189
179
190
  /**
180
  /**
191
   * Get the list of available modes.
181
   * Get the list of available modes.
192
-- a/src/uan/model/uan-phy.h
182
++ b/src/uan/model/uan-phy.h
 Lines 267-278    Link Here 
267
   */
267
   */
268
  virtual void SetReceiveErrorCallback (RxErrCallback cb) = 0;
268
  virtual void SetReceiveErrorCallback (RxErrCallback cb) = 0;
269
269
270
  /**
271
   * Set the receiver gain.
272
   *
273
   * \param gain Gain added at receiver, in dB.
274
   */
275
  virtual void SetRxGainDb (double gain) = 0;
276
270
277
  /**
271
  /**
278
   * Set the transmit power.
272
   * Set the transmit power.
 Lines 297-308    Link Here 
297
   */
291
   */
298
  virtual void SetCcaThresholdDb (double thresh) = 0;
292
  virtual void SetCcaThresholdDb (double thresh) = 0;
299
293
300
  /**
301
   * Get the receiver gain added to signal at receiver in dB.
302
   *
303
   * \return The gain.
304
   */
305
  virtual double GetRxGainDb (void) = 0;
306
294
307
  /**
295
  /**
308
   * Get the current transmit power, in dB.
296
   * Get the current transmit power, in dB.

Return to bug 2492