|
244 |
m_lastSwitchingDuration (MicroSeconds (0)), |
244 |
m_lastSwitchingDuration (MicroSeconds (0)), |
245 |
m_rxing (false), |
245 |
m_rxing (false), |
246 |
m_slotTime (Seconds (0.0)), |
246 |
m_slotTime (Seconds (0.0)), |
|
|
247 |
m_slotTimeInvert (Scalar (1) / Seconds (10.0)), |
247 |
m_sifs (Seconds (0.0)), |
248 |
m_sifs (Seconds (0.0)), |
248 |
m_phyListener (0), |
249 |
m_phyListener (0), |
249 |
m_lowListener (0) |
250 |
m_lowListener (0) |
|
274 |
DcfManager::SetSlot (Time slotTime) |
275 |
DcfManager::SetSlot (Time slotTime) |
275 |
{ |
276 |
{ |
276 |
m_slotTime = slotTime; |
277 |
m_slotTime = slotTime; |
|
|
278 |
m_slotTimeInvert = Scalar (1) / slotTime; |
277 |
} |
279 |
} |
278 |
void |
280 |
void |
279 |
DcfManager::SetSifs (Time sifs) |
281 |
DcfManager::SetSifs (Time sifs) |
|
519 |
Time backoffStart = GetBackoffStartFor (state); |
521 |
Time backoffStart = GetBackoffStartFor (state); |
520 |
if (backoffStart <= Simulator::Now ()) |
522 |
if (backoffStart <= Simulator::Now ()) |
521 |
{ |
523 |
{ |
522 |
Scalar nSlots = (Simulator::Now () - backoffStart) / m_slotTime; |
524 |
Scalar nSlots = (Simulator::Now () - backoffStart) * m_slotTimeInvert; |
523 |
uint32_t nIntSlots = lrint (nSlots.GetDouble ()); |
525 |
uint32_t nIntSlots = lrint (nSlots.GetDouble ()); |
524 |
uint32_t n = std::min (nIntSlots, state->GetBackoffSlots ()); |
526 |
uint32_t n = std::min (nIntSlots, state->GetBackoffSlots ()); |
525 |
MY_DEBUG ("dcf " << k << " dec backoff slots=" << n); |
527 |
MY_DEBUG ("dcf " << k << " dec backoff slots=" << n); |