From 2f12768168f091ef7a3098754239a59e3a8f62a5 Mon Sep 17 00:00:00 2001 From: Lynn Shi Date: Sun, 31 Jan 2021 20:49:17 -0500 Subject: [PATCH 1/2] WIFI-1397 Cloud SDK: inconsistent treatment of active/manual/auto/backup channels --- .../utils/RealtimeEventPublisher.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/RealtimeEventPublisher.java b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/RealtimeEventPublisher.java index 2b8eacf..2e7e921 100644 --- a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/RealtimeEventPublisher.java +++ b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/RealtimeEventPublisher.java @@ -24,6 +24,10 @@ import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface; import com.telecominfraproject.wlan.equipment.models.ApElementConfiguration; import com.telecominfraproject.wlan.equipment.models.Equipment; import com.telecominfraproject.wlan.opensync.util.OvsdbToWlanCloudTypeMappingUtility; +import com.telecominfraproject.wlan.profile.ProfileServiceInterface; +import com.telecominfraproject.wlan.profile.models.ProfileContainer; +import com.telecominfraproject.wlan.profile.models.ProfileType; +import com.telecominfraproject.wlan.profile.rf.models.RfConfiguration; import com.telecominfraproject.wlan.systemevent.equipment.BaseDhcpEvent; import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeChannelHopEvent; import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeEventType; @@ -80,6 +84,9 @@ public class RealtimeEventPublisher { @Autowired private EquipmentServiceInterface equipmentServiceInterface; + + @Autowired + private ProfileServiceInterface profileServiceInterface; private static final Logger LOG = LoggerFactory.getLogger(RealtimeEventPublisher.class); @@ -94,6 +101,16 @@ public class RealtimeEventPublisher { if (equipment == null) { return; } + ProfileContainer profileContainer = new ProfileContainer( + profileServiceInterface.getProfileWithChildren(equipment.getProfileId())); + RfConfiguration rfConfig = null; + if (profileContainer != null) { + rfConfig = (RfConfiguration) profileContainer.getChildOfTypeOrNull(equipment.getProfileId(), ProfileType.rf).getDetails(); + } + if (profileContainer == null || rfConfig == null) { + LOG.warn("publishChannelHopEvents:profileContainer {} or RfConfiguration {} is null for customerId {} equipmentId {}", + profileContainer, rfConfig, customerId, equipmentId); + } for (sts.OpensyncStats.EventReport.ChannelSwitchEvent channelSwitchEvent : e.getChannelSwitchList()) { @@ -141,10 +158,14 @@ public class RealtimeEventPublisher { channelSwitchEvent); continue; } + boolean autoChannelSelection = false; + if (rfConfig != null && rfConfig.getRfConfigMap() != null && rfConfig.getRfConfigMap().get(radioType) != null) { + autoChannelSelection = rfConfig.getRfConfigMap().get(radioType).getAutoChannelSelection(); + } RealTimeChannelHopEvent channelHopEvent = new RealTimeChannelHopEvent(RealTimeEventType.Channel_Hop, customerId, locationId, equipmentId, radioType, channel, - ((ApElementConfiguration) equipment.getDetails()).getRadioMap().get(radioType).getChannelNumber(), + ((ApElementConfiguration) equipment.getDetails()).getRadioMap().get(radioType).getActiveChannel(autoChannelSelection), reason, timestamp); events.add(channelHopEvent); From 6a8d5478a04d7f167b88bfee63acf8983641b12a Mon Sep 17 00:00:00 2001 From: Lynn Shi Date: Mon, 1 Feb 2021 09:36:43 -0500 Subject: [PATCH 2/2] WIFI-1397 Cloud SDK: inconsistent treatment of active/manual/auto/backup channels --- .../wlan/opensync/ovsdb/dao/OvsdbDao.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java index 0888646..4b67080 100644 --- a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java +++ b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java @@ -1871,7 +1871,10 @@ public class OvsdbDao { ElementRadioConfiguration elementRadioConfig = apElementConfiguration.getRadioMap().get(radioType); RfElementConfiguration rfElementConfig = rfConfig.getRfConfig(radioType); - int channel = elementRadioConfig.getChannelNumber(); + boolean autoChannelSelection = rfElementConfig.getAutoChannelSelection(); + int channel = elementRadioConfig.getActiveChannel(autoChannelSelection); + LOG.debug("configureWifiRadios autoChannelSelection {} activeChannel {} getChannelNumber {} ", + autoChannelSelection, channel, elementRadioConfig.getChannelNumber()); ChannelBandwidth bandwidth = rfElementConfig.getChannelBandwidth(); String ht_mode = null; switch (bandwidth) { @@ -1893,7 +1896,6 @@ public class OvsdbDao { default: ht_mode = null; } - rfElementConfig.getAutoChannelSelection(); RadioConfiguration radioConfig = apElementConfiguration.getAdvancedRadioMap().get(radioType); int beaconInterval = rfElementConfig.getBeaconInterval();