summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorJulien Massot <jmassot@aldebaran-robotics.com>2012-08-07 18:57:06 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-08-14 08:57:37 +0300
commit1da7a47cb33bfe4cb64f9ad3ac023ad6de56a70f (patch)
tree2a2269e765733332fee206be3d6931bbda48f8f2 /src/technology.c
parent5e4bbf588b8095107c84978ae29a326a0696ab2a (diff)
downloadconnman-1da7a47cb33bfe4cb64f9ad3ac023ad6de56a70f.tar.gz
connman-1da7a47cb33bfe4cb64f9ad3ac023ad6de56a70f.tar.bz2
connman-1da7a47cb33bfe4cb64f9ad3ac023ad6de56a70f.zip
technology: Save tethering identifier and passphrase
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/technology.c b/src/technology.c
index f5aeb95d..ce1f024e 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -328,6 +328,16 @@ static void technology_save(struct connman_technology *technology)
g_key_file_set_boolean(keyfile, identifier, "Enable",
technology->enable_persistent);
+ if (technology->tethering_ident != NULL)
+ g_key_file_set_string(keyfile, identifier,
+ "Tethering.Identifier",
+ technology->tethering_ident);
+
+ if (technology->tethering_passphrase != NULL)
+ g_key_file_set_string(keyfile, identifier,
+ "Tethering.Passphrase",
+ technology->tethering_passphrase);
+
done:
g_free(identifier);
@@ -374,6 +384,12 @@ static void technology_load(struct connman_technology *technology)
technology_save(technology);
g_clear_error(&error);
}
+
+ technology->tethering_ident = g_key_file_get_string(keyfile,
+ identifier, "Tethering.Identifier", NULL);
+
+ technology->tethering_passphrase = g_key_file_get_string(keyfile,
+ identifier, "Tethering.Passphrase", NULL);
done:
g_free(identifier);
@@ -759,6 +775,7 @@ static DBusMessage *set_property(DBusConnection *conn,
return __connman_error_invalid_arguments(msg);
technology->tethering_ident = g_strdup(str);
+ technology_save(technology);
} else if (g_str_equal(name, "TetheringPassphrase") == TRUE) {
const char *str;
@@ -771,6 +788,7 @@ static DBusMessage *set_property(DBusConnection *conn,
return __connman_error_passphrase_required(msg);
technology->tethering_passphrase = g_strdup(str);
+ technology_save(technology);
} else if (g_str_equal(name, "Powered") == TRUE) {
connman_bool_t enable;