diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2013-04-25 16:24:56 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-04-26 12:34:11 +0300 |
commit | 9fa0059ee800cb2795815ec66e7ce298e64dd759 (patch) | |
tree | d87db556fc9f09c7e2c4ebf63f91b7b5fc5323ff /src/main.c | |
parent | 208d20a459c5225d6540d7f4adb86d525d4f439f (diff) | |
download | connman-9fa0059ee800cb2795815ec66e7ce298e64dd759.tar.gz connman-9fa0059ee800cb2795815ec66e7ce298e64dd759.tar.bz2 connman-9fa0059ee800cb2795815ec66e7ce298e64dd759.zip |
main: Add support for PersistentTetheringMode configuration variable
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -71,6 +71,7 @@ static struct { connman_bool_t allow_hostname_updates; connman_bool_t single_tech; char **allowed_tethering_technologies; + connman_bool_t persistent_tethering_mode; } connman_settings = { .bg_scan = TRUE, .pref_timeservers = NULL, @@ -83,6 +84,7 @@ static struct { .allow_hostname_updates = TRUE, .single_tech = FALSE, .allowed_tethering_technologies = NULL, + .persistent_tethering_mode = FALSE, }; #define CONF_BG_SCAN "BackgroundScanning" @@ -96,6 +98,7 @@ static struct { #define CONF_ALLOW_HOSTNAME_UPDATES "AllowHostnameUpdates" #define CONF_SINGLE_TECH "SingleConnectedTechnology" #define CONF_ALLOWED_TETHERING_TECHNOLOGIES "AllowedTetheringTechnologies" +#define CONF_PERSISTENT_TETHERING_MODE "PersistentTetheringMode" static const char *supported_options[] = { CONF_BG_SCAN, @@ -109,6 +112,7 @@ static const char *supported_options[] = { CONF_ALLOW_HOSTNAME_UPDATES, CONF_SINGLE_TECH, CONF_ALLOWED_TETHERING_TECHNOLOGIES, + CONF_PERSISTENT_TETHERING_MODE, NULL }; @@ -340,6 +344,14 @@ static void parse_config(GKeyFile *config) connman_settings.allowed_tethering_technologies = tethering; g_clear_error(&error); + + boolean = g_key_file_get_boolean(config, "General", + CONF_PERSISTENT_TETHERING_MODE, + &error); + if (error == NULL) + connman_settings.persistent_tethering_mode = boolean; + + g_clear_error(&error); } static int config_init(const char *file) @@ -511,6 +523,9 @@ connman_bool_t connman_setting_get_bool(const char *key) if (g_str_equal(key, CONF_SINGLE_TECH) == TRUE) return connman_settings.single_tech; + if (g_str_equal(key, CONF_PERSISTENT_TETHERING_MODE) == TRUE) + return connman_settings.persistent_tethering_mode; + return FALSE; } |