src/wifi/model/wifi-phy.h
author Daniel Lertpratchya <nikkipui@gmail.com>
Mon, 18 Feb 2013 10:35:03 -0500
changeset 9238 e6c89f14f09b
parent 8981 7e1c95c4d1a7
child 10139 17a71cd49da3
permissions -rw-r--r--
Prevent EndTxNoAck after sending a Block ACK response
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7334
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2005,2006 INRIA
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 *
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 *
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 */
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
1890
a2b30c6456c9 Phy80211 -> WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1889
diff changeset
    21
#ifndef WIFI_PHY_H
a2b30c6456c9 Phy80211 -> WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1889
diff changeset
    22
#define WIFI_PHY_H
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include <stdint.h>
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include "ns3/callback.h"
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
#include "ns3/packet.h"
2054
ba8e810bae4c derive WifiPhy from Object and manage it with a Ptr<>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1988
diff changeset
    27
#include "ns3/object.h"
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
#include "ns3/nstime.h"
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
#include "ns3/ptr.h"
1902
26a57487bb49 no need for ns3 prefix
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1892
diff changeset
    30
#include "wifi-mode.h"
1920
1d4864775cf8 replace header mode with preamble mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1919
diff changeset
    31
#include "wifi-preamble.h"
2166
00b5eb43dba2 Improve the accuracy of 802.11a tx duration calculations.
Federico Maguolo <federico.maguolo@dei.unipd.it>
parents: 2159
diff changeset
    32
#include "wifi-phy-standard.h"
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
    33
