From: Szymon Janc <szymon.janc@gmail.com>
To: Marcin Kraglak <marcin.kraglak@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv2 02/11] android/gatt: Add helper to get client by id
Date: Thu, 27 Mar 2014 22:49:31 +0100 [thread overview]
Message-ID: <5391615.38ozq05xKo@athlon> (raw)
In-Reply-To: <1395954789-32459-2-git-send-email-marcin.kraglak@tieto.com>
Hi Marcin,
On Thursday 27 March 2014 22:13:00 Marcin Kraglak wrote:
> It will look for gatt_client by client_id.
> ---
> android/gatt.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/android/gatt.c b/android/gatt.c
> index 7a3db27..1af7e33 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -148,6 +148,11 @@ static bool match_client_by_id(const void *data, const
> void *user_data) return client->id == exp_id;
> }
>
> +static struct gatt_client *find_client_by_id(int32_t id)
> +{
> + return queue_find(gatt_clients, match_client_by_id, INT_TO_PTR(id));
> +}
> +
> static bool match_by_value(const void *data, const void *user_data)
> {
> return data == user_data;
> @@ -628,8 +633,7 @@ static void handle_client_scan(const void *buf, uint16_t
> len)
>
> DBG("new state %d", cmd->start);
>
> - registered = queue_find(gatt_clients, match_client_by_id,
> - INT_TO_PTR(cmd->client_if));
> + registered = find_client_by_id(cmd->client_if);
> if (!registered) {
> error("gatt: Client not registered");
> status = HAL_STATUS_FAILED;
> @@ -736,8 +740,7 @@ static void handle_client_connect(const void *buf,
> uint16_t len) DBG("");
>
> /* Check if client is registered */
> - l = queue_find(gatt_clients, match_client_by_id,
> - INT_TO_PTR(cmd->client_if));
> + l = find_client_by_id(cmd->client_if);
> if (!l) {
> error("gatt: Client id %d not found", cmd->client_if);
> status = HAL_STATUS_FAILED;
This patch is now applied, thanks.
--
Szymon K. Janc
szymon.janc@gmail.com
next prev parent reply other threads:[~2014-03-27 21:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 21:12 [PATCHv2 01/11] android/gatt: Add helper for getting device by conn_id Marcin Kraglak
2014-03-27 21:13 ` [PATCHv2 02/11] android/gatt: Add helper to get client by id Marcin Kraglak
2014-03-27 21:49 ` Szymon Janc [this message]
2014-03-27 21:13 ` [PATCHv2 03/11] android/gatt: Service error when client cannot be created Marcin Kraglak
2014-03-27 21:46 ` Szymon Janc
2014-03-27 21:13 ` [PATCHv2 04/11] android/gatt: Add initial implementation of get_included_service Marcin Kraglak
2014-03-27 21:57 ` Szymon Janc
2014-03-27 21:13 ` [PATCHv2 05/11] android/gatt: Add get_included_data struct and callback Marcin Kraglak
2014-03-27 21:13 ` [PATCHv2 06/11] android/gatt: Add implementation of get_included_cb Marcin Kraglak
2014-03-27 22:04 ` Szymon Janc
2014-03-27 21:13 ` [PATCHv2 07/11] android/gatt: Add notifications list to gatt_client Marcin Kraglak
2014-03-27 22:10 ` Szymon Janc
2014-03-27 21:13 ` [PATCHv2 08/11] android/gatt: Add initial implementation of register_for_notification Marcin Kraglak
2014-03-27 22:20 ` Szymon Janc
2014-03-27 21:13 ` [PATCHv2 09/11] android/gatt: Add client_register_for_notif_cb function Marcin Kraglak
2014-03-27 22:25 ` Szymon Janc
2014-03-27 21:13 ` [PATCHv2 10/11] android/gatt: Add handler for ATT_OP_HANDLE_NOTIFY and ATT_OP_HANDLE_IND Marcin Kraglak
2014-03-27 22:32 ` Szymon Janc
2014-03-27 21:13 ` [PATCHv2 11/11] android/gatt: Add deregister_for_notification implementation Marcin Kraglak
2014-03-27 22:50 ` Szymon Janc
2014-03-27 21:33 ` [PATCHv2 01/11] android/gatt: Add helper for getting device by conn_id Szymon Janc
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=5391615.38ozq05xKo@athlon \
--to=szymon.janc@gmail.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 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.