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 * | 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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 ", snr=" << snrPer.snr << ", per=" << snrPer.per << ", size=" <<
packet->GetSize ()); | 784 ", snr=" << snrPer.snr << ", per=" << snrPer.per << ", size=" <<
packet->GetSize ()); |
785 if (m_random.GetValue () > snrPer.per) | 785 if (m_random.GetValue () > snrPer.per) |
786 { | 786 { |
787 NotifyRxEnd (packet); | 787 NotifyRxEnd (packet); |
788 uint32_t rate = event->GetPayloadMode ().GetDataRate () / 500000; | 788 uint32_t rate = event->GetPayloadMode ().GetDataRate () / 500000; |
789 bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ()); | 789 bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ()); |
790 double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30; | 790 double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30; |
791 double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNo
iseFigure () + 30; | 791 double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNo
iseFigure () + 30; |
792 uint8_t frameFlags = RadiotapHeader::FRAME_FLAG_NONE; | 792 uint8_t frameFlags = RadiotapHeader::FRAME_FLAG_NONE; |
793 Ptr<Packet> p = packet->Copy (); | 793 Ptr<Packet> p = packet->Copy (); |
794 WifiMacHeader wifimacheader; | |
795 p->RemoveHeader (wifimacheader); | |
796 | |
797 | 794 |
798 RadiotapHeader header; | 795 RadiotapHeader header; |
799 header.SetTsft (Simulator::Now ().GetMicroSeconds ()); | 796 header.SetTsft (Simulator::Now ().GetMicroSeconds ()); |
800 frameFlags |= RadiotapHeader::FRAME_FLAG_FCS_INCLUDED; | 797 frameFlags |= RadiotapHeader::FRAME_FLAG_FCS_INCLUDED; |
801 | 798 |
802 if (isShortPreamble) | 799 if (isShortPreamble) |
803 { | 800 { |
804 frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE; | 801 frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE; |
805 } | 802 } |
806 | 803 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetPayloadMode (),
event->GetPreambleType (), header); | 839 m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetPayloadMode (),
event->GetPreambleType (), header); |
843 } | 840 } |
844 else | 841 else |
845 { | 842 { |
846 /* failure. */ | 843 /* failure. */ |
847 NotifyRxDrop (packet); | 844 NotifyRxDrop (packet); |
848 m_state->SwitchFromRxEndError (packet, snrPer.snr); | 845 m_state->SwitchFromRxEndError (packet, snrPer.snr); |
849 } | 846 } |
850 } | 847 } |
851 } // namespace ns3 | 848 } // namespace ns3 |
LEFT | RIGHT |