--- a/src/wifi/model/wifi-tx-vector.cc Fri Dec 19 16:22:49 2014 -0800
+++ b/src/wifi/model/wifi-tx-vector.cc Fri Dec 19 18:28:40 2014 -0800
@@ -20,10 +20,18 @@
*/
#include "ns3/wifi-tx-vector.h"
+#include "ns3/fatal-error.h"
namespace ns3 {
WifiTxVector::WifiTxVector ()
+ : m_retries (0),
+ m_shortGuardInterval (false),
+ m_nss (1),
+ m_ness (0),
+ m_stbc (false),
+ m_modeInitialized (false),
+ m_txPowerLevelInitialized (false)
{
}
@@ -35,18 +43,28 @@
m_shortGuardInterval(shortGuardInterval),
m_nss(nss),
m_ness(ness),
- m_stbc(stbc)
+ m_stbc(stbc),
+ m_modeInitialized (true),
+ m_txPowerLevelInitialized (true)
{
}
WifiMode
WifiTxVector::GetMode (void) const
{
+ if (!m_modeInitialized)
+ {
+ NS_FATAL_ERROR ("WifiTxVector mode must be set before using");
+ }
return m_mode;
}
uint8_t
WifiTxVector::GetTxPowerLevel (void) const
{
+ if (!m_txPowerLevelInitialized)
+ {
+ NS_FATAL_ERROR ("WifiTxVector txPowerLevel must be set before using");
+ }
return m_txPowerLevel;
}
uint8_t
@@ -79,11 +97,13 @@
WifiTxVector::SetMode (WifiMode mode)
{
m_mode=mode;
+ m_modeInitialized = true;
}
void
WifiTxVector::SetTxPowerLevel (uint8_t powerlevel)
{
m_txPowerLevel=powerlevel;
+ m_txPowerLevelInitialized = true;
}
void
WifiTxVector::SetRetries (uint8_t retries)