wpa/hostapd(hidl): Implementation of terminate
These invoke the same functions as the "TERMINATE" string command in the
socket interface. The terminate command aborts the daemon (& cleans up
hwbinder, etc).
Bug: 72394251
Test: Compiles
Change-Id: I23238ff103aa7198e86827c23e7ce77922e17049
diff --git a/hostapd/hidl/1.0/hostapd.cpp b/hostapd/hidl/1.0/hostapd.cpp
index 04e2840..3878037 100644
--- a/hostapd/hidl/1.0/hostapd.cpp
+++ b/hostapd/hidl/1.0/hostapd.cpp
@@ -17,6 +17,11 @@
#include "hostapd.h"
#include "hidl_return_util.h"
+extern "C"
+{
+#include "utils/eloop.h"
+}
+
// The HIDL implementation for hostapd creates a hostapd.conf dynamically for
// each interface. This file can then be used to hook onto the normal config
// file parsing logic in hostapd code. Helps us to avoid duplication of code
@@ -198,6 +203,12 @@
this, &Hostapd::removeAccessPointInternal, _hidl_cb, iface_name);
}
+Return<void> Hostapd::terminate() {
+ wpa_printf(MSG_INFO, "Terminating...");
+ eloop_terminate();
+ return Void();
+}
+
HostapdStatus Hostapd::addAccessPointInternal(
const IfaceParams& iface_params, const NetworkParams& nw_params)
{