All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>,
	Marcel Holtmann <marcel@holtmann.org>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 5/6] Bluetooth: mgmt: Add support for switching to LE peripheral mode
Date: Thu, 25 Oct 2012 14:48:17 +0300	[thread overview]
Message-ID: <20121025114817.GA2197@x220> (raw)
In-Reply-To: <CAJdJm_Odk8_8dLjcYw9kfr+CCD0Q0bNgu9duhRo6oKXYAo9cKA@mail.gmail.com>

Hi Lizardo,

On Thu, Oct 25, 2012, Anderson Lizardo wrote:
> On Thu, Oct 25, 2012 at 3:50 AM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> > Hi Vinicius,
> >
> > On Thu, Oct 25, 2012, Vinicius Costa Gomes wrote:
> >> So, what information will we use to set the advertising type and the
> >> Flags field in the advertising event (think general/limited
> >> discoverable modes)?
> >
> > Take a look at the create_ad() function in the last patch of this set.
> > Setting the right flags value is really quite simple. The advertising
> > type could be selected in a similar way, i.e. through hdev->dev_flags.
> 
> I don't see any use now, but "actual" LE peripherals allow to use
> directed advertising when for instance, they need to send an ATT
> notification just to a specific device, and not let anyone else
> connect to them. Do you see an easy way of selecting an specific
> device to advertise to?
> 
> The issue here is that once LE Peripheral is enabled, any device can
> connect to you (e.g. other previously bonded devices will for sure
> attempt to reconnect). If you want to be connected by a specific
> device, you need to use directed advertising from the beginning.

This will need some more thinking. We could add a new mgmt command for
that, or if you wanna go crazy why not map this to the L2CAP socket
interface's connect() system call. I.e. if LE GAP is in peripheral mode
instead of doing HCI_LE_Create_Connection or just failing with "not
allowed" a socket connect() would simply trigger directed advertising to
the device in question and deliver the successful connection in the same
way as a central role triggered connect would do (unless we time out
waiting for the remote device to connect). Now that I think of this
second option it actually sounds quite natural and not so crazy after
all :)

> Also is LE advertising re-enabled when a connection is established
> (remember it is disabled automatically by the controller after
> connection is established)? And after an HCI Reset ?

The "after a connection" part is still missing and I'll have that as a
separate patch not to grow the already quite big patch. As for reset,
right now that's only sent when power-cycling the adapter and the HCI
init sequence then takes care of enabling advertising.

Johan

  reply	other threads:[~2012-10-25 11:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24 21:09 [PATCH 0/6] Bluetooth: Some fixes and full peripheral role support Johan Hedberg
2012-10-24 21:09 ` [PATCH 1/6] Bluetooth: Fix setting host feature bits for SSP Johan Hedberg
2012-10-24 21:45   ` Marcel Holtmann
2012-10-24 21:09 ` [PATCH 2/6] Bluetooth: Fix sending unnecessary HCI_Write_SSP_Mode command Johan Hedberg
2012-10-24 21:48   ` Marcel Holtmann
2012-10-24 21:09 ` [PATCH 3/6] Bluetooth: Fix sending unnecessary HCI_LE_Host_Enable Johan Hedberg
2012-10-24 21:48   ` Marcel Holtmann
2012-10-25 15:05   ` Gustavo Padovan
2012-10-25 15:07     ` Marcel Holtmann
2012-10-25 15:14       ` Johan Hedberg
2012-10-25 15:20         ` Gustavo Padovan
2012-10-24 21:09 ` [PATCH 4/6] Bluetooth: Fix unnecessary EIR update during powering on Johan Hedberg
2012-10-24 21:49   ` Marcel Holtmann
2012-10-25 15:08   ` Gustavo Padovan
2012-10-24 21:09 ` [PATCH 5/6] Bluetooth: mgmt: Add support for switching to LE peripheral mode Johan Hedberg
2012-10-24 22:13   ` Vinicius Costa Gomes
2012-10-24 22:36     ` Johan Hedberg
2012-10-25  0:58       ` Vinicius Costa Gomes
2012-10-25  1:54         ` Marcel Holtmann
2012-10-25  4:56           ` Vinicius Costa Gomes
2012-10-25  7:50             ` Johan Hedberg
2012-10-25 10:41               ` Anderson Lizardo
2012-10-25 11:48                 ` Johan Hedberg [this message]
2012-10-25 12:04                   ` Johan Hedberg
2012-10-25 14:31                     ` Vinicius Costa Gomes
2012-10-25 15:07                       ` Johan Hedberg
2012-10-25 18:48                         ` Vinicius Costa Gomes
2012-10-24 21:09 ` [PATCH 6/6] Bluetooth: Add support for setting LE advertising data Johan Hedberg
2012-10-24 21:53 ` [PATCH 0/6] Bluetooth: Some fixes and full peripheral role support 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=20121025114817.GA2197@x220 \
    --to=johan.hedberg@gmail.com \
    --cc=anderson.lizardo@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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.