This email list is read-only. Emails sent to this list will be discarded
----------------------------------
bootstrap-configure | 2 +-
doc/network-api.txt | 4 ++++
include/element.h | 2 ++
plugins/wifi.c | 2 ++
src/element.c | 20 +++++++++++++++-----
src/storage.c | 10 +++++++++-
6 files changed, 33 insertions(+), 7 deletions(-)
New commits:
commit 0dbb44988061fa97f85bb56e5b745df9fe888cba
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date: Thu Dec 11 00:29:28 2008 +0100
Add Available and Remember properties for networks
commit d6558ac5058ca81e2bb25ea1ee5f20a7186e4dcf
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date: Thu Dec 11 00:26:40 2008 +0100
Mention Connected property
commit ab6d36ab9ea43a39daf3d68f1ae2486cfb92457b
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date: Wed Dec 10 23:40:29 2008 +0100
Don't built fake plugin anymore
Diff in this email is a maximum of 400 lines.
diff --git a/bootstrap-configure b/bootstrap-configure
index cba03dc..0714169 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -16,4 +16,4 @@ fi
--mandir=/usr/share/man \
--localstatedir=/var \
--sysconfdir=/etc \
- --enable-fake $*
+ --disable-fake $*
diff --git a/doc/network-api.txt b/doc/network-api.txt
index 9bcdf12..8480fcd 100644
--- a/doc/network-api.txt
+++ b/doc/network-api.txt
@@ -40,6 +40,10 @@ Properties string Name [readonly]
The scanning process can change this property.
+ boolean Connected [readonly]
+
+ Indicates that this network is currently connected.
+
boolean Remember [readwrite]
Indicates that this network will be remembered.
diff --git a/include/element.h b/include/element.h
index 85b9b06..aaf389d 100644
--- a/include/element.h
+++ b/include/element.h
@@ -92,6 +92,8 @@ struct connman_element {
enum connman_element_state state;
enum connman_element_policy policy;
gboolean enabled;
+ gboolean available;
+ gboolean remember;
guint16 priority;
struct connman_element *parent;
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 39f288d..b0ee4ae 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -251,6 +251,8 @@ static void scan_result(struct connman_element *parent,
connman_element_register(element, parent);
}
+ element->available = TRUE;
+
g_free(temp);
}
diff --git a/src/element.c b/src/element.c
index 6ad75b1..a8eee21 100644
--- a/src/element.c
+++ b/src/element.c
@@ -529,6 +529,8 @@ static DBusMessage *device_create_network(DBusConnection
*conn,
network->type = CONNMAN_ELEMENT_TYPE_NETWORK;
network->index = element->index;
+ network->remember = TRUE;
+
connman_element_add_static_property(network, "Name",
DBUS_TYPE_STRING, &ssid);
@@ -550,7 +552,7 @@ static DBusMessage *device_remove_network(DBusConnection
*conn,
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;
@@ -576,9 +578,15 @@ static DBusMessage *get_network_properties(DBusConnection
*conn,
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);
@@ -586,7 +594,7 @@ static DBusMessage *get_network_properties(DBusConnection
*conn,
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;
@@ -606,7 +614,9 @@ static DBusMessage *set_network_property(DBusConnection
*conn,
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);
@@ -788,8 +798,8 @@ static GDBusMethodTable device_methods[] = {
};
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 },
{ },
diff --git a/src/storage.c b/src/storage.c
index bbd9417..e0e3dc5 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -48,6 +48,10 @@ static int do_load(GKeyFile *keyfile, struct connman_element
*element)
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)
@@ -116,6 +120,10 @@ static void do_update(GKeyFile *keyfile, struct
connman_element *element)
//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) {
@@ -172,7 +180,7 @@ int __connman_element_store(struct connman_element *element)
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;
}
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits