LEFT | RIGHT |
(no file at all) | |
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 if (m_channelAccess == ExtendedAccess) | 252 if (m_channelAccess == ExtendedAccess) |
253 { | 253 { |
254 if (m_channelNumber != sch) | 254 if (m_channelNumber != sch) |
255 { | 255 { |
256 return false; | 256 return false; |
257 } | 257 } |
258 else | 258 else |
259 { | 259 { |
260 // if current remain extends cannot fulfill the requirement for extend
s | 260 // if current remain extends cannot fulfill the requirement for extend
s |
261 Time remainTime = Simulator::GetDelayLeft (m_extendEvent); | 261 Time remainTime = Simulator::GetDelayLeft (m_extendEvent); |
262 uint32_t remainExtends = remainTime / m_coordinator->GetSyncInterval (
); | 262 uint32_t remainExtends = static_cast<uint32_t> (remainTime / m_coordin
ator->GetSyncInterval ()); |
263 if (remainExtends > extends) | 263 if (remainExtends > extends) |
264 { | 264 { |
265 return true; | 265 return true; |
266 } | 266 } |
267 else | 267 else |
268 { | 268 { |
269 return false; | 269 return false; |
270 } | 270 } |
271 } | 271 } |
272 } | 272 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 return; | 363 return; |
364 } | 364 } |
365 Ptr<OcbWifiMac> curMacEntity = m_device->GetMac (curChannelNumber); | 365 Ptr<OcbWifiMac> curMacEntity = m_device->GetMac (curChannelNumber); |
366 Ptr<OcbWifiMac> nextMacEntity = m_device->GetMac (nextChannelNumber); | 366 Ptr<OcbWifiMac> nextMacEntity = m_device->GetMac (nextChannelNumber); |
367 // Perfect channel switch operation among multiple MAC entities in the context
of single PHY device. | 367 // Perfect channel switch operation among multiple MAC entities in the context
of single PHY device. |
368 // first make current MAC entity in sleep mode. | 368 // first make current MAC entity in sleep mode. |
369 curMacEntity->Suspend (); | 369 curMacEntity->Suspend (); |
370 // second unattached current MAC entity from single PHY device | 370 // second unattached current MAC entity from single PHY device |
371 curMacEntity->ResetWifiPhy (); | 371 curMacEntity->ResetWifiPhy (); |
372 // third switch PHY device from current channel to next channel; | 372 // third switch PHY device from current channel to next channel; |
373 m_phy->SetChannelNumber (nextChannelNumber); | 373 m_phy->SetChannelNumber (static_cast<uint8_t> (nextChannelNumber)); |
374 // Here channel switch time is required to notify next MAC entity | 374 // Here channel switch time is required to notify next MAC entity |
375 // that channel access cannot be enabled in channel switch time. | 375 // that channel access cannot be enabled in channel switch time. |
376 Time switchTime = m_phy->GetChannelSwitchDelay (); | 376 Time switchTime = m_phy->GetChannelSwitchDelay (); |
377 nextMacEntity->MakeVirtualBusy (switchTime); | 377 nextMacEntity->MakeVirtualBusy (switchTime); |
378 // four attach next MAC entity to single PHY device | 378 // four attach next MAC entity to single PHY device |
379 nextMacEntity->SetWifiPhy (m_phy); | 379 nextMacEntity->SetWifiPhy (m_phy); |
380 // finally resume next MAC entity from sleep mode | 380 // finally resume next MAC entity from sleep mode |
381 nextMacEntity->Resume (); | 381 nextMacEntity->Resume (); |
382 } | 382 } |
383 | 383 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 else | 441 else |
442 { | 442 { |
443 Ptr<OcbWifiMac> mac = m_device->GetMac (m_channelNumber); | 443 Ptr<OcbWifiMac> mac = m_device->GetMac (m_channelNumber); |
444 SwitchToNextChannel (CCH, m_channelNumber); | 444 SwitchToNextChannel (CCH, m_channelNumber); |
445 // see chapter 6.2.5 Sync tolerance | 445 // see chapter 6.2.5 Sync tolerance |
446 // a medium busy shall be declared during the guard interval. | 446 // a medium busy shall be declared during the guard interval. |
447 mac->MakeVirtualBusy (duration); | 447 mac->MakeVirtualBusy (duration); |
448 } | 448 } |
449 } | 449 } |
450 } // namespace ns3 | 450 } // namespace ns3 |
LEFT | RIGHT |