#include "ns3/traced-callback.h"
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
namespace ns3 {
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    37
1891
add6fb8761f3 use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1890
diff changeset
    38
class WifiChannel;
3912
4d1a61f80745 new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3906
diff changeset
    39
class NetDevice;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    40
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    41
/**
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    42
 * \brief receive notifications about phy events.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    43
 */
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    44
class WifiPhyListener
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    45
{
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    46
public:
1890
a2b30c6456c9 Phy80211 -> WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1889
diff changeset
    47
  virtual ~WifiPhyListener ();
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    49
  /**
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    50
   * \param duration the expected duration of the packet reception.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    51
   *
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    52
   * We have received the first bit of a packet. We decided
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    53
   * that we could synchronize on this packet. It does not mean
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
   * we will be able to successfully receive completely the
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    55
   * whole packet. It means that we will report a BUSY status until
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    56
   * one of the following happens:
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    57
   *   - NotifyRxEndOk
8867
743aeb2fef78 fixed typo in doxygen of WifiPhyListener
Nicola Baldo <nbaldo@cttc.es>
parents: 7600
diff changeset
    58
   *   - NotifyRxEndError
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    59
   *   - NotifyTxStart
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
   */
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
  virtual void NotifyRxStart (Time duration) = 0;
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    62
  /**
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    63
   * We have received the last bit of a packet for which
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    64
   * NotifyRxStart was invoked first and, the packet has
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    65
   * been successfully received.
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    66
   */
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    67
  virtual void NotifyRxEndOk (void) = 0;
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    68
  /**
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    69
   * We have received the last bit of a packet for which
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    70
   * NotifyRxStart was invoked first and, the packet has
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    71
   * _not_ been successfully received.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    72
   */
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    73
  virtual void NotifyRxEndError (void) = 0;
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    74
  /**
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    75
   * \param duration the expected transmission duration.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    76
   *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    77
   * We are about to send the first bit of the packet.
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    78
   * We do not send any event to notify the end of
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    79
   * transmission. Listeners should assume that the
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    80
   * channel implicitely reverts to the idle state
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    81
   * unless they have received a cca busy report.
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    82
   */
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    83
  virtual void NotifyTxStart (Time duration) = 0;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
    84
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    85
  /**
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    86
   * \param duration the expected busy duration.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    87
   *
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    88
   * This method does not really report a real state
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    89
   * change as opposed to the other methods in this class.
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    90
   * It merely reports that, unless the medium is reported
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    91
   * busy through NotifyTxStart or NotifyRxStart/End,
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    92
   * it will be busy as defined by the currently selected
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    93
   * CCA mode.
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    94
   *
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    95
   * Typical client code which wants to have a clear picture
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    96
   * of the CCA state will need to keep track of the time at
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    97
   * which the last NotifyCcaBusyStart method is called and
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    98
   * what duration it reported.
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    99
   */
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
   100
  virtual void NotifyMaybeCcaBusyStart (Time duration) = 0;
5189
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   101
  /**
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   102
   * \param duration the expected channel switching duration.
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   103
   *
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   104
   * We do not send any event to notify the end of
5189
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   105
   * channel switching. Listeners should assume that the
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   106
   * channel implicitely reverts to the idle or busy states.
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   107
   */
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   108
  virtual void NotifySwitchingStart (Time duration) = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   109
};
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   110
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   111
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   112
/**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   113
 * \brief 802.11 PHY layer model
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   114
 * \ingroup wifi
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   115
 *
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   116
 */
2054
ba8e810bae4c derive WifiPhy from Object and manage it with a Ptr<>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1988
diff changeset
   117
class WifiPhy : public Object
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   118
{
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   119
public:
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   120
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   121
   * The state of the PHY layer.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   122
   */
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   123
  enum State
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   124
  {
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   125
    /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   126
     * The PHY layer is IDLE.
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   127
     */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   128
    IDLE,
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   129
    /**
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   130
     * The PHY layer has sense the medium busy through the CCA mechanism
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   131
     */
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   132
    CCA_BUSY,
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   133
    /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   134
     * The PHY layer is sending a packet.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   135
     */
2055
8899d6ef5d52 phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2054
diff changeset
   136
    TX,
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   137
    /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   138
     * The PHY layer is receiving a packet.
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   139
     */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   140
    RX,
5189
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   141
    /**
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   142
     * The PHY layer is switching to other channel.
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   143
     */
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   144
    SWITCHING
2055
8899d6ef5d52 phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2054
diff changeset
   145
  };
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   146
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   147
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   148
   * arg1: packet received successfully
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   149
   * arg2: snr of packet
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   150
   * arg3: mode of packet
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   151
   * arg4: type of preamble used for packet.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   152
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   153
  typedef Callback<void,Ptr<Packet>, double, WifiMode, enum WifiPreamble> RxOkCallback;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   154
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   155
   * arg1: packet received unsuccessfully
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   156
   * arg2: snr of packet
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   157
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   158
  typedef Callback<void,Ptr<const Packet>, double> RxErrorCallback;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   159
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   160
  static TypeId GetTypeId (void);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   161
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   162
  WifiPhy ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   163
  virtual ~WifiPhy ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   164
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   165
  virtual double GetTxPowerStart (void) const = 0;
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   166
  virtual double GetTxPowerEnd (void) const = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   167
  /**
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   168
   * \returns the number of tx power levels available for this PHY.
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   169
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   170
  virtual uint32_t GetNTxPower (void) const = 0;
1891
add6fb8761f3 use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1890
diff changeset
   171
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   172
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   173
   * \param callback the callback to invoke
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   174
   *        upon successful packet reception.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   175
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   176
  virtual void SetReceiveOkCallback (RxOkCallback callback) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   177
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   178
   * \param callback the callback to invoke
6273
8d70de29d514 spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents: 5820
diff changeset
   179
   *        upon erroneous packet reception.
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   180
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   181
  virtual void SetReceiveErrorCallback (RxErrorCallback callback) = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   182
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   183
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   184
   * \param packet the packet to send
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   185
   * \param mode the transmission mode to use to send this packet
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   186
   * \param preamble the type of preamble to use to send this packet.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   187
   * \param txPowerLevel a power level to use to send this packet. The real
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   188
   *        transmission power is calculated as txPowerMin + txPowerLevel * (txPowerMax - txPowerMin) / nTxLevels
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   189
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   190
  virtual void SendPacket (Ptr<const Packet> packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel) = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   191
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   192
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   193
   * \param listener the new listener
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   194
   *
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   195
   * Add the input listener to the list of objects to be notified of
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   196
   * PHY-level events.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   197
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   198
  virtual void RegisterListener (WifiPhyListener *listener) = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   199
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   200
  /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   201
   * \returns true of the current state of the PHY layer is WifiPhy::IDLE, false otherwise.
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   202
   */
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   203
  virtual bool IsStateIdle (void) = 0;
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   204
  /**
3890
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3888
diff changeset
   205
   * \returns true of the current state of the PHY layer is WifiPhy::CCA_BUSY, false otherwise.
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   206
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   207
  virtual bool IsStateCcaBusy (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   208
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   209
   * \returns true of the current state of the PHY layer is not WifiPhy::IDLE, false otherwise.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   210
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   211
  virtual bool IsStateBusy (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   212
  /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   213
   * \returns true of the current state of the PHY layer is WifiPhy::RX, false otherwise.
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   214
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   215
  virtual bool IsStateRx (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   216
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   217
   * \returns true of the current state of the PHY layer is WifiPhy::TX, false otherwise.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   218
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   219
  virtual bool IsStateTx (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   220
  /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   221
   * \returns true of the current state of the PHY layer is WifiPhy::SWITCHING, false otherwise.
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   222
   */
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   223
  virtual bool IsStateSwitching (void) = 0;
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   224
  /**
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   225
   * \returns the amount of time since the current state has started.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   226
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   227
  virtual Time GetStateDuration (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   228
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   229
   * \returns the predicted delay until this PHY can become WifiPhy::IDLE.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   230
   *
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   231
   * The PHY will never become WifiPhy::IDLE _before_ the delay returned by
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   232
   * this method but it could become really idle later.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   233
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   234
  virtual Time GetDelayUntilIdle (void) = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   235
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   236
  virtual Time GetLastRxStartTime (void) const = 0;
2139
a2cf93c741c3 add WifiPhy::GetLastRxStart
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2083
diff changeset
   237
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   238
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   239
   * \param size the number of bytes in the packet to send
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   240
   * \param payloadMode the transmission mode to use for this packet
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   241
   * \param preamble the type of preamble to use for this packet.
7143
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   242
   * \return the total amount of time this PHY will stay busy for
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   243
   *          the transmission of these bytes.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   244
   */
7143
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   245
  static Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble);
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   246
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   247
  /** 
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   248
   * \param payloadMode the WifiMode use for the transmission of the payload
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   249
   * \param preamble the type of preamble
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   250
   * 
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   251
   * \return the WifiMode used for the transmission of the PLCP header 
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   252
   */
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   253
  static WifiMode GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble);
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   254
7600
57ba46094a0d fix various doxygen errors
Vedran Miletić <rivanvx@gmail.com>
parents: 7385
diff changeset
   255
  /**
7143
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   256
   * \param payloadMode the WifiMode use for the transmission of the payload
7600
57ba46094a0d fix various doxygen errors
Vedran Miletić <rivanvx@gmail.com>
parents: 7385
diff changeset
   257
   * \param preamble the type of preamble
7143
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   258
   * 
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   259
   * \return the duration of the PLCP header in microseconds
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   260
   */
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   261
  static uint32_t GetPlcpHeaderDurationMicroSeconds (WifiMode payloadMode, WifiPreamble preamble);
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   262
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   263
  /** 
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   264
   * \param payloadMode the WifiMode use for the transmission of the payload
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   265
   * \param preamble the type of preamble 
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   266
   * 
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   267
   * \return the duration of the PLCP preamble in microseconds
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   268
   */
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   269
  static uint32_t GetPlcpPreambleDurationMicroSeconds (WifiMode payloadMode, WifiPreamble preamble);
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   270
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   271
  /** 
7600
57ba46094a0d fix various doxygen errors
Vedran Miletić <rivanvx@gmail.com>
parents: 7385
diff changeset
   272
   * \param size the number of bytes in the packet to send
7143
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   273
   * \param payloadMode the WifiMode use for the transmission of the payload
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   274
   * 
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   275
   * \return the duration of the payload in microseconds
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   276
   */
