From: Tomasz Bursztyka Date: Fri, 20 Apr 2012 12:18:36 +0000 (+0300) Subject: wifi: Decide to use WPS PBC if the AP is already advertizing for it X-Git-Tag: 0.81~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d8856bf6328c5e59e114d8db338c53b6a88b1b8;p=platform%2Fupstream%2Fconnman.git wifi: Decide to use WPS PBC if the AP is already advertizing for it --- diff --git a/plugins/wifi.c b/plugins/wifi.c index 912e1ee..aea53ae 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -1118,6 +1118,9 @@ static void network_added(GSupplicantNetwork *supplicant_network) const unsigned char *ssid; unsigned int ssid_len; connman_bool_t wps; + connman_bool_t wps_pbc; + connman_bool_t wps_ready; + connman_bool_t wps_advertizing; DBG(""); @@ -1128,6 +1131,10 @@ static void network_added(GSupplicantNetwork *supplicant_network) security = g_supplicant_network_get_security(supplicant_network); group = g_supplicant_network_get_identifier(supplicant_network); wps = g_supplicant_network_get_wps(supplicant_network); + wps_pbc = g_supplicant_network_is_wps_pbc(supplicant_network); + wps_ready = g_supplicant_network_is_wps_active(supplicant_network); + wps_advertizing = g_supplicant_network_is_wps_advertizing( + supplicant_network); mode = g_supplicant_network_get_mode(supplicant_network); if (wifi == NULL) @@ -1163,6 +1170,14 @@ static void network_added(GSupplicantNetwork *supplicant_network) calculate_strength(supplicant_network)); connman_network_set_bool(network, "WiFi.WPS", wps); + if (wps == TRUE) { + /* Is AP advertizing for WPS association? + * If so, we decide to use WPS by default */ + if (wps_ready == TRUE && wps_pbc == TRUE && + wps_advertizing == TRUE) + connman_network_set_bool(network, "WiFi.UseWPS", TRUE); + } + connman_network_set_frequency(network, g_supplicant_network_get_frequency(supplicant_network));