wifi: Remove casts in logging outputs

This commit is contained in:
Sébastien Deronne
2018-02-26 23:18:47 +01:00
parent 8b355753c9
commit 673667d2f7
28 changed files with 134 additions and 134 deletions

View File

@@ -83,7 +83,7 @@ AmpduSubframeHeader::Print (std::ostream &os) const
{
os << "EOF = " << m_eof << ", length = " << m_length;
char previousFillChar = os.fill ('0');
os << ", CRC = 0x" << std::hex << std::setw (2) << static_cast<uint16_t> (m_crc) << ", Signature = 0x" << static_cast<uint16_t> (m_sig) << std::dec;
os << ", CRC = 0x" << std::hex << std::setw (2) << +m_crc << ", Signature = 0x" << +m_sig << std::dec;
os.fill (previousFillChar);
}

View File

@@ -253,7 +253,7 @@ AmrrWifiManager::UpdateMode (AmrrWifiRemoteStation *station)
station->m_success++;
NS_LOG_DEBUG ("++ success=" << station->m_success << " successThreshold=" << station->m_successThreshold <<
" tx_ok=" << station->m_tx_ok << " tx_err=" << station->m_tx_err << " tx_retr=" << station->m_tx_retr <<
" rate=" << static_cast<uint16_t>(station->m_txrate) << " n-supported-rates=" << static_cast<uint16_t>(GetNSupported (station)));
" rate=" << +station->m_txrate << " n-supported-rates=" << +GetNSupported (station));
if (station->m_success >= station->m_successThreshold
&& !IsMaxRate (station))
{
@@ -272,7 +272,7 @@ AmrrWifiManager::UpdateMode (AmrrWifiRemoteStation *station)
station->m_success = 0;
NS_LOG_DEBUG ("-- success=" << station->m_success << " successThreshold=" << station->m_successThreshold <<
" tx_ok=" << station->m_tx_ok << " tx_err=" << station->m_tx_err << " tx_retr=" << station->m_tx_retr <<
" rate=" << static_cast<uint16_t>(station->m_txrate) << " n-supported-rates=" << static_cast<uint16_t>(GetNSupported (station)));
" rate=" << +station->m_txrate << " n-supported-rates=" << +GetNSupported (station));
if (!IsMinRate (station))
{
if (station->m_recovery)

View File

@@ -292,7 +292,7 @@ void
ApWifiMac::ForwardDown (Ptr<const Packet> packet, Mac48Address from,
Mac48Address to, uint8_t tid)
{
NS_LOG_FUNCTION (this << packet << from << to << static_cast<uint32_t> (tid));
NS_LOG_FUNCTION (this << packet << from << to << +tid);
WifiMacHeader hdr;
//For now, an AP that supports QoS does not support non-QoS

View File

@@ -147,8 +147,8 @@ AparfWifiManager::DoCreateStation (void) const
station->m_aparfState = AparfWifiManager::High;
station->m_initialized = false;
NS_LOG_DEBUG ("create station=" << station << ", rate=" << static_cast<uint16_t>(station->m_rateIndex)
<< ", power=" << static_cast<uint16_t>(station->m_powerLevel));
NS_LOG_DEBUG ("create station=" << station << ", rate=" << +station->m_rateIndex
<< ", power=" << +station->m_powerLevel);
return station;
}
@@ -244,7 +244,7 @@ AparfWifiManager::DoReportDataOk (WifiRemoteStation *st, double ackSnr,
CheckInit (station);
station->m_nSuccess++;
station->m_nFailed = 0;
NS_LOG_DEBUG ("station=" << station << " data ok success=" << station->m_nSuccess << ", rate=" << static_cast<uint16_t>(station->m_rateIndex) << ", power=" << static_cast<uint16_t>(station->m_powerLevel));
NS_LOG_DEBUG ("station=" << station << " data ok success=" << station->m_nSuccess << ", rate=" << +station->m_rateIndex << ", power=" << +station->m_powerLevel);
if ((station->m_aparfState == AparfWifiManager::High) && (station->m_nSuccess >= station->m_successThreshold))
{

View File

@@ -31,7 +31,7 @@ BlockAckAgreement::BlockAckAgreement (Mac48Address peer, uint8_t tid)
m_htSupported (0),
m_inactivityEvent ()
{
NS_LOG_FUNCTION (this << peer << static_cast<uint16_t> (tid));
NS_LOG_FUNCTION (this << peer << +tid);
m_tid = tid;
m_peer = peer;
}

View File

@@ -48,7 +48,7 @@ Bar::Bar (Ptr<const Packet> bar, Mac48Address recipient, uint8_t tid, bool immed
tid (tid),
immediate (immediate)
{
NS_LOG_FUNCTION (this << bar << recipient << static_cast<uint16_t> (tid) << immediate);
NS_LOG_FUNCTION (this << bar << recipient << +tid << immediate);
}
NS_OBJECT_ENSURE_REGISTERED (BlockAckManager);
@@ -80,7 +80,7 @@ BlockAckManager::~BlockAckManager ()
bool
BlockAckManager::ExistsAgreement (Mac48Address recipient, uint8_t tid) const
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint16_t> (tid));
NS_LOG_FUNCTION (this << recipient << +tid);
return (m_agreements.find (std::make_pair (recipient, tid)) != m_agreements.end ());
}
@@ -88,7 +88,7 @@ bool
BlockAckManager::ExistsAgreementInState (Mac48Address recipient, uint8_t tid,
OriginatorBlockAckAgreement::State state) const
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint16_t> (tid) << state);
NS_LOG_FUNCTION (this << recipient << +tid << state);
AgreementsCI it;
it = m_agreements.find (std::make_pair (recipient, tid));
if (it != m_agreements.end ())
@@ -142,7 +142,7 @@ BlockAckManager::CreateAgreement (const MgtAddBaRequestHeader *reqHdr, Mac48Addr
void
BlockAckManager::DestroyAgreement (Mac48Address recipient, uint8_t tid)
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint16_t> (tid));
NS_LOG_FUNCTION (this << recipient << +tid);
AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
if (it != m_agreements.end ())
{
@@ -413,7 +413,7 @@ BlockAckManager::RemovePacket (uint8_t tid, Mac48Address recipient, uint16_t seq
i->second.second.erase ((*it));
m_retryPackets.erase (it);
NS_LOG_DEBUG ("Removed Packet from retry queue = " << hdr.GetSequenceNumber () << " " << static_cast<uint16_t> (tid) << " " << recipient << " Buffer Size = " << m_retryPackets.size ());
NS_LOG_DEBUG ("Removed Packet from retry queue = " << hdr.GetSequenceNumber () << " " << +tid << " " << recipient << " Buffer Size = " << m_retryPackets.size ());
return true;
}
}
@@ -443,7 +443,7 @@ BlockAckManager::HasPackets (void) const
uint32_t
BlockAckManager::GetNBufferedPackets (Mac48Address recipient, uint8_t tid) const
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint16_t> (tid));
NS_LOG_FUNCTION (this << recipient << +tid);
uint32_t nPackets = 0;
if (ExistsAgreement (recipient, tid))
{
@@ -468,7 +468,7 @@ BlockAckManager::GetNBufferedPackets (Mac48Address recipient, uint8_t tid) const
uint32_t
BlockAckManager::GetNRetryNeededPackets (Mac48Address recipient, uint8_t tid) const
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint16_t> (tid));
NS_LOG_FUNCTION (this << recipient << +tid);
uint32_t nPackets = 0;
uint16_t currentSeq = 0;
if (ExistsAgreement (recipient, tid))
@@ -503,7 +503,7 @@ BlockAckManager::GetNRetryNeededPackets (Mac48Address recipient, uint8_t tid) co
void
BlockAckManager::SetBlockAckThreshold (uint8_t nPackets)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (nPackets));
NS_LOG_FUNCTION (this << +nPackets);
m_blockAckThreshold = nPackets;
}
@@ -661,7 +661,7 @@ BlockAckManager::ScheduleBlockAckReqIfNeeded (Mac48Address recipient, uint8_t ti
this number could be incorrect. In fact is possible that a block ack agreement exists for n
packets but some of these packets are dropped due to MSDU lifetime expiration.
*/
NS_LOG_FUNCTION (this << recipient << static_cast<uint32_t> (tid));
NS_LOG_FUNCTION (this << recipient << +tid);
AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
NS_ASSERT (it != m_agreements.end ());
@@ -697,14 +697,14 @@ BlockAckManager::ScheduleBlockAckReqIfNeeded (Mac48Address recipient, uint8_t ti
void
BlockAckManager::InactivityTimeout (Mac48Address recipient, uint8_t tid)
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint32_t> (tid));
NS_LOG_FUNCTION (this << recipient << +tid);
m_blockAckInactivityTimeout (recipient, tid, true);
}
void
BlockAckManager::NotifyAgreementEstablished (Mac48Address recipient, uint8_t tid, uint16_t startingSeq)
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint32_t> (tid) << startingSeq);
NS_LOG_FUNCTION (this << recipient << +tid << startingSeq);
AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
NS_ASSERT (it != m_agreements.end ());
it->second.first.SetState (OriginatorBlockAckAgreement::ESTABLISHED);
@@ -714,7 +714,7 @@ BlockAckManager::NotifyAgreementEstablished (Mac48Address recipient, uint8_t tid
void
BlockAckManager::NotifyAgreementUnsuccessful (Mac48Address recipient, uint8_t tid)
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint32_t> (tid));
NS_LOG_FUNCTION (this << recipient << +tid);
AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
NS_ASSERT (it != m_agreements.end ());
if (it != m_agreements.end ())
@@ -726,7 +726,7 @@ BlockAckManager::NotifyAgreementUnsuccessful (Mac48Address recipient, uint8_t ti
void
BlockAckManager::NotifyMpduTransmission (Mac48Address recipient, uint8_t tid, uint16_t nextSeqNumber, WifiMacHeader::QosAckPolicy policy)
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint32_t> (tid) << nextSeqNumber);
NS_LOG_FUNCTION (this << recipient << +tid << nextSeqNumber);
Ptr<Packet> bar = 0;
AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
NS_ASSERT (it != m_agreements.end ());
@@ -761,7 +761,7 @@ BlockAckManager::SetQueue (const Ptr<WifiMacQueue> queue)
bool
BlockAckManager::SwitchToBlockAckIfNeeded (Mac48Address recipient, uint8_t tid, uint16_t startingSeq)
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint16_t> (tid) << startingSeq);
NS_LOG_FUNCTION (this << recipient << +tid << startingSeq);
NS_ASSERT (!ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::PENDING));
if (!ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::UNSUCCESSFUL) && ExistsAgreement (recipient, tid))
{
@@ -881,7 +881,7 @@ BlockAckManager::SetTxMiddle (const Ptr<MacTxMiddle> txMiddle)
uint16_t
BlockAckManager::GetSeqNumOfNextRetryPacket (Mac48Address recipient, uint8_t tid) const
{
NS_LOG_FUNCTION (this << recipient << static_cast<uint16_t> (tid));
NS_LOG_FUNCTION (this << recipient << +tid);
std::list<PacketQueueI>::const_iterator it = m_retryPackets.begin ();
while (it != m_retryPackets.end ())
{

View File

@@ -160,7 +160,7 @@ CaraWifiManager::DoReportDataOk (WifiRemoteStation *st,
{
station->m_rate++;
}
NS_LOG_DEBUG ("self=" << station << " inc rate=" << static_cast<uint16_t>(station->m_rate));
NS_LOG_DEBUG ("self=" << station << " inc rate=" << +station->m_rate);
station->m_timer = 0;
station->m_success = 0;
}

View File

@@ -123,7 +123,7 @@ EdcaTxopN::SetWifiRemoteStationManager (const Ptr<WifiRemoteStationManager> remo
void
EdcaTxopN::SetTypeOfStation (TypeOfStation type)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (type));
NS_LOG_FUNCTION (this << +type);
m_typeOfStation = type;
}
@@ -613,7 +613,7 @@ EdcaTxopN::MissedAck (void)
void
EdcaTxopN::MissedBlockAck (uint8_t nMpdus)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (nMpdus));
NS_LOG_FUNCTION (this << +nMpdus);
uint8_t tid = GetTid (m_currentPacket, m_currentHdr);
if (GetAmpduExist (m_currentHdr.GetAddr1 ()))
{
@@ -1162,7 +1162,7 @@ EdcaTxopN::GetFragmentPacket (WifiMacHeader *hdr)
void
EdcaTxopN::SetAccessCategory (AcIndex ac)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (ac));
NS_LOG_FUNCTION (this << +ac);
m_ac = ac;
}
@@ -1418,7 +1418,7 @@ EdcaTxopN::CompleteConfig (void)
void
EdcaTxopN::SetBlockAckThreshold (uint8_t threshold)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (threshold));
NS_LOG_FUNCTION (this << +threshold);
m_blockAckThreshold = threshold;
m_baManager->SetBlockAckThreshold (threshold);
}
@@ -1441,7 +1441,7 @@ void
EdcaTxopN::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16_t startSeq,
uint16_t timeout, bool immediateBAck)
{
NS_LOG_FUNCTION (this << dest << static_cast<uint16_t> (tid) << startSeq << timeout << immediateBAck);
NS_LOG_FUNCTION (this << dest << +tid << startSeq << timeout << immediateBAck);
NS_LOG_DEBUG ("sent ADDBA request to " << dest);
WifiMacHeader hdr;
hdr.SetType (WIFI_MAC_MGT_ACTION);
@@ -1501,7 +1501,7 @@ EdcaTxopN::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16_t startSeq,
void
EdcaTxopN::SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator)
{
NS_LOG_FUNCTION (this << addr << static_cast<uint16_t> (tid) << byOriginator);
NS_LOG_FUNCTION (this << addr << +tid << byOriginator);
WifiMacHeader hdr;
hdr.SetType (WIFI_MAC_MGT_ACTION);
hdr.SetAddr1 (addr);

View File

@@ -481,9 +481,9 @@ std::ostream &
operator << (std::ostream &os, const HeCapabilities &HeCapabilities)
{
os << HeCapabilities.GetHeMacCapabilitiesInfo1 () << "|"
<< static_cast<uint16_t> (HeCapabilities.GetHeMacCapabilitiesInfo2 ()) << "|"
<< +HeCapabilities.GetHeMacCapabilitiesInfo2 () << "|"
<< HeCapabilities.GetHePhyCapabilitiesInfo1 () << "|"
<< static_cast<uint16_t> (HeCapabilities.GetHePhyCapabilitiesInfo2 ()) << "|"
<< +HeCapabilities.GetHePhyCapabilitiesInfo2 () << "|"
<< HeCapabilities.GetSupportedMcsAndNss ();
return os;
}

View File

@@ -134,8 +134,8 @@ IdealWifiManager::DoInitialize ()
//derive NSS from the MCS index
nss = (mode.GetMcsValue () / 8) + 1;
NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () <<
" channel width " << static_cast<uint16_t> (j) <<
" nss " << static_cast<uint16_t> (nss) <<
" channel width " << +j <<
" nss " << +nss <<
" GI " << guardInterval);
NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ());
txVector.SetNss (nss);
@@ -157,8 +157,8 @@ IdealWifiManager::DoInitialize ()
for (uint8_t i = 1; i <= GetPhy ()->GetMaxSupportedTxSpatialStreams (); i++)
{
NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () <<
" channel width " << static_cast<uint16_t> (j) <<
" nss " << static_cast<uint16_t> (i) <<
" channel width " << +j <<
" nss " << +i <<
" GI " << guardInterval);
NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ());
txVector.SetNss (i);
@@ -178,13 +178,13 @@ IdealWifiManager::GetSnrThreshold (WifiTxVector txVector) const
for (Thresholds::const_iterator i = m_thresholds.begin (); i != m_thresholds.end (); i++)
{
NS_LOG_DEBUG ("Checking " << i->second.GetMode ().GetUniqueName () <<
" nss " << static_cast<uint16_t> (i->second.GetNss ()) <<
" nss " << +i->second.GetNss () <<
" GI " << i->second.GetGuardInterval () <<
" width " << static_cast<uint16_t> (i->second.GetChannelWidth ()));
" width " << +i->second.GetChannelWidth ());
NS_LOG_DEBUG ("against TxVector " << txVector.GetMode ().GetUniqueName () <<
" nss " << static_cast<uint16_t> (txVector.GetNss ()) <<
" nss " << +txVector.GetNss () <<
" GI " << txVector.GetGuardInterval () <<
" width " << static_cast<uint16_t> (txVector.GetChannelWidth ()));
" width " << +txVector.GetChannelWidth ());
if (txVector.GetMode () == i->second.GetMode ()
&& txVector.GetNss () == i->second.GetNss ()
&& txVector.GetChannelWidth () == i->second.GetChannelWidth ())
@@ -260,7 +260,7 @@ IdealWifiManager::DoReportDataOk (WifiRemoteStation *st,
void
IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
{
NS_LOG_FUNCTION (this << st << static_cast<uint16_t> (nSuccessfulMpdus) << static_cast<uint16_t> (nFailedMpdus) << rxSnr << dataSnr);
NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
IdealWifiRemoteStation *station = (IdealWifiRemoteStation *)st;
if (dataSnr == 0)
{
@@ -308,7 +308,7 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
NS_LOG_DEBUG ("Using cached mode = " << maxMode.GetUniqueName () <<
" last snr observed " << station->m_lastSnrObserved <<
" cached " << station->m_lastSnrCached <<
" nss " << static_cast<uint16_t> (selectedNss));
" nss " << +selectedNss);
}
else
{
@@ -340,8 +340,8 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
|| nss > std::min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (st)))
{
NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
" nss " << static_cast<uint16_t> (nss) <<
" width " << static_cast<uint16_t> (txVector.GetChannelWidth ()));
" nss " << +nss <<
" width " << +txVector.GetChannelWidth ());
continue;
}
double threshold = GetSnrThreshold (txVector);
@@ -383,8 +383,8 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
if (!txVector.IsValid ())
{
NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
" nss " << static_cast<uint16_t> (nss) <<
" width " << static_cast<uint16_t> (txVector.GetChannelWidth ()));
" nss " << +nss <<
" width " << +txVector.GetChannelWidth ());
continue;
}
double threshold = GetSnrThreshold (txVector);
@@ -422,8 +422,8 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
if (!txVector.IsValid ())
{
NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
" nss " << static_cast<uint16_t> (nss) <<
" width " << static_cast<uint16_t> (txVector.GetChannelWidth ()));
" nss " << +nss <<
" width " << +txVector.GetChannelWidth ());
continue;
}
double threshold = GetSnrThreshold (txVector);
@@ -481,7 +481,7 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
station->m_lastMode = maxMode;
station->m_nss = selectedNss;
}
NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << static_cast<uint16_t> (channelWidth));
NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << +channelWidth);
if (maxMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
{
guardInterval = std::max (GetGuardInterval (station), static_cast<uint16_t> (GetPhy ()->GetGuardInterval ().GetNanoSeconds ()));

View File

@@ -234,7 +234,7 @@ InterferenceHelper::CalculateSnr (double signal, double noiseInterference, uint8
double noiseFloor = m_noiseFigure * Nt;
double noise = noiseFloor + noiseInterference;
double snr = signal / noise; //linear scale
NS_LOG_DEBUG ("bandwidth(MHz)=" << static_cast<uint16_t> (channelWidth) << ", signal(W)= " << signal << ", noise(W)=" << noiseFloor << ", interference(W)=" << noiseInterference << ", snr(linear)=" << snr);
NS_LOG_DEBUG ("bandwidth(MHz)=" << +channelWidth << ", signal(W)= " << signal << ", noise(W)=" << noiseFloor << ", interference(W)=" << noiseInterference << ", snr(linear)=" << snr);
return snr;
}
@@ -271,8 +271,8 @@ InterferenceHelper::CalculateChunkSuccessRate (double snir, Time duration, WifiM
{
nbits /= txVector.GetNss (); //divide effective number of bits by NSS to achieve same chunk error rate as SISO for AWGN
double gain = (txVector.GetNTx () * m_numRxAntennas); //compute gain offered by MIMO, SIMO or MISO compared to SISO for AWGN
NS_LOG_DEBUG ("TX=" << static_cast<uint16_t> (txVector.GetNTx ()) <<
", RX=" << static_cast<uint16_t> (m_numRxAntennas) <<
NS_LOG_DEBUG ("TX=" << +txVector.GetNTx () <<
", RX=" << +m_numRxAntennas <<
", SNIR improvement=+" << 10 * std::log10 (gain) << "dB");
snir *= gain;
}

View File

@@ -2190,7 +2190,7 @@ MacLow::SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time durat
NS_LOG_FUNCTION (this);
if (!m_phy->IsStateTx () && !m_phy->IsStateRx ())
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (tid) << originator << duration.As (Time::S) << blockAckReqTxVector << rxSnr);
NS_LOG_FUNCTION (this << +tid << originator << duration.As (Time::S) << blockAckReqTxVector << rxSnr);
CtrlBAckResponseHeader blockAck;
uint16_t seqNumber = 0;
BlockAckCachesI i = m_bAckCaches.find (std::make_pair (originator, tid));

View File

@@ -253,7 +253,7 @@ MinstrelHtWifiManager::DoInitialize ()
AddFirstMpduTxTime (groupId, mode, CalculateFirstMpduTxDuration (GetPhy (), streams, sgi, chWidth, mode));
AddMpduTxTime (groupId, mode, CalculateMpduTxDuration (GetPhy (), streams, sgi, chWidth, mode));
}
NS_LOG_DEBUG ("Initialized group " << groupId << ": (" << static_cast<uint16_t> (streams) << "," << static_cast<uint16_t> (sgi) << "," << static_cast<uint16_t> (chWidth) << ")");
NS_LOG_DEBUG ("Initialized group " << groupId << ": (" << +streams << "," << +sgi << "," << +chWidth << ")");
}
}
}
@@ -295,7 +295,7 @@ MinstrelHtWifiManager::DoInitialize ()
AddMpduTxTime (groupId, mode, CalculateMpduTxDuration (GetPhy (), streams, sgi, chWidth, mode));
}
}
NS_LOG_DEBUG ("Initialized group " << groupId << ": (" << static_cast<uint16_t> (streams) << "," << static_cast<uint16_t> (sgi) << "," << static_cast<uint16_t> (chWidth) << ")");
NS_LOG_DEBUG ("Initialized group " << groupId << ": (" << +streams << "," << +sgi << "," << +chWidth << ")");
}
}
}
@@ -315,7 +315,7 @@ MinstrelHtWifiManager::SetupMac (const Ptr<WifiMac> mac)
bool
MinstrelHtWifiManager::IsValidMcs (Ptr<WifiPhy> phy, uint8_t streams, uint8_t chWidth, WifiMode mode)
{
NS_LOG_FUNCTION (this << phy << static_cast<uint16_t> (streams) << static_cast<uint16_t> (chWidth) << mode);
NS_LOG_FUNCTION (this << phy << +streams << +chWidth << mode);
WifiTxVector txvector;
txvector.SetNss (streams);
txvector.SetChannelWidth (chWidth);
@@ -326,7 +326,7 @@ MinstrelHtWifiManager::IsValidMcs (Ptr<WifiPhy> phy, uint8_t streams, uint8_t ch
Time
MinstrelHtWifiManager::CalculateFirstMpduTxDuration (Ptr<WifiPhy> phy, uint8_t streams, uint8_t sgi, uint8_t chWidth, WifiMode mode)
{
NS_LOG_FUNCTION (this << phy << static_cast<uint16_t> (streams) << static_cast<uint16_t> (sgi) << static_cast<uint16_t> (chWidth) << mode);
NS_LOG_FUNCTION (this << phy << +streams << +sgi << +chWidth << mode);
WifiTxVector txvector;
txvector.SetNss (streams);
txvector.SetGuardInterval (sgi ? 400 : 800);
@@ -341,7 +341,7 @@ MinstrelHtWifiManager::CalculateFirstMpduTxDuration (Ptr<WifiPhy> phy, uint8_t s
Time
MinstrelHtWifiManager::CalculateMpduTxDuration (Ptr<WifiPhy> phy, uint8_t streams, uint8_t sgi, uint8_t chWidth, WifiMode mode)
{
NS_LOG_FUNCTION (this << phy << static_cast<uint16_t> (streams) << static_cast<uint16_t> (sgi) << static_cast<uint16_t> (chWidth) << mode);
NS_LOG_FUNCTION (this << phy << +streams << +sgi << +chWidth << mode);
WifiTxVector txvector;
txvector.SetNss (streams);
txvector.SetGuardInterval (sgi ? 400 : 800);
@@ -672,7 +672,7 @@ MinstrelHtWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st)
void
MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
{
NS_LOG_FUNCTION (this << st << static_cast<uint16_t> (nSuccessfulMpdus) << static_cast<uint16_t> (nFailedMpdus) << rxSnr << dataSnr);
NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
MinstrelHtWifiRemoteStation *station = (MinstrelHtWifiRemoteStation *) st;
CheckInit (station);
@@ -687,7 +687,7 @@ MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSu
}
NS_LOG_DEBUG ("DoReportAmpduTxStatus. TxRate=" << station->m_txrate << " SuccMpdus= " <<
static_cast<uint16_t> (nSuccessfulMpdus) << " FailedMpdus= " << static_cast<uint16_t> (nFailedMpdus));
+nSuccessfulMpdus << " FailedMpdus= " << +nFailedMpdus);
station->m_ampduPacketCount++;
station->m_ampduLen += nSuccessfulMpdus + nFailedMpdus;
@@ -835,7 +835,7 @@ MinstrelHtWifiManager::UpdateRetry (MinstrelHtWifiRemoteStation *station)
void
MinstrelHtWifiManager::UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus)
{
NS_LOG_FUNCTION (this << station << static_cast<uint16_t> (nSuccessfulMpdus) << static_cast<uint16_t> (nFailedMpdus));
NS_LOG_FUNCTION (this << station << +nSuccessfulMpdus << +nFailedMpdus);
station->m_totalPacketsCount += nSuccessfulMpdus + nFailedMpdus;
if (station->m_isSampling)
@@ -902,8 +902,8 @@ MinstrelHtWifiManager::DoGetDataTxVector (WifiRemoteStation *st)
// Check consistency of rate selected.
if ((group.sgi && !GetShortGuardInterval (station)) || group.chWidth > GetChannelWidth (station) || group.streams > GetNumberOfSupportedStreams (station))
{
NS_ASSERT_MSG (false, "Inconsistent group selected. Group: (" << static_cast<uint16_t> (group.streams) <<
"," << static_cast<uint16_t> (group.sgi) << "," << static_cast<uint16_t> (group.chWidth) << ")" <<
NS_ASSERT_MSG (false, "Inconsistent group selected. Group: (" << +group.streams <<
"," << +group.sgi << "," << +group.chWidth << ")" <<
" Station capabilities: (" << GetNumberOfSupportedStreams (station) <<
"," << GetShortGuardInterval (station) << "," << GetChannelWidth (station) << ")");
}
@@ -1173,8 +1173,8 @@ MinstrelHtWifiManager::FindRate (MinstrelHtWifiRemoteStation *station)
Time maxProbDuration = station->m_groupsTable[maxProbGroupId].m_ratesTable[maxProbRateId].perfectTxTime;
NS_LOG_DEBUG ("Use sample rate? SampleDuration= " << sampleDuration << " maxTp2Duration= " << maxTp2Duration <<
" maxProbDuration= " << maxProbDuration << " sampleStreams= " << static_cast<uint16_t> (sampleStreams) <<
" maxTpStreams= " << static_cast<uint16_t> (maxTpStreams));
" maxProbDuration= " << maxProbDuration << " sampleStreams= " << +sampleStreams <<
" maxTpStreams= " << +maxTpStreams);
if (sampleDuration < maxTp2Duration || (sampleStreams < maxTpStreams && sampleDuration < maxProbDuration))
{
/// Set flag that we are currently sampling.
@@ -1504,8 +1504,8 @@ MinstrelHtWifiManager::RateInit (MinstrelHtWifiRemoteStation *station)
&& (GetChannelWidth (station) >= m_minstrelGroups[groupId].chWidth) ///Is channel width supported by the receiver?
&& (GetNumberOfSupportedStreams (station) >= m_minstrelGroups[groupId].streams)) ///Are streams supported by the receiver?
{
NS_LOG_DEBUG ("Group " << groupId << ": (" << static_cast<uint16_t> (m_minstrelGroups[groupId].streams) <<
"," << static_cast<uint16_t> (m_minstrelGroups[groupId].sgi) << "," << static_cast<uint16_t> (m_minstrelGroups[groupId].chWidth) << ")");
NS_LOG_DEBUG ("Group " << groupId << ": (" << +m_minstrelGroups[groupId].streams <<
"," << +m_minstrelGroups[groupId].sgi << "," << +m_minstrelGroups[groupId].chWidth << ")");
station->m_groupsTable[groupId].m_supported = true; ///Group supported.
station->m_groupsTable[groupId].m_col = 0;
@@ -1805,14 +1805,14 @@ MinstrelHtWifiManager::GetGroupId (uint32_t index)
uint32_t
MinstrelHtWifiManager::GetHtGroupId (uint8_t txstreams, uint8_t sgi, uint8_t chWidth)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (txstreams) << static_cast<uint16_t> (sgi) << static_cast<uint16_t> (chWidth));
NS_LOG_FUNCTION (this << +txstreams << +sgi << +chWidth);
return MAX_SUPPORTED_STREAMS * 2 * (chWidth == 40 ? 1 : 0) + MAX_SUPPORTED_STREAMS * sgi + txstreams - 1;
}
uint32_t
MinstrelHtWifiManager::GetVhtGroupId (uint8_t txstreams, uint8_t sgi, uint8_t chWidth)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (txstreams) << static_cast<uint16_t> (sgi) << static_cast<uint16_t> (chWidth));
NS_LOG_FUNCTION (this << +txstreams << +sgi << +chWidth);
return MAX_HT_STREAM_GROUPS * MAX_SUPPORTED_STREAMS + MAX_SUPPORTED_STREAMS * 2 * (chWidth == 160 ? 3 : chWidth == 80 ? 2 : chWidth == 40 ? 1 : 0) + MAX_SUPPORTED_STREAMS * sgi + txstreams - 1;
}

