From fc41a18566f0bb753fd8ce35873d1442942f464c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 15 Jun 2012 16:00:21 +0300 Subject: service: Connecting hidden network waits until connected If the user is connecting to hidden network, then we delay the return of the reply to caller until the real service has connected. This way the user connect to hidden and non-hidden networks works the same way from caller point of view. --- plugins/wifi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins/wifi.c') diff --git a/plugins/wifi.c b/plugins/wifi.c index 3cd2be29..3f9afad9 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -68,6 +68,7 @@ struct hidden_params { unsigned int ssid_len; char *identity; char *passphrase; + gpointer user_data; }; /** @@ -664,6 +665,7 @@ static void scan_callback(int result, GSupplicantInterface *interface, DBG("result %d", result); if (wifi != NULL && wifi->hidden != NULL) { + connman_network_clear_hidden(wifi->hidden->user_data); hidden_free(wifi->hidden); wifi->hidden = NULL; } @@ -865,7 +867,8 @@ static int wifi_scan_fast(struct connman_device *device) */ static int wifi_scan_hidden(struct connman_device *device, const char *ssid, unsigned int ssid_len, - const char *identity, const char* passphrase) + const char *identity, const char* passphrase, + gpointer user_data) { struct wifi_data *wifi = connman_device_get_data(device); GSupplicantScanParams *scan_params = NULL; @@ -911,6 +914,7 @@ static int wifi_scan_hidden(struct connman_device *device, hidden->ssid_len = ssid_len; hidden->identity = g_strdup(identity); hidden->passphrase = g_strdup(passphrase); + hidden->user_data = user_data; wifi->hidden = hidden; connman_device_ref(device); @@ -1572,7 +1576,9 @@ static void network_added(GSupplicantNetwork *supplicant_network) ssid_len) == 0) { connman_network_connect_hidden(network, wifi->hidden->identity, - wifi->hidden->passphrase); + wifi->hidden->passphrase, + wifi->hidden->user_data); + wifi->hidden->user_data = NULL; hidden_free(wifi->hidden); wifi->hidden = NULL; } -- cgit v1.2.3