All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ] profile: Create a service for incomming connections
Date: Fri, 3 May 2013 07:36:02 +0300	[thread overview]
Message-ID: <20130503043602.GA3742@x220> (raw)
In-Reply-To: <1367533776-3987-1-git-send-email-vinicius.gomes@openbossa.org>

Hi Vinicius,

On Thu, May 02, 2013, Vinicius Costa Gomes wrote:
> diff --git a/src/profile.c b/src/profile.c
> index 0500983..2c35dc7 100644
> --- a/src/profile.c
> +++ b/src/profile.c
> @@ -1045,6 +1045,7 @@ static struct ext_io *create_conn(struct ext_io *server, GIOChannel *io,
>  {
>  	struct btd_device *device;
>  	struct ext_io *conn;
> +	struct btd_profile *profile;
>  	GIOCondition cond;
>  
>  	conn = g_new0(struct ext_io, 1);
> @@ -1052,11 +1053,14 @@ static struct ext_io *create_conn(struct ext_io *server, GIOChannel *io,
>  	conn->proto = server->proto;
>  	conn->ext = server->ext;
>  	conn->adapter = btd_adapter_ref(server->adapter);
> +	profile = &server->ext->p;
>  
>  	device = adapter_find_device(server->adapter, dst);
>  
> -	if (device)
> +	if (device) {
>  		conn->device = btd_device_ref(device);
> +		conn->service = service_create(device, profile);
> +	}
>  
>  	cond = G_IO_HUP | G_IO_ERR | G_IO_NVAL;
>  	conn->io_id = g_io_add_watch(io, cond, ext_io_disconnected, conn);

How would the service show up in the list of services for the device
object in question? To me it seems like src/device.c is the only place
that should be calling service_create because of this. What does seem to
be missing in profile.c is a call to btd_device_add_uuid for unexpected
connections from a device which we did not yet know to support a certain
UUID. The btd_device_add_uuid function should cause a new service to be
created, but it may not yet be enough to get the service to be assigned
to conn in profile.c.

Johan

  reply	other threads:[~2013-05-03  4:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 22:29 [PATCH BlueZ] profile: Create a service for incomming connections Vinicius Costa Gomes
2013-05-03  4:36 ` Johan Hedberg [this message]
2013-05-06 17:23   ` Vinicius Gomes
2013-05-07  7:34     ` Mikel Astiz

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=20130503043602.GA3742@x220 \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=vinicius.gomes@openbossa.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 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.