linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: mike tsai <mikeyhtsai@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Fix Read-Not-Permit in char discovery
Date: Wed, 11 Jan 2012 13:28:54 +0200	[thread overview]
Message-ID: <20120111112854.GA23670@x220> (raw)
In-Reply-To: <CAE-CKuhSu6EdLSLio8HcorP+cwAo3-ByMwSxJEMc7BefhC_Sdw@mail.gmail.com>

Hi,

On Thu, Jul 21, 2011, mike tsai wrote:
> Hi,
>      This patch reads the discovered characteristic's property to
> determine if Read is permitted before sending read request. This
> avoids the error response from server as "read not permitted".
> 
>  ---
>  attrib/client.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/attrib/client.c b/attrib/client.c
> index 1ef2699..f345a9e 100644
> --- a/attrib/client.c
> +++ b/attrib/client.c
> @@ -850,6 +850,8 @@ static void update_all_chars(gpointer data,
> gpointer user_data)
>  	struct primary *prim = user_data;
>  	struct gatt_service *gatt = prim->gatt;
> 
> +	if (chr->perm & ATT_CHAR_PROPER_READ)
> +	{
>  	qdesc = g_new0(struct query_data, 1);
>  	qdesc->prim = prim;
>  	qdesc->chr = chr;
> @@ -864,8 +866,8 @@ static void update_all_chars(gpointer data,
> gpointer user_data)
> 
>  	gatt->attrib = g_attrib_ref(gatt->attrib);
>  	gatt_read_char(gatt->attrib, chr->handle, 0, update_char_value, qvalue);
> +	}
>  }
> -
>  static void char_discovered_cb(GSList *characteristics, guint8 status,

Besides the obvious coding-style issue, is this patch still valid?

Johan

  reply	other threads:[~2012-01-11 11:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21 18:19 [PATCH] Fix Read-Not-Permit in char discovery mike tsai
2012-01-11 11:28 ` Johan Hedberg [this message]
2012-01-11 14:29   ` Vinicius Costa Gomes

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=20120111112854.GA23670@x220 \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mikeyhtsai@gmail.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;
as well as URLs for NNTP newsgroup(s).