summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2019-02-13 16:25:05 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2019-02-13 17:09:13 +0200
commitf12dc48511204eb0c7f1366fdb1421a39339ef9c (patch)
treedb160a30e863c67087bae12245fe0f7920dc513f /client
parent40ebc70dae281ff904af29d196f85befee9e03cd (diff)
downloadbluez-f12dc48511204eb0c7f1366fdb1421a39339ef9c.tar.gz
client: Forward notifications from cloned attributes
Notifications come in a form of 'Value' property changes thus this copies the values to the local attribute so they are in sync.
Diffstat (limited to 'client')
-rw-r--r--client/gatt.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/client/gatt.c b/client/gatt.c
index b24ebdc61..288aa0895 100644
--- a/client/gatt.c
+++ b/client/gatt.c
@@ -2915,6 +2915,23 @@ static void proxy_property_changed(GDBusProxy *proxy, const char *name,
DBusConnection *conn = bt_shell_get_env("DBUS_CONNECTION");
struct chrc *chrc = user_data;
+ bt_shell_printf("[" COLORED_CHG "] Attribute %s (%s) %s:\n",
+ chrc->path, bt_uuidstr_to_str(chrc->uuid), name);
+
+ if (!strcmp(name, "Value")) {
+ DBusMessageIter array;
+ uint8_t *value;
+ int len;
+
+ if (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_ARRAY) {
+ dbus_message_iter_recurse(iter, &array);
+ dbus_message_iter_get_fixed_array(&array, &value, &len);
+ write_value(&chrc->value_len, &chrc->value, value, len,
+ 0, chrc->max_val_len);
+ bt_shell_hexdump(value, len);
+ }
+ }
+
g_dbus_emit_property_changed(conn, chrc->path, CHRC_INTERFACE, name);
}