Skip to contentSkip to conversation

core/gatt-client: Fix WriteValue always failing after first request

PATCH Applied Luiz Augusto von Dentz 1 participant 2 messages Sep 18, 2015 – Sep 19, 2015 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 core/gatt-client: Fix WriteValue always failing after first request

From: Luiz Augusto von Dentz <[email protected]>

WriteValue may use write without response proceduce in case it is supported but since that don't have any response write_id is left set after first request preventing blocking any new request.

---
 src/gatt-client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/gatt-client.c +3 -3
index 399133a..6c10a82 100644
@@ -946,11 +946,11 @@ static DBusMessage *characteristic_write_value(DBusConnection *conn,
 		goto fail;
 
 	supported = true;
-	chrc->write_id = bt_gatt_client_write_without_response(gatt,
+
+	if (bt_gatt_client_write_without_response(gatt,
 					chrc->value_handle,
 					chrc->props & BT_GATT_CHRC_PROP_AUTH,
-					value, value_len);
-	if (chrc->write_id)
+					value, value_len))
 		return dbus_message_new_method_return(msg);
 
 fail:
Signature · 1 line
2.4.3
author maintainer Applied
#1 lore raw

Hi,

Quoted 29 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

WriteValue may use write without response proceduce in case it is supported but since that don't have any response write_id is left set after first request preventing blocking any new request.

---
 src/gatt-client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/gatt-client.c +3 -4
index 399133a..6c10a82 100644
@@ -946,11 +946,11 @@ static DBusMessage *characteristic_write_value(DBusConnection *conn,
                goto fail;
 
        supported = true;
-       chrc->write_id = bt_gatt_client_write_without_response(gatt,
+
+       if (bt_gatt_client_write_without_response(gatt,
                                        chrc->value_handle,
                                        chrc->props & BT_GATT_CHRC_PROP_AUTH,
-                                       value, value_len);
-       if (chrc->write_id)
+                                       value, value_len))
                return dbus_message_new_method_return(msg);
 
 fail:
--
Quoted 1 line

2.4.3

Applied.

Signature · 1 line
Luiz Augusto von Dentz