diff options
| author | San Mehat <san@google.com> | 2009-05-22 15:36:13 -0700 |
|---|---|---|
| committer | San Mehat <san@google.com> | 2009-05-29 15:26:21 -0700 |
| commit | 3c5a6f0bc8aefc4dacab8e95ba9017a7ac7d91f5 (patch) | |
| tree | e73708dde1e774c8e6a0539a91a228acd68000a2 /nexus/Supplicant.h | |
| parent | 192331d9060763b92f7989124bedbd136689d735 (diff) | |
| download | system_core-3c5a6f0bc8aefc4dacab8e95ba9017a7ac7d91f5.tar.gz system_core-3c5a6f0bc8aefc4dacab8e95ba9017a7ac7d91f5.tar.bz2 system_core-3c5a6f0bc8aefc4dacab8e95ba9017a7ac7d91f5.zip | |
nexus: Refactor some of the create/remove network path and add code for
retrieving network lists from supplicant
nexus: Rework properties
nexus: Implement wifi network enable/disable and add some error checking
nexus: Add some TODOs
nexus: Whitespace cleanup
nexus: Add bindings between controllers and network interfaces
nexus: Add properties for InterfaceConfig
nexus: Fix a few conversion bugs in InterfaceConfig
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'nexus/Supplicant.h')
| -rw-r--r-- | nexus/Supplicant.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/nexus/Supplicant.h b/nexus/Supplicant.h index 2ea0892b..34ecdcf9 100644 --- a/nexus/Supplicant.h +++ b/nexus/Supplicant.h @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef _SUPPLICANT_H #define _SUPPLICANT_H @@ -20,25 +21,35 @@ struct wpa_ctrl; class SupplicantListener; class SupplicantEvent; class ServiceManager; +class PropertyManager; +class Controller; +class WifiController; #include <pthread.h> #include "ScanResult.h" #include "WifiNetwork.h" +#include "IPropertyProvider.h" -class Supplicant { +class Supplicant : public IPropertyProvider { private: struct wpa_ctrl *mCtrl; struct wpa_ctrl *mMonitor; SupplicantListener *mListener; int mState; ServiceManager *mServiceManager; + PropertyManager *mPropMngr; + WifiController *mController; + char *mInterfaceName; ScanResultCollection *mLatestScanResults; pthread_mutex_t mLatestScanResultsLock; - + + WifiNetworkCollection *mNetworks; + pthread_mutex_t mNetworksLock; + public: - Supplicant(); + Supplicant(WifiController *wc, PropertyManager *propmngr); virtual ~Supplicant(); int start(); @@ -48,12 +59,23 @@ public: int triggerScan(bool active); ScanResultCollection *createLatestScanResults(); - int addNetwork(); - int removeNetwork(int networkId); + WifiNetwork *createNetwork(); + WifiNetwork *lookupNetwork(int networkId); + int removeNetwork(WifiNetwork *net); WifiNetworkCollection *createNetworkList(); + int refreshNetworkList(); + + int setNetworkVar(int networkId, const char *var, const char *value); + const char *getNetworkVar(int networkid, const char *var, char *buffer, + size_t max); + int enableNetwork(int networkId, bool enabled); int getState() { return mState; } + Controller *getController() { return (Controller *) mController; } + const char *getInterfaceName() { return mInterfaceName; } + 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 @@ -76,6 +98,7 @@ private: int connectToSupplicant(); int sendCommand(const char *cmd, char *reply, size_t *reply_len); int setupConfig(); + int retrieveInterfaceName(); }; #endif |