View File

@@ -907,7 +907,7 @@ MinstrelWifiManager::RateInit (MinstrelWifiRemoteStation *station)
NS_LOG_FUNCTION (this << station);
for (uint8_t i = 0; i < station->m_nModes; i++)
{
NS_LOG_DEBUG ("Initializing rate index " << static_cast<uint16_t>(i) << " " << GetSupported (station, i));
NS_LOG_DEBUG ("Initializing rate index " << +i << " " << GetSupported (station, i));
station->m_minstrelTable[i].numRateAttempt = 0;
station->m_minstrelTable[i].numRateSuccess = 0;
station->m_minstrelTable[i].prevNumRateSuccess = 0;

View File

@@ -116,7 +116,7 @@ ParfWifiManager::DoCreateStation (void) const
station->m_nAttempt = 0;
NS_LOG_DEBUG ("create station=" << station << ", timer=" << station->m_nAttempt
<< ", rate=" << static_cast<uint16_t>(station->m_rateIndex) << ", power=" << static_cast<uint16_t>(station->m_powerLevel));
<< ", rate=" << +station->m_rateIndex << ", power=" << +station->m_powerLevel);
return station;
}
@@ -168,7 +168,7 @@ ParfWifiManager::DoReportDataFailed (WifiRemoteStation *st)
station->m_nSuccess = 0;
NS_LOG_DEBUG ("station=" << station << " data fail retry=" << station->m_nRetry << ", timer=" << station->m_nAttempt
<< ", rate=" << static_cast<uint16_t>(station->m_rateIndex) << ", power=" << static_cast<uint16_t>(station->m_powerLevel));
<< ", rate=" << +station->m_rateIndex << ", power=" << +station->m_powerLevel);
if (station->m_usingRecoveryRate)
{
NS_ASSERT (station->m_nRetry >= 1);
@@ -251,7 +251,7 @@ void ParfWifiManager::DoReportDataOk (WifiRemoteStation *st,
station->m_usingRecoveryRate = false;
station->m_usingRecoveryPower = false;
station->m_nRetry = 0;
NS_LOG_DEBUG ("station=" << station << " data ok success=" << station->m_nSuccess << ", timer=" << station->m_nAttempt << ", rate=" << static_cast<uint16_t>(station->m_rateIndex) << ", power=" << static_cast<uint16_t>(station->m_powerLevel));
NS_LOG_DEBUG ("station=" << station << " data ok success=" << station->m_nSuccess << ", timer=" << station->m_nAttempt << ", rate=" << +station->m_rateIndex << ", power=" << +station->m_powerLevel);
if ((station->m_nSuccess == m_successThreshold
|| station->m_nAttempt == m_attemptThreshold)
&& (station->m_rateIndex < (station->m_state->m_operationalRateSet.size () - 1)))

View File

@@ -27,7 +27,7 @@ namespace ns3 {
AcIndex
QosUtilsMapTidToAc (uint8_t tid)
{
NS_ASSERT_MSG (tid < 8, "Tid " << static_cast<uint16_t> (tid) << " out of range");
NS_ASSERT_MSG (tid < 8, "Tid " << +tid << " out of range");
switch (tid)
{
case 0:

View File

@@ -398,28 +398,28 @@ RegularWifiMac::SetBkMaxAmpduSize (uint16_t size)
void
RegularWifiMac::SetVoBlockAckThreshold (uint8_t threshold)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (threshold));
NS_LOG_FUNCTION (this << +threshold);
GetVOQueue ()->SetBlockAckThreshold (threshold);
}
void
RegularWifiMac::SetViBlockAckThreshold (uint8_t threshold)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (threshold));
NS_LOG_FUNCTION (this << +threshold);
GetVIQueue ()->SetBlockAckThreshold (threshold);
}
void
RegularWifiMac::SetBeBlockAckThreshold (uint8_t threshold)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (threshold));
NS_LOG_FUNCTION (this << +threshold);
GetBEQueue ()->SetBlockAckThreshold (threshold);
}
void
RegularWifiMac::SetBkBlockAckThreshold (uint8_t threshold)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (threshold));
NS_LOG_FUNCTION (this << +threshold);
GetBKQueue ()->SetBlockAckThreshold (threshold);
}

