Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 1 | /* |
Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 2 | * hidl interface for wpa_supplicant daemon |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 3 | * 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 Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 10 | #ifndef WPA_SUPPLICANT_HIDL_SUPPLICANT_H |
| 11 | #define WPA_SUPPLICANT_HIDL_SUPPLICANT_H |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 12 | |
Roshan Pius | d6e3751 | 2016-07-07 13:20:46 -0700 | [diff] [blame] | 13 | #include <android-base/macros.h> |
| 14 | |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 15 | #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 Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 18 | |
| 19 | extern "C" { |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 20 | #include "utils/common.h" |
Dmitry Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 21 | #include "utils/includes.h" |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 22 | #include "utils/wpa_debug.h" |
| 23 | #include "wpa_supplicant_i.h" |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 24 | } |
| 25 | |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 26 | namespace android { |
| 27 | namespace hardware { |
| 28 | namespace wifi { |
| 29 | namespace supplicant { |
| 30 | namespace V1_0 { |
| 31 | namespace implementation { |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 32 | /** |
Roshan Pius | 57ffbcf | 2016-09-27 09:12:46 -0700 | [diff] [blame] | 33 | * Implementation of the supplicant hidl object. This hidl |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 34 | * object is used core for global control operations on |
| 35 | * wpa_supplicant. |
| 36 | */ |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 37 | class Supplicant : public android::hardware::wifi::supplicant::V1_0::ISupplicant |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 38 | { |
| 39 | public: |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 40 | Supplicant(struct wpa_global* global); |
Roshan Pius | d6e3751 | 2016-07-07 13:20:46 -0700 | [diff] [blame] | 41 | ~Supplicant() override = default; |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 42 | |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 43 | // Hidl methods exposed. |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 44 | Return<void> getInterface( |
Roshan Pius | e286edf | 2016-11-01 16:56:42 -0700 | [diff] [blame] | 45 | const IfaceInfo& iface_info, getInterface_cb _hidl_cb) override; |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 46 | Return<void> listInterfaces(listInterfaces_cb _hidl_cb) override; |
| 47 | Return<void> registerCallback( |
| 48 | const sp<ISupplicantCallback>& callback, |
| 49 | registerCallback_cb _hidl_cb) override; |
| 50 | Return<void> setDebugParams( |
| 51 | ISupplicant::DebugLevel level, bool show_timestamp, bool show_keys, |
| 52 | setDebugParams_cb _hidl_cb) override; |
| 53 | Return<ISupplicant::DebugLevel> getDebugLevel() override; |
| 54 | Return<bool> isDebugShowTimestampEnabled() override; |
| 55 | Return<bool> isDebugShowKeysEnabled() override; |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 56 | |
| 57 | private: |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 58 | // Raw pointer to the global structure maintained by the core. |
| 59 | struct wpa_global* wpa_global_; |
| 60 | // Driver name to be used for creating interfaces. |
| 61 | static const char kDriverName[]; |
| 62 | // wpa_supplicant.conf file location on the device. |
| 63 | static const char kConfigFilePath[]; |
Roshan Pius | d6e3751 | 2016-07-07 13:20:46 -0700 | [diff] [blame] | 64 | |
| 65 | DISALLOW_COPY_AND_ASSIGN(Supplicant); |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 68 | } // namespace implementation |
| 69 | } // namespace V1_0 |
| 70 | } // namespace wifi |
| 71 | } // namespace supplicant |
| 72 | } // namespace hardware |
| 73 | } // namespace android |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 74 | |
Roshan Pius | 7c0ebf2 | 2016-09-20 15:11:56 -0700 | [diff] [blame] | 75 | #endif // WPA_SUPPLICANT_HIDL_SUPPLICANT_H |