From: Pasi Sjöholm <pasi.sjoh...@jollamobile.com> Makes it possible to only do passive scanning so that the SSIDs are not revealed during the scans. --- plugins/wifi.c | 2 +- src/main.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/plugins/wifi.c b/plugins/wifi.c index 42dd407..0fecee7 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -1820,7 +1820,7 @@ static int wifi_scan(enum connman_service_type type, return 0; } - } else if (wifi->connected) { + } else if (wifi->connected || connman_setting_get_bool("PassiveWiFiScan")) { g_supplicant_free_scan_params(scan_params); return wifi_scan_simple(device); } else { diff --git a/src/main.c b/src/main.c index 1c17991..21c6121 100644 --- a/src/main.c +++ b/src/main.c @@ -73,6 +73,7 @@ static struct { bool single_tech; char **tethering_technologies; bool persistent_tethering_mode; + bool passive_wifi_scan; } connman_settings = { .bg_scan = true, .pref_timeservers = NULL, @@ -86,6 +87,7 @@ static struct { .single_tech = false, .tethering_technologies = NULL, .persistent_tethering_mode = false, + .passive_wifi_scan = false, }; #define CONF_BG_SCAN "BackgroundScanning" @@ -100,6 +102,7 @@ static struct { #define CONF_SINGLE_TECH "SingleConnectedTechnology" #define CONF_TETHERING_TECHNOLOGIES "TetheringTechnologies" #define CONF_PERSISTENT_TETHERING_MODE "PersistentTetheringMode" +#define CONF_PASSIVE_WIFI_SCAN "PassiveWiFiScan" static const char *supported_options[] = { CONF_BG_SCAN, @@ -114,6 +117,7 @@ static const char *supported_options[] = { CONF_SINGLE_TECH, CONF_TETHERING_TECHNOLOGIES, CONF_PERSISTENT_TETHERING_MODE, + CONF_PASSIVE_WIFI_SCAN, NULL }; @@ -354,6 +358,14 @@ static void parse_config(GKeyFile *config) connman_settings.persistent_tethering_mode = boolean; g_clear_error(&error); + + boolean = __connman_config_get_bool(config, "General", + CONF_PASSIVE_WIFI_SCAN, + &error); + if (!error) + connman_settings.passive_wifi_scan = boolean; + + g_clear_error(&error); } static int config_init(const char *file) @@ -528,6 +540,9 @@ bool connman_setting_get_bool(const char *key) if (g_str_equal(key, CONF_PERSISTENT_TETHERING_MODE)) return connman_settings.persistent_tethering_mode; + if (g_str_equal(key, CONF_PASSIVE_WIFI_SCAN)) + return connman_settings.passive_wifi_scan; + return false; } -- 2.1.0 _______________________________________________ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman