linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/1] Remove useless error from StartNotify()
@ 2017-12-30 10:07 Ahmed Alsharif
  2017-12-30 10:07 ` [PATCH BlueZ 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 Ahmed Alsharif
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmed Alsharif @ 2017-12-30 10:07 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ahmed Alsharif

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(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH BlueZ 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.
  2017-12-30 10:07 [PATCH BlueZ 0/1] Remove useless error from StartNotify() Ahmed Alsharif
@ 2017-12-30 10:07 ` Ahmed Alsharif
  0 siblings, 0 replies; 2+ messages in thread
From: Ahmed Alsharif @ 2017-12-30 10:07 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ahmed Alsharif

---
 doc/gatt-api.txt  | 1 -
 src/gatt-client.c | 9 +++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/gatt-api.txt b/doc/gatt-api.txt
index ccf3a8b6d..681b1bd8f 100644
--- a/doc/gatt-api.txt
+++ b/doc/gatt-api.txt
@@ -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()
diff --git a/src/gatt-client.c b/src/gatt-client.c
index 2f01867dc..5efbaa5ed 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -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)
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-30 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-30 10:07 [PATCH BlueZ 0/1] Remove useless error from StartNotify() Ahmed Alsharif
2017-12-30 10:07 ` [PATCH BlueZ 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 Ahmed Alsharif

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).