wifi: Add method to get modulation class from preamble type (when possible)
This commit is contained in:
@@ -113,6 +113,30 @@ GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble
|
||||
}
|
||||
}
|
||||
|
||||
WifiModulationClass
|
||||
GetModulationClassForPreamble(WifiPreamble preamble)
|
||||
{
|
||||
switch (preamble)
|
||||
{
|
||||
case WIFI_PREAMBLE_HT_MF:
|
||||
return WIFI_MOD_CLASS_HT;
|
||||
case WIFI_PREAMBLE_VHT_SU:
|
||||
case WIFI_PREAMBLE_VHT_MU:
|
||||
return WIFI_MOD_CLASS_VHT;
|
||||
case WIFI_PREAMBLE_HE_SU:
|
||||
case WIFI_PREAMBLE_HE_ER_SU:
|
||||
case WIFI_PREAMBLE_HE_MU:
|
||||
case WIFI_PREAMBLE_HE_TB:
|
||||
return WIFI_MOD_CLASS_HE;
|
||||
case WIFI_PREAMBLE_EHT_MU:
|
||||
case WIFI_PREAMBLE_EHT_TB:
|
||||
return WIFI_MOD_CLASS_EHT;
|
||||
default:
|
||||
NS_ABORT_MSG("Unsupported preamble type: " << preamble);
|
||||
}
|
||||
return WIFI_MOD_CLASS_UNKNOWN;
|
||||
}
|
||||
|
||||
bool
|
||||
IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq,
|
||||
WifiModulationClass modClassAnswer)
|
||||
|
||||
@@ -475,6 +475,15 @@ uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode,
|
||||
*/
|
||||
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble);
|
||||
|
||||
/**
|
||||
* Return the modulation class corresponding to the given preamble type.
|
||||
* Only preamble types used by HT/VHT/HE/EHT can be passed to this function.
|
||||
*
|
||||
* \param preamble the given preamble type (must be one defined by HT standard or later)
|
||||
* \return the modulation class corresponding to the given preamble type
|
||||
*/
|
||||
WifiModulationClass GetModulationClassForPreamble(WifiPreamble preamble);
|
||||
|
||||
/**
|
||||
* Return whether the modulation class of the selected mode for the
|
||||
* control answer frame is allowed.
|
||||
|
||||
Reference in New Issue
Block a user