Skip to contentSkip to conversation

Remove useless error from StartNotify()

PATCH New Ahmed Alsharif 1 participant 2 messages Dec 30, 2017 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

cover Remove useless error from StartNotify()

StartNotify() should work regardless whether the device is connected or not, but it only returns an InProgress error when the device isn't, which is a bit inconsistent.

Ahmed Alsharif (1):
remove InProgress error from StartNotify() The error is only returned
when the device is not connected, even though StartNotify is supposed to work in that case as well.

 doc/gatt-api.txt  | 1 -
 src/gatt-client.c | 9 +++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 remove InProgress error from StartNotify() The error is only returned when the device is not connected, even though StartNotify is supposed to work in that case as well.

---
 doc/gatt-api.txt  | 1 -
 src/gatt-client.c | 9 +++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
doc/gatt-api.txt +0 -1
index ccf3a8b6d..681b1bd8f 100644
@@ -162,7 +162,6 @@ Methods		array{byte} ReadValue(dict options)
 
 			Possible Errors: org.bluez.Error.Failed
 					 org.bluez.Error.NotPermitted
-					 org.bluez.Error.InProgress
 					 org.bluez.Error.NotSupported
 
 		void StopNotify()
src/gatt-client.c +5 -4
index 2f01867dc..5efbaa5ed 100644
@@ -1521,12 +1521,13 @@ static DBusMessage *characteristic_start_notify(DBusConnection *conn,
 				chrc->props & BT_GATT_CHRC_PROP_INDICATE))
 		return btd_error_not_supported(msg);
 
-	/* Each client can only have one active notify session. */
+	/*
+	 * Each client can only have one active notify session. If the client
+	 * already has one, we just return with no error.
+	 */
 	client = queue_find(chrc->notify_clients, match_notify_sender, sender);
 	if (client)
-		return client->notify_id ?
-				g_dbus_create_reply(msg, DBUS_TYPE_INVALID) :
-				btd_error_in_progress(msg);
+		return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 
 	client = notify_client_create(chrc, sender);
 	if (!client)
Signature · 1 line
2.11.0