Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Mariusz Skamra <mariusz.skamra@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv2] android/gatt: Fix missing error response to find by type value request
Date: Thu, 11 Dec 2014 14:30:36 +0100	[thread overview]
Message-ID: <1502650.D3eWmbCRKv@uw000953> (raw)
In-Reply-To: <1418222421-6049-1-git-send-email-mariusz.skamra@tieto.com>

Hi Mariusz,

On Wednesday 10 of December 2014 15:40:21 Mariusz Skamra wrote:
> This patch fixes Find By Type Value Request issue.
> When the attribute queue is empty, error response should be sent.
> ---
>  android/gatt.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index b2ce9c1..58bc22d 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -6189,6 +6189,17 @@ static uint8_t find_by_type_request(const uint8_t *cmd, uint16_t cmd_len,
>  
>  	gatt_db_find_by_type(gatt_db, start, end, &uuid, q);
>  
> +	if (queue_isempty(q)) {
> +		size_t mtu;
> +		uint8_t *rsp = g_attrib_get_buffer(device->attrib, &mtu);
> +
> +		len = enc_error_resp(ATT_OP_FIND_BY_TYPE_REQ, start,
> +					ATT_ECODE_ATTR_NOT_FOUND, rsp, mtu);
> +		g_attrib_send(device->attrib, 0, rsp, len, NULL, NULL, NULL);
> +		queue_destroy(q, NULL);
> +		return 0;
> +	}
> +
>  	while (queue_peek_head(q)) {
>  		struct gatt_db_attribute *attrib = queue_pop_head(q);
>  		struct pending_request *data;
> 

Patch applied, thanks.

-- 
Best regards, 
Szymon Janc

      reply	other threads:[~2014-12-11 13:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10 14:40 [PATCHv2] android/gatt: Fix missing error response to find by type value request Mariusz Skamra
2014-12-11 13:30 ` 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=1502650.D3eWmbCRKv@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mariusz.skamra@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