diff options
author | Jaehyun Kim <jeik01.kim@samsung.com> | 2020-08-27 23:32:34 +0900 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2020-08-27 23:32:34 +0900 |
commit | c45eee86f5a3fb041df570f23b2b477c38af0cce (patch) | |
tree | f0a30ba5b7f3370f880115c39a532f854b810f01 /src/main.c | |
parent | 26dbdca524427fa4b1bbdecdc9d0e9351cdc830b (diff) | |
download | connman-c45eee86f5a3fb041df570f23b2b477c38af0cce.tar.gz connman-c45eee86f5a3fb041df570f23b2b477c38af0cce.tar.bz2 connman-c45eee86f5a3fb041df570f23b2b477c38af0cce.zip |
Add support for handling multiple wifi interfacessubmit/tizen/20200828.142119
Change-Id: I4762c8d3444167dce34498634de4948e822f865f
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
Diffstat (limited to 'src/main.c')
-rwxr-xr-x | src/main.c | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -46,6 +46,10 @@ #define DEFAULT_INPUT_REQUEST_TIMEOUT (120 * 1000) #define DEFAULT_BROWSER_LAUNCH_TIMEOUT (300 * 1000) +#if defined TIZEN_EXT +#define DEFAULT_WIFI_INTERFACE "wlan0" +#endif + #define MAINFILE "main.conf" #define CONFIGMAINFILE CONFIGDIR "/" MAINFILE @@ -99,6 +103,7 @@ static struct { bool auto_ip; char *global_nameserver; bool supplicant_debug; + char *def_wifi_ifname; #endif } connman_settings = { .bg_scan = true, @@ -128,6 +133,7 @@ static struct { .auto_ip = true, .global_nameserver = NULL, .supplicant_debug = false, + .def_wifi_ifname = DEFAULT_WIFI_INTERFACE, #endif }; @@ -214,6 +220,7 @@ static struct { #define CONF_ENABLE_AUTO_IP "EnableAutoIp" #define CONF_GLOBAL_NAMESERVER "GlobalNameserver" #define CONF_CONNMAN_SUPPLICANT_DEBUG "ConnmanSupplicantDebug" +#define CONF_CONNMAN_WIFI_DEF_IFNAME "DefaultWifiInterface" #endif #if defined TIZEN_EXT @@ -271,6 +278,7 @@ static const char *supported_options[] = { CONF_ENABLE_AUTO_IP, CONF_GLOBAL_NAMESERVER, CONF_CONNMAN_SUPPLICANT_DEBUG, + CONF_CONNMAN_WIFI_DEF_IFNAME, #endif NULL }; @@ -611,6 +619,7 @@ static void check_Tizen_configuration(GKeyFile *config) GError *error = NULL; char **cellular_interfaces; char *global_nameserver; + char *default_wifi_ifname; bool boolean; gsize len; @@ -650,6 +659,13 @@ static void check_Tizen_configuration(GKeyFile *config) g_clear_error(&error); + default_wifi_ifname = __connman_config_get_string(config, "General", + CONF_CONNMAN_WIFI_DEF_IFNAME, &error); + if (!error) + connman_settings.def_wifi_ifname = default_wifi_ifname; + + g_clear_error(&error); + check_Tizen_INS_configuration(config); } @@ -1067,14 +1083,15 @@ const char *connman_option_get_string(const char *key) #if defined TIZEN_EXT if (g_str_equal(key, CONF_GLOBAL_NAMESERVER)) return connman_settings.global_nameserver; -#endif -#if defined TIZEN_EXT if (g_str_equal(key, CONF_INS_PREFERRED_FREQ_BSSID)) return connman_ins_settings.ins_preferred_freq_bssid; if (g_str_equal(key, CONF_INS_PREFERRED_FREQ)) return connman_ins_settings.ins_preferred_freq; + + if (g_str_equal(key, CONF_CONNMAN_WIFI_DEF_IFNAME)) + return connman_settings.def_wifi_ifname; #endif return NULL; } |