---
Hi,

Currently when setting tethering related properties, it does not send a 
PropertyChanged signal.
>From a client point of view it's not nice: either you believe the SetProperty 
>return success or 
after it you run a GetTechnologies again to be sure. I prefer having such 
signal, what do you think?
(at least it goes like all other properties)

Tomasz

 src/technology.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/technology.c b/src/technology.c
index 3fc7afc..d78e7b3 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -734,9 +734,17 @@ static DBusMessage *set_property(DBusConnection *conn,
                if (strlen(str) < 1 || strlen(str) > 32)
                        return __connman_error_invalid_arguments(msg);
 
-               g_free(technology->tethering_ident);
-               technology->tethering_ident = g_strdup(str);
-               technology_save(technology);
+               if (g_strcmp0(technology->tethering_ident, str) != 0) {
+                       g_free(technology->tethering_ident);
+                       technology->tethering_ident = g_strdup(str);
+                       technology_save(technology);
+
+                       connman_dbus_property_changed_basic(technology->path,
+                                               CONNMAN_TECHNOLOGY_INTERFACE,
+                                               "TetheringIdentifier",
+                                               DBUS_TYPE_STRING,
+                                               &technology->tethering_ident);
+               }
        } else if (g_str_equal(name, "TetheringPassphrase") == TRUE) {
                const char *str;
 
@@ -748,9 +756,17 @@ static DBusMessage *set_property(DBusConnection *conn,
                if (strlen(str) < 8 || strlen(str) > 63)
                        return __connman_error_passphrase_required(msg);
 
-               g_free(technology->tethering_passphrase);
-               technology->tethering_passphrase = g_strdup(str);
-               technology_save(technology);
+               if (g_strcmp0(technology->tethering_passphrase, str) != 0) {
+                       g_free(technology->tethering_passphrase);
+                       technology->tethering_passphrase = g_strdup(str);
+                       technology_save(technology);
+
+                       connman_dbus_property_changed_basic(technology->path,
+                                       CONNMAN_TECHNOLOGY_INTERFACE,
+                                       "TetheringPassphrase",
+                                       DBUS_TYPE_STRING,
+                                       &technology->tethering_passphrase);
+               }
        } else if (g_str_equal(name, "Powered") == TRUE) {
                connman_bool_t enable;
 
-- 
1.7.12

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to