From: Szymon Janc <szymon.janc@gmail.com>
To: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org, szymon.janc@tieto.com
Subject: Re: [PATCH] android/gatt: Fix handling write cmd.
Date: Tue, 20 May 2014 23:56:43 +0200 [thread overview]
Message-ID: <1968899.besIGN6Gpp@athlon> (raw)
In-Reply-To: <1400582569-30934-1-git-send-email-lukasz.rymanowski@tieto.com>
Hi Łukasz,
On Tuesday 20 May 2014 12:42:49 Lukasz Rymanowski wrote:
> We should not response on write cmd. This patch fixed that.
> ---
> android/gatt.c | 17 ++++++-----------
> 1 file changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/android/gatt.c b/android/gatt.c
> index 8e0d72a..36a1a7a 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -4648,7 +4648,7 @@ static uint8_t find_by_type_request(const uint8_t
> *cmd, uint16_t cmd_len, return 0;
> }
>
> -static uint8_t write_cmd_request(const uint8_t *cmd, uint16_t cmd_len,
> +static void write_cmd_request(const uint8_t *cmd, uint16_t cmd_len,
> struct gatt_device *dev)
> {
> uint8_t value[ATT_DEFAULT_LE_MTU];
> @@ -4658,13 +4658,9 @@ static uint8_t write_cmd_request(const uint8_t *cmd,
> uint16_t cmd_len,
>
> len = dec_write_cmd(cmd, cmd_len, &handle, value, &vlen);
> if (!len)
> - return ATT_ECODE_INVALID_PDU;
> -
> - if (!gatt_db_write(gatt_db, handle, 0, value, vlen, cmd[0],
> - &dev->bdaddr))
> - return ATT_ECODE_UNLIKELY;
> + return;
>
> - return 0;
> + gatt_db_write(gatt_db, handle, 0, value, vlen, cmd[0], &dev->bdaddr);
> }
>
> static uint8_t write_req_request(const uint8_t *cmd, uint16_t cmd_len,
> @@ -4750,10 +4746,9 @@ static void att_handler(const uint8_t *ipdu, uint16_t
> len, gpointer user_data) return;
> break;
> case ATT_OP_WRITE_CMD:
> - status = write_cmd_request(ipdu, len, dev);
> - if (!status)
> - return;
> - break;
> + write_cmd_request(ipdu, len, dev);
> + /* No response on write cmd */
> + return;
> case ATT_OP_PREP_WRITE_REQ:
> status = write_prep_request(ipdu, len, dev);
> if (!status)
Patch applied, thanks.
--
Szymon K. Janc
szymon.janc@gmail.com
prev parent reply other threads:[~2014-05-20 21:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 10:42 [PATCH] android/gatt: Fix handling write cmd Lukasz Rymanowski
2014-05-20 21:56 ` 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=1968899.besIGN6Gpp@athlon \
--to=szymon.janc@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=lukasz.rymanowski@tieto.com \
--cc=szymon.janc@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 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.