From: Florian Grandel <fgrandel@gmail.com>
To: Arman Uguray <armansito@chromium.org>
Cc: Marcel Holtmann <marcel@holtmann.org>,
BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: Re: Multi-Advertising: implementation options, timing questions
Date: Mon, 30 Mar 2015 01:23:49 +0200 [thread overview]
Message-ID: <55188985.80001@gmail.com> (raw)
In-Reply-To: <CAHrH25RbwtPDgLuRNVa92a=5+y5beMYgzrJLfwf19ut-T=cANA@mail.gmail.com>
Hi Arman,
> Now that most of the logic for a single instance is in place it should
> be straightforward to extend it for multiple instances. I would start
> by turning the adv_instance field of hci_dev into a list of
> adv_instances and a way to determine and get a pointer to the
> currently active instance.
Yes, agreed. That's exactly where I started. Happy to hear that you got
the same procedure in mind. I experimented with a dynamically extended
array and a linked list. The latter seems to be the better choice as it
allows us to easily remove entries in the middle of the list.
> You would then modify the code in
> net/bluetooth/mgmt.c that accesses the instance 1 parameters to use
> the new getter instead. Once all of that is done, the second step
> would be a matter of inserting new elements into the advertising list
> and handling the round-robin logic and the duration parameter.
Agreed. That's what I had in mind, too.
> If it makes things easier I can start tackling the first step which is
> mostly refactoring my recent code to enable multiple instances. You
> can then cleanly build the multiple instance logic on top of that.
It's up to you. Just let me know so that I don't interfere with your
work. I don't want to block you as I'll certainly take much longer to
get it right (newbie + evenings/weekends only). Today I just set up my
dev env and made the build + e2e-tests run on a vm with a minimal
kernel. So not much done in the code, yet.
Apart from that I got a few thoughts while familiarizing myself with the
source that you might be able to comment on:
- Why do we have two flags to distinguish between multi- and
single-instance advertising (HCI_ADVERTISING[_INSTANCE])? Doesn't that
allow for inconsistencies (=both true)? Wouldn't it be better to
interpret one as "advertising generally en-/disabled" and the other as a
switch between single and multi adv mode? That would also allow us to
keep track of the adv mode when advertising is temporarily disabled and
then re-enabled. As Marcel commented this might be necessary for some
controllers in multi-adv mode when adv data cannot be changed on-the-fly.
- What do you think of the idea to handle "set adv" and multi-adv more
uniformly? I have the following in mind:
1) whenever an adv mode switch occurs, all current adv instances will be
canceled and destroyed
2) "set adv" will add/replace a single instance to the list
3) "add adv" will add instances up to max_instances
This would probably dry up the code and duplicate memory structures
quite a bit and also remove some logic quirks.
- Instances are currently being identified by an integer
"adv_info.instance". When we add instances more dynamically would it not
be better to pass pointers around and get rid of that integer? That
would remove the necessity to keep track of, synchronize and verify
instance ids.
- The mgmt_rp_read_adv_features structure contains an unused
instance[0]. Seems to be redundant and could be removed, right?
Well, that's it for the moment. Thanks for being so friendly to a newcomer.
Florian
next prev parent reply other threads:[~2015-03-29 23:23 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 ` Multi-Advertising: implementation options, timing questions Florian Grandel
2015-03-28 6:57 ` Marcel Holtmann
2015-03-28 13:32 ` Florian Grandel
2015-03-28 20:18 ` Arman Uguray
2015-03-29 23:23 ` Florian Grandel [this message]
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=55188985.80001@gmail.com \
--to=fgrandel@gmail.com \
--cc=armansito@chromium.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).