summaryrefslogtreecommitdiff
path: root/wifi/1.0/default/hidl_struct_util.cpp
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2016-12-05 16:18:43 -0800
committerRoshan Pius <rpius@google.com>2016-12-08 17:58:50 -0800
commite3f72ff3440684f6f03157bed67bd39dd829fb2c (patch)
treea691f6e1677e98a9132376c54a0bce844e28c43d /wifi/1.0/default/hidl_struct_util.cpp
parent970f031170f26f81a879764d369b76185b1e5cb8 (diff)
wifi: Add method implementations in IWifiRttController
Hookup the legacy HAL functions to the corresponding HIDL methods in WifiRttController and perform the necessary struct conversions. Bug: 31991232 Test: Compiles Change-Id: I7bd8bd7e7af2230699c079f1ad8e0a8b1e496026
Diffstat (limited to 'wifi/1.0/default/hidl_struct_util.cpp')
-rw-r--r--wifi/1.0/default/hidl_struct_util.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index b940200987..e3e41c3d79 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -1431,6 +1431,23 @@ bool convertHidlRttConfigToLegacy(const RttConfig& hidl_config,
return true;
}
+bool convertHidlVectorOfRttConfigToLegacy(
+ const std::vector<RttConfig>& hidl_configs,
+ std::vector<legacy_hal::wifi_rtt_config>* legacy_configs) {
+ if (!legacy_configs) {
+ return false;
+ }
+ legacy_configs->clear();
+ for (const auto& hidl_config : hidl_configs) {
+ legacy_hal::wifi_rtt_config legacy_config;
+ if (!convertHidlRttConfigToLegacy(hidl_config, &legacy_config)) {
+ return false;
+ }
+ legacy_configs->push_back(legacy_config);
+ }
+ return true;
+}
+
bool convertHidlRttLciInformationToLegacy(
const RttLciInformation& hidl_info,
legacy_hal::wifi_lci_information* legacy_info) {
@@ -1596,6 +1613,23 @@ bool convertLegacyRttResultToHidl(
}
return true;
}
+
+bool convertLegacyVectorOfRttResultToHidl(
+ const std::vector<const legacy_hal::wifi_rtt_result*>& legacy_results,
+ std::vector<RttResult>* hidl_results) {
+ if (!hidl_results) {
+ return false;
+ }
+ hidl_results->clear();
+ for (const auto legacy_result : legacy_results) {
+ RttResult hidl_result;
+ if (!convertLegacyRttResultToHidl(*legacy_result, &hidl_result)) {
+ return false;
+ }
+ hidl_results->push_back(hidl_result);
+ }
+ return true;
+}
} // namespace hidl_struct_util
} // namespace implementation
} // namespace V1_0