hostapd(hidl): Add HIDL interface skeletal code
Adding support for HIDL IPC in hostapd. This CL only adds the skeletal
framework for supporting HIDL interface implementation.
There is also a change in the hostapd.h to fix a C++ compilation error.
Bug: 36646171
Test: Compiles with CONFIG_CTRL_IFACE_HIDL=y in android.config
Change-Id: I4a7047a56f8e9be1ed51f2315df707ef5daddc11
diff --git a/hostapd/hidl/1.0/hostapd.cpp b/hostapd/hidl/1.0/hostapd.cpp
new file mode 100644
index 0000000..8834a82
--- /dev/null
+++ b/hostapd/hidl/1.0/hostapd.cpp
@@ -0,0 +1,55 @@
+/*
+ * hidl interface for wpa_hostapd daemon
+ * Copyright (c) 2004-2018, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2004-2018, Roshan Pius <rpius@google.com>
+ *
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
+ */
+
+#include "hostapd.h"
+#include "hidl_return_util.h"
+
+namespace android {
+namespace hardware {
+namespace wifi {
+namespace hostapd {
+namespace V1_0 {
+namespace implementation {
+using hidl_return_util::call;
+
+Hostapd::Hostapd(struct hapd_interfaces* interfaces) : interfaces_(interfaces)
+{}
+
+Return<void> Hostapd::addAccessPoint(
+ const IfaceParams& iface_params, const NetworkParams& nw_params,
+ addAccessPoint_cb _hidl_cb)
+{
+ return call(
+ this, &Hostapd::addAccessPointInternal, _hidl_cb, iface_params,
+ nw_params);
+}
+
+Return<void> Hostapd::removeAccessPoint(
+ const hidl_string& iface_name, removeAccessPoint_cb _hidl_cb)
+{
+ return call(
+ this, &Hostapd::removeAccessPointInternal, _hidl_cb, iface_name);
+}
+
+HostapdStatus Hostapd::addAccessPointInternal(
+ const IfaceParams& iface_params, const NetworkParams& nw_params)
+{
+ return {HostapdStatusCode::SUCCESS, ""};
+}
+
+HostapdStatus Hostapd::removeAccessPointInternal(const std::string& iface_name)
+{
+ return {HostapdStatusCode::SUCCESS, ""};
+}
+} // namespace implementation
+} // namespace V1_0
+} // namespace hostapd
+} // namespace wifi
+} // namespace hardware
+} // namespace android