From: Ahmed Alsharif <ahmeds2000x@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Ahmed Alsharif <ahmeds2000x@gmail.com>
Subject: [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.
Date: Sat, 30 Dec 2017 11:07:02 +0100 [thread overview]
Message-ID: <20171230100702.14124-2-ahmeds2000x@gmail.com> (raw)
In-Reply-To: <20171230100702.14124-1-ahmeds2000x@gmail.com>
---
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
prev parent reply other threads:[~2017-12-30 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-30 10:07 [PATCH BlueZ 0/1] Remove useless error from StartNotify() Ahmed Alsharif
2017-12-30 10:07 ` Ahmed Alsharif [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171230100702.14124-2-ahmeds2000x@gmail.com \
--to=ahmeds2000x@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).