View File

@@ -453,7 +453,7 @@ RraaWifiManager::ARts (RraaWifiRemoteStation *station)
WifiRraaThresholds
RraaWifiManager::GetThresholds (RraaWifiRemoteStation *station, uint8_t rate) const
{
NS_LOG_FUNCTION (this << station << static_cast<uint16_t>(rate));
NS_LOG_FUNCTION (this << station << +rate);
WifiMode mode = GetSupported (station, rate);
return GetThresholds (station, mode);
}

View File

@@ -466,7 +466,7 @@ RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station)
{
NS_LOG_DEBUG ("bploss >= MTL and power < maxPower => Increase Power");
station->m_pdTable[station->m_rateIndex][station->m_powerLevel] /= m_gamma;
NS_LOG_DEBUG ("pdTable[" << static_cast<uint16_t> (station->m_rateIndex) << "][" << station->m_powerLevel << "] = " << station->m_pdTable[station->m_rateIndex][station->m_powerLevel]);
NS_LOG_DEBUG ("pdTable[" << +station->m_rateIndex << "][" << station->m_powerLevel << "] = " << station->m_pdTable[station->m_rateIndex][station->m_powerLevel]);
station->m_powerLevel++;
ResetCountersBasic (station);
}
@@ -474,7 +474,7 @@ RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station)
{
NS_LOG_DEBUG ("bploss >= MTL and power = maxPower => Decrease Rate");
station->m_pdTable[station->m_rateIndex][station->m_powerLevel] /= m_gamma;
NS_LOG_DEBUG ("pdTable[" << static_cast<uint16_t> (station->m_rateIndex) << "][" << station->m_powerLevel << "] = " << station->m_pdTable[station->m_rateIndex][station->m_powerLevel]);
NS_LOG_DEBUG ("pdTable[" << +station->m_rateIndex << "][" << station->m_powerLevel << "] = " << station->m_pdTable[station->m_rateIndex][station->m_powerLevel]);
station->m_rateIndex--;
ResetCountersBasic (station);
}
@@ -518,7 +518,7 @@ RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station)
{
station->m_pdTable[station->m_rateIndex][i] = 1;
}
NS_LOG_DEBUG ("pdTable[" << static_cast<uint16_t> (station->m_rateIndex) << "][" << i << "] = " << station->m_pdTable[station->m_rateIndex][i]);
NS_LOG_DEBUG ("pdTable[" << +station->m_rateIndex << "][" << i << "] = " << station->m_pdTable[station->m_rateIndex][i]);
}
double rand = m_uniformRandomVariable->GetValue (0,1);
if (rand < station->m_pdTable[station->m_rateIndex][station->m_powerLevel - 1])
@@ -543,7 +543,7 @@ RrpaaWifiManager::RunBasicAlgorithm (RrpaaWifiRemoteStation *station)
{
station->m_pdTable[station->m_rateIndex][i] = 1;
}
NS_LOG_DEBUG ("pdTable[" << static_cast<uint16_t> (station->m_rateIndex) << "][" << i << "] = " << station->m_pdTable[station->m_rateIndex][i]);
NS_LOG_DEBUG ("pdTable[" << +station->m_rateIndex << "][" << i << "] = " << station->m_pdTable[station->m_rateIndex][i]);
}
double rand = m_uniformRandomVariable->GetValue (0,1);
if (rand < station->m_pdTable[station->m_rateIndex][station->m_powerLevel - 1])
@@ -590,7 +590,7 @@ RrpaaWifiManager::RunAdaptiveRtsAlgorithm (RrpaaWifiRemoteStation *station)
WifiRrpaaThresholds
RrpaaWifiManager::GetThresholds (RrpaaWifiRemoteStation *station, uint8_t rate) const
{
NS_LOG_FUNCTION (this << station << static_cast<uint16_t>(rate));
NS_LOG_FUNCTION (this << station << +rate);
WifiMode mode = GetSupported (station, rate);
return GetThresholds (station, mode);
}

