mirror of
https://github.com/Telecominfraproject/wlan-cloud-analytics.git
synced 2026-01-27 10:22:33 +00:00
Adding channel for SSID.
This commit is contained in:
@@ -84,15 +84,16 @@ namespace OpenWifi {
|
||||
|
||||
DTP.timestamp = DI_.lastState;
|
||||
|
||||
std::map<uint, uint> radio_band;
|
||||
std::map<uint, std::pair<uint,uint> > radio_map;
|
||||
if(State->contains("radios") && (*State)["radios"].is_array()) {
|
||||
auto radios = (*State)["radios"];
|
||||
uint radio_index = 0;
|
||||
for (const auto &radio: radios) {
|
||||
if (radio.contains("channel")) {
|
||||
AnalyticsObjects::RadioTimePoint RTP;
|
||||
RTP.channel = radio["channel"];
|
||||
RTP.band = radio["channel"] <= 16 ? 2 : 5;
|
||||
radio_band[radio_index++] = RTP.band;
|
||||
radio_map[radio_index++] = std::make_pair(RTP.band, RTP.channel);
|
||||
GetJSON("busy_ms", radio, RTP.busy_ms, (uint64_t) 0);
|
||||
GetJSON("receive_ms", radio, RTP.receive_ms, (uint64_t) 0);
|
||||
GetJSON("transmit_ms", radio, RTP.transmit_ms, (uint64_t) 0);
|
||||
@@ -142,8 +143,9 @@ namespace OpenWifi {
|
||||
auto radio_parts = Poco::StringTokenizer(ref, "/");
|
||||
if(radio_parts.count()==3) {
|
||||
radio_location = std::strtol(radio_parts[2].c_str(), nullptr, 10);
|
||||
if(radio_band.find(radio_location)!=radio_band.end()) {
|
||||
SSIDTP.band = radio_band[radio_location];
|
||||
if(radio_map.find(radio_location)!=radio_map.end()) {
|
||||
SSIDTP.band = radio_map[radio_location].first;
|
||||
SSIDTP.channel = radio_map[radio_location].second;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,9 +155,9 @@ namespace OpenWifi {
|
||||
GetJSON("ssid",ssid,SSIDTP.ssid, std::string{""} );
|
||||
if (ssid.contains("associations") && ssid["associations"].is_array()) {
|
||||
auto associations = ssid["associations"];
|
||||
auto it = radio_band.find(radio_location);
|
||||
if(it!=radio_band.end()) {
|
||||
auto the_radio = it->second;
|
||||
auto it = radio_map.find(radio_location);
|
||||
if(it!=radio_map.end()) {
|
||||
auto the_radio = it->second.first;
|
||||
if (the_radio == 2)
|
||||
DI_.associations_2g += associations.size();
|
||||
else if (the_radio == 5)
|
||||
|
||||
@@ -340,6 +340,7 @@ namespace OpenWifi::AnalyticsObjects {
|
||||
field_to_json(Obj,"mode",mode);
|
||||
field_to_json(Obj,"ssid",ssid);
|
||||
field_to_json(Obj,"band",band);
|
||||
field_to_json(Obj,"channel",channel);
|
||||
field_to_json(Obj,"associations",associations);
|
||||
field_to_json(Obj,"tx_bytes_bw",tx_bytes_bw);
|
||||
field_to_json(Obj,"rx_bytes_bw",rx_bytes_bw);
|
||||
@@ -356,6 +357,7 @@ namespace OpenWifi::AnalyticsObjects {
|
||||
field_from_json(Obj,"mode",mode);
|
||||
field_from_json(Obj,"ssid",ssid);
|
||||
field_from_json(Obj,"band",band);
|
||||
field_from_json(Obj,"channel",channel);
|
||||
field_from_json(Obj,"associations",associations);
|
||||
field_from_json(Obj,"tx_bytes_bw",tx_bytes_bw);
|
||||
field_from_json(Obj,"rx_bytes_bw",rx_bytes_bw);
|
||||
|
||||
@@ -138,7 +138,6 @@ namespace OpenWifi {
|
||||
tx_retries_pct = 0.0 ,
|
||||
tx_duration_pct = 0.0;
|
||||
|
||||
|
||||
UE_rate tx_rate,
|
||||
rx_rate;
|
||||
std::vector<TIDstat_entry> tidstats;
|
||||
@@ -177,7 +176,8 @@ namespace OpenWifi {
|
||||
std::string bssid,
|
||||
mode,
|
||||
ssid;
|
||||
uint64_t band=0;
|
||||
uint64_t band=0,
|
||||
channel=0;
|
||||
std::vector<UETimePoint> associations;
|
||||
AveragePoint tx_bytes_bw,
|
||||
rx_bytes_bw,
|
||||
|
||||
Reference in New Issue
Block a user