src/wifi/model/wifi-phy.h
author Lalith Suresh <suresh.lalith@gmail.com>
Fri, 04 Mar 2011 01:26:54 +0000
changeset 6852 8f1a53d3f6ca
parent 6848 src/devices/wifi/model/wifi-phy.h@1f453ad50ef3
child 7139 79dd02ed46ec
permissions -rw-r--r--
Moves devices/* and routing/* to src/
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
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
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as 
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
 */
1890
a2b30c6456c9 Phy80211 -> WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1889
diff changeset
    44
class WifiPhyListener {
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
public:
1890
a2b30c6456c9 Phy80211 -> WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1889
diff changeset
    46
  virtual ~WifiPhyListener ();
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    47
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    48
  /**
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    49
   * \param duration the expected duration of the packet reception.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    50
   *
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    51
   * 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
    52
   * that we could synchronize on this packet. It does not mean
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    53
   * 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
    54
   * 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
    55
   * 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
    56
   *   - NotifyRxEndOk
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    57
   *   - NotifyExEndError
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    58
   *   - NotifyTxStart
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
   */
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
  virtual void NotifyRxStart (Time duration) = 0;
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    61
  /**
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    62
   * 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
    63
   * NotifyRxStart was invoked first and, the packet has
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    64
   * been successfully received.
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    65
   */
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    66
  virtual void NotifyRxEndOk (void) = 0;  
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    67
  /**
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    68
   * 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
    69
   * NotifyRxStart was invoked first and, the packet has
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    70
   * _not_ been successfully received.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    71
   */
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    72
  virtual void NotifyRxEndError (void) = 0;
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    73
  /**
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    74
   * \param duration the expected transmission duration.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    75
   *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    76
   * We are about to send the first bit of the packet.
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    77
   * We do not send any event to notify the end of 
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    78
   * 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
    79
   * 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
    80
   * unless they have received a cca busy report.
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    81
   */
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    82
  virtual void NotifyTxStart (Time duration) = 0;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
    83
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    84
  /**
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    85
   * \param duration the expected busy duration.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    86
   *
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    87
   * 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
    88
   * 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
    89
   * It merely reports that, unless the medium is reported
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    90
   * busy through NotifyTxStart or NotifyRxStart/End, 
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    91
   * it will be busy as defined by the currently selected 
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    92
   * CCA mode.
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    93
   *
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    94
   * 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
    95
   * 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
    96
   * 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
    97
   * what duration it reported.
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2659
diff changeset
    98
   */
3905
99c9346b5d71 split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3899
diff changeset
    99
  virtual void NotifyMaybeCcaBusyStart (Time duration) = 0;
5189
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   100
  /**
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   101
   * \param duration the expected channel switching duration.
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   102
   *
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   103
   * We do not send any event to notify the end of 
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   104
   * channel switching. Listeners should assume that the
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   105
   * channel implicitely reverts to the idle or busy states.
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   106
   */
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   107
  virtual void NotifySwitchingStart (Time duration) = 0; 
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   108
};
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
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   111
/**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   112
 * \brief 802.11 PHY layer model
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   113
 *
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   114
 */
2054
ba8e810bae4c derive WifiPhy from Object and manage it with a Ptr<>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1988
diff changeset
   115
