All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Grandel <fgrandel@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Multi-Advertising: implementation options, timing questions
Date: Sat, 28 Mar 2015 07:45:00 +0100	[thread overview]
Message-ID: <55164DEC.6070009@gmail.com> (raw)
In-Reply-To: <0B4D986A-2913-46C0-8EB2-53EE29C67739@holtmann.org>

On 03/28/2015 01:01 AM, Marcel Holtmann wrote:
> the kernel side has currently only support for 1 advertising
> instance. That needs to be fixed or you need to do the rotation in
> the HAL and fake it that way. Ideally you do that in the kernel since
> it has better control over the hardware than userspace ever will be.
> However it would work by faking it in the HAL.

If I'm not mistaken then bluez kernel drivers rely exclusively on 
standard HCI commands in communicating with bluetooth hardware.

Multi-advertising doesn't seem to be a standard HCI procedure, though. 
It rather seems to be a (broadcom?) vendor-specific addition we cannot 
rely on in general. I didn't find any good documentation on vendor 
specific HCI command sets either. Do you have something there?

Please correct me if I'm on the wrong track, but doesn't that mean that 
we have to emulate multi-advertising in any case, even if it was in the 
kernel?

As the new advertising mgmt api already has been designed with multiple 
advertising instances in mind it seems a natural choice to implement the 
multi-advertising emulation in the mgmt layer. But as I'm a complete 
bluetooth/bluez newbie, I might be completely mistaken here.

What I'm wondering about are the implementation options we have for the 
emulation, especially when it comes to timing. How would we schedule 
advertisement data updates wrt min/max advertising intervals?

If we maintain the current advertising instance data structure with 
separate advertising interval settings per instance then I'd expect 
advertisement events to interleave somehow like this:

advEvt1
|xxx|................|---|xxx|................|---|xxx|...
  advInt1            advDelay

         advEvt2
....|---|xxx|................|---|xxx|................|---
          advInt2

                advEvt3
............|---|xxx|....................................|---|xxx|..
                  advInt3

Advertisement intervals would have to be multiples of a common factor to 
avoid event collisions. And the interval would have to be long enough to 
fit all instances into one cycle.

Alternatively we could schedule adv evts with a common adv interval like 
this:

advEvt1                 advEvt2                  advEvt3
|xxx|................|---|xxx|................|---|xxx|...
        advInt      advDelay

I'd be in favor of the first solution which more closely emulates the 
existence of independent peripheral devices sharing a common physical 
adv channel.

(compare BT Core Spec 4.x, Vol 6, Part B, 4.4.2.2)

What I really wonder about, though, is how we'd be able to implement 
such a timing scheme with nothing but the standard HCI API. How quickly 
and reliably does the hardware respond to a large number of HCI calls as 
would be required here? Does it really make sense to implement such a 
low-level aspect of the protocol in the mgmt api code? What other 
options do we have? I'm probably making things too complicated...

Florian

  reply	other threads:[~2015-03-28  6:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 23:51 Nexus 4 in BLE peripheral role with bluez stack Florian Grandel
2015-03-28  0:01 ` Marcel Holtmann
2015-03-28  6:45   ` Florian Grandel [this message]
2015-03-28  6:57     ` Multi-Advertising: implementation options, timing questions Marcel Holtmann
2015-03-28 13:32       ` Florian Grandel
2015-03-28 20:18         ` Arman Uguray
2015-03-29 23:23           ` Florian Grandel
2015-03-30  0:48             ` Marcel Holtmann
2015-03-30 17:23               ` Jakub Pawlowski
2015-03-30 17:44                 ` Arman Uguray
2015-03-30 18:04                   ` Jakub Pawlowski
2015-03-30 21:57                 ` Marcel Holtmann
2015-03-30 22:26                   ` Jakub Pawlowski
2015-04-01 12:34               ` Florian Grandel
  -- strict thread matches above, loose matches on Subject: below --
2015-03-30 22:37 Jakub Pawlowski

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=55164DEC.6070009@gmail.com \
    --to=fgrandel@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.