A Discrete-Event Network Simulator
API
wifi-tx-vector.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 CTTC
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Nicola Baldo <nbaldo@cttc.es>
19  * Ghada Badawy <gbadawy@gmail.com>
20  */
21 
22 #ifndef WIFI_TX_VECTOR_H
23 #define WIFI_TX_VECTOR_H
24 
25 #include <list>
26 #include "wifi-mode.h"
27 #include "wifi-preamble.h"
28 #include "he-ru.h"
29 
30 namespace ns3 {
31 
34 {
37  uint8_t nss;
38 };
39 
71 {
72 public:
74  typedef std::map <uint16_t /* staId */, HeMuUserInfo /* HE MU specific user info */> HeMuUserInfoMap;
75 
76  WifiTxVector ();
77  ~WifiTxVector ();
94  WifiTxVector (WifiMode mode,
95  uint8_t powerLevel,
96  WifiPreamble preamble,
97  uint16_t guardInterval,
98  uint8_t nTx,
99  uint8_t nss,
100  uint8_t ness,
101  uint16_t channelWidth,
102  bool aggregation,
103  bool stbc = false,
104  bool ldpc = false,
105  uint8_t bssColor = 0);
110  WifiTxVector (const WifiTxVector& txVector);
111 
115  bool GetModeInitialized (void) const;
125  WifiMode GetMode (uint16_t staId = SU_STA_ID) const;
131  void SetMode (WifiMode mode);
138  void SetMode (WifiMode mode, uint16_t staId);
139 
143  uint8_t GetTxPowerLevel (void) const;
149  void SetTxPowerLevel (uint8_t powerlevel);
153  WifiPreamble GetPreambleType (void) const;
159  void SetPreambleType (WifiPreamble preamble);
163  uint16_t GetChannelWidth (void) const;
169  void SetChannelWidth (uint16_t channelWidth);
173  uint16_t GetGuardInterval (void) const;
179  void SetGuardInterval (uint16_t guardInterval);
183  uint8_t GetNTx (void) const;
189  void SetNTx (uint8_t nTx);
199  uint8_t GetNss (uint16_t staId = SU_STA_ID) const;
203  uint8_t GetNssMax (void) const;
209  void SetNss (uint8_t nss);
216  void SetNss (uint8_t nss, uint16_t staId);
220  uint8_t GetNess (void) const;
226  void SetNess (uint8_t ness);
232  bool IsAggregation (void) const;
238  void SetAggregation (bool aggregation);
245  bool IsStbc (void) const;
251  void SetStbc (bool stbc);
258  bool IsLdpc (void) const;
264  void SetLdpc (bool ldpc);
269  void SetBssColor (uint8_t color);
274  uint8_t GetBssColor (void) const;
282  bool IsValid (void) const;
290  HeRu::RuSpec GetRu (uint16_t staId) const;
298  void SetRu (HeRu::RuSpec ru, uint16_t staId);
306  HeMuUserInfo GetHeMuUserInfo (uint16_t staId) const;
314  void SetHeMuUserInfo (uint16_t staId, HeMuUserInfo userInfo);
321  const HeMuUserInfoMap& GetHeMuUserInfoMap (void) const;
322 
323 
324 private:
328  uint8_t m_txPowerLevel;
332  uint16_t m_channelWidth;
333  uint16_t m_guardInterval;
334  uint8_t m_nTx;
335  uint8_t m_nss;
336  uint8_t m_ness;
338  bool m_stbc;
339  bool m_ldpc;
340  uint8_t m_bssColor;
344  //MU information
349 };
350 
359 std::ostream & operator << (std::ostream & os,const WifiTxVector &v);
360 
361 } //namespace ns3
362 
363 #endif /* WIFI_TX_VECTOR_H */
uint16_t m_channelWidth
channel width in MHz
uint8_t GetNssMax(void) const
bool IsAggregation(void) const
Checks whether the PSDU contains A-MPDU.
uint8_t m_nTx
number of TX antennas
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
uint8_t nss
number of spatial streams
bool m_ldpc
LDPC FEC coding if true, BCC otherwise.
void SetBssColor(uint8_t color)
Set the BSS color.
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info paramters indexed by STA-ID
void SetStbc(bool stbc)
Sets if STBC is being used.
bool IsStbc(void) const
Check if STBC is used or not.
bool GetModeInitialized(void) const
uint8_t GetNess(void) const
uint16_t GetGuardInterval(void) const
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
HeMuUserInfo GetHeMuUserInfo(uint16_t staId) const
Get the HE MU user-specific transmission information for the given STA-ID.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
WifiMode mcs
MCS.
bool IsLdpc(void) const
Check if LDPC FEC coding is used or not.
uint8_t m_nss
number of spatial streams
HeRu::RuSpec GetRu(uint16_t staId) const
Get the RU specification for the STA-ID.
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode...
WifiPreamble GetPreambleType(void) const
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:32
uint8_t m_bssColor
BSS color.
bool IsValid(void) const
The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.
RU Specification.
Definition: he-ru.h:64
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
uint16_t m_guardInterval
guard interval duration in nanoseconds
uint8_t GetNTx(void) const
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
void SetNss(uint8_t nss)
Sets the number of Nss.
bool m_modeInitialized
Internal initialization flag.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
bool m_aggregation
Flag whether the PSDU contains A-MPDU.
HeRu::RuSpec ru
RU specification.
bool m_stbc
STBC used or not.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
uint8_t GetBssColor(void) const
Get the BSS color.
void SetNess(uint8_t ness)
Sets the Ness number.
HeMuUserInfoMap m_muUserInfos
HE MU specific per-user information indexed by station ID (STA-ID) corresponding to the 11 LSBs of th...
uint8_t GetTxPowerLevel(void) const
uint16_t GetChannelWidth(void) const
uint8_t m_ness
number of spatial streams in beamforming
const HeMuUserInfoMap & GetHeMuUserInfoMap(void) const
Get the map HE MU user-specific transmission information indexed by STA-ID.
void SetRu(HeRu::RuSpec ru, uint16_t staId)
Set the RU specification for the STA-ID.
HE MU specific user transmission parameters.
#define SU_STA_ID
Definition: wifi-mode.h:30
uint8_t m_txPowerLevel
The TXPWR_LEVEL parameter in Table 15-4.
WifiMode m_mode
The DATARATE parameter in Table 15-4.
WifiPreamble m_preamble
preamble