class WifiPhy : public Object
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   116
{
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   117
public:
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   118
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   119
   * The state of the PHY layer.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   120
   */
2055
8899d6ef5d52 phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2054
diff changeset
   121
  enum State {
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   122
    /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   123
     * The PHY layer is IDLE.
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   124
     */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   125
    IDLE,
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   126
    /**
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   127
     * 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
   128
     */
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   129
    CCA_BUSY,
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   130
    /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   131
     * The PHY layer is sending a packet.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   132
     */
2055
8899d6ef5d52 phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2054
diff changeset
   133
    TX,
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   134
    /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   135
     * The PHY layer is receiving a packet.
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   136
     */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   137
    RX,
5189
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   138
    /**
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   139
     * The PHY layer is switching to other channel.
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   140
     */
8fcdf87a790a Channel switching support for Wifi
Ramon Bauza
parents: 5179
diff changeset
   141
    SWITCHING
2055
8899d6ef5d52 phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2054
diff changeset
   142
  };
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   143
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   144
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   145
   * arg1: packet received successfully
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   146
   * arg2: snr of packet
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   147
   * arg3: mode of packet
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   148
   * arg4: type of preamble used for packet.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   149
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   150
  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
   151
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   152
   * arg1: packet received unsuccessfully
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   153
   * arg2: snr of packet
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   154
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   155
  typedef Callback<void,Ptr<const Packet>, double> RxErrorCallback;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   156
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   157
  static TypeId GetTypeId (void);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   158
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   159
  WifiPhy ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   160
  virtual ~WifiPhy ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   161
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   162
  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
   163
  virtual double GetTxPowerEnd (void) const = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   164
  /**
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2166
diff changeset
   165
   * \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
   166
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   167
  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
   168
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   169
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   170
   * \param callback the callback to invoke
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   171
   *        upon successful packet reception.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   172
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   173
  virtual void SetReceiveOkCallback (RxOkCallback callback) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   174
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   175
   * \param callback the callback to invoke
6273
8d70de29d514 spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents: 5820
diff changeset
   176
   *        upon erroneous packet reception.
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   177
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   178
  virtual void SetReceiveErrorCallback (RxErrorCallback callback) = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   179
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   180
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   181
   * \param packet the packet to send
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   182
   * \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
   183
   * \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
   184
   * \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
   185
   *        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
   186
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   187
  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
   188
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   189
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   190
   * \param listener the new listener
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   191
   *
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   192
   * 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
   193
   * PHY-level events.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   194
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   195
  virtual void RegisterListener (WifiPhyListener *listener) = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   196
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   197
  /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   198
   * \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
   199
   */
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   200
  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
   201
  /**
3890
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3888
diff changeset
   202
   * \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
   203
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   204
  virtual bool IsStateCcaBusy (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   205
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   206
   * \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
   207
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   208
  virtual bool IsStateBusy (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   209
  /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   210
   * \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
   211
   */
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   212
  virtual bool IsStateRx (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   213
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   214
   * \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
   215
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   216
  virtual bool IsStateTx (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   217
  /**
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   218
   * \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
   219
   */
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   220
  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
   221
  /**
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   222
   * \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
   223
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   224
  virtual Time GetStateDuration (void) = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   225
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   226
   * \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
   227
   *
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   228
   * 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
   229
   * this method but it could become really idle later.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   230
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   231
  virtual Time GetDelayUntilIdle (void) = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   232
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   233
  virtual Time GetLastRxStartTime (void) const = 0;
2139
a2cf93c741c3 add WifiPhy::GetLastRxStart
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2083
diff changeset
   234
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   235
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   236
   * \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
   237
   * \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
   238
   * \param preamble the type of preamble to use for this packet.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   239
   * \returns the total amount of time this PHY will stay busy for
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   240
   *          the transmission of these bytes.
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   241
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   242
  virtual Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble) const = 0;
6372
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   243
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   244
  /**
6372
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   245
   * 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
   246
   * (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
   247
   * 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
   248
   * 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
   249
   * 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
   250
   *
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   251
   * 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
   252
   * 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
   253
   * 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
   254
   * 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
   255
   * 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
   256
   *
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   257
   * \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
   258
   *
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   259
   * \sa WifiPhy::GetMode()
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   260
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   261
  virtual uint32_t GetNModes (void) const = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   262
  /**
6372
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   263
   * 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
   264
   * (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
   265
   * 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
   266
   * 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
   267
   * 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
   268
   *
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   269
   * 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
   270
   * 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
   271
   * 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
   272
   * 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
   273
   * 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
   274
   *
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   275
   * \param mode index in array of supported modes
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   276
   * \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
   277
   *
0fafd9716f44 Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents: 6360
diff changeset
   278
   * \sa WifiPhy::GetNModes()
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   279
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   280
  virtual WifiMode GetMode (uint32_t mode) const = 0;
2057
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   281
  /**
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   282
   * \param txMode the transmission mode
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   283
   * \param ber the probability of bit error rate
73723aad7527 dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2056
diff changeset
   284
   * \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
   285
   *          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
   286
   */
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   287
  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
   288
4690
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   289
  /** 
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   290
   * \brief Set channel number. 
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   291
   * 
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   292
   * 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
   293
   *
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   294
   * 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
   295
   * as defined in IEEE 802.11-2007 17.3.8.3.2.
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   296
   */ 
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   297
  virtual void SetChannelNumber (uint16_t id) = 0;
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   298
  /// Return current channel number, see SetChannelNumber()
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   299
  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
   300
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4715
diff changeset
   301
  virtual void ConfigureStandard (enum WifiPhyStandard standard) = 0;
4690
86343f7d6bfd Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents: 4680
diff changeset
   302
  
3888
a15618dcd0eb rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3887
diff changeset
   303
  virtual Ptr<WifiChannel> GetChannel (void) const = 0;
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   304
6360
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   305
  static WifiMode GetDsssRate1Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   306
  static WifiMode GetDsssRate2Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   307
  static WifiMode GetDsssRate5_5Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   308
  static WifiMode GetDsssRate11Mbps ();
6597
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   309
  static WifiMode GetErpOfdmRate6Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   310
  static WifiMode GetErpOfdmRate9Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   311
  static WifiMode GetErpOfdmRate12Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   312
  static WifiMode GetErpOfdmRate18Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   313
  static WifiMode GetErpOfdmRate24Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   314
  static WifiMode GetErpOfdmRate36Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   315
  static WifiMode GetErpOfdmRate48Mbps ();
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6372
diff changeset
   316
  static WifiMode GetErpOfdmRate54Mbps ();
6360
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   317
  static WifiMode GetOfdmRate6Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   318
  static WifiMode GetOfdmRate9Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   319
  static WifiMode GetOfdmRate12Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   320
  static WifiMode GetOfdmRate18Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   321
  static WifiMode GetOfdmRate24Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   322
  static WifiMode GetOfdmRate36Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   323
  static WifiMode GetOfdmRate48Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   324
  static WifiMode GetOfdmRate54Mbps ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   325
  static WifiMode GetOfdmRate3MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   326
  static WifiMode GetOfdmRate4_5MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   327
  static WifiMode GetOfdmRate6MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   328
  static WifiMode GetOfdmRate9MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   329
  static WifiMode GetOfdmRate12MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   330
  static WifiMode GetOfdmRate18MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   331
  static WifiMode GetOfdmRate24MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   332
  static WifiMode GetOfdmRate27MbpsBW10MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   333
  static WifiMode GetOfdmRate1_5MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   334
  static WifiMode GetOfdmRate2_25MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   335
  static WifiMode GetOfdmRate3MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   336
  static WifiMode GetOfdmRate4_5MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   337
  static WifiMode GetOfdmRate6MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   338
  static WifiMode GetOfdmRate9MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   339
  static WifiMode GetOfdmRate12MbpsBW5MHz ();
d8975477ff6a Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents: 6273
diff changeset
   340
  static WifiMode GetOfdmRate13_5MbpsBW5MHz ();
4470
51b5c1a272d3 802.11b PHY support
Gary Pei <guangyu.pei@boeing.com>
parents: 4264
diff changeset
   341
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   342
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   343
  /**
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   344
   * Public method used to fire a PhyTxBegin trace.  Implemented for encapsulation 
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   345
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   346
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   347
  void NotifyTxBegin (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   348
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   349
  /**
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   350
   * Public method used to fire a PhyTxEnd trace.  Implemented for encapsulation 
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   351
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   352
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   353
  void NotifyTxEnd (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   354
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   355
  /**
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   356
   * Public method used to fire a PhyTxDrop trace.  Implemented for encapsulation 
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   357
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   358
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   359
  void NotifyTxDrop (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   360
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   361
  /**
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   362
   * Public method used to fire a PhyRxBegin trace.  Implemented for encapsulation 
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   363
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   364
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   365
  void NotifyRxBegin (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   366
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   367
  /**
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   368
   * Public method used to fire a PhyRxEnd trace.  Implemented for encapsulation 
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   369
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   370
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   371
  void NotifyRxEnd (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   372
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   373
  /**
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   374
   * Public method used to fire a PhyRxDrop trace.  Implemented for encapsulation 
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   375
   * purposes.
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   376
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   377
  void NotifyRxDrop (Ptr<const Packet> packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   378
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   379
  /** 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   380
   * 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   381
   * Public method used to fire a PromiscSniffer 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
   382
   * purposes.
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   383
   * 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   384
   * @param packet the packet being received
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   385
   * @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
   386
   * 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
   387
   * 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
   388
   * 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
   389
   * 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
   390
   * 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
   391
   * on a nearby channel.
4757
1b7c28a1c131 Fix doxygen errors
Tom Henderson <tomh@tomh.org>
parents: 4720
diff changeset
   392
   * @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
   393
   * @param rate the PHY data rate in units of 500kbps (i.e., the same
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   394
   * 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
   395
   * @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
   396
   * @param signalDbm signal power in dBm
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   397
   * @param noiseDbm  noise power in dBm
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   398
   */
4715
d0041768ff60 bug 644: make sure we set standard and frequency correctly in radiotap output
Nicola Baldo <nbaldo@cttc.es>
parents: 4690
diff changeset
   399
  void NotifyPromiscSniffRx (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
   400
                             double signalDbm, double noiseDbm);
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   401
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   402
  /** 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   403
   * 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   404
   * Public method used to fire a PromiscSniffer trace for a wifi packet being transmitted.  Implemented for encapsulation 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   405
   * purposes.
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   406
   * 
4757
1b7c28a1c131 Fix doxygen errors
Tom Henderson <tomh@tomh.org>
parents: 4720
diff changeset
   407
   * @param packet the packet being transmitted
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   408
   * @param channelFreqMhz the frequency in MHz at which the packet is
4757
1b7c28a1c131 Fix doxygen errors
Tom Henderson <tomh@tomh.org>
parents: 4720
diff changeset
   409
   * transmitted. 
1b7c28a1c131 Fix doxygen errors
Tom Henderson <tomh@tomh.org>
parents: 4720
diff changeset
   410
   * @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
   411
   * @param rate the PHY data rate in units of 500kbps (i.e., the same
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   412
   * 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
   413
   * @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
   414
   */
4715
d0041768ff60 bug 644: make sure we set standard and frequency correctly in radiotap output
Nicola Baldo <nbaldo@cttc.es>
parents: 4690
diff changeset
   415
  void NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble);
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   416
  
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   417
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   418
private:
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   419
  /**
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   420
   * 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
   421
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   422
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   423
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   424
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   425
  TracedCallback<Ptr<const Packet> > m_phyTxBeginTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   426
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   427
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   428
   * 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
   429
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   430
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   431
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   432
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   433
  TracedCallback<Ptr<const Packet> > m_phyTxEndTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   434
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   435
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   436
   * 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
   437
   * to transmit it.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   438
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   439
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   440
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   441
  TracedCallback<Ptr<const Packet> > m_phyTxDropTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   442
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   443
  /**
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   444
   * 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
   445
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   446
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   447
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   448
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   449
  TracedCallback<Ptr<const Packet> > m_phyRxBeginTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   450
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   451
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   452
   * 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
   453
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   454
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   455
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   456
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   457
  TracedCallback<Ptr<const Packet> > m_phyRxEndTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   458
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   459
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   460
   * 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
   461
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   462
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   463
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   464
  TracedCallback<Ptr<const Packet> > m_phyRxDropTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   465
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   466
  /**
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   467
   * A trace source that emulates a wifi device in monitor mode
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   468
   * sniffing a packet being received. 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   469
   * 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   470
   * 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
   471
   * 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
   472
   * ieee80211_input_monitor()
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   473
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   474
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 4039
diff changeset
   475
   */
4715
d0041768ff60 bug 644: make sure we set standard and frequency correctly in radiotap output
Nicola Baldo <nbaldo@cttc.es>
parents: 4690
diff changeset
   476
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool, double, double> m_phyPromiscSniffRxTrace;
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   477
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   478
  /**
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   479
   * A trace source that emulates a wifi device in monitor mode
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   480
   * sniffing a packet being transmitted. 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   481
   * 
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   482
   * 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
   483
   * 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
   484
   * ieee80211_input_monitor()
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   485
   *
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   486
   * \see class CallBackTraceSource
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   487
   */
4715
d0041768ff60 bug 644: make sure we set standard and frequency correctly in radiotap output
Nicola Baldo <nbaldo@cttc.es>
parents: 4690
diff changeset
   488
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool> m_phyPromiscSniffTxTrace;
4492
3ebeb7bf3c15 added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents: 4470
diff changeset
   489
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   490
};
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   491
5820
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   492
/**
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   493
 * \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
   494
 * \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
   495
 */
1c02054740eb Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents: 5189
diff changeset
   496
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
   497
1977
4303409f3d8e remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1964
diff changeset
   498
} // namespace ns3
1889
41589561e4a7 WifiPhy class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   499
1890
a2b30c6456c9 Phy80211 -> WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1889
diff changeset
   500
#endif /* WIFI_PHY_H */