Merge pull request #72 from Telecominfraproject/WIFI-3589

[Wifi 3589] Support channel bandwidth in AP status API
This commit is contained in:
Thomas-Leung2021
2021-11-15 13:52:20 -05:00
committed by GitHub
2 changed files with 26 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ import com.telecominfraproject.wlan.client.session.models.ClientDhcpDetails;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.client.session.models.ClientSessionDetails;
import com.telecominfraproject.wlan.core.model.entity.CountryCode;
import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth;
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
import com.telecominfraproject.wlan.core.model.equipment.LedStatus;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
@@ -1352,10 +1353,33 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
channelStatus.setDetails(channelStatusData);
}
((EquipmentChannelStatusData) channelStatus.getDetails()).getChannelNumberStatusDataMap().put(radioState.getFreqBand(), radioState.getChannel());
ChannelBandwidth channelBandwidth = convertHtModeToChannelBandwidth(radioState.getHtMode());
((EquipmentChannelStatusData) channelStatus.getDetails()).getChannelBandwidthStatusDataMap().put(radioState.getFreqBand(), channelBandwidth);
((EquipmentChannelStatusData) channelStatus.getDetails()).getTxPowerDataMap().put(radioState.getFreqBand(), radioState.getTxPower());
return channelStatus;
}
private ChannelBandwidth convertHtModeToChannelBandwidth(String htMode) {
if (htMode == null) {
return null;
}
switch (htMode) {
case "HT20":
return ChannelBandwidth.is20MHz;
case "HT40":
case "HT40-":
case "HT40+":
return ChannelBandwidth.is40MHz;
case "HT80":
return ChannelBandwidth.is80MHz;
case "HT160":
return ChannelBandwidth.is160MHz;
default:
LOG.warn("Unrecognized channel HtMode {}", htMode);
return ChannelBandwidth.UNSUPPORTED;
}
}
private boolean updateChannelPowerLevels(String apId, ApElementConfiguration apElementConfiguration, OpensyncAPRadioState radioState) {
boolean configStateMismatch = false;

View File

@@ -42,7 +42,7 @@ public class OpensyncAPRadioState extends OpensyncAPBase {
public Map<String, String> hwConfig;
public int channel;
public int txPower;
public String htMode;
public String htMode; // used in channel bandwidth
public int thermalDowngradeTemp;
public String hwMode;
public boolean enabled;