diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-04-20 15:18:36 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-04-23 10:50:32 +0300 |
commit | 4d8856bf6328c5e59e114d8db338c53b6a88b1b8 (patch) | |
tree | 0de0d8ba4098793b0c3c0c8d654e056c54446877 /plugins/wifi.c | |
parent | 86c198cbb20d75d774c694ebd735133a962be601 (diff) | |
download | connman-4d8856bf6328c5e59e114d8db338c53b6a88b1b8.tar.gz connman-4d8856bf6328c5e59e114d8db338c53b6a88b1b8.tar.bz2 connman-4d8856bf6328c5e59e114d8db338c53b6a88b1b8.zip |
wifi: Decide to use WPS PBC if the AP is already advertizing for it
Diffstat (limited to 'plugins/wifi.c')
-rw-r--r-- | plugins/wifi.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c index 912e1eed..aea53ae7 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)); |