View | Details | Raw Unified | Return to bug 2030
Collapse All | Expand All

(-)a/src/wifi/model/wifi-tx-vector.cc (-1 / +21 lines)
 Lines 20-29    Link Here 
20
 */
20
 */
21
21
22
#include "ns3/wifi-tx-vector.h"
22
#include "ns3/wifi-tx-vector.h"
23
#include "ns3/fatal-error.h"
23
24
24
namespace ns3 {
25
namespace ns3 {
25
26
26
WifiTxVector::WifiTxVector ()
27
WifiTxVector::WifiTxVector ()
28
  : m_retries (0),
29
    m_shortGuardInterval (false),
30
    m_nss (1),
31
    m_ness (0),
32
    m_stbc (false),
33
    m_modeInitialized (false),
34
    m_txPowerLevelInitialized (false)
27
{
35
{
28
}
36
}
29
37
 Lines 35-52    Link Here 
35
    m_shortGuardInterval(shortGuardInterval),
43
    m_shortGuardInterval(shortGuardInterval),
36
    m_nss(nss),
44
    m_nss(nss),
37
    m_ness(ness),
45
    m_ness(ness),
38
    m_stbc(stbc)
46
    m_stbc(stbc),
47
    m_modeInitialized (true),
48
    m_txPowerLevelInitialized (true)
39
{
49
{
40
}
50
}
41
51
42
WifiMode
52
WifiMode
43
WifiTxVector::GetMode (void) const
53
WifiTxVector::GetMode (void) const
44
{
54
{
55
  if (!m_modeInitialized)
56
    {
57
      NS_FATAL_ERROR ("WifiTxVector mode must be set before using");
58
    }
45
  return m_mode;
59
  return m_mode;
46
}
60
}
47
uint8_t 
61
uint8_t 
48
WifiTxVector::GetTxPowerLevel (void) const
62
WifiTxVector::GetTxPowerLevel (void) const
49
{
63
{
64
  if (!m_txPowerLevelInitialized)
65
    {
66
      NS_FATAL_ERROR ("WifiTxVector txPowerLevel must be set before using");
67
    }
50
  return m_txPowerLevel;
68
  return m_txPowerLevel;
51
}
69
}
52
uint8_t 
70
uint8_t 
 Lines 79-89    Link Here 
79
WifiTxVector::SetMode (WifiMode mode)
97
WifiTxVector::SetMode (WifiMode mode)
80
{
98
{
81
  m_mode=mode;
99
  m_mode=mode;
100
  m_modeInitialized = true;
82
}
101
}
83
void 
102
void 
84
WifiTxVector::SetTxPowerLevel (uint8_t powerlevel)
103
WifiTxVector::SetTxPowerLevel (uint8_t powerlevel)
85
{
104
{
86
  m_txPowerLevel=powerlevel;
105
  m_txPowerLevel=powerlevel;
106
  m_txPowerLevelInitialized = true;
87
}
107
}
88
void 
108
void 
89
WifiTxVector::SetRetries (uint8_t retries)
109
WifiTxVector::SetRetries (uint8_t retries)
(-)a/src/wifi/model/wifi-tx-vector.h (-4 / +21 lines)
 Lines 35-40    Link Here 
35
 * and also 15.4.4.2 "PMD_SAP peer-to-peer service primitive
35
 * and also 15.4.4.2 "PMD_SAP peer-to-peer service primitive
36
 * parameters".
36
 * parameters".
37
 *
37
 *
38
 * If this class is constructed with the constructor that takes no
39
 * arguments, then the client must explicitly set the mode and 
40
 * transmit power level parameters before using them.  Default
41
 * member initializers are provided for the other parameters, to
42
 * conform to a non-MIMO/long guard configuration, although these
43
 * may also be explicitly set after object construction.
44
 *
45
 * When used in a infrastructure context, WifiTxVector values should be 
46
 * drawn from WifiRemoteStationManager parameters since rate adaptation 
47
 * is responsible for picking the mode, number of streams, etc., but in 
48
 * the case in which there is no such manager (e.g. mesh), the client 
49
 * still needs to initialize at least the mode and transmit power level 
50
 * appropriately.
51
 *
38
 * \note the above reference is valid for the DSSS PHY only (clause
52
 * \note the above reference is valid for the DSSS PHY only (clause
39
 * 15). TXVECTOR is defined also for the other PHYs, however they
53
 * 15). TXVECTOR is defined also for the other PHYs, however they
40
 * don't include the TXPWRLVL explicitly in the TXVECTOR. This is
54
 * don't include the TXPWRLVL explicitly in the TXVECTOR. This is
 Lines 144-153    Link Here 
144
                           to PMD_TXPWRLVL.request */ 
158
                           to PMD_TXPWRLVL.request */ 
145
  uint8_t  m_retries;      /**< The DATA_RETRIES/RTS_RETRIES parameter
159
  uint8_t  m_retries;      /**< The DATA_RETRIES/RTS_RETRIES parameter
146
                           for Click radiotap information */
160
                           for Click radiotap information */
147
  bool     m_shortGuardInterval; //true if short GI is going to be used
161
  bool     m_shortGuardInterval; /**< true if short GI is going to be used */
148
  uint8_t  m_nss; //number of streams
162
  uint8_t  m_nss; /**< number of streams */
149
  uint8_t  m_ness; //number of streams in beamforming
163
  uint8_t  m_ness; /**< number of streams in beamforming */
150
  bool     m_stbc; //STBC used or not
164
  bool     m_stbc; /**< STBC used or not */
165
166
  bool     m_modeInitialized; //*< Internal initialization flag */
167
  bool     m_txPowerLevelInitialized; //*< Internal initialization flag */
151
168
152
};
169
};
153
170

Return to bug 2030