From: Szymon Janc <szymon.janc@tieto.com>
To: Marcin Kraglak <marcin.kraglak@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] android/gatt: Fix sending incorrect frames
Date: Wed, 09 Jul 2014 11:31:52 +0200 [thread overview]
Message-ID: <4147685.7A3m3PkMs2@uw000953> (raw)
In-Reply-To: <1404896033-17337-1-git-send-email-marcin.kraglak@tieto.com>
Hi Marcin,
On Wednesday 09 of July 2014 10:53:52 Marcin Kraglak wrote:
> Don't send pdu if encoding failed. It cause errors when trying
> send notification larger than MTU - encoding pdu failed, and
> length passed to g_attrib_send was 0. I caused errors.
> ---
> android/gatt.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/android/gatt.c b/android/gatt.c
> index 2ee2d05..cccf23e 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -4884,9 +4884,14 @@ static void handle_server_send_indication(const void *buf, uint16_t len)
> (uint8_t *)cmd->value, cmd->len,
> pdu, mtu);
>
> - g_attrib_send(conn->device->attrib, 0, pdu, length, NULL, NULL, NULL);
> -
> - status = HAL_STATUS_SUCCESS;
> + if (length == 0) {
> + error("gatt: Failed to encode indication");
> + status = HAL_STATUS_FAILED;
> + } else {
> + g_attrib_send(conn->device->attrib, 0, pdu, length, NULL, NULL,
> + NULL);
> + status = HAL_STATUS_SUCCESS;
> + }
>
> reply:
> ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT,
>
Both patches applied, thanks.
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-07-09 9:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 8:53 [PATCH 1/2] android/gatt: Fix sending incorrect frames Marcin Kraglak
2014-07-09 8:53 ` [PATCH 2/2] android/gatt: Set need_resp flag in when received PREP_WRITE_REQ Marcin Kraglak
2014-07-09 9:31 ` Szymon Janc [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=4147685.7A3m3PkMs2@uw000953 \
--to=szymon.janc@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcin.kraglak@tieto.com \
/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