All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/2] serial: Add support to Disconnect fd passing connections
Date: Wed, 7 Sep 2011 10:50:15 +0300	[thread overview]
Message-ID: <CABBYNZ+wMVMQ=43dgZpPAXpP-17Tr4rdRHWjYqyKnARbn0SudQ@mail.gmail.com> (raw)
In-Reply-To: <20110906051657.GB13617@joana>

Hi Gustavo,

On Tue, Sep 6, 2011 at 8:16 AM, Gustavo Padovan <padovan@profusion.mobi> wr=
ote:
> * Luiz Augusto von Dentz <luiz.dentz@gmail.com> [2011-08-24 13:43:47 +030=
0]:
>
>> Hi Marcel,
>>
>> On Tue, Aug 23, 2011 at 10:51 PM, Marcel Holtmann <marcel@holtmann.org> =
wrote:
>> > Hi Luiz,
>> >
>> >> > This already fails today. Our code doesn't allow us to call twice t=
he Connect
>> >> > method, so we can't have two of the same UUID connected.
>> >>
>> >> Well with RFCOMM you can't really connect multiple times to the same
>> >> channel/UUID and if we return the same fd clients will probably have
>> >> conflicts.
>> >
>> > you can not connect the same channel twice (except in the other
>> > direction), that is true, but you can connect to a different channel
>> > with a different UUID. That is the reason why we also allow connection
>> > by handles. Or at least we should.
>>
>> You mean record handle? Currently we support connecting by UUID,
>> friendly name or channel.
>>
>> > So even if we would make this limitation of 1 connection per UUID, the
>> > API is a fully asymmetric then. You are suppose to disconnect with the
>> > result of the connect call. I do not like that at all. It is bad API
>> > design and we are trying to squeeze this in the wrong way.
>>
>> Currently we support disconnecting by UUID, friendly name, channel and
>> dev node. As you mentioned it doesn't really work for fd since it is
>> only unique per process, in the other hand the parameter is a pattern.
>>
>> Perhaps what we should be doing is to return a object path in
>> Serial.Connect e.g. [variable
>> prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serialXX then Disconnect
>> just get it as parameter, the drawback is that this does not return
>> the tty/fd immediately so we need another round-trip or return
>> multiple values to Connect.
>
> I've been discussing this with Johan and we came to two possible solution=
s.
> The first one is the similar as this one, with three functions:
>
> =A0 =A0 =A0 =A0handle, fd ConnectFD("pattern")
>
> =A0 =A0 =A0 =A0ConnectCancel(handle)
>
> =A0 =A0 =A0 =A0Disconnect(handle)
>
> And other with only ConnectFD() (and maybe ConnectCancel method). Disconn=
ect
> would be handled by the client with shutdown().
>
> I'm tempted to go with this last approach, it's simpler and easier. What =
do
> you think?

Yep, I guess the shutdown is the simplest one and I suppose we don't
have to keep any tracking/reference to the fd in bluetoothd it is up
to the client process to deal with the connection.


--=20
Luiz Augusto von Dentz

  reply	other threads:[~2011-09-07  7:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 17:19 [PATCH 1/2] serial: add Serial.ConnectFD() Gustavo F. Padovan
2011-08-22 17:19 ` [PATCH 2/2] serial: Add support to Disconnect fd passing connections Gustavo F. Padovan
2011-08-23 16:18   ` Marcel Holtmann
2011-08-23 16:28     ` Gustavo Padovan
2011-08-23 16:30       ` Marcel Holtmann
2011-08-23 16:45         ` Gustavo Padovan
2011-08-23 18:39           ` Luiz Augusto von Dentz
2011-08-23 18:52             ` Gustavo Padovan
2011-08-23 19:51             ` Marcel Holtmann
2011-08-24 10:43               ` Luiz Augusto von Dentz
2011-08-25 14:55                 ` Gustavo Padovan
2011-08-26  7:22                   ` Luiz Augusto von Dentz
2011-08-26 18:16                     ` Gustavo Padovan
2011-09-06  5:16                 ` Gustavo Padovan
2011-09-07  7:50                   ` Luiz Augusto von Dentz [this message]
2011-09-07 11:56                     ` Marcel Holtmann
2011-09-07 12:09                       ` Luiz Augusto von Dentz
2011-09-07 12:46                         ` Marcel Holtmann
2011-09-07 15:05                           ` Luiz Augusto von Dentz
2011-09-08 18:35                             ` Gustavo Padovan
2011-09-07 11:54                   ` Marcel Holtmann

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='CABBYNZ+wMVMQ=43dgZpPAXpP-17Tr4rdRHWjYqyKnARbn0SudQ@mail.gmail.com' \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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.