From: Jakub Pawlowski <jpawlowski@google.com>
To: linux-bluetooth@vger.kernel.org
Cc: Jakub Pawlowski <jpawlowski@google.com>
Subject: [PATCH v3 2/2] core/gatt-client: fix losing notifications
Date: Fri, 18 Sep 2015 00:46:43 -0700 [thread overview]
Message-ID: <1442562403-5176-2-git-send-email-jpawlowski@google.com> (raw)
In-Reply-To: <1442562403-5176-1-git-send-email-jpawlowski@google.com>
When notifications are quickly send to BlueZ, it tries to signal that
through dbus using g_dbus_emit_property_changed, which would merge all
changes and schedule sending property changed in g_iddle_add.
If the stream of notifications from device is fast enough, there might be
no iddle moment to send properties changed before next notification
arives, which would result in notifications being lost.
This patch fixes that by using method that sends properties changed
immediately, without waiting for iddle moment.
---
src/gatt-client.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gatt-client.c b/src/gatt-client.c
index 399133a..62ac03d 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -778,8 +778,9 @@ static void write_characteristic_cb(struct gatt_db_attribute *attr, int err,
if (err)
return;
- g_dbus_emit_property_changed(btd_get_dbus_connection(), chrc->path,
- GATT_CHARACTERISTIC_IFACE, "Value");
+ g_dbus_emit_property_changed_full(btd_get_dbus_connection(),
+ chrc->path, GATT_CHARACTERISTIC_IFACE, "Value", true);
+
}
static void chrc_read_cb(bool success, uint8_t att_ecode, const uint8_t *value,
--
2.5.0
next prev parent reply other threads:[~2015-09-18 7:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 7:46 [PATCH v3 1/2] gdbus: add method for immediate property update Jakub Pawlowski
2015-09-18 7:46 ` Jakub Pawlowski [this message]
2015-09-18 8:02 ` Johan Hedberg
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=1442562403-5176-2-git-send-email-jpawlowski@google.com \
--to=jpawlowski@google.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).