View File

@@ -107,7 +107,7 @@ SpectrumWifiPhy::GetRxSpectrumModel () const
}
else
{
NS_LOG_DEBUG ("Creating spectrum model from frequency/width pair of (" << GetFrequency () << ", " << static_cast<uint16_t> (GetChannelWidth ()) << ")");
NS_LOG_DEBUG ("Creating spectrum model from frequency/width pair of (" << GetFrequency () << ", " << +GetChannelWidth () << ")");
m_rxSpectrumModel = WifiSpectrumValueHelper::GetSpectrumModel (GetFrequency (), GetChannelWidth (), GetBandBandwidth (), GetGuardBandwidth ());
}
}
@@ -131,7 +131,7 @@ SpectrumWifiPhy::ResetSpectrumModel (void)
{
NS_LOG_FUNCTION (this);
NS_ASSERT_MSG (IsInitialized (), "Executing method before run-time");
NS_LOG_DEBUG ("Run-time change of spectrum model from frequency/width pair of (" << GetFrequency () << ", " << static_cast<uint16_t> (GetChannelWidth ()) << ")");
NS_LOG_DEBUG ("Run-time change of spectrum model from frequency/width pair of (" << GetFrequency () << ", " << +GetChannelWidth () << ")");
// Replace existing spectrum model with new one, and must call AddRx ()
// on the SpectrumChannel to provide this new spectrum model to it
m_rxSpectrumModel = WifiSpectrumValueHelper::GetSpectrumModel (GetFrequency (), GetChannelWidth (), GetBandBandwidth (), GetGuardBandwidth ());
@@ -141,7 +141,7 @@ SpectrumWifiPhy::ResetSpectrumModel (void)
void
SpectrumWifiPhy::SetChannelNumber (uint8_t nch)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (nch));
NS_LOG_FUNCTION (this << +nch);
WifiPhy::SetChannelNumber (nch);
if (IsInitialized ())
{
@@ -163,7 +163,7 @@ SpectrumWifiPhy::SetFrequency (uint16_t freq)
void
SpectrumWifiPhy::SetChannelWidth (uint8_t channelwidth)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (channelwidth));
NS_LOG_FUNCTION (this << +channelwidth);
WifiPhy::SetChannelWidth (channelwidth);
if (IsInitialized ())
{
@@ -287,7 +287,7 @@ SpectrumWifiPhy::CreateWifiSpectrumPhyInterface (Ptr<NetDevice> device)
Ptr<SpectrumValue>
SpectrumWifiPhy::GetTxPowerSpectralDensity (uint16_t centerFrequency, uint8_t channelWidth, double txPowerW, WifiModulationClass modulationClass) const
{
NS_LOG_FUNCTION (centerFrequency << static_cast<uint16_t> (channelWidth) << txPowerW);
NS_LOG_FUNCTION (centerFrequency << +channelWidth << txPowerW);
Ptr<SpectrumValue> v;
switch (modulationClass)
{
@@ -342,7 +342,7 @@ SpectrumWifiPhy::StartTx (Ptr<Packet> packet, WifiTxVector txVector, Time txDura
txParams->txPhy = m_wifiSpectrumPhyInterface->GetObject<SpectrumPhy> ();
txParams->txAntenna = m_antenna;
txParams->packet = packet;
NS_LOG_DEBUG ("Starting transmission with power " << WToDbm (txPowerWatts) << " dBm on channel " << static_cast<uint16_t> (GetChannelNumber ()));
NS_LOG_DEBUG ("Starting transmission with power " << WToDbm (txPowerWatts) << " dBm on channel " << +GetChannelNumber ());
NS_LOG_DEBUG ("Starting transmission with integrated spectrum power " << WToDbm (Integral (*txPowerSpectrum)) << " dBm; spectrum model Uid: " << txPowerSpectrum->GetSpectrumModel ()->GetUid ());
m_channel->StartTx (txParams);
}

View File

@@ -90,7 +90,7 @@ SupportedRates::AddSupportedRate (uint32_t bs)
}
m_rates[m_nRates] = bs / 500000;
m_nRates++;
NS_LOG_DEBUG ("add rate=" << bs << ", n rates=" << static_cast<uint16_t> (m_nRates));
NS_LOG_DEBUG ("add rate=" << bs << ", n rates=" << +m_nRates);
}
}
@@ -108,7 +108,7 @@ SupportedRates::SetBasicRate (uint32_t bs)
}
if (rate == m_rates[i])
{
NS_LOG_DEBUG ("set basic rate=" << bs << ", n rates=" << static_cast<uint16_t> (m_nRates));
NS_LOG_DEBUG ("set basic rate=" << bs << ", n rates=" << +m_nRates);
m_rates[i] |= 0x80;
return;
}

