2 * Copyright (C) 2008 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 class SupplicantListener;
25 class SupplicantStatus;
29 #include "WifiNetwork.h"
30 #include "ISupplicantEventHandler.h"
33 struct wpa_ctrl *mCtrl;
34 struct wpa_ctrl *mMonitor;
35 SupplicantListener *mListener;
36 ServiceManager *mServiceManager;
37 WifiController *mController;
40 WifiNetworkCollection *mNetworks;
41 pthread_mutex_t mNetworksLock;
42 ISupplicantEventHandler *mHandlers;
45 Supplicant(WifiController *wc, ISupplicantEventHandler *handlers);
46 virtual ~Supplicant();
52 int setScanMode(bool active);
55 WifiNetwork *createNetwork();
56 WifiNetwork *lookupNetwork(int networkId);
57 int removeNetwork(WifiNetwork *net);
58 WifiNetworkCollection *createNetworkList();
59 int refreshNetworkList();
61 int setNetworkVar(int networkId, const char *var, const char *value);
62 const char *getNetworkVar(int networkid, const char *var, char *buffer,
64 int enableNetwork(int networkId, bool enabled);
69 int setApScanMode(int mode);
70 int enablePacketFilter();
71 int disablePacketFilter();
72 int setBluetoothCoexistenceMode(int mode);
73 int enableBluetoothCoexistenceScan();
74 int disableBluetoothCoexistenceScan();
77 int getRssi(int *buffer);
79 int getNetworkCount();
81 SupplicantStatus *getStatus();
83 Controller *getController() { return (Controller *) mController; }
84 const char *getInterfaceName() { return mInterfaceName; }
86 int sendCommand(const char *cmd, char *reply, size_t *reply_len);
89 int connectToSupplicant();
91 int retrieveInterfaceName();
92 WifiNetwork *lookupNetwork_UNLOCKED(int networkId);