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.h b/wifi/1.0/default/wifi.h
index 989b630..c682116 100644
--- a/wifi/1.0/default/wifi.h
+++ b/wifi/1.0/default/wifi.h
@@ -39,9 +39,12 @@
  public:
   Wifi();
 
+  bool isValid();
+
   // HIDL methods exposed.
   Return<void> registerEventCallback(
-      const sp<IWifiEventCallback>& event_callback) override;
+      const sp<IWifiEventCallback>& event_callback,
+      registerEventCallback_cb hidl_status_cb) override;
   Return<bool> isStarted() override;
   Return<void> start(start_cb hidl_status_cb) override;
   Return<void> stop(stop_cb hidl_status_cb) override;
@@ -51,6 +54,14 @@
  private:
   enum class RunState { STOPPED, STARTED, STOPPING };
 
+  // Corresponding worker functions for the HIDL methods.
+  WifiStatus registerEventCallbackInternal(
+      const sp<IWifiEventCallback>& event_callback);
+  WifiStatus startInternal();
+  WifiStatus stopInternal();
+  std::pair<WifiStatus, std::vector<ChipId>> getChipIdsInternal();
+  std::pair<WifiStatus, sp<IWifiChip>> getChipInternal(ChipId chip_id);
+
   // Instance is created in this root level |IWifi| HIDL interface object
   // and shared with all the child HIDL interface objects.
   std::shared_ptr<WifiLegacyHal> legacy_hal_;