From: Julien Massot Date: Tue, 7 Aug 2012 16:57:06 +0000 (+0200) Subject: technology: Save tethering identifier and passphrase X-Git-Tag: 1.5~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1da7a47cb33bfe4cb64f9ad3ac023ad6de56a70f;p=platform%2Fupstream%2Fconnman.git technology: Save tethering identifier and passphrase --- diff --git a/src/technology.c b/src/technology.c index f5aeb95..ce1f024 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;