|
|
| 245 |
TimeValue (MicroSeconds (250)), |
245 |
TimeValue (MicroSeconds (250)), |
| 246 |
MakeTimeAccessor (&WifiPhy::m_channelSwitchDelay), |
246 |
MakeTimeAccessor (&WifiPhy::m_channelSwitchDelay), |
| 247 |
MakeTimeChecker ()) |
247 |
MakeTimeChecker ()) |
| 248 |
.AddAttribute ("TxAntennas", |
248 |
.AddAttribute ("Antennas", |
| 249 |
"The number of supported Tx antennas.", |
249 |
"The number of antennas on the device.", |
| 250 |
UintegerValue (1), |
250 |
UintegerValue (1), |
| 251 |
MakeUintegerAccessor (&WifiPhy::GetNumberOfTransmitAntennas, |
251 |
MakeUintegerAccessor (&WifiPhy::GetNumberOfAntennas, |
| 252 |
&WifiPhy::SetNumberOfTransmitAntennas), |
252 |
&WifiPhy::SetNumberOfAntennas), |
| 253 |
MakeUintegerChecker<uint32_t> ()) |
253 |
MakeUintegerChecker<uint32_t> ()) |
| 254 |
.AddAttribute ("RxAntennas", |
254 |
.AddAttribute ("MaxSupportedTxSpatialStreams", |
| 255 |
"The number of supported Rx antennas.", |
255 |
"The maximum number of supported TX spatial streams." |
|
|
256 |
"This parameter is only valuable for 802.11n/ac STAs and APs.", |
| 256 |
UintegerValue (1), |
257 |
UintegerValue (1), |
| 257 |
MakeUintegerAccessor (&WifiPhy::GetNumberOfReceiveAntennas, |
258 |
MakeUintegerAccessor (&WifiPhy::GetMaxSupportedTxSpatialStreams, |
| 258 |
&WifiPhy::SetNumberOfReceiveAntennas), |
259 |
&WifiPhy::SetMaxSupportedTxSpatialStreams), |
| 259 |
MakeUintegerChecker<uint32_t> ()) |
260 |
MakeUintegerChecker<uint8_t> ()) |
|
|
261 |
.AddAttribute ("MaxSupportedRxSpatialStreams", |
| 262 |
"The maximum number of supported RX spatial streams." |
| 263 |
"This parameter is only valuable for 802.11n/ac STAs and APs.", |
| 264 |
UintegerValue (1), |
| 265 |
MakeUintegerAccessor (&WifiPhy::GetMaxSupportedRxSpatialStreams, |
| 266 |
&WifiPhy::SetMaxSupportedRxSpatialStreams), |
| 267 |
MakeUintegerChecker<uint8_t> ()) |
| 260 |
.AddAttribute ("ShortGuardEnabled", |
268 |
.AddAttribute ("ShortGuardEnabled", |
| 261 |
"Whether or not short guard interval is enabled." |
269 |
"Whether or not short guard interval is enabled." |
| 262 |
"This parameter is only valuable for 802.11n/ac STAs and APs.", |
270 |
"This parameter is only valuable for 802.11n/ac STAs and APs.", |
|
|
| 456 |
{ |
464 |
{ |
| 457 |
NS_LOG_FUNCTION (this << noiseFigureDb); |
465 |
NS_LOG_FUNCTION (this << noiseFigureDb); |
| 458 |
m_interference.SetNoiseFigure (DbToRatio (noiseFigureDb)); |
466 |
m_interference.SetNoiseFigure (DbToRatio (noiseFigureDb)); |
|
|
467 |
m_interference.SetNumberOfReceiveAntennas (GetNumberOfAntennas ()); |
| 459 |
} |
468 |
} |
| 460 |
|
469 |
|
| 461 |
double |
470 |
double |
|
|
| 629 |
WifiPhy::SetErrorRateModel (Ptr<ErrorRateModel> rate) |
638 |
WifiPhy::SetErrorRateModel (Ptr<ErrorRateModel> rate) |
| 630 |
{ |
639 |
{ |
| 631 |
m_interference.SetErrorRateModel (rate); |
640 |
m_interference.SetErrorRateModel (rate); |
|
|
641 |
m_interference.SetNumberOfReceiveAntennas (GetNumberOfAntennas ()); |
| 632 |
} |
642 |
} |
| 633 |
|
643 |
|
| 634 |
Ptr<ErrorRateModel> |
644 |
Ptr<ErrorRateModel> |
|
|
| 853 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs5 ()); |
863 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs5 ()); |
| 854 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs6 ()); |
864 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs6 ()); |
| 855 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs7 ()); |
865 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs7 ()); |
| 856 |
if (GetSupportedTxSpatialStreams () > 1) |
866 |
if (GetMaxSupportedTxSpatialStreams () > 1) |
| 857 |
{ |
867 |
{ |
| 858 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs8 ()); |
868 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs8 ()); |
| 859 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs9 ()); |
869 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs9 ()); |
|
|
| 864 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs14 ()); |
874 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs14 ()); |
| 865 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs15 ()); |
875 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs15 ()); |
| 866 |
} |
876 |
} |
| 867 |
if (GetSupportedTxSpatialStreams () > 2) |
877 |
if (GetMaxSupportedTxSpatialStreams () > 2) |
| 868 |
{ |
878 |
{ |
| 869 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs16 ()); |
879 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs16 ()); |
| 870 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs17 ()); |
880 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs17 ()); |
|
|
| 875 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs22 ()); |
885 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs22 ()); |
| 876 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs23 ()); |
886 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs23 ()); |
| 877 |
} |
887 |
} |
| 878 |
if (GetSupportedTxSpatialStreams () > 3) |
888 |
if (GetMaxSupportedTxSpatialStreams () > 3) |
| 879 |
{ |
889 |
{ |
| 880 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs24 ()); |
890 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs24 ()); |
| 881 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs25 ()); |
891 |
m_deviceMcsSet.push_back (WifiPhy::GetHtMcs25 ()); |
|
|
| 1160 |
} |
1170 |
} |
| 1161 |
|
1171 |
|
| 1162 |
void |
1172 |
void |
| 1163 |
WifiPhy::SetNumberOfTransmitAntennas (uint32_t tx) |
1173 |
WifiPhy::SetNumberOfAntennas (uint8_t antennas) |
| 1164 |
{ |
1174 |
{ |
| 1165 |
m_numberOfTransmitters = tx; |
1175 |
NS_ASSERT_MSG (antennas > 0 && antennas <= 4, "unsupported number of antennas"); |
|
|
1176 |
m_numberOfAntennas = antennas; |
| 1177 |
m_interference.SetNumberOfReceiveAntennas (antennas); |
| 1178 |
} |
| 1179 |
|
| 1180 |
uint8_t |
| 1181 |
WifiPhy::GetNumberOfAntennas (void) const |
| 1182 |
{ |
| 1183 |
return m_numberOfAntennas; |
| 1184 |
} |
| 1185 |
|
| 1186 |
void |
| 1187 |
WifiPhy::SetMaxSupportedTxSpatialStreams (uint8_t streams) |
| 1188 |
{ |
| 1189 |
NS_ASSERT (streams <= GetNumberOfAntennas ()); |
| 1190 |
m_txSpatialStreams = streams; |
| 1166 |
ConfigureHtDeviceMcsSet (); |
1191 |
ConfigureHtDeviceMcsSet (); |
| 1167 |
} |
1192 |
} |
| 1168 |
|
1193 |
|
| 1169 |
void |
1194 |
uint8_t |
| 1170 |
WifiPhy::SetNumberOfReceiveAntennas (uint32_t rx) |
1195 |
WifiPhy::GetMaxSupportedTxSpatialStreams (void) const |
| 1171 |
{ |
1196 |
{ |
| 1172 |
m_numberOfReceivers = rx; |
1197 |
return m_txSpatialStreams; |
| 1173 |
} |
1198 |
} |
| 1174 |
|
1199 |
|
| 1175 |
uint32_t |
1200 |
void |
| 1176 |
WifiPhy::GetNumberOfTransmitAntennas (void) const |
1201 |
WifiPhy::SetMaxSupportedRxSpatialStreams (uint8_t streams) |
| 1177 |
{ |
1202 |
{ |
| 1178 |
return m_numberOfTransmitters; |
1203 |
NS_ASSERT (streams <= GetNumberOfAntennas ()); |
| 1179 |
} |
1204 |
m_rxSpatialStreams = streams; |
| 1180 |
|
|
|
| 1181 |
uint32_t |
| 1182 |
WifiPhy::GetNumberOfReceiveAntennas (void) const |
| 1183 |
{ |
| 1184 |
return m_numberOfReceivers; |
| 1185 |
} |
1205 |
} |
| 1186 |
|
1206 |
|
| 1187 |
uint8_t |
1207 |
uint8_t |
| 1188 |
WifiPhy::GetSupportedRxSpatialStreams (void) const |
1208 |
WifiPhy::GetMaxSupportedRxSpatialStreams (void) const |
| 1189 |
{ |
1209 |
{ |
| 1190 |
return (static_cast<uint8_t> (GetNumberOfReceiveAntennas ())); |
1210 |
return m_rxSpatialStreams; |
| 1191 |
} |
|
|
| 1192 |
|
| 1193 |
uint8_t |
| 1194 |
WifiPhy::GetSupportedTxSpatialStreams (void) const |
| 1195 |
{ |
| 1196 |
return (static_cast<uint8_t> (GetNumberOfTransmitAntennas ())); |
| 1197 |
} |
1211 |
} |
| 1198 |
|
1212 |
|
| 1199 |
uint32_t |
1213 |
uint32_t |