network->type = CONNMAN_ELEMENT_TYPE_NETWORK;
network->index = element->index;
+ network->remember = TRUE;
+
connman_element_add_static_property(network, "Name",
DBUS_TYPE_STRING, &ssid);
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
-static DBusMessage *get_network_properties(DBusConnection *conn,
+static DBusMessage *network_get_properties(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct connman_element *element = data;
connman_dbus_dict_append_variant(&dict, "Policy",
DBUS_TYPE_STRING, &str);
+ connman_dbus_dict_append_variant(&dict, "Available",
+ DBUS_TYPE_BOOLEAN, &element->available);
+
connman_dbus_dict_append_variant(&dict, "Connected",
DBUS_TYPE_BOOLEAN, &element->enabled);
+ connman_dbus_dict_append_variant(&dict, "Remember",
+ DBUS_TYPE_BOOLEAN, &element->remember);
+
add_common_properties(element, &dict);
dbus_message_iter_close_container(&array, &dict);
return reply;
}
-static DBusMessage *set_network_property(DBusConnection *conn,
+static DBusMessage *network_set_property(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct connman_element *element = data;
if (__connman_security_check_privileges(msg) < 0)
return __connman_error_permission_denied(msg);
- if (g_str_equal(name, "WiFi.Passphrase") == TRUE) {
+ if (g_str_equal(name, "Remember") == TRUE) {
+ dbus_message_iter_get_basic(&value, &element->remember);
+ } else if (g_str_equal(name, "WiFi.Passphrase") == TRUE) {
const char *str;
dbus_message_iter_get_basic(&value, &str);
};
static GDBusMethodTable network_methods[] = {
- { "GetProperties", "", "a{sv}", get_network_properties },
- { "SetProperty", "sv", "", set_network_property },
+ { "GetProperties", "", "a{sv}", network_get_properties },
+ { "SetProperty", "sv", "", network_set_property },
{ "Connect", "", "", do_enable },
{ "Disconnect", "", "", do_disable },
{ },
if (value != NULL)
element->policy = __connman_element_string2policy(value);
+ if (element->type == CONNMAN_ELEMENT_TYPE_NETWORK)
+ element->remember = g_key_file_get_boolean(keyfile,
+ element->path, "Remember", NULL);
+
value = g_key_file_get_string(keyfile, element->path,
"WiFi.Security", NULL);
if (value != NULL)
//g_key_file_set_boolean(keyfile, element->path, "Enabled",
// element->enabled);
+ if (element->type == CONNMAN_ELEMENT_TYPE_NETWORK)
+ g_key_file_set_boolean(keyfile, element->path, "Remember",
+ element->remember);
+
__connman_element_lock(element);
for (list = element->properties; list; list = list->next) {
if (length > 0) {
if (g_key_file_load_from_data(keyfile, data, length,
- G_KEY_FILE_KEEP_COMMENTS, NULL) == FALSE)
+ 0, NULL) == FALSE)
goto done;
}