0146b1916bc0 wifi tx duration calculations moved from InterferenceHelper to WifiPhy
Nicola Baldo <nicola@baldo.biz>
parents: 7141
diff changeset
   277
  static uint32_t GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payloadMode);
6372
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   278
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   279
  /**
6372
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   280
   * The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   281
   * (e.g., by a WifiRemoteStationManager) to determine the set of
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   282
   * transmission/reception modes that this WifiPhy(-derived class)
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   283
   * can support - a set of WifiMode objects which we call the
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   284
   * DeviceRateSet, and which is stored as WifiPhy::m_deviceRateSet.
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   285
   *
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   286
   * It is important to note that the DeviceRateSet is a superset (not
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   287
   * necessarily proper) of the OperationalRateSet (which is
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   288
   * logically, if not actually, a property of the associated
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   289
   * WifiRemoteStationManager), which itself is a superset (again, not
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   290
   * necessarily proper) of the BSSBasicRateSet.
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   291
   *
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   292
   * \returns the number of transmission modes supported by this PHY.
6372
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   293
   *
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   294
   * \sa WifiPhy::GetMode()
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   295
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   296
  virtual uint32_t GetNModes (void) const = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   297
  /**
6372
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   298
   * The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   299
   * (e.g., by a WifiRemoteStationManager) to determine the set of
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   300
   * transmission/reception modes that this WifiPhy(-derived class)
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   301
   * can support - a set of WifiMode objects which we call the
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   302
   * DeviceRateSet, and which is stored as WifiPhy::m_deviceRateSet.
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   303
   *
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   304
   * It is important to note that the DeviceRateSet is a superset (not
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   305
   * necessarily proper) of the OperationalRateSet (which is
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   306
   * logically, if not actually, a property of the associated
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   307
   * WifiRemoteStationManager), which itself is a superset (again, not
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   308
   * necessarily proper) of the BSSBasicRateSet.
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   309
   *
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   310
   * \param mode index in array of supported modes
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   311
   * \returns the mode whose index is specified.
6372
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   312
   *
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   313
   * \sa WifiPhy::GetNModes()
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   314
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   315
  virtual WifiMode GetMode (uint32_t mode) const = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   316
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   317
   * \param txMode the transmission mode
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   318
   * \param ber the probability of bit error rate
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   319
   * \returns the minimum snr which is required to achieve
3912
4d1a61f80745 new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3906
diff changeset
   320
   *          the requested ber for the specified transmission mode. (W/W)
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   321
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   322
  virtual double CalculateSnr (WifiMode txMode, double ber) const = 0;
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   323
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   324
  /**
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   325
   * \brief Set channel number.
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   326
   *
4690
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   327
   * Channel center frequency = Channel starting frequency + 5 MHz * (nch - 1)
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   328
   *
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   329
   * where Starting channel frequency is standard-dependent, see SetStandard()
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   330
   * as defined in IEEE 802.11-2007 17.3.8.3.2.
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   331
   */
