wifi: Duplicate getValidChannelsForBand in AP iface
This functionality is needed even for AP iface. So, duplicate this
method.
Changes in the CL:
1. Add getValidChannelsForBand() in IWifiApIface.
2. Rename StaBackgroundScanBan to WifiBand to make it a more generic
name.
3. Change the existing method name in IWifiStaIface to match with the
one in IWifiApIface.
While there,
Fix indentation in hidl_callback_util.h
Bug: 35663149
Test: Compiles
Change-Id: Iaeb6c323e13eedf2f98de92fea77e327c76ffa5b
diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp
index 55c9cf7..0c84102 100644
--- a/wifi/1.0/default/wifi_sta_iface.cpp
+++ b/wifi/1.0/default/wifi_sta_iface.cpp
@@ -106,15 +106,13 @@
hidl_status_cb);
}
-Return<void> WifiStaIface::getValidFrequenciesForBackgroundScan(
- StaBackgroundScanBand band,
- getValidFrequenciesForBackgroundScan_cb hidl_status_cb) {
- return validateAndCall(
- this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiStaIface::getValidFrequenciesForBackgroundScanInternal,
- hidl_status_cb,
- band);
+Return<void> WifiStaIface::getValidFrequenciesForBand(
+ WifiBand band, getValidFrequenciesForBand_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::getValidFrequenciesForBandInternal,
+ hidl_status_cb,
+ band);
}
Return<void> WifiStaIface::startBackgroundScan(
@@ -363,14 +361,13 @@
}
std::pair<WifiStatus, std::vector<WifiChannelInMhz>>
-WifiStaIface::getValidFrequenciesForBackgroundScanInternal(
- StaBackgroundScanBand band) {
+WifiStaIface::getValidFrequenciesForBandInternal(WifiBand band) {
static_assert(sizeof(WifiChannelInMhz) == sizeof(uint32_t), "Size mismatch");
legacy_hal::wifi_error legacy_status;
std::vector<uint32_t> valid_frequencies;
std::tie(legacy_status, valid_frequencies) =
- legacy_hal_.lock()->getValidFrequenciesForGscan(
- hidl_struct_util::convertHidlGscanBandToLegacy(band));
+ legacy_hal_.lock()->getValidFrequenciesForBand(
+ hidl_struct_util::convertHidlWifiBandToLegacy(band));
return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies};
}