aboutsummaryrefslogtreecommitdiffstats
path: root/nexus/WifiController.cpp
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-06-22 10:39:36 -0700
committerSan Mehat <san@google.com>2009-06-22 10:40:53 -0700
commitd6c6796670a5e566977b13d542020fb8cc88e6cf (patch)
treeb21d0a9b7618c8bfc824044ed4f457dbdc398e9c /nexus/WifiController.cpp
parent54962e0fd647f5f390269994c573f80c92f537d4 (diff)
downloadsystem_core-d6c6796670a5e566977b13d542020fb8cc88e6cf.tar.gz
system_core-d6c6796670a5e566977b13d542020fb8cc88e6cf.tar.bz2
system_core-d6c6796670a5e566977b13d542020fb8cc88e6cf.zip
nexus: Rename onInterfaceStarted -> onInterfaceConnected and add Dhcp start/stop control
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'nexus/WifiController.cpp')
-rw-r--r--nexus/WifiController.cpp46
1 files changed, 22 insertions, 24 deletions
diff --git a/nexus/WifiController.cpp b/nexus/WifiController.cpp
index b7bd6eda..ef5ecae1 100644
--- a/nexus/WifiController.cpp
+++ b/nexus/WifiController.cpp
@@ -279,33 +279,31 @@ void WifiController::onAssociatedEvent(SupplicantAssociatedEvent *evt) {
void WifiController::onConnectedEvent(SupplicantConnectedEvent *evt) {
LOGD("onConnectedEvent(%s, %d)", evt->getBssid(), evt->getReassociated());
- if (!evt->getReassociated()) {
- SupplicantStatus *ss = mSupplicant->getStatus();
- WifiNetwork *wn;
+ SupplicantStatus *ss = mSupplicant->getStatus();
+ WifiNetwork *wn;
- if (ss->getWpaState() != SupplicantState::COMPLETED) {
- char tmp[32];
+ if (ss->getWpaState() != SupplicantState::COMPLETED) {
+ char tmp[32];
- LOGW("onConnected() with SupplicantState = %s!",
- SupplicantState::toString(ss->getWpaState(), tmp,
- sizeof(tmp)));
- return;
- }
+ LOGW("onConnected() with SupplicantState = %s!",
+ SupplicantState::toString(ss->getWpaState(), tmp,
+ sizeof(tmp)));
+ return;
+ }
- if (ss->getId() == -1) {
- LOGW("onConnected() with id = -1!");
- return;
- }
-
- if (!(wn = mSupplicant->lookupNetwork(ss->getId()))) {
- LOGW("Error looking up connected network id %d (%s)",
- ss->getId(), strerror(errno));
- return;
- }
-
- delete ss;
- mHandlers->onInterfaceStarted(this, wn->getIfaceCfg());
+ if (ss->getId() == -1) {
+ LOGW("onConnected() with id = -1!");
+ return;
+ }
+
+ if (!(wn = mSupplicant->lookupNetwork(ss->getId()))) {
+ LOGW("Error looking up connected network id %d (%s)",
+ ss->getId(), strerror(errno));
+ return;
}
+
+ delete ss;
+ mHandlers->onInterfaceConnected(this, wn->getIfaceCfg());
}
void WifiController::onScanResultsEvent(SupplicantScanResultsEvent *evt) {
@@ -373,7 +371,7 @@ void WifiController::onConnectionTimeoutEvent(SupplicantConnectionTimeoutEvent *
}
void WifiController::onDisconnectedEvent(SupplicantDisconnectedEvent *evt) {
- LOGD("onDisconnectedEvent()");
+ mHandlers->onInterfaceDisconnected(this, getBoundInterface());
}
#if 0