Attached are simple patches to add notifications that the following
properties changed:

0001-notify-manager-property-changed-when-system-goes-off.patch
      if the default profiles go offline, then notify manager property
OfflineMode changed.

0002-service-notify-IPv4.Configuration-property-changed.patch
     when IPv4.Configuration changes, notify it


Some others are still missing, but I need more time to figure out how
to proper notify them. One example is that Manager
Services/Networks/Devices are not being updated when these go away,
this is easy to spot when you turn offline mode and your client will
not get PropertyChanged on manager.

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
From e0d02354303f9ca8a052e5eddda10d3c08d5116c Mon Sep 17 00:00:00 2001
From: Gustavo Sverzut Barbieri <[email protected]>
Date: Sat, 2 Jan 2010 18:55:50 -0200
Subject: [PATCH] notify manager property changed when system goes offline.

---
 src/profile.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/profile.c b/src/profile.c
index 04e260c..b7dc96f 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -77,6 +77,13 @@ static void offlinemode_changed(struct connman_profile *profile)
 	connman_dbus_property_changed_basic(profile->path,
 				CONNMAN_PROFILE_INTERFACE, "OfflineMode",
 				DBUS_TYPE_BOOLEAN, &profile->offlinemode);
+
+	if (profile != default_profile)
+		return;
+
+	connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
+				CONNMAN_MANAGER_INTERFACE, "OfflineMode",
+				DBUS_TYPE_BOOLEAN, &profile->offlinemode);
 }
 
 connman_bool_t __connman_profile_get_offlinemode(void)
-- 
1.6.0.4

From 2149664ffbd53ab63ad6dd5cfb653dc293be90f5 Mon Sep 17 00:00:00 2001
From: Gustavo Sverzut Barbieri <[email protected]>
Date: Sat, 2 Jan 2010 18:56:44 -0200
Subject: [PATCH] service: notify IPv4.Configuration property changed.

---
 src/service.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/service.c b/src/service.c
index a941f44..ddb9fcb 100644
--- a/src/service.c
+++ b/src/service.c
@@ -447,6 +447,15 @@ static void settings_changed(struct connman_service *service)
 							append_ipv4, service);
 }
 
+static void ipv4_configuration_changed(struct connman_service *service)
+{
+	connman_dbus_property_changed_dict(service->path,
+					CONNMAN_SERVICE_INTERFACE,
+							"IPv4.Configuration",
+							append_ipv4config,
+							service);
+}
+
 static DBusMessage *get_properties(DBusConnection *conn,
 					DBusMessage *msg, void *user_data)
 {
@@ -727,6 +736,8 @@ static DBusMessage *set_property(DBusConnection *conn,
 		if (err < 0)
 			return __connman_error_failed(msg, -err);
 
+		ipv4_configuration_changed(service);
+
 		__connman_storage_save_service(service);
 	} else
 		return __connman_error_invalid_property(msg);
-- 
1.6.0.4

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to