Benedek Kupper
Embedded Software Developer
epitome GmbH | The ICON Vienna, Tower 17, 10th
floor | Gertrude-Froehlich-Sandner-Strasse 2-4 | 1100 Vienna
benedek.kupper@xxxxxxxxxxx | www.epitome.inc | office-AT: +43 676 8967 6100
UID-ATU73252623 | FN: FN489535f, Handelsgericht Wien
|
The content of this e-mail is for information purposes and is intended
exclusively for the designated addressee. If you are not the intended
recipient of this e-mail or its representative, please note that any form of
disclosure, publication, reproduction or transmission of the contents of
this e-mail is prohibited. In this case, please contact the sender of the
e-mail. Thank you very much.
|
|
From 412a8a7b3f5b3cc3ef160f49648648a184210c18 Mon Sep 17 00:00:00 2001
From: Benedek Kupper <benedek.kupper@xxxxxxxxxxx>
Date: Thu, 22 Aug 2024 11:36:51 +0200
Subject: [PATCH] gatt-client: allow AcquireNotify when characteristic has
indicate flag
StartNotify / StopNotify already correctly allows usage when the
characteristic indicate is present (simplify this check though),
apply the same to AcquireNotify.
---
src/gatt-client.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/gatt-client.c b/src/gatt-client.c
index 8d83a9577..a67e04eee 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -1556,7 +1556,8 @@ static DBusMessage *characteristic_acquire_notify(DBusConnection *conn,
if (!queue_isempty(chrc->notify_clients))
return btd_error_in_progress(msg);
- if (!(chrc->props & BT_GATT_CHRC_PROP_NOTIFY))
+ if (!(chrc->props & (BT_GATT_CHRC_PROP_NOTIFY |
+ BT_GATT_CHRC_PROP_INDICATE)))
return btd_error_not_supported(msg);
client = notify_client_create(chrc, sender);
@@ -1601,8 +1602,8 @@ static DBusMessage *characteristic_start_notify(DBusConnection *conn,
if (chrc->notify_io)
return btd_error_not_permitted(msg, "Notify acquired");
- if (!(chrc->props & BT_GATT_CHRC_PROP_NOTIFY ||
- chrc->props & BT_GATT_CHRC_PROP_INDICATE))
+ if (!(chrc->props & (BT_GATT_CHRC_PROP_NOTIFY |
+ BT_GATT_CHRC_PROP_INDICATE)))
return btd_error_not_supported(msg);
/* Each client can only have one active notify session. */
--
2.34.1