Add the HAL support for getCachedScanResult.
Bug: 269485350
Test: adb shell cmd wifi get-cached-scan-data
Test: adb shell halutil -get_cached_scan_results
Test: hardware/interfaces/wifi/aidl/default/tests/runtests.sh
Change-Id: Ie94fbdd51a21c25c6aefa4afbd40cfcaabbe0f8c
diff --git a/wifi/aidl/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h
index 5168a8b..8e7c1b8 100644
--- a/wifi/aidl/default/wifi_legacy_hal.h
+++ b/wifi/aidl/default/wifi_legacy_hal.h
@@ -256,6 +256,7 @@
using ::WIFI_BAND_BG;
using ::WIFI_BAND_UNSPECIFIED;
using ::wifi_cached_scan_report;
+using ::wifi_cached_scan_result;
using ::wifi_cached_scan_results;
using ::WIFI_CHAN_WIDTH_10;
using ::WIFI_CHAN_WIDTH_160;
@@ -422,6 +423,12 @@
bool valid;
};
+struct WifiCachedScanReport {
+ uint64_t ts;
+ std::vector<int> scanned_freqs;
+ std::vector<wifi_cached_scan_result> results;
+};
+
#pragma GCC diagnostic pop
// The |WLAN_DRIVER_WAKE_REASON_CNT.cmd_event_wake_cnt| and
@@ -532,8 +539,9 @@
std::function<void(chre_nan_rtt_state)> on_wifi_chre_nan_rtt_state;
};
-// Cached Scan Results response and event callbacks struct.
-struct CachedScanResultsCallbackHandlers {
+using on_cached_scan_results_callback = std::function<void(wifi_cached_scan_report*)>;
+
+struct CachedScanResultsCallbfackHandlers {
// Callback for Cached Scan Results
std::function<void(wifi_cached_scan_report*)> on_cached_scan_results;
};
@@ -776,7 +784,7 @@
wifi_error enableWifiTxPowerLimits(const std::string& iface_name, bool enable);
wifi_error getWifiCachedScanResults(const std::string& iface_name,
- const CachedScanResultsCallbackHandlers& handler);
+ WifiCachedScanReport& report);
std::pair<wifi_error, wifi_chip_capabilities> getWifiChipCapabilities();
wifi_error enableStaChannelForPeerNetwork(uint32_t channelCategoryEnableFlag);
wifi_error setMloMode(wifi_mlo_mode mode);