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

(-)a/src/wifi/model/wifi-phy.cc (-2 / +4 lines)
 Lines 308-316    Link Here 
308
}
308
}
309
309
310
void
310
void
311
WifiPhy::NotifyTxEnd (Ptr<const Packet> packet)
311
WifiPhy::NotifyTxEnd (Ptr<const Packet> packet,
312
                      const Time& duration,
313
                      uint32_t nReceivers)
312
{
314
{
313
  m_phyTxEndTrace (packet);
315
  m_phyTxEndTrace (packet, duration, nReceivers);
314
}
316
}
315
317
316
void
318
void
(-)a/src/wifi/model/wifi-phy.h (-2 / +11 lines)
 Lines 386-393    Link Here 
386
  /**
386
  /**
387
   * Public method used to fire a PhyTxEnd trace.  Implemented for encapsulation
387
   * Public method used to fire a PhyTxEnd trace.  Implemented for encapsulation
388
   * purposes.
388
   * purposes.
389
   *
390
   * \param Ptr to packet that was transmitted
391
   * \param Duration for Transmission
392
   * \param Number of reeivers for the transmission
389
   */
393
   */
390
  void NotifyTxEnd (Ptr<const Packet> packet);
394
  void NotifyTxEnd (Ptr<const Packet> packet,
395
                    const Time& duration,
396
                    uint32_t nReceivers);
391
397
392
  /**
398
  /**
393
   * Public method used to fire a PhyTxDrop trace.  Implemented for encapsulation
399
   * Public method used to fire a PhyTxDrop trace.  Implemented for encapsulation
 Lines 465-473    Link Here 
465
   * The trace source fired when a packet ends the transmission process on
471
   * The trace source fired when a packet ends the transmission process on
466
   * the medium.
472
   * the medium.
467
   *
473
   *
474
   * \param Ptr to packet that was transmitted
475
   * \param Duration for Transmission
476
   * \param Number of reeivers for the transmission
468
   * \see class CallBackTraceSource
477
   * \see class CallBackTraceSource
469
   */
478
   */
470
  TracedCallback<Ptr<const Packet> > m_phyTxEndTrace;
479
  TracedCallback<Ptr<const Packet>, const Time&, uint32_t> m_phyTxEndTrace;
471
480
472
  /**
481
  /**
473
   * The trace source fired when the phy layer drops a packet as it tries
482
   * The trace source fired when the phy layer drops a packet as it tries
(-)a/src/wifi/model/yans-wifi-channel.cc (-1 / +4 lines)
 Lines 74-86    Link Here 
74
  m_delay = delay;
74
  m_delay = delay;
75
}
75
}
76
76
77
void
77
uint32_t
78
YansWifiChannel::Send (Ptr<YansWifiPhy> sender, Ptr<const Packet> packet, double txPowerDbm,
78
YansWifiChannel::Send (Ptr<YansWifiPhy> sender, Ptr<const Packet> packet, double txPowerDbm,
79
                       WifiMode wifiMode, WifiPreamble preamble) const
79
                       WifiMode wifiMode, WifiPreamble preamble) const
80
{
80
{
81
  Ptr<MobilityModel> senderMobility = sender->GetMobility ()->GetObject<MobilityModel> ();
81
  Ptr<MobilityModel> senderMobility = sender->GetMobility ()->GetObject<MobilityModel> ();
82
  NS_ASSERT (senderMobility != 0);
82
  NS_ASSERT (senderMobility != 0);
83
  uint32_t j = 0;
83
  uint32_t j = 0;
84
  uint32_t nReceivers = 0;
84
  for (PhyList::const_iterator i = m_phyList.begin (); i != m_phyList.end (); i++, j++)
85
  for (PhyList::const_iterator i = m_phyList.begin (); i != m_phyList.end (); i++, j++)
85
    {
86
    {
86
      if (sender != (*i))
87
      if (sender != (*i))
 Lines 107-117    Link Here 
107
            {
108
            {
108
              dstNode = dstNetDevice->GetObject<NetDevice> ()->GetNode ()->GetId ();
109
              dstNode = dstNetDevice->GetObject<NetDevice> ()->GetNode ()->GetId ();
109
            }
110
            }
111
          nReceivers++;
110
          Simulator::ScheduleWithContext (dstNode,
112
          Simulator::ScheduleWithContext (dstNode,
111
                                          delay, &YansWifiChannel::Receive, this,
113
                                          delay, &YansWifiChannel::Receive, this,
112
                                          j, copy, rxPowerDbm, wifiMode, preamble);
114
                                          j, copy, rxPowerDbm, wifiMode, preamble);
113
        }
115
        }
114
    }
116
    }
117
  return nReceivers;
115
}
118
}
116
119
117
void
120
void
(-)a/src/wifi/model/yans-wifi-channel.h (-2 / +3 lines)
 Lines 76-88    Link Here 
76
   * \param wifiMode the tx mode associated to the packet
76
   * \param wifiMode the tx mode associated to the packet
77
   * \param preamble the preamble associated to the packet
77
   * \param preamble the preamble associated to the packet
78
   *
78
   *
79
   * returns the number of receivers that will receive the packet
79
   * This method should not be invoked by normal users. It is
80
   * This method should not be invoked by normal users. It is
80
   * currently invoked only from WifiPhy::Send. YansWifiChannel
81
   * currently invoked only from WifiPhy::Send. YansWifiChannel
81
   * delivers packets only between PHYs with the same m_channelNumber,
82
   * delivers packets only between PHYs with the same m_channelNumber,
82
   * e.g. PHYs that are operating on the same channel.
83
   * e.g. PHYs that are operating on the same channel.
83
   */
84
   */
84
  void Send (Ptr<YansWifiPhy> sender, Ptr<const Packet> packet, double txPowerDbm,
85
  uint32_t Send (Ptr<YansWifiPhy> sender, Ptr<const Packet> packet, double txPowerDbm,
85
             WifiMode wifiMode, WifiPreamble preamble) const;
86
                 WifiMode wifiMode, WifiPreamble preamble) const;
86
87
87
private:
88
private:
88
  YansWifiChannel& operator = (const YansWifiChannel &);
89
  YansWifiChannel& operator = (const YansWifiChannel &);
(-)a/src/wifi/model/yans-wifi-phy.cc (-1 / +2 lines)
 Lines 518-524    Link Here 
518
  bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble);
518
  bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble);
519
  NotifyPromiscSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble);
519
  NotifyPromiscSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble);
520
  m_state->SwitchToTx (txDuration, packet, txMode, preamble, txPower);
520
  m_state->SwitchToTx (txDuration, packet, txMode, preamble, txPower);
521
  m_channel->Send (this, packet, GetPowerDbm (txPower) + m_txGainDb, txMode, preamble);
521
  uint32_t nReceivers = m_channel->Send (this, packet, GetPowerDbm (txPower) + m_txGainDb, txMode, preamble);
522
  NotifyTxEnd (packet, txDuration, nReceivers);
522
}
523
}
523
524
524
uint32_t
525
uint32_t

Return to bug 1185