diff --git a/agent/src/beerocks/slave/ap_manager_thread.cpp b/agent/src/beerocks/slave/ap_manager_thread.cpp index 57fb2ff03e..a8073469f3 100644 --- a/agent/src/beerocks/slave/ap_manager_thread.cpp +++ b/agent/src/beerocks/slave/ap_manager_thread.cpp @@ -67,6 +67,27 @@ get_radio_supported_channels_string(std::shared_ptr &ap_wlan_h return os.str(); } +static std::string +get_radio_supported_channels_string(beerocks::message::sWifiChannel supported_channels[]) +{ + std::ostringstream os; + for (uint i = 0; + i < beerocks::message::SUPPORTED_CHANNELS_LENGTH && supported_channels[i].channel != 0; + i++) { + auto val = supported_channels[i]; + if (val.channel > 0) { + os << " ch = " << int(val.channel) << " |" + << " tx_pow = " << int(val.tx_pow) << " |" + << " bandwidth = " << int(val.channel_bandwidth) << " |" + << " dfs = " << int(val.is_dfs_channel) << " |" + << " noise = " << int(val.noise) << " [dbm] |" + << " bss_overlap = " << int(val.bss_overlap) << std::endl; + } + } + + return os.str(); +} + static void copy_vaps_info(std::shared_ptr &ap_wlan_hal, std::list &backhaul_vaps_list, @@ -1450,6 +1471,11 @@ void ap_manager_thread::handle_hostapd_attached() { LOG(DEBUG) << "handling enabled hostapd"; + ap_wlan_hal->read_supported_channels(); + beerocks::message::sWifiChannel + hw_supported_channels[beerocks::message::SUPPORTED_CHANNELS_LENGTH]; + copy_radio_supported_channels(ap_wlan_hal, hw_supported_channels); + if (acs_enabled) { LOG(DEBUG) << "retrieving ACS report"; int read_acs_attempt = 0; @@ -1498,6 +1524,15 @@ void ap_manager_thread::handle_hostapd_attached() // Copy the channels supported by the AP copy_radio_supported_channels(ap_wlan_hal, notification->params().supported_channels); + auto supported_channels_list = &std::get<1>(notification->supported_channels_list(0)); + for (uint i = 0; + i < beerocks::message::SUPPORTED_CHANNELS_LENGTH && hw_supported_channels[i].channel != 0; + i++) { + if (hw_supported_channels[i].channel == 0) + continue; + supported_channels_list[i] = hw_supported_channels[i]; + } + LOG(INFO) << "send ACTION_APMANAGER_JOINED_NOTIFICATION"; LOG(INFO) << " mac = " << ap_wlan_hal->get_radio_mac(); LOG(INFO) << " ant_num = " << ap_wlan_hal->get_radio_info().ant_num; @@ -1507,7 +1542,9 @@ void ap_manager_thread::handle_hostapd_attached() LOG(INFO) << " current bw = " << ap_wlan_hal->get_radio_info().bandwidth; LOG(INFO) << " supported_channels = " << std::endl << get_radio_supported_channels_string(ap_wlan_hal); - + LOG(INFO) << " hw_supported_channels = " << std::endl + << get_radio_supported_channels_string( + &std::get<1>(notification->supported_channels_list(0))); // Send CMDU message_com::send_cmdu(slave_socket, cmdu_tx); }