blob: cad405257ac294a89869b7ffab26fc58d442d6e2 [file] [log] [blame]
Dmitry Shmidte4663042016-04-04 10:07:49 -07001/*
Roshan Pius57ffbcf2016-09-27 09:12:46 -07002 * hidl interface for wpa_supplicant daemon
Dmitry Shmidte4663042016-04-04 10:07:49 -07003 * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
4 * Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
5 *
6 * This software may be distributed under the terms of the BSD license.
7 * See README for more details.
8 */
9
Roshan Pius57ffbcf2016-09-27 09:12:46 -070010#ifndef WPA_SUPPLICANT_HIDL_SUPPLICANT_H
11#define WPA_SUPPLICANT_HIDL_SUPPLICANT_H
Dmitry Shmidte4663042016-04-04 10:07:49 -070012
Roshan Piusd6e37512016-07-07 13:20:46 -070013#include <android-base/macros.h>
14
Roshan Pius7c0ebf22016-09-20 15:11:56 -070015#include <android/hardware/wifi/supplicant/1.0/ISupplicant.h>
16#include <android/hardware/wifi/supplicant/1.0/ISupplicantCallback.h>
17#include <android/hardware/wifi/supplicant/1.0/ISupplicantIface.h>
Dmitry Shmidte4663042016-04-04 10:07:49 -070018
19extern "C" {
Dmitry Shmidte4663042016-04-04 10:07:49 -070020#include "utils/common.h"
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070021#include "utils/includes.h"
Roshan Pius7c0ebf22016-09-20 15:11:56 -070022#include "utils/wpa_debug.h"
23#include "wpa_supplicant_i.h"
Dmitry Shmidte4663042016-04-04 10:07:49 -070024}
25
Roshan Pius7c0ebf22016-09-20 15:11:56 -070026namespace android {
27namespace hardware {
28namespace wifi {
29namespace supplicant {
30namespace V1_0 {
31namespace implementation {
Dmitry Shmidte4663042016-04-04 10:07:49 -070032/**
Roshan Pius57ffbcf2016-09-27 09:12:46 -070033 * Implementation of the supplicant hidl object. This hidl
Dmitry Shmidte4663042016-04-04 10:07:49 -070034 * object is used core for global control operations on
35 * wpa_supplicant.
36 */
Roshan Pius7c0ebf22016-09-20 15:11:56 -070037class Supplicant : public android::hardware::wifi::supplicant::V1_0::ISupplicant
Dmitry Shmidte4663042016-04-04 10:07:49 -070038{
39public:
Roshan Pius7c0ebf22016-09-20 15:11:56 -070040 Supplicant(struct wpa_global* global);
Roshan Piusd6e37512016-07-07 13:20:46 -070041 ~Supplicant() override = default;
Dmitry Shmidte4663042016-04-04 10:07:49 -070042
Roshan Pius7c0ebf22016-09-20 15:11:56 -070043 // Hidl methods exposed.
44 Return<void> createInterface(
45 const hidl_string& ifname, createInterface_cb _hidl_cb) override;
46 Return<void> removeInterface(
47 const hidl_string& ifname, removeInterface_cb _hidl_cb) override;
48 Return<void> getInterface(
49 const hidl_string& ifname, getInterface_cb _hidl_cb) override;
50 Return<void> listInterfaces(listInterfaces_cb _hidl_cb) override;
51 Return<void> registerCallback(
52 const sp<ISupplicantCallback>& callback,
53 registerCallback_cb _hidl_cb) override;
54 Return<void> setDebugParams(
55 ISupplicant::DebugLevel level, bool show_timestamp, bool show_keys,
56 setDebugParams_cb _hidl_cb) override;
57 Return<ISupplicant::DebugLevel> getDebugLevel() override;
58 Return<bool> isDebugShowTimestampEnabled() override;
59 Return<bool> isDebugShowKeysEnabled() override;
Dmitry Shmidte4663042016-04-04 10:07:49 -070060
61private:
Roshan Pius7c0ebf22016-09-20 15:11:56 -070062 // Raw pointer to the global structure maintained by the core.
63 struct wpa_global* wpa_global_;
64 // Driver name to be used for creating interfaces.
65 static const char kDriverName[];
66 // wpa_supplicant.conf file location on the device.
67 static const char kConfigFilePath[];
Roshan Piusd6e37512016-07-07 13:20:46 -070068
69 DISALLOW_COPY_AND_ASSIGN(Supplicant);
Dmitry Shmidte4663042016-04-04 10:07:49 -070070};
71
Roshan Pius7c0ebf22016-09-20 15:11:56 -070072} // namespace implementation
73} // namespace V1_0
74} // namespace wifi
75} // namespace supplicant
76} // namespace hardware
77} // namespace android
Dmitry Shmidte4663042016-04-04 10:07:49 -070078
Roshan Pius7c0ebf22016-09-20 15:11:56 -070079#endif // WPA_SUPPLICANT_HIDL_SUPPLICANT_H