From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Petri Gynther <pgynther@google.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH 1/2] shared/gatt-client: Fix discover_primary_cb()
Date: Thu, 1 Dec 2016 22:46:42 +0200 [thread overview]
Message-ID: <CABBYNZ+EGhkLiSogD4U_fDSHFt5bfW2haAiGP8Okv6TuddyW9Q@mail.gmail.com> (raw)
In-Reply-To: <1480623362-49499-1-git-send-email-pgynther@google.com>
Hi Petri,
On Thu, Dec 1, 2016 at 10:16 PM, Petri Gynther <pgynther@google.com> wrote:
> Fix the handling of primary services discovery failure.
> ---
> src/shared/gatt-client.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
> index 4386692..84145e7 100644
> --- a/src/shared/gatt-client.c
> +++ b/src/shared/gatt-client.c
> @@ -1052,11 +1052,14 @@ static void discover_primary_cb(bool success, uint8_t att_ecode,
> "Primary service discovery failed."
> " ATT ECODE: 0x%02x", att_ecode);
> /* Reset error in case of not found */
> - if (BT_ATT_ERROR_ATTRIBUTE_NOT_FOUND) {
> + switch (att_ecode) {
> + case BT_ATT_ERROR_ATTRIBUTE_NOT_FOUND:
> success = true;
> att_ecode = 0;
> + goto secondary;
> + default:
> + goto done;
> }
> - goto secondary;
> }
>
> if (!result || !bt_gatt_iter_init(&iter, result)) {
> --
> 2.8.0.rc3.226.g39d4020
Looks like we had similar idea, although this is probably better as
other errors shall be cause the discovery to be interrupted.
--
Luiz Augusto von Dentz
next prev parent reply other threads:[~2016-12-01 20:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-01 20:16 [PATCH 1/2] shared/gatt-client: Fix discover_primary_cb() Petri Gynther
2016-12-01 20:16 ` [PATCH 2/2] shared/gatt-client: Fix discover_secondary_cb() Petri Gynther
2016-12-01 20:46 ` Luiz Augusto von Dentz [this message]
2016-12-02 11:53 ` [PATCH 1/2] shared/gatt-client: Fix discover_primary_cb() Luiz Augusto von Dentz
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=CABBYNZ+EGhkLiSogD4U_fDSHFt5bfW2haAiGP8Okv6TuddyW9Q@mail.gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=pgynther@google.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).