A Discrete-Event Network Simulator
API
yans-wifi-phy.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  *
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
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  * Ghada Badawy <gbadawy@gmail.com>
20  * S├ębastien Deronne <sebastien.deronne@gmail.com>
21  */
22 
23 #ifndef YANS_WIFI_PHY_H
24 #define YANS_WIFI_PHY_H
25 
26 #include "wifi-phy.h"
27 
28 namespace ns3 {
29 
30 class YansWifiChannel;
31 
47 class YansWifiPhy : public WifiPhy
48 {
49 public:
50  static TypeId GetTypeId (void);
51 
52  YansWifiPhy ();
53  virtual ~YansWifiPhy ();
54 
61 
73  double rxPowerDbm,
74  WifiTxVector txVector,
75  WifiPreamble preamble,
76  enum mpduType mpdutype,
77  Time rxDuration);
87  void StartReceivePacket (Ptr<Packet> packet,
88  WifiTxVector txVector,
89  WifiPreamble preamble,
90  enum mpduType mpdutype,
92 
93  virtual void SetReceiveOkCallback (WifiPhy::RxOkCallback callback);
94  virtual void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback);
95  virtual void SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, enum WifiPreamble preamble);
96  virtual void SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, enum WifiPreamble preamble, enum mpduType mpdutype);
97  virtual void RegisterListener (WifiPhyListener *listener);
98  virtual void UnregisterListener (WifiPhyListener *listener);
99  virtual void SetSleepMode (void);
100  virtual void ResumeFromSleep (void);
101  virtual Ptr<WifiChannel> GetChannel (void) const;
102 
103 protected:
104  // Inherited
105  virtual void DoDispose (void);
106  virtual bool DoChannelSwitch (uint16_t id);
107  virtual bool DoFrequencySwitch (uint32_t frequency);
108 
109 private:
118  void EndReceive (Ptr<Packet> packet, enum WifiPreamble preamble, enum mpduType mpdutype, Ptr<InterferenceHelper::Event> event);
119 
121 };
122 
123 } //namespace ns3
124 
125 #endif /* YANS_WIFI_PHY_H */
tuple channel
Definition: third.py:85
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual void SendPacket(Ptr< const Packet > packet, WifiTxVector txVector, enum WifiPreamble preamble)
Ptr< YansWifiChannel > m_channel
YansWifiChannel that this YansWifiPhy is connected to.
802.11 PHY layer model
Definition: wifi-phy.h:162
virtual void RegisterListener(WifiPhyListener *listener)
virtual bool DoFrequencySwitch(uint32_t frequency)
The default implementation does nothing and returns true.
virtual void SetReceiveErrorCallback(WifiPhy::RxErrorCallback callback)
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:30
void StartReceivePacket(Ptr< Packet > packet, WifiTxVector txVector, WifiPreamble preamble, enum mpduType mpdutype, Ptr< InterferenceHelper::Event > event)
Starting receiving the payload of a packet (i.e.
receive notifications about phy events.
Definition: wifi-phy.h:81
virtual void DoDispose(void)
Destructor implementation.
void SetChannel(Ptr< YansWifiChannel > channel)
Set the YansWifiChannel this YansWifiPhy is to be connected to.
virtual ~YansWifiPhy()
virtual void SetReceiveOkCallback(WifiPhy::RxOkCallback callback)
virtual void UnregisterListener(WifiPhyListener *listener)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
802.11 PHY layer modelThis PHY implements a model of 802.11a.
Definition: yans-wifi-phy.h:47
static TypeId GetTypeId(void)
virtual void SetSleepMode(void)
Put in sleep mode.
void StartReceivePreambleAndHeader(Ptr< Packet > packet, double rxPowerDbm, WifiTxVector txVector, WifiPreamble preamble, enum mpduType mpdutype, Time rxDuration)
Starting receiving the plcp of a packet (i.e.
virtual Ptr< WifiChannel > GetChannel(void) const
Return the WifiChannel this WifiPhy is connected to.
void EndReceive(Ptr< Packet > packet, enum WifiPreamble preamble, enum mpduType mpdutype, Ptr< InterferenceHelper::Event > event)
The last bit of the packet has arrived.
a unique identifier for an interface.
Definition: type-id.h:58
virtual void ResumeFromSleep(void)
Resume from sleep mode.
mpduType
This enumeration defines the type of an MPDU.
Definition: wifi-phy.h:56
virtual bool DoChannelSwitch(uint16_t id)
The default implementation does nothing and returns true.