4690
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   332
  virtual void SetChannelNumber (uint16_t id) = 0;
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   333
  /// Return current channel number, see SetChannelNumber()
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   334
  virtual uint16_t GetChannelNumber () const = 0;
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4715
diff changeset
   335
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4715
diff changeset
   336
  virtual void ConfigureStandard (enum WifiPhyStandard standard) = 0;
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   337
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   338
  virtual Ptr<WifiChannel> GetChannel (void) const = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   339
6360
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   340
  static WifiMode GetDsssRate1Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   341
  static WifiMode GetDsssRate2Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   342
  static WifiMode GetDsssRate5_5Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   343
  static WifiMode GetDsssRate11Mbps ();
6597
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   344
  static WifiMode GetErpOfdmRate6Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   345
  static WifiMode GetErpOfdmRate9Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   346
  static WifiMode GetErpOfdmRate12Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   347
  static WifiMode GetErpOfdmRate18Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   348
  static WifiMode GetErpOfdmRate24Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   349
  static WifiMode GetErpOfdmRate36Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   350
  static WifiMode GetErpOfdmRate48Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   351
  static WifiMode GetErpOfdmRate54Mbps ();
6360
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   352
  static WifiMode GetOfdmRate6Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   353
  static WifiMode GetOfdmRate9Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   354
  static WifiMode GetOfdmRate12Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   355
  static WifiMode GetOfdmRate18Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   356
  static WifiMode GetOfdmRate24Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   357
  static WifiMode GetOfdmRate36Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   358
  static WifiMode GetOfdmRate48Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   359
  static WifiMode GetOfdmRate54Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   360
  static WifiMode GetOfdmRate3MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   361
  static WifiMode GetOfdmRate4_5MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   362
  static WifiMode GetOfdmRate6MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   363
  static WifiMode GetOfdmRate9MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   364
  static WifiMode GetOfdmRate12MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   365
  static WifiMode GetOfdmRate18MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   366
  static WifiMode GetOfdmRate24MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   367
  static WifiMode GetOfdmRate27MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   368
  static WifiMode GetOfdmRate1_5MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   369
  static WifiMode GetOfdmRate2_25MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   370
  static WifiMode GetOfdmRate3MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   371
  static WifiMode GetOfdmRate4_5MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   372
  static WifiMode GetOfdmRate6MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   373
  static WifiMode GetOfdmRate9MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   374
  static WifiMode GetOfdmRate12MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   375
  static WifiMode GetOfdmRate13_5MbpsBW5MHz ();
