aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/client.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2011-12-21 18:41:50 -0300
committerJohan Hedberg <johan.hedberg@intel.com>2011-12-27 12:05:20 +0200
commitd6f93380ff280cf5c0c09086135f4496dc6f8073 (patch)
treebeb69e34a2e28be88ab0c8a771b00cc3fb6b2368 /attrib/client.c
parentf583bef247cea1def6c78045fa623ed03b42cca5 (diff)
downloadbluez-d6f93380ff280cf5c0c09086135f4496dc6f8073.tar.gz
bluez-d6f93380ff280cf5c0c09086135f4496dc6f8073.tar.xz
bluez-d6f93380ff280cf5c0c09086135f4496dc6f8073.zip
attrib-client: Fix consecutive set value when disconnected
SetProperty for "Value" property needs to be queued when disconnected. Registering ATTIO connection callback does not mean that the link is established, GAttrib instance is assigned in the connection callback.
Diffstat (limited to 'attrib/client.c')
-rw-r--r--attrib/client.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/attrib/client.c b/attrib/client.c
index 380a288a..60cff016 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -420,15 +420,17 @@ static DBusMessage *set_value(DBusConnection *conn, DBusMessage *msg,
characteristic_set_value(chr, value, len);
- if (gatt->attioid == 0) {
+ if (gatt->attioid == 0)
gatt->attioid = btd_device_add_attio_callback(gatt->dev,
attio_connected,
attio_disconnected,
gatt);
- gatt->offline_chars = g_slist_append(gatt->offline_chars, chr);
- } else
+
+ if (gatt->attrib)
gatt_write_cmd(gatt->attrib, chr->handle, value, len,
NULL, NULL);
+ else
+ gatt->offline_chars = g_slist_append(gatt->offline_chars, chr);
return dbus_message_new_method_return(msg);
}