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

(-)a/src/wifi/model/edca-txop-n.cc (-1 / +16 lines)
 Lines 253-258    Link Here 
253
                     "Trace source for contention window values",
253
                     "Trace source for contention window values",
254
                     MakeTraceSourceAccessor (&EdcaTxopN::m_cwTrace),
254
                     MakeTraceSourceAccessor (&EdcaTxopN::m_cwTrace),
255
                     "ns3::TracedValue::Uint32Callback")
255
                     "ns3::TracedValue::Uint32Callback")
256
    .AddTraceSource ("TxopTrace",
257
                     "Trace source for txop start and duration times",
258
                     MakeTraceSourceAccessor (&EdcaTxopN::m_txopTrace),
259
                     "ns3::TracedValueCallback::Time")
256
  ;
260
  ;
257
  return tid;
261
  return tid;
258
}
262
}
 Lines 1254-1262    Link Here 
1254
EdcaTxopN::StartNext (void)
1258
EdcaTxopN::StartNext (void)
1255
{
1259
{
1256
  NS_LOG_FUNCTION (this);
1260
  NS_LOG_FUNCTION (this);
1261
  NS_ASSERT (GetTxopLimit () == NanoSeconds (0) || Simulator::Now () - m_startTxop <= GetTxopLimit ());
1262
1257
  WifiMacHeader hdr;
1263
  WifiMacHeader hdr;
1258
  Time tstamp;
1264
  Time tstamp;
1259
1260
  Ptr<const Packet> peekedPacket = m_queue->PeekByTidAndAddress (&hdr,
1265
  Ptr<const Packet> peekedPacket = m_queue->PeekByTidAndAddress (&hdr,
1261
                                                                 m_currentHdr.GetQosTid (),
1266
                                                                 m_currentHdr.GetQosTid (),
1262
                                                                 WifiMacHeader::ADDR1,
1267
                                                                 WifiMacHeader::ADDR1,
 Lines 1264-1269    Link Here 
1264
                                                                 &tstamp);
1269
                                                                 &tstamp);
1265
  if (peekedPacket == 0)
1270
  if (peekedPacket == 0)
1266
    {
1271
    {
1272
      if (GetTxopLimit () > NanoSeconds (0))
1273
        {
1274
          NS_ASSERT (Simulator::Now () - m_startTxop <= GetTxopLimit ());
1275
          m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop);
1276
        }
1267
      return;
1277
      return;
1268
    }
1278
    }
1269
    
1279
    
 Lines 1297-1302    Link Here 
1297
                                                         m_currentHdr.GetAddr1 ());
1307
                                                         m_currentHdr.GetAddr1 ());
1298
      Low ()->StartTransmission (m_currentPacket, &m_currentHdr, params, m_transmissionListener);
1308
      Low ()->StartTransmission (m_currentPacket, &m_currentHdr, params, m_transmissionListener);
1299
    }
1309
    }
1310
  else if (GetTxopLimit () > NanoSeconds (0))
1311
    {
1312
      NS_ASSERT (Simulator::Now () - m_startTxop <= GetTxopLimit ());
1313
      m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop);
1314
    }
1300
}
1315
}
1301
1316
1302
Time
1317
Time
(-)a/src/wifi/model/edca-txop-n.h (+1 lines)
 Lines 594-599    Link Here 
594
  bool m_isAccessRequestedForRts;
594
  bool m_isAccessRequestedForRts;
595
  TracedValue<uint32_t> m_backoffTrace;
595
  TracedValue<uint32_t> m_backoffTrace;
596
  TracedValue<uint32_t> m_cwTrace;
596
  TracedValue<uint32_t> m_cwTrace;
597
  TracedCallback<Time, Time> m_txopTrace;
597
};
598
};
598
599
599
} //namespace ns3
600
} //namespace ns3
(-)a/src/wifi/test/wifi-test.cc (+3 lines)
 Lines 1025-1030    Link Here 
1025
  phy.SetChannel (channel.Create ());
1025
  phy.SetChannel (channel.Create ());
1026
1026
1027
  WifiHelper wifi;
1027
  WifiHelper wifi;
1028
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
1029
                                "DataMode", StringValue ("OfdmRate54Mbps"),
1030
                                "ControlMode", StringValue ("OfdmRate24Mbps"));
1028
  WifiMacHelper mac;
1031
  WifiMacHelper mac;
1029
  Ssid ssid = Ssid ("ns-3-ssid");
1032
  Ssid ssid = Ssid ("ns-3-ssid");
1030
  mac.SetType ("ns3::AdhocWifiMac",
1033
  mac.SetType ("ns3::AdhocWifiMac",

Return to bug 2463