[PATCH BlueZ 2/2] Fix consecutive set value when disconnected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 attrib/client.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/attrib/client.c b/attrib/client.c
index 5f1e6ce..4c8474c 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);
 }
-- 
1.7.8

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux