aboutsummaryrefslogtreecommitdiffstats
path: root/nexus/WifiController.h
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-06-15 14:10:44 -0700
committerSan Mehat <san@google.com>2009-06-15 14:20:02 -0700
commit3aff2d1de59972684bf2ab798351be5544158239 (patch)
treee16fdc00ec3615dc4257ef1b57b2d0f49437fdcf /nexus/WifiController.h
parent669a7011e7e23c0594242465caa15b46b92aa340 (diff)
downloadsystem_core-3aff2d1de59972684bf2ab798351be5544158239.tar.gz
system_core-3aff2d1de59972684bf2ab798351be5544158239.tar.bz2
system_core-3aff2d1de59972684bf2ab798351be5544158239.zip
Nexus: Clean up supplicant events, protocol, and continue plumbing
- Create SupplicantEvent classes for events - New SupplicantEventFactory for creating events - Extract Controller -> NetworkManager callbacks into IControllerHandler - Move ScanResult handling from Supplicant -> WifiController - Plumb more 'onConnected()' code - Instead of re-creating NetworkList every-time, merge in new entries - Extract SupplicantListener -> Supplicant callbacks into ISupplicantEventHandler - Move SupplicantListener callback handling to WifiController - Add unlocked version of lookupNetwork() - Save supplicant config after setting a WifiNetwork variable - Move property registration from WifiNetwork -> Supplicant - Change wifi enable broadcast messages - Add 3 new events: 'onAssociating', 'onAssociated', 'onConnectionTimeout' - Add support for handling KeyManagement Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'nexus/WifiController.h')
-rw-r--r--nexus/WifiController.h45
1 files changed, 39 insertions, 6 deletions
diff --git a/nexus/WifiController.h b/nexus/WifiController.h
index b2f45307..c61d97a5 100644
--- a/nexus/WifiController.h
+++ b/nexus/WifiController.h
@@ -20,15 +20,21 @@
#include <sys/types.h>
#include "Controller.h"
+#include "ScanResult.h"
+#include "WifiNetwork.h"
+#include "ISupplicantEventHandler.h"
class NetInterface;
class Supplicant;
class WifiScanner;
-
-#include "ScanResult.h"
-#include "WifiNetwork.h"
-
-class WifiController : public Controller {
+class SupplicantAssociatingEvent;
+class SupplicantAssociatedEvent;
+class SupplicantConnectedEvent;
+class SupplicantScanResultsEvent;
+class SupplicantStateChangeEvent;
+class SupplicantDisconnectedEvent;
+
+class WifiController : public Controller, public ISupplicantEventHandler {
public:
static const uint32_t SCAN_ENABLE_MASK = 0x01;
static const uint32_t SCAN_ACTIVE_MASK = 0x02;
@@ -45,12 +51,18 @@ private:
char mModulePath[255];
char mModuleName[64];
char mModuleArgs[255];
+
uint32_t mCurrentScanMode;
WifiScanner *mScanner;
+ int mSupplicantState;
+
+ ScanResultCollection *mLatestScanResults;
+ pthread_mutex_t mLatestScanResultsLock;
+
bool mEnabled;
public:
- WifiController(PropertyManager *propmngr, char *modpath, char *modname, char *modargs);
+ WifiController(PropertyManager *propmngr, IControllerHandler *handlers, char *modpath, char *modname, char *modargs);
virtual ~WifiController() {}
int start();
@@ -85,6 +97,27 @@ private:
int setScanMode(uint32_t mode);
int enable();
int disable();
+
+ // ISupplicantEventHandler methods
+ virtual void onAssociatingEvent(SupplicantAssociatingEvent *evt);
+ virtual void onAssociatedEvent(SupplicantAssociatedEvent *evt);
+ virtual void onConnectedEvent(SupplicantConnectedEvent *evt);
+ virtual void onScanResultsEvent(SupplicantScanResultsEvent *evt);
+ virtual void onStateChangeEvent(SupplicantStateChangeEvent *evt);
+ virtual void onConnectionTimeoutEvent(SupplicantConnectionTimeoutEvent *evt);
+ virtual void onDisconnectedEvent(SupplicantDisconnectedEvent *evt);
+#if 0
+ virtual void onTerminatingEvent(SupplicantEvent *evt);
+ virtual void onPasswordChangedEvent(SupplicantEvent *evt);
+ virtual void onEapNotificationEvent(SupplicantEvent *evt);
+ virtual void onEapStartedEvent(SupplicantEvent *evt);
+ virtual void onEapMethodEvent(SupplicantEvent *evt);
+ virtual void onEapSuccessEvent(SupplicantEvent *evt);
+ virtual void onEapFailureEvent(SupplicantEvent *evt);
+ virtual void onLinkSpeedEvent(SupplicantEvent *evt);
+ virtual void onDriverStateEvent(SupplicantEvent *evt);
+#endif
+
};
#endif