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 * Copyright (c) 2005,2006 INRIA | 3 * Copyright (c) 2005,2006 INRIA |
4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
5 * it under the terms of the GNU General Public License version 2 as | 5 * it under the terms of the GNU General Public License version 2 as |
6 * published by the Free Software Foundation; | 6 * published by the Free Software Foundation; |
7 * | 7 * |
8 * This program is distributed in the hope that it will be useful, | 8 * This program is distributed in the hope that it will be useful, |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 // if current PHY devices do not support data rate of the tx profile | 399 // if current PHY devices do not support data rate of the tx profile |
400 for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); +
+i) | 400 for (PhyEntitiesI i = m_phyEntities.begin (); i != m_phyEntities.end (); +
+i) |
401 { | 401 { |
402 if ( !((*i)->IsModeSupported (txInfo.dataRate))) | 402 if ( !((*i)->IsModeSupported (txInfo.dataRate))) |
403 { | 403 { |
404 return false; | 404 return false; |
405 } | 405 } |
406 } | 406 } |
407 WifiTxVector txVector; | 407 WifiTxVector txVector; |
408 txVector.SetChannelWidth (10); | 408 txVector.SetChannelWidth (10); |
409 txVector.SetTxPowerLevel (txInfo.txPowerLevel); | 409 txVector.SetTxPowerLevel (static_cast<uint8_t> (txInfo.txPowerLevel)); |
410 txVector.SetMode (txInfo.dataRate); | 410 txVector.SetMode (txInfo.dataRate); |
411 txVector.SetPreambleType (txInfo.preamble); | 411 txVector.SetPreambleType (txInfo.preamble); |
412 HigherLayerTxVectorTag tag = HigherLayerTxVectorTag (txVector, false); | 412 HigherLayerTxVectorTag tag = HigherLayerTxVectorTag (txVector, false); |
413 packet->AddPacketTag (tag); | 413 packet->AddPacketTag (tag); |
414 } | 414 } |
415 | 415 |
416 LlcSnapHeader llc; | 416 LlcSnapHeader llc; |
417 llc.SetType (protocol); | 417 llc.SetType (static_cast<uint16_t> (protocol)); |
418 packet->AddHeader (llc); | 418 packet->AddHeader (llc); |
419 | 419 |
420 // according to channel number and priority, | 420 // according to channel number and priority, |
421 // route the packet to a proper queue. | 421 // route the packet to a proper queue. |
422 SocketPriorityTag prio; | 422 SocketPriorityTag prio; |
423 prio.SetPriority (txInfo.priority); | 423 prio.SetPriority (static_cast<uint8_t> (txInfo.priority)); |
424 packet->ReplacePacketTag (prio); | 424 packet->ReplacePacketTag (prio); |
425 Ptr<WifiMac> mac = GetMac (txInfo.channelNumber); | 425 Ptr<WifiMac> mac = GetMac (txInfo.channelNumber); |
426 Mac48Address realTo = Mac48Address::ConvertFrom (dest); | 426 Mac48Address realTo = Mac48Address::ConvertFrom (dest); |
427 mac->NotifyTx (packet); | 427 mac->NotifyTx (packet); |
428 mac->Enqueue (packet, realTo); | 428 mac->Enqueue (packet, realTo); |
429 return true; | 429 return true; |
430 } | 430 } |
431 | 431 |
432 void | 432 void |
433 WaveNetDevice::ChangeAddress (Address newAddress) | 433 WaveNetDevice::ChangeAddress (Address newAddress) |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 return false; | 607 return false; |
608 } | 608 } |
609 if (m_txProfile->dataRate == WifiMode () || m_txProfile->txPowerLevel == 8) | 609 if (m_txProfile->dataRate == WifiMode () || m_txProfile->txPowerLevel == 8) |
610 { | 610 { |
611 // let MAC layer itself determine tx parameters. | 611 // let MAC layer itself determine tx parameters. |
612 NS_LOG_DEBUG ("High layer does not want to control tx parameters."); | 612 NS_LOG_DEBUG ("High layer does not want to control tx parameters."); |
613 } | 613 } |
614 else | 614 else |
615 { | 615 { |
616 WifiTxVector txVector; | 616 WifiTxVector txVector; |
617 txVector.SetTxPowerLevel (m_txProfile->txPowerLevel); | 617 txVector.SetTxPowerLevel (static_cast<uint8_t> (m_txProfile->txPowerLevel)
); |
618 txVector.SetMode (m_txProfile->dataRate); | 618 txVector.SetMode (m_txProfile->dataRate); |
619 txVector.SetPreambleType (m_txProfile->preamble); | 619 txVector.SetPreambleType (m_txProfile->preamble); |
620 HigherLayerTxVectorTag tag = HigherLayerTxVectorTag (txVector, m_txProfile
->adaptable); | 620 HigherLayerTxVectorTag tag = HigherLayerTxVectorTag (txVector, m_txProfile
->adaptable); |
621 packet->AddPacketTag (tag); | 621 packet->AddPacketTag (tag); |
622 } | 622 } |
623 | 623 |
624 LlcSnapHeader llc; | 624 LlcSnapHeader llc; |
625 llc.SetType (protocol); | 625 llc.SetType (protocol); |
626 packet->AddHeader (llc); | 626 packet->AddHeader (llc); |
627 | 627 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 } | 733 } |
734 } | 734 } |
735 | 735 |
736 bool | 736 bool |
737 WaveNetDevice::SupportsSendFrom (void) const | 737 WaveNetDevice::SupportsSendFrom (void) const |
738 { | 738 { |
739 return (GetMac (CCH))->SupportsSendFrom (); | 739 return (GetMac (CCH))->SupportsSendFrom (); |
740 } | 740 } |
741 | 741 |
742 } // namespace ns3 | 742 } // namespace ns3 |
LEFT | RIGHT |