From: Szymon Janc <szymon.janc@tieto.com>
To: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v3 1/6] android/gatt: Add API to remove autoconnect GATT based device
Date: Fri, 05 Sep 2014 11:11:51 +0200 [thread overview]
Message-ID: <8060157.bhBlHtOcd8@uw000953> (raw)
In-Reply-To: <1409755353-6027-1-git-send-email-lukasz.rymanowski@tieto.com>
Hi Łukasz,
On Wednesday 03 of September 2014 16:42:28 Lukasz Rymanowski wrote:
> ---
> v2: Fixed issue found by Szymon
> v3: Fixes according to Luiz comments
>
> android/gatt.c | 24 ++++++++++++++++++++++++
> android/gatt.h | 1 +
> 2 files changed, 25 insertions(+)
>
> diff --git a/android/gatt.c b/android/gatt.c
> index aff5dc5..a3486ca 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -6768,3 +6768,27 @@ bool bt_gatt_add_autoconnect(unsigned int id, const bdaddr_t *addr)
>
> return true;
> }
> +
> +void bt_gatt_remove_autoconnect(unsigned int id, const bdaddr_t *addr)
> +{
> + struct gatt_device *dev;
> +
> + DBG("");
> +
> + dev = find_device_by_addr(addr);
> + if (!dev) {
> + error("gatt: Device not found");
> + return;
> + }
> +
> + queue_remove(dev->autoconnect_apps, INT_TO_PTR(id));
> +
> + if (queue_isempty(dev->autoconnect_apps)) {
> + bt_auto_connect_remove(addr);
> +
> + if (dev->state == DEVICE_CONNECT_INIT)
> + device_set_state(dev, DEVICE_DISCONNECTED);
> +
> + device_unref(dev);
> + }
> +}
> diff --git a/android/gatt.h b/android/gatt.h
> index 40699b2..3382df9 100644
> --- a/android/gatt.h
> +++ b/android/gatt.h
> @@ -40,3 +40,4 @@ bool bt_gatt_connect_app(unsigned int id, const bdaddr_t *addr);
> bool bt_gatt_disconnect_app(unsigned int id, const bdaddr_t *addr);
> bool bt_gatt_set_security(const bdaddr_t *bdaddr, int sec_level);
> bool bt_gatt_add_autoconnect(unsigned int id, const bdaddr_t *addr);
> +void bt_gatt_remove_autoconnect(unsigned int id, const bdaddr_t *addr);
Patches 1-5 are now applied. 6th requires rebase, thanks.
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-09-05 9:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 14:42 [PATCH v3 1/6] android/gatt: Add API to remove autoconnect GATT based device Lukasz Rymanowski
2014-09-03 14:42 ` [PATCH v3 2/6] android/gatt: Unsubscribe from autoconnect on unregister Lukasz Rymanowski
2014-09-03 14:42 ` [PATCH v3 3/6] android/gatt: Extract remove_autoconnect_device helper Lukasz Rymanowski
2014-09-03 14:42 ` [PATCH v3 4/6] android/gatt: Make sure GATT will reconnect after disconnection Lukasz Rymanowski
2014-09-03 14:42 ` [PATCH v3 5/6] android/gatt: Remove device from white list on device destroy Lukasz Rymanowski
2014-09-03 14:42 ` [PATCH v3 6/6] android/hidhost: Remove reconnect logic Lukasz Rymanowski
2014-09-05 9:11 ` 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=8060157.bhBlHtOcd8@uw000953 \
--to=szymon.janc@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=lukasz.rymanowski@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;
as well as URLs for NNTP newsgroup(s).