diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-08-10 01:11:02 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-08-10 01:11:02 -0700 |
commit | 49370a2e9a4068bd3e5666bb215a19ce2f0dc333 (patch) | |
tree | da75d5f7e2524a01bdf24da27712638ef1e262b9 | |
parent | 6b8f85ab661243c7a34da9aaf10de464ad752308 (diff) | |
download | connman-49370a2e9a4068bd3e5666bb215a19ce2f0dc333.tar.gz connman-49370a2e9a4068bd3e5666bb215a19ce2f0dc333.tar.bz2 connman-49370a2e9a4068bd3e5666bb215a19ce2f0dc333.zip |
Add tracking of scanning state to supplicant driver
-rw-r--r-- | plugins/supplicant.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/supplicant.c b/plugins/supplicant.c index 5f9d712a..a2cf1fc1 100644 --- a/plugins/supplicant.c +++ b/plugins/supplicant.c @@ -1579,6 +1579,27 @@ static int task_connect(struct supplicant_task *task) return -EINPROGRESS; } +static void scanning(struct supplicant_task *task, DBusMessage *msg) +{ + DBusError error; + dbus_bool_t scanning; + + dbus_error_init(&error); + + if (dbus_message_get_args(msg, &error, DBUS_TYPE_BOOLEAN, &scanning, + DBUS_TYPE_INVALID) == FALSE) { + if (dbus_error_is_set(&error) == TRUE) { + connman_error("%s", error.message); + dbus_error_free(&error); + } else + connman_error("Wrong arguments for scanning"); + return; + } + + connman_info("%s scanning %s", task->ifname, + scanning == TRUE ? "started" : "finished"); +} + static void state_change(struct supplicant_task *task, DBusMessage *msg) { DBusError error; @@ -1602,6 +1623,8 @@ static void state_change(struct supplicant_task *task, DBusMessage *msg) DBG("state %s ==> %s", oldstate, newstate); + connman_info("%s %s", task->ifname, newstate); + state = string2state(newstate); if (state == WPA_INVALID) return; @@ -1697,6 +1720,8 @@ static DBusHandlerResult supplicant_filter(DBusConnection *conn, if (g_str_equal(member, "ScanResultsAvailable") == TRUE) scan_results_available(task); + else if (g_str_equal(member, "Scanning") == TRUE) + scanning(task, msg); else if (g_str_equal(member, "StateChange") == TRUE) state_change(task, msg); |