LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License version 2 as | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // the time to Guard Interval of next CCH Interval | 277 // the time to Guard Interval of next CCH Interval |
278 return (GetSyncInterval () - GetIntervalTime (duration)); | 278 return (GetSyncInterval () - GetIntervalTime (duration)); |
279 } | 279 } |
280 | 280 |
281 Time | 281 Time |
282 ChannelCoordinator::GetIntervalTime (Time duration) const | 282 ChannelCoordinator::GetIntervalTime (Time duration) const |
283 { | 283 { |
284 NS_LOG_FUNCTION (this << duration); | 284 NS_LOG_FUNCTION (this << duration); |
285 Time future = Now () + duration; | 285 Time future = Now () + duration; |
286 Time sync = GetSyncInterval (); | 286 Time sync = GetSyncInterval (); |
287 uint32_t n = static_cast<uint32_t>(future.GetMilliSeconds () / sync.GetMilliSe
conds ()); | 287 uint32_t n = static_cast<uint32_t> (future.GetMilliSeconds () / sync.GetMilliS
econds ()); |
288 return future - MilliSeconds (n * sync.GetMilliSeconds ()); | 288 return future - MilliSeconds (n * sync.GetMilliSeconds ()); |
289 } | 289 } |
290 | 290 |
291 Time | 291 Time |
292 ChannelCoordinator::GetRemainTime (Time duration) const | 292 ChannelCoordinator::GetRemainTime (Time duration) const |
293 { | 293 { |
294 NS_LOG_FUNCTION (this << duration); | 294 NS_LOG_FUNCTION (this << duration); |
295 return GetSyncInterval () - GetIntervalTime (duration); | 295 return GetSyncInterval () - GetIntervalTime (duration); |
296 } | 296 } |
297 | 297 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 m_coordination = Simulator::Schedule (guardSlot, &ChannelCoordinator::Noti
fySchSlot, this); | 390 m_coordination = Simulator::Schedule (guardSlot, &ChannelCoordinator::Noti
fySchSlot, this); |
391 } | 391 } |
392 for (ListenersI i = m_listeners.begin (); i != m_listeners.end (); ++i) | 392 for (ListenersI i = m_listeners.begin (); i != m_listeners.end (); ++i) |
393 { | 393 { |
394 (*i)->NotifyGuardSlotStart (guardSlot, inCchi); | 394 (*i)->NotifyGuardSlotStart (guardSlot, inCchi); |
395 } | 395 } |
396 m_guardCount++; | 396 m_guardCount++; |
397 } | 397 } |
398 | 398 |
399 } // namespace ns3 | 399 } // namespace ns3 |
LEFT | RIGHT |