wifi: Helper functions for invoking hidl cont callbacks
The helper functions are used to invoke an internal method which
implements the functionality and then invoke the HIDL callback
with the return values.
HIDL's auto-generated code uses on-stack callbacks to return
non-primitive/multiple values from HIDL methods. This is unwieldy and
the implementation of the method's functionality gets mixed up with the
semantics of handling these callbacks. This tries to hide the semantics
of HIDL auto-generated code from the functionality.
Converted all IWifi methods to use these new helper functions.
Bug: 32337072
Test: Compiles
Change-Id: I57cbafcc2ecb52ec5055f4bd80bc064bd438b850
diff --git a/wifi/1.0/default/wifi_status_util.cpp b/wifi/1.0/default/wifi_status_util.cpp
index 21b4eeb..34a1c1d 100644
--- a/wifi/1.0/default/wifi_status_util.cpp
+++ b/wifi/1.0/default/wifi_status_util.cpp
@@ -50,10 +50,7 @@
WifiStatus createWifiStatus(WifiStatusCode code,
const std::string& description) {
- WifiStatus result;
- result.code = code;
- result.description = description.data();
- return result;
+ return {code, description};
}
WifiStatus createWifiStatus(WifiStatusCode code) {