Re: [PATCH BlueZ v7 5/9] core: Queue discovery if scanning is active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi João, Claudio,

On 14:38 Tue 25 Sep, João Paulo Rechi Vita wrote:
> From: Claudio Takahasi <claudio.takahasi@xxxxxxxxxxxxx>
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux