summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 6dcdced6..0700304e 100755
--- a/src/main.c
+++ b/src/main.c
@@ -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;
}