View File

@@ -174,9 +174,9 @@ ATTRIBUTE_HELPER_CPP (VhtOperation);
std::ostream &
operator << (std::ostream &os, const VhtOperation &VhtOperation)
{
os << static_cast<uint16_t> (VhtOperation.GetChannelWidth ()) << "|"
<< static_cast<uint16_t> (VhtOperation.GetChannelCenterFrequencySegment0 ()) << "|"
<< static_cast<uint16_t> (VhtOperation.GetChannelCenterFrequencySegment1 ()) << "|"
os << +VhtOperation.GetChannelWidth () << "|"
<< +VhtOperation.GetChannelCenterFrequencySegment0 () << "|"
<< +VhtOperation.GetChannelCenterFrequencySegment1 () << "|"
<< VhtOperation.GetBasicVhtMcsAndNssSet ();
return os;
}

View File

@@ -105,7 +105,7 @@ WifiInformationElementVector::DeserializeSingleIe (Buffer::Iterator start)
{
case 0: // eliminate compiler warning
default:
NS_FATAL_ERROR ("Information element " << static_cast<uint16_t> (id) << " is not implemented");
NS_FATAL_ERROR ("Information element " << +id << " is not implemented");
return 0;
}
/* unreachable: b/c switch is guaranteed to return from this function

View File

@@ -198,7 +198,7 @@ WifiMode::GetDataRate (uint8_t channelWidth, uint16_t guardInterval, uint8_t nss
{
if (item->modClass == WIFI_MOD_CLASS_VHT)
{
NS_ASSERT_MSG (IsAllowed (channelWidth, nss), "VHT MCS " << static_cast<uint16_t> (item->mcsValue) << " forbidden at " << static_cast<uint16_t> (channelWidth) << " MHz when NSS is " << static_cast<uint16_t> (nss));
NS_ASSERT_MSG (IsAllowed (channelWidth, nss), "VHT MCS " << +item->mcsValue << " forbidden at " << +channelWidth << " MHz when NSS is " << +nss);
}
NS_ASSERT (guardInterval == 800 || guardInterval == 400);
@@ -255,7 +255,7 @@ WifiMode::GetDataRate (uint8_t channelWidth, uint16_t guardInterval, uint8_t nss
break;
case WIFI_CODE_RATE_UNDEFINED:
default:
NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined with nss: " << static_cast<uint16_t> (nss));
NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined with nss: " << +nss);
break;
}
@@ -299,7 +299,7 @@ WifiMode::GetDataRate (uint8_t channelWidth, uint16_t guardInterval, uint8_t nss
break;
case WIFI_CODE_RATE_UNDEFINED:
default:
NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined with nss: " << static_cast<uint16_t> (nss));
NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined with nss: " << +nss);
break;
}

View File

@@ -463,7 +463,7 @@ WifiPhy::InitializeFrequencyChannelNumber (void)
}
else if (m_initialChannelNumber != 0 && GetStandard () == WIFI_PHY_STANDARD_UNSPECIFIED)
{
NS_FATAL_ERROR ("Error, ChannelNumber " << static_cast<uint16_t> (GetChannelNumber ()) << " was set by user, but neither a standard nor a frequency");
NS_FATAL_ERROR ("Error, ChannelNumber " << +GetChannelNumber () << " was set by user, but neither a standard nor a frequency");
}
m_frequencyChannelNumberInitialized = true;
}
@@ -543,7 +543,7 @@ WifiPhy::GetTxPowerEnd (void) const
void
WifiPhy::SetNTxPower (uint8_t n)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (n));
NS_LOG_FUNCTION (this << +n);
m_nTxPower = n;
}
@@ -1049,7 +1049,7 @@ WifiPhy::Configure80211ax (void)
bool
WifiPhy::DefineChannelNumber (uint8_t channelNumber, WifiPhyStandard standard, uint16_t frequency, uint8_t channelWidth)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (channelNumber) << standard << frequency << static_cast<uint16_t> (channelWidth));
NS_LOG_FUNCTION (this << +channelNumber << standard << frequency << +channelWidth);
ChannelNumberStandardPair p = std::make_pair (channelNumber, standard);
ChannelToFrequencyWidthMap::const_iterator it;
it = m_channelToFrequencyWidth.find (p);
@@ -1066,7 +1066,7 @@ WifiPhy::DefineChannelNumber (uint8_t channelNumber, WifiPhyStandard standard, u
uint8_t
WifiPhy::FindChannelNumberForFrequencyWidth (uint16_t frequency, uint8_t width) const
{
NS_LOG_FUNCTION (this << frequency << static_cast<uint16_t> (width));
NS_LOG_FUNCTION (this << frequency << +width);
bool found = false;
FrequencyWidthPair f = std::make_pair (frequency, width);
ChannelToFrequencyWidthMap::const_iterator it = m_channelToFrequencyWidth.begin ();
@@ -1081,7 +1081,7 @@ WifiPhy::FindChannelNumberForFrequencyWidth (uint16_t frequency, uint8_t width)
}
if (found)
{
NS_LOG_DEBUG ("Found, returning " << static_cast<uint16_t> (it->first.first));
NS_LOG_DEBUG ("Found, returning " << +it->first.first);
return (it->first.first);
}
else
@@ -1106,7 +1106,7 @@ WifiPhy::ConfigureChannelForStandard (WifiPhyStandard standard)
uint8_t channelNumberSearched = FindChannelNumberForFrequencyWidth (GetFrequency (), GetChannelWidth ());
if (channelNumberSearched)
{
NS_LOG_DEBUG ("Channel number found; setting to " << static_cast<uint16_t> (channelNumberSearched));
NS_LOG_DEBUG ("Channel number found; setting to " << +channelNumberSearched);
SetChannelNumber (channelNumberSearched);
}
else
@@ -1120,7 +1120,7 @@ WifiPhy::ConfigureChannelForStandard (WifiPhyStandard standard)
// If the channel number is known for this particular standard or for
// the unspecified standard, configure using the known values;
// otherwise, this is a configuration error
NS_LOG_DEBUG ("Configuring for channel number " << static_cast<uint16_t> (GetChannelNumber ()));
NS_LOG_DEBUG ("Configuring for channel number " << +GetChannelNumber ());
FrequencyWidthPair f = GetFrequencyWidthForChannelNumberStandard (GetChannelNumber (), standard);
if (f.first == 0)
{
@@ -1130,11 +1130,11 @@ WifiPhy::ConfigureChannelForStandard (WifiPhyStandard standard)
}
if (f.first == 0)
{
NS_FATAL_ERROR ("Error, ChannelNumber " << static_cast<uint16_t> (GetChannelNumber ()) << " is unknown for this standard");
NS_FATAL_ERROR ("Error, ChannelNumber " << +GetChannelNumber () << " is unknown for this standard");
}
else
{
NS_LOG_DEBUG ("Setting frequency to " << f.first << "; width to " << static_cast<uint16_t> (f.second));
NS_LOG_DEBUG ("Setting frequency to " << f.first << "; width to " << +f.second);
SetFrequency (f.first);
SetChannelWidth (f.second);
}
@@ -1236,10 +1236,10 @@ WifiPhy::SetFrequency (uint16_t frequency)
uint8_t nch = FindChannelNumberForFrequencyWidth (frequency, GetChannelWidth ());
if (nch != 0)
{
NS_LOG_DEBUG ("Setting frequency " << frequency << " corresponds to channel " << static_cast<uint16_t> (nch));
NS_LOG_DEBUG ("Setting frequency " << frequency << " corresponds to channel " << +nch);
if (DoFrequencySwitch (frequency))
{
NS_LOG_DEBUG ("Channel frequency switched to " << frequency << "; channel number to " << static_cast<uint16_t> (nch));
NS_LOG_DEBUG ("Channel frequency switched to " << frequency << "; channel number to " << +nch);
m_channelCenterFrequency = frequency;
m_channelNumber = nch;
}
@@ -1273,7 +1273,7 @@ WifiPhy::GetFrequency (void) const
void
WifiPhy::SetChannelWidth (uint8_t channelwidth)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (channelwidth));
NS_LOG_FUNCTION (this << +channelwidth);
NS_ASSERT_MSG (channelwidth == 5 || channelwidth == 10 || channelwidth == 20 || channelwidth == 22 || channelwidth == 40 || channelwidth == 80 || channelwidth == 160, "wrong channel width value");
bool changed = (m_channelWidth == channelwidth);
m_channelWidth = channelwidth;
@@ -1406,7 +1406,7 @@ WifiPhy::GetMembershipSelectorModes (uint32_t selector)
void
WifiPhy::AddSupportedChannelWidth (uint8_t width)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (width));
NS_LOG_FUNCTION (this << +width);
for (std::vector<uint32_t>::size_type i = 0; i != m_supportedChannelWidthSet.size (); i++)
{
if (m_supportedChannelWidthSet[i] == width)
@@ -1414,7 +1414,7 @@ WifiPhy::AddSupportedChannelWidth (uint8_t width)
return;
}
}
NS_LOG_FUNCTION ("Adding " << static_cast<uint16_t> (width) << " to supported channel width set");
NS_LOG_FUNCTION ("Adding " << +width << " to supported channel width set");
m_supportedChannelWidthSet.push_back (width);
}
@@ -1435,7 +1435,7 @@ WifiPhy::GetFrequencyWidthForChannelNumberStandard (uint8_t channelNumber, WifiP
void
WifiPhy::SetChannelNumber (uint8_t nch)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (nch));
NS_LOG_FUNCTION (this << +nch);
if (m_isConstructed == false)
{
NS_LOG_DEBUG ("Saving channel number configuration for initialization");
@@ -1469,7 +1469,7 @@ WifiPhy::SetChannelNumber (uint8_t nch)
{
if (DoChannelSwitch (nch))
{
NS_LOG_DEBUG ("Setting frequency to " << f.first << "; width to " << static_cast<uint16_t> (f.second));
NS_LOG_DEBUG ("Setting frequency to " << f.first << "; width to " << +f.second);
m_channelCenterFrequency = f.first;
SetChannelWidth (f.second);
m_channelNumber = nch;
@@ -1498,7 +1498,7 @@ WifiPhy::DoChannelSwitch (uint8_t nch)
if (!IsInitialized ())
{
//this is not channel switch, this is initialization
NS_LOG_DEBUG ("initialize to channel " << static_cast<uint16_t> (nch));
NS_LOG_DEBUG ("initialize to channel " << +nch);
return true;
}
@@ -1531,7 +1531,7 @@ WifiPhy::DoChannelSwitch (uint8_t nch)
switchChannel:
NS_LOG_DEBUG ("switching channel " << static_cast<uint16_t> (GetChannelNumber ()) << " -> " << static_cast<uint16_t> (nch));
NS_LOG_DEBUG ("switching channel " << +GetChannelNumber () << " -> " << +nch);
m_state->SwitchToChannelSwitching (GetChannelSwitchDelay ());
m_interference.EraseEvents ();
/*
@@ -2365,8 +2365,8 @@ WifiPhy::SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, MpduType m
NS_LOG_FUNCTION (this << packet << txVector.GetMode ()
<< txVector.GetMode ().GetDataRate (txVector)
<< txVector.GetPreambleType ()
<< static_cast<uint16_t> (txVector.GetTxPowerLevel ())
<< static_cast<uint16_t> (mpdutype));
<< +txVector.GetTxPowerLevel ()
<< +mpdutype);
/* Transmission can happen if:
* - we are syncing on a packet. It is the responsability of the
* MAC layer to avoid doing this but the PHY does nothing to
@@ -2466,7 +2466,7 @@ WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim
if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT
&& (txVector.GetNss () != (1 + (txVector.GetMode ().GetMcsValue () / 8))))
{
NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << static_cast<uint16_t> (txVector.GetMode ().GetMcsValue ()) << ", NSS = " << static_cast<uint16_t> (txVector.GetNss ()));
NS_FATAL_ERROR ("MCS value does not match NSS value: MCS = " << +txVector.GetMode ().GetMcsValue () << ", NSS = " << +txVector.GetNss ());
}
Time endRx = Simulator::Now () + rxDuration;
@@ -2578,7 +2578,7 @@ WifiPhy::StartReceivePacket (Ptr<Packet> packet,
MpduType mpdutype,
Ptr<InterferenceHelper::Event> event)
{
NS_LOG_FUNCTION (this << packet << txVector.GetMode () << txVector.GetPreambleType () << static_cast<uint16_t> (mpdutype));
NS_LOG_FUNCTION (this << packet << txVector.GetMode () << txVector.GetPreambleType () << +mpdutype);
NS_ASSERT (IsStateRx ());
NS_ASSERT (m_endPlcpRxEvent.IsExpired ());
WifiMode txMode = txVector.GetMode ();
@@ -3702,7 +3702,7 @@ WifiPhy::AbortCurrentReception ()
void
WifiPhy::StartRx (Ptr<Packet> packet, WifiTxVector txVector, MpduType mpdutype, double rxPowerW, Time rxDuration, Ptr<InterferenceHelper::Event> event)
{
NS_LOG_FUNCTION (this << packet << txVector << static_cast<uint16_t> (mpdutype) << rxPowerW << rxDuration);
NS_LOG_FUNCTION (this << packet << txVector << +mpdutype << rxPowerW << rxDuration);
if (rxPowerW > GetEdThresholdW ()) //checked here, no need to check in the payload reception (current implementation assumes constant rx power over the packet duration)
{
AmpduTag ampduTag;

View File

@@ -818,7 +818,7 @@ WifiRemoteStationManager::PrepareForQueue (Mac48Address address, const WifiMacHe
uint8_t
WifiRemoteStationManager::GetChannelWidthForTransmission (WifiMode mode, uint8_t maxSupportedChannelWidth)
{
NS_LOG_FUNCTION (mode << static_cast<uint16_t> (maxSupportedChannelWidth));
NS_LOG_FUNCTION (mode << +maxSupportedChannelWidth);
WifiModulationClass modulationClass = mode.GetModulationClass ();
if (maxSupportedChannelWidth > 20
&& (modulationClass == WifiModulationClass::WIFI_MOD_CLASS_OFDM // all non-HT OFDM control and management frames
@@ -1024,7 +1024,7 @@ WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address, uint8_t tid
uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
double rxSnr, double dataSnr)
{
NS_LOG_FUNCTION (this << address << static_cast<uint16_t> (tid) << static_cast<uint16_t> (nSuccessfulMpdus) << static_cast<uint16_t> (nFailedMpdus) << rxSnr << dataSnr);
NS_LOG_FUNCTION (this << address << +tid << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
NS_ASSERT (!address.IsGroup ());
WifiRemoteStation *station = Lookup (address, tid);
for (uint8_t i = 0; i < nFailedMpdus; i++)
@@ -1678,7 +1678,7 @@ WifiRemoteStationManager::Lookup (Mac48Address address, const WifiMacHeader *hea
WifiRemoteStation *
WifiRemoteStationManager::Lookup (Mac48Address address, uint8_t tid) const
{
NS_LOG_FUNCTION (this << address << static_cast<uint16_t> (tid));
NS_LOG_FUNCTION (this << address << +tid);
for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end (); i++)
{
if ((*i)->m_tid == tid
@@ -1930,7 +1930,7 @@ WifiRemoteStationManager::GetNonErpBasicMode (uint8_t i) const
void
WifiRemoteStationManager::AddBasicMcs (WifiMode mcs)
{
NS_LOG_FUNCTION (this << static_cast<uint16_t> (mcs.GetMcsValue ()));
NS_LOG_FUNCTION (this << +mcs.GetMcsValue ());
for (uint8_t i = 0; i < GetNBasicMcs (); i++)
{
if (GetBasicMcs (i) == mcs)

View File

@@ -242,14 +242,14 @@ WifiTxVector::IsValid (void) const
std::ostream & operator << ( std::ostream &os, const WifiTxVector &v)
{
os << "mode: " << v.GetMode () <<
" txpwrlvl: " << static_cast<uint16_t> (v.GetTxPowerLevel ()) <<
" retries: " << static_cast<uint16_t> (v.GetRetries ()) <<
" txpwrlvl: " << +v.GetTxPowerLevel () <<
" retries: " << +v.GetRetries () <<
" preamble: " << v.GetPreambleType () <<
" channel width: " << static_cast<uint16_t> (v.GetChannelWidth ()) <<
" channel width: " << +v.GetChannelWidth () <<
" GI: " << v.GetGuardInterval () <<
" NTx: " << static_cast<uint16_t> (v.GetNTx ()) <<
" Nss: " << static_cast<uint16_t> (v.GetNss ()) <<
" Ness: " << static_cast<uint16_t> (v.GetNess ()) <<
" NTx: " << +v.GetNTx () <<
" Nss: " << +v.GetNss () <<
" Ness: " << +v.GetNess () <<
" MPDU aggregation: " << v.IsAggregation () <<
" STBC: " << v.IsStbc ();
return os;

View File

@@ -129,7 +129,7 @@ TxDurationTest::CheckPayloadDuration (uint32_t size, WifiMode payloadMode, uint8
{
std::cerr << "size=" << size
<< " mode=" << payloadMode
<< " channelWidth=" << static_cast<uint16_t> (channelWidth)
<< " channelWidth=" << +channelWidth
<< " guardInterval=" << guardInterval
<< " datarate=" << payloadMode.GetDataRate (channelWidth, guardInterval, 1)
<< " known=" << knownDuration
@@ -166,7 +166,7 @@ TxDurationTest::CheckTxDuration (uint32_t size, WifiMode payloadMode, uint8_t ch
{
std::cerr << "size=" << size
<< " mode=" << payloadMode
<< " channelWidth=" << static_cast<uint16_t> (channelWidth)
<< " channelWidth=" << +channelWidth
<< " guardInterval=" << guardInterval
<< " datarate=" << payloadMode.GetDataRate (channelWidth, guardInterval, 1)
<< " preamble=" << preamble