All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 1/2] gatt: Print error if gatt_db_attribut_notify fails
Date: Mon, 14 Mar 2022 14:50:09 -0700	[thread overview]
Message-ID: <20220314215010.23822-1-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This prints an error if gatt_db_attribut_notify fails.
---
 src/gatt-database.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gatt-database.c b/src/gatt-database.c
index 485af04ea..d6c94058c 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -1523,8 +1523,9 @@ static void send_service_changed(struct btd_gatt_database *database,
 	put_le16(start, value);
 	put_le16(end, value + 2);
 
-	gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value),
-				NULL);
+	if (!gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value),
+								NULL))
+		error("Failed to notify Service Changed");
 }
 
 static void gatt_db_service_added(struct gatt_db_attribute *attrib,
@@ -3967,6 +3968,7 @@ void btd_gatt_database_restore_svc_chng_ccc(struct btd_gatt_database *database)
 	put_le16(0x0001, value);
 	put_le16(0xffff, value + 2);
 
-	gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value),
-				NULL);
+	if (!gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value),
+								NULL))
+		error("Failed to notify Service Changed");
 }
-- 
2.35.1


             reply	other threads:[~2022-03-14 21:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 21:50 Luiz Augusto von Dentz [this message]
2022-03-14 21:50 ` [PATCH BlueZ 2/2] gatt-db: Fix gatt_db_attribute_notify Luiz Augusto von Dentz
2022-03-14 23:40 ` [PATCH BlueZ 1/2] gatt: Print error if gatt_db_attribut_notify fails patchwork-bot+bluetooth
2022-03-15  0:15 ` [BlueZ,1/2] " bluez.test.bot

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=20220314215010.23822-1-luiz.dentz@gmail.com \
    --to=luiz.dentz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.