Left: | ||
Right: |
OLD | NEW |
---|---|
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 * Copyright (c) 2016 University of Washington | 3 * Copyright (c) 2016 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 if (standard == clientStandards[i].m_name) | 309 if (standard == clientStandards[i].m_name) |
310 { | 310 { |
311 clientSelectedStandard = clientStandards[i]; | 311 clientSelectedStandard = clientStandards[i]; |
312 } | 312 } |
313 } | 313 } |
314 | 314 |
315 NS_ABORT_IF (serverSelectedStandard.m_name == "none"); | 315 NS_ABORT_IF (serverSelectedStandard.m_name == "none"); |
316 NS_ABORT_IF (clientSelectedStandard.m_name == "none"); | 316 NS_ABORT_IF (clientSelectedStandard.m_name == "none"); |
317 std::cout << "Testing " << serverSelectedStandard.m_name << " with " << wifiMa nager << " ..." << std::endl; | 317 std::cout << "Testing " << serverSelectedStandard.m_name << " with " << wifiMa nager << " ..." << std::endl; |
318 NS_ABORT_MSG_IF (clientSelectedStandard.m_snrLow >= clientSelectedStandard.m_s nrHigh, "SNR values in wrong order"); | 318 NS_ABORT_MSG_IF (clientSelectedStandard.m_snrLow >= clientSelectedStandard.m_s nrHigh, "SNR values in wrong order"); |
319 steps = std::abs ((int) (clientSelectedStandard.m_snrHigh - clientSelectedStan dard.m_snrLow ) / stepSize) + 1; | 319 steps = static_cast<uint32_t>(std::abs ((int) (clientSelectedStandard.m_snrHig h - clientSelectedStandard.m_snrLow ) / stepSize) + 1); |
S. Deronne
2017/12/23 10:19:58
I see two cast here, one c++ and one old C style c
ammo6818-vandals.uidaho.edu
2017/12/23 15:14:33
change to c++ style.
| |
320 NS_LOG_DEBUG ("Using " << steps << " steps for SNR range " << clientSelectedSt andard.m_snrLow << ":" << clientSelectedStandard.m_snrHigh); | 320 NS_LOG_DEBUG ("Using " << steps << " steps for SNR range " << clientSelectedSt andard.m_snrLow << ":" << clientSelectedStandard.m_snrHigh); |
321 Ptr<Node> clientNode = CreateObject<Node> (); | 321 Ptr<Node> clientNode = CreateObject<Node> (); |
322 Ptr<Node> serverNode = CreateObject<Node> (); | 322 Ptr<Node> serverNode = CreateObject<Node> (); |
323 | 323 |
324 Config::SetDefault ("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue (m axSlrc)); | 324 Config::SetDefault ("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue (m axSlrc)); |
325 Config::SetDefault ("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue (m axSsrc)); | 325 Config::SetDefault ("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue (m axSsrc)); |
326 | 326 |
327 WifiHelper wifi; | 327 WifiHelper wifi; |
328 wifi.SetStandard (serverSelectedStandard.m_standard); | 328 wifi.SetStandard (serverSelectedStandard.m_standard); |
329 YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); | 329 YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
393 | 393 |
394 // Perform post-install configuration from defaults for channel width, | 394 // Perform post-install configuration from defaults for channel width, |
395 // guard interval, and nss, if necessary | 395 // guard interval, and nss, if necessary |
396 // Obtain pointer to the WifiPhy | 396 // Obtain pointer to the WifiPhy |
397 Ptr<NetDevice> ndClient = clientDevice.Get (0); | 397 Ptr<NetDevice> ndClient = clientDevice.Get (0); |
398 Ptr<NetDevice> ndServer = serverDevice.Get (0); | 398 Ptr<NetDevice> ndServer = serverDevice.Get (0); |
399 Ptr<WifiNetDevice> wndClient = ndClient->GetObject<WifiNetDevice> (); | 399 Ptr<WifiNetDevice> wndClient = ndClient->GetObject<WifiNetDevice> (); |
400 Ptr<WifiNetDevice> wndServer = ndServer->GetObject<WifiNetDevice> (); | 400 Ptr<WifiNetDevice> wndServer = ndServer->GetObject<WifiNetDevice> (); |
401 Ptr<WifiPhy> wifiPhyPtrClient = wndClient->GetPhy (); | 401 Ptr<WifiPhy> wifiPhyPtrClient = wndClient->GetPhy (); |
402 Ptr<WifiPhy> wifiPhyPtrServer = wndServer->GetPhy (); | 402 Ptr<WifiPhy> wifiPhyPtrServer = wndServer->GetPhy (); |
403 wifiPhyPtrClient->SetNumberOfAntennas (clientNss); | 403 wifiPhyPtrClient->SetNumberOfAntennas (static_cast<uint8_t>(clientNss)); |
404 wifiPhyPtrClient->SetMaxSupportedTxSpatialStreams (clientNss); | 404 wifiPhyPtrClient->SetMaxSupportedTxSpatialStreams (static_cast<uint8_t>(client Nss)); |
405 wifiPhyPtrClient->SetMaxSupportedRxSpatialStreams (clientNss); | 405 wifiPhyPtrClient->SetMaxSupportedRxSpatialStreams (static_cast<uint8_t>(client Nss)); |
406 wifiPhyPtrServer->SetNumberOfAntennas (serverNss); | 406 wifiPhyPtrServer->SetNumberOfAntennas (static_cast<uint8_t>(serverNss)); |
407 wifiPhyPtrServer->SetMaxSupportedTxSpatialStreams (serverNss); | 407 wifiPhyPtrServer->SetMaxSupportedTxSpatialStreams (static_cast<uint8_t>(server Nss)); |
408 wifiPhyPtrServer->SetMaxSupportedRxSpatialStreams (serverNss); | 408 wifiPhyPtrServer->SetMaxSupportedRxSpatialStreams (static_cast<uint8_t>(server Nss)); |
409 // Only set the channel width and guard interval for HT and VHT modes | 409 // Only set the channel width and guard interval for HT and VHT modes |
410 if (serverSelectedStandard.m_name == "802.11n-5GHz" | 410 if (serverSelectedStandard.m_name == "802.11n-5GHz" |
411 || serverSelectedStandard.m_name == "802.11n-2.4GHz" | 411 || serverSelectedStandard.m_name == "802.11n-2.4GHz" |
412 || serverSelectedStandard.m_name == "802.11ac") | 412 || serverSelectedStandard.m_name == "802.11ac") |
413 { | 413 { |
414 wifiPhyPtrServer->SetChannelWidth (serverSelectedStandard.m_width); | 414 wifiPhyPtrServer->SetChannelWidth (static_cast<uint8_t>(serverSelectedStan dard.m_width)); |
415 wifiPhyPtrServer->SetShortGuardInterval (serverShortGuardInterval == 400); | 415 wifiPhyPtrServer->SetShortGuardInterval (serverShortGuardInterval == 400); |
416 wifiPhyPtrClient->SetChannelWidth (clientSelectedStandard.m_width); | 416 wifiPhyPtrClient->SetChannelWidth (static_cast<uint8_t>(clientSelectedStan dard.m_width)); |
417 wifiPhyPtrClient->SetShortGuardInterval (clientShortGuardInterval == 400); | 417 wifiPhyPtrClient->SetShortGuardInterval (clientShortGuardInterval == 400); |
418 } | 418 } |
419 else if (serverSelectedStandard.m_name == "802.11ax-5GHz" | 419 else if (serverSelectedStandard.m_name == "802.11ax-5GHz" |
420 || serverSelectedStandard.m_name == "802.11ax-2.4GHz") | 420 || serverSelectedStandard.m_name == "802.11ax-2.4GHz") |
421 { | 421 { |
422 wifiPhyPtrServer->SetChannelWidth (serverSelectedStandard.m_width); | 422 wifiPhyPtrServer->SetChannelWidth (static_cast<uint8_t>(serverSelectedStan dard.m_width)); |
423 wifiPhyPtrServer->SetGuardInterval (NanoSeconds (serverShortGuardInterval) ); | 423 wifiPhyPtrServer->SetGuardInterval (NanoSeconds (serverShortGuardInterval) ); |
424 wifiPhyPtrClient->SetChannelWidth (clientSelectedStandard.m_width); | 424 wifiPhyPtrClient->SetChannelWidth (static_cast<uint8_t>(clientSelectedStan dard.m_width)); |
425 wifiPhyPtrClient->SetGuardInterval (NanoSeconds (clientShortGuardInterval) ); | 425 wifiPhyPtrClient->SetGuardInterval (NanoSeconds (clientShortGuardInterval) ); |
426 } | 426 } |
427 NS_LOG_DEBUG ("Channel width " << wifiPhyPtrClient->GetChannelWidth () << " no iseDbm " << noiseDbm); | 427 NS_LOG_DEBUG ("Channel width " << wifiPhyPtrClient->GetChannelWidth () << " no iseDbm " << noiseDbm); |
428 NS_LOG_DEBUG ("NSS " << wifiPhyPtrClient->GetMaxSupportedTxSpatialStreams ()); | 428 NS_LOG_DEBUG ("NSS " << wifiPhyPtrClient->GetMaxSupportedTxSpatialStreams ()); |
429 | 429 |
430 // Configure signal and noise, and schedule first iteration | 430 // Configure signal and noise, and schedule first iteration |
431 noiseDbm += 10 * log10 (clientSelectedStandard.m_width * 1000000); | 431 noiseDbm += 10 * log10 (clientSelectedStandard.m_width * 1000000); |
432 double rssCurrent = (clientSelectedStandard.m_snrHigh + noiseDbm); | 432 double rssCurrent = (clientSelectedStandard.m_snrHigh + noiseDbm); |
433 rssLossModel->SetRss (rssCurrent); | 433 rssLossModel->SetRss (rssCurrent); |
434 NS_LOG_INFO ("Setting initial Rss to " << rssCurrent); | 434 NS_LOG_INFO ("Setting initial Rss to " << rssCurrent); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
539 gnuplot.SetTitle (title); | 539 gnuplot.SetTitle (title); |
540 gnuplot.SetExtra (xRangeStr); | 540 gnuplot.SetExtra (xRangeStr); |
541 gnuplot.AppendExtra (yRangeStr); | 541 gnuplot.AppendExtra (yRangeStr); |
542 gnuplot.AppendExtra ("set key top left"); | 542 gnuplot.AppendExtra ("set key top left"); |
543 gnuplot.GenerateOutput (outfile); | 543 gnuplot.GenerateOutput (outfile); |
544 outfile.close (); | 544 outfile.close (); |
545 | 545 |
546 return 0; | 546 return 0; |
547 } | 547 } |
548 | 548 |
OLD | NEW |