linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
To: "João Paulo Rechi Vita" <jprvita@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org,
	Claudio Takahasi <claudio.takahasi@openbossa.org>
Subject: Re: [PATCH BlueZ v7 5/9] core: Queue discovery if scanning is active
Date: Thu, 27 Sep 2012 00:16:16 -0300	[thread overview]
Message-ID: <20120927031616.GA7630@echo> (raw)
In-Reply-To: <1348594686-26221-5-git-send-email-jprvita@openbossa.org>

Hi João, Claudio,

On 14:38 Tue 25 Sep, João Paulo Rechi Vita wrote:
> From: Claudio Takahasi <claudio.takahasi@openbossa.org>
> 
> This patch manages BR/EDR inquiry and BLE scanning discovery sessions.
> A scanning session is added in the discovery session list when there is
> a bonded device which requires re-connection.
> 
> bluetoothd decides if interleaved or scanning needs to be executed based
> on the queued discovery sessions. Interleaved discovery has higher
> priority, scanning only is executed when there is only a scanning
> session active.
> ---
>  src/adapter.c | 65 ++++++++++++++++++++++++++++++++++++++++++-----------------
>  1 file changed, 46 insertions(+), 19 deletions(-)
> 
> diff --git a/src/adapter.c b/src/adapter.c
> index 201e6a0..0a0ac8f 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -132,6 +132,7 @@ struct btd_adapter {
>  	GSList *devices;		/* Devices structure pointers */
>  	GSList *mode_sessions;		/* Request Mode sessions */
>  	GSList *disc_sessions;		/* Discovery sessions */
> +	struct session_req *scanning_session;
>  	GSList *connect_list;		/* Devices to connect when found */
>  	guint discov_id;		/* Discovery timer */
>  	gboolean discovering;		/* Discovery active */
> @@ -221,17 +222,18 @@ static struct session_req *create_session(struct btd_adapter *adapter,
>  					DBusMessage *msg, uint8_t mode,
>  					GDBusWatchFunction cb)
>  {
> -	const char *sender = dbus_message_get_sender(msg);
> +	const char *sender;
>  	struct session_req *req;
>  
>  	req = g_new0(struct session_req, 1);
>  	req->adapter = adapter;
> -	req->msg = dbus_message_ref(msg);
>  	req->mode = mode;
>  
> -	if (cb == NULL)
> +	if (cb == NULL || msg == NULL)
>  		return session_ref(req);

Sorry for taking so long to notice this, but there is a problem here.
'req->msg' is needed in 'set_mode_complete()' (around adapter.c:2329) even
when 'cb' is NULL: when setting the "Powered" or "Discoverable" property,
the session created doesn't have a 'cb' but it has a 'msg'.


[snip]


Cheers,
-- 
Vinicius

  reply	other threads:[~2012-09-27  3:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25 17:37 [PATCH BlueZ v7 1/9] core: Mutually exclude concurrent connections João Paulo Rechi Vita
2012-09-25 17:37 ` [PATCH BlueZ v7 2/9] mgmt: Add LE scanning callback João Paulo Rechi Vita
2012-09-27  7:43   ` Johan Hedberg
2012-09-28 14:27     ` Claudio Takahasi
2012-10-01  8:36       ` Johan Hedberg
2012-09-25 17:38 ` [PATCH BlueZ v7 3/9] core: Replace interleaved by LE scanning João Paulo Rechi Vita
2012-09-25 17:38 ` [PATCH BlueZ v7 4/9] core: Start LE scanning when a device requests João Paulo Rechi Vita
2012-09-25 17:38 ` [PATCH BlueZ v7 5/9] core: Queue discovery if scanning is active João Paulo Rechi Vita
2012-09-27  3:16   ` Vinicius Costa Gomes [this message]
2012-09-27 20:34     ` Joao Paulo Rechi Vita
2012-09-25 17:38 ` [PATCH BlueZ v7 6/9] core: Disable unnecessary auto connections João Paulo Rechi Vita
2012-09-25 17:38 ` [PATCH BlueZ v7 7/9] core: Re-connect for ECONNRESET or ECONNABORTED João Paulo Rechi Vita
2012-09-27  7:41   ` Johan Hedberg
2012-09-27 18:20     ` Claudio Takahasi
2012-09-25 17:38 ` [PATCH BlueZ v7 8/9] mgmt: Add address type to bonding debug message João Paulo Rechi Vita
2012-09-25 17:38 ` [PATCH BlueZ v7 9/9] core: Suspend scanning before connect on pairing João Paulo Rechi Vita
2012-09-27  7:42 ` [PATCH BlueZ v7 1/9] core: Mutually exclude concurrent connections Johan Hedberg
2012-09-27 20:31   ` Joao Paulo Rechi Vita

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=20120927031616.GA7630@echo \
    --to=vinicius.gomes@openbossa.org \
    --cc=claudio.takahasi@openbossa.org \
    --cc=jprvita@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /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).