diff options
author | San Mehat <san@google.com> | 2009-06-01 08:38:45 -0700 |
---|---|---|
committer | San Mehat <san@google.com> | 2009-06-02 10:26:58 -0700 |
commit | 78828ff4f5f959fcf8066ecb6a6b689d2a3c5985 (patch) | |
tree | 5b64f524ecdb43119bedd3351f987a8ad5a4b2cf /nexus/Supplicant.h | |
parent | 37629255e95c0800ee0555042a0b6dea38efc5fe (diff) | |
download | system_core-78828ff4f5f959fcf8066ecb6a6b689d2a3c5985.zip system_core-78828ff4f5f959fcf8066ecb6a6b689d2a3c5985.tar.gz system_core-78828ff4f5f959fcf8066ecb6a6b689d2a3c5985.tar.bz2 |
nexus: Use interface for handling Supplicant events
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'nexus/Supplicant.h')
-rw-r--r-- | nexus/Supplicant.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/nexus/Supplicant.h b/nexus/Supplicant.h index 34ecdcf..42f2f79 100644 --- a/nexus/Supplicant.h +++ b/nexus/Supplicant.h @@ -30,8 +30,9 @@ class WifiController; #include "ScanResult.h" #include "WifiNetwork.h" #include "IPropertyProvider.h" +#include "ISupplicantEventHandler.h" -class Supplicant : public IPropertyProvider { +class Supplicant : public IPropertyProvider, public ISupplicantEventHandler { private: struct wpa_ctrl *mCtrl; struct wpa_ctrl *mMonitor; @@ -77,9 +78,13 @@ public: int set(const char *name, const char *value); const char *get(const char *name, char *buffer, size_t max); -// XXX: Extract these into an interface -// handlers for SupplicantListener -public: +private: + int connectToSupplicant(); + int sendCommand(const char *cmd, char *reply, size_t *reply_len); + int setupConfig(); + int retrieveInterfaceName(); + + // ISupplicantEventHandler methods virtual int onConnectedEvent(SupplicantEvent *evt); virtual int onDisconnectedEvent(SupplicantEvent *evt); virtual int onTerminatingEvent(SupplicantEvent *evt); @@ -93,12 +98,6 @@ public: virtual int onStateChangeEvent(SupplicantEvent *evt); virtual int onLinkSpeedEvent(SupplicantEvent *evt); virtual int onDriverStateEvent(SupplicantEvent *evt); - -private: - int connectToSupplicant(); - int sendCommand(const char *cmd, char *reply, size_t *reply_len); - int setupConfig(); - int retrieveInterfaceName(); }; #endif |