4470
51b5c1a272d3 802.11b PHY support
Gary Pei <guangyu.pei@boeing.com>
parents: 4264
diff changeset
   376
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   377
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   378
  /**
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   379
   * Public method used to fire a PhyTxBegin trace.  Implemented for encapsulation
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   380
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   381
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   382
  void NotifyTxBegin (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   383
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   384
  /**
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   385
   * Public method used to fire a PhyTxEnd trace.  Implemented for encapsulation
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   386
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   387
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   388
  void NotifyTxEnd (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   389
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   390
  /**
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   391
   * Public method used to fire a PhyTxDrop trace.  Implemented for encapsulation
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   392
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   393
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   394
  void NotifyTxDrop (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   395
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   396
  /**
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   397
   * Public method used to fire a PhyRxBegin trace.  Implemented for encapsulation
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   398
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   399
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   400
  void NotifyRxBegin (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   401
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   402
  /**
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   403
   * Public method used to fire a PhyRxEnd trace.  Implemented for encapsulation
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   404
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   405
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   406
  void NotifyRxEnd (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   407
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   408
  /**
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   409
   * Public method used to fire a PhyRxDrop trace.  Implemented for encapsulation
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   410
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   411
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   412
  void NotifyRxDrop (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   413
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   414
  /**
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   415
   *
7334
21b6b53ba0d5 [Bug 827] Rename promisc trace to monitor in WifiPhy
Ruben Merz <ruben@net.t-labs.tu-berlin.de>
parents: 7143
diff changeset
   416
   * Public method used to fire a MonitorSniffer trace for a wifi packet being received.  Implemented for encapsulation
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   417
   * purposes.
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   418
   *
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   419
   * @param packet the packet being received
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   420
   * @param channelFreqMhz the frequency in MHz at which the packet is
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   421
   * received. Note that in real devices this is normally the
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   422
   * frequency to which  the receiver is tuned, and this can be
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   423
   * different than the frequency at which the packet was originally
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   424
   * transmitted. This is because it is possible to have the receiver
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   425
   * tuned on a given channel and still to be able to receive packets
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   426
   * on a nearby channel.
4757
1b7c28a1c131 Fix doxygen errors
Tom Henderson <tomh@tomh.org>
parents: 4720
diff changeset
   427
   * @param channelNumber the channel on which the packet is received
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   428
   * @param rate the PHY data rate in units of 500kbps (i.e., the same
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   429
   * units used both for the radiotap and for the prism header)
4645
d53223aae797 get rid of some doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4497
diff changeset
   430
   * @param isShortPreamble true if short preamble is used, false otherwise
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   431
   * @param signalDbm signal power in dBm
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   432
   * @param noiseDbm  noise power in dBm
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   433
   */
7334
21b6b53ba0d5 [Bug 827] Rename promisc trace to monitor in WifiPhy
Ruben Merz <ruben@net.t-labs.tu-berlin.de>
parents: 7143
diff changeset
   434
  void NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble,
4497
43c7dfd72eb1 make it fit on my monitor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4492
diff changeset
   435
                             double signalDbm, double noiseDbm);
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   436
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   437
  /**
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   438
   *
7334
21b6b53ba0d5 [Bug 827] Rename promisc trace to monitor in WifiPhy
Ruben Merz <ruben@net.t-labs.tu-berlin.de>
parents: 7143
diff changeset
   439
   * Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.  Implemented for encapsulation
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   440
   * purposes.
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   441
   *
4757
1b7c28a1c131 Fix doxygen errors
Tom Henderson <tomh@tomh.org>
parents: 4720
diff changeset
   442
   * @param packet the packet being transmitted
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   443
   * @param channelFreqMhz the frequency in MHz at which the packet is
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   444
   * transmitted.
4757
1b7c28a1c131 Fix doxygen errors
Tom Henderson <tomh@tomh.org>
parents: 4720
diff changeset
   445
   * @param channelNumber the channel on which the packet is transmitted
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   446
   * @param rate the PHY data rate in units of 500kbps (i.e., the same
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   447
   * units used both for the radiotap and for the prism header)
4645
d53223aae797 get rid of some doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4497
diff changeset
   448
   * @param isShortPreamble true if short preamble is used, false otherwise
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   449
   */
7334
21b6b53ba0d5 [Bug 827] Rename promisc trace to monitor in WifiPhy
Ruben Merz <ruben@net.t-labs.tu-berlin.de>
parents: 7143
diff changeset
   450
  void NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble);
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   451
8981
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   452
 /**
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   453
  * Assign a fixed random variable stream number to the random variables
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   454
  * used by this model.  Return the number of streams (possibly zero) that
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   455
  * have been assigned.
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   456
  *
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   457
  * \param stream first stream index to use
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   458
  * \return the number of stream indices assigned by this model
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   459
  */
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   460
  virtual int64_t AssignStreams (int64_t stream) = 0;
7e1c95c4d1a7 Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents: 8867
diff changeset
   461
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   462
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   463
private:
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   464
  /**
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   465
   * The trace source fired when a packet begins the transmission process on
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   466
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   467
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   468
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   469
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   470
  TracedCallback<Ptr<const Packet> > m_phyTxBeginTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   471
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   472
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   473
   * The trace source fired when a packet ends the transmission process on
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   474
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   475
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   476
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   477
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   478
  TracedCallback<Ptr<const Packet> > m_phyTxEndTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   479
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   480
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   481
   * The trace source fired when the phy layer drops a packet as it tries
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   482
   * to transmit it.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   483
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   484
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   485
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   486
  TracedCallback<Ptr<const Packet> > m_phyTxDropTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   487
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   488
  /**
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   489
   * The trace source fired when a packet begins the reception process from
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   490
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   491
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   492
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   493
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   494
  TracedCallback<Ptr<const Packet> > m_phyRxBeginTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   495
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   496
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   497
   * The trace source fired when a packet ends the reception process from
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   498
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   499
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   500
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   501
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   502
  TracedCallback<Ptr<const Packet> > m_phyRxEndTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   503
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   504
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   505
   * The trace source fired when the phy layer drops a packet it has received.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   506
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   507
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   508
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   509
  TracedCallback<Ptr<const Packet> > m_phyRxDropTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   510
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   511
  /**
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   512
   * A trace source that emulates a wifi device in monitor mode
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   513
   * sniffing a packet being received.
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   514
   *
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   515
   * As a reference with the real world, firing this trace
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   516
   * corresponds in the madwifi driver to calling the function
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   517
   * ieee80211_input_monitor()
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   518
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   519
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   520
   */
7334
21b6b53ba0d5 [Bug 827] Rename promisc trace to monitor in WifiPhy
Ruben Merz <ruben@net.t-labs.tu-berlin.de>
parents: 7143
diff changeset
   521
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool, double, double> m_phyMonitorSniffRxTrace;
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   522
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   523
  /**
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   524
   * A trace source that emulates a wifi device in monitor mode
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   525
   * sniffing a packet being transmitted.
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   526
   *
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   527
   * As a reference with the real world, firing this trace
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   528
   * corresponds in the madwifi driver to calling the function
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   529
   * ieee80211_input_monitor()
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   530
   *
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   531
   * \see class CallBackTraceSource
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   532
   */
7334
21b6b53ba0d5 [Bug 827] Rename promisc trace to monitor in WifiPhy
Ruben Merz <ruben@net.t-labs.tu-berlin.de>
parents: 7143
diff changeset
   533
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool> m_phyMonitorSniffTxTrace;
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   534
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   535
};
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   536
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   537
/**
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   538
 * \param os          output stream
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   539
 * \param state       wifi state to stringify
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   540
 */
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   541
std::ostream& operator<< (std::ostream& os, enum WifiPhy::State state);
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   542
1977
4303409f3d8e remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1964
diff changeset
   543
} // namespace ns3
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   544
1890
a2b30c6456c9 Phy80211 -> WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1889
diff changeset
   545
#endif /* WIFI_PHY_H */