From: Marcin Kraglak <marcin.kraglak@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] android/gatt: Fix not sending confirmation while receiving indication
Date: Wed, 9 Apr 2014 11:22:40 +0200 [thread overview]
Message-ID: <1397035360-32680-1-git-send-email-marcin.kraglak@tieto.com> (raw)
Send confirmation after receiving indication.
---
android/gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/android/gatt.c b/android/gatt.c
index a33ce25..a4c5026 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -2355,6 +2355,18 @@ static void handle_notification(const uint8_t *pdu, uint16_t len,
ev->len = len - data_offset;
memcpy(ev->value, pdu + data_offset, len - data_offset);
+ if (!ev->is_notify) {
+ uint8_t *res;
+ uint16_t len;
+ size_t plen;
+
+ res = g_attrib_get_buffer(notification->dev->attrib, &plen);
+ len = enc_confirmation(res, plen);
+ if (len > 0)
+ g_attrib_send(notification->dev->attrib, 0, res, len,
+ NULL, NULL, NULL);
+ }
+
ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT, HAL_EV_GATT_CLIENT_NOTIFY,
sizeof(*ev) + ev->len, ev);
}
--
1.8.5.3
next reply other threads:[~2014-04-09 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 9:22 Marcin Kraglak [this message]
2014-04-10 9:29 ` [PATCH] android/gatt: Fix not sending confirmation while receiving indication Szymon Janc
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=1397035360-32680-1-git-send-email-marcin.kraglak@tieto.com \
--to=marcin.kraglak@tieto.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