From: ingas@codeaurora.org
To: johan.hedberg@gmail.com
Cc: ingas@codeaurora.org, linux-bluetooth@vger.kernel.org,
rshaffer@codeaurora.org, marcel@holtmann.org
Subject: Re: [PATCH v4 0/5] Enhanced support for extended inquiry response
Date: Wed, 28 Jul 2010 13:08:09 -0700 (PDT) [thread overview]
Message-ID: <feb3c412e1be4c1b7b42efdbc581aabb.squirrel@www.codeaurora.org> (raw)
In-Reply-To: <20100726094444.GB20357@jh-x301>
Hi Johan,
>
> Both the D-Bus interface as well as sdptool trigger the same code paths
> in src/sdpd-service.c. I.e. it doesn't make sense to solve this twice
> when it can be solved once by targetting the common lower layer. We
> already do this for the service class bits with update_svclass_list() in
> sdpd-service.c. The need to update the EIR data is very similar to the
> need to update the service class bits so the existing code is probably a
> good place to take example of.
>
>
My original intent when creating this patch set was no to perturb the code
that is already in place too much. Hence the changes were done only to
D-Bus methods. Sure, I can change the EIR write bot happen deeper down the
pipeline. However, before I invest your and my time in generating and
reviewing more patches , lets agree on the solution first.
In the current implementation, EIR write is keyed off HCI Command
Complete events for a set of commands (in security.c).
- When first registering an OPP service with sdptool, the
update_svcclass_list() (sdpd-service.c) calls manager_update_svc()
(manager.c) which in turn calls adapter_update() (adapter.c). BTW, why
this level of indirection, since manager_update_svc() is called only from
one place in the code and calling adapter_update() is all it does?
Probably some earlier architectural decision I am not aware of
- Anyway, as a result, HCI command to write service class is done, returns
Command Complete event (processed in , calls back into adapter layer
adapter_set_class_complete() which invokes invokes
update_ext_inquiry_response() and (voilà!) EIR is written. So far so good.
- When consequently another OBEX based service like FTP is added using
sdptool, service class of the device does not change, adapter_update()
does nothing, and ultimately EIR is not updated with FTP uuid. This is the
problem that you observed when testing with sdptool. While showing either
only OPP or only FTP might be considered not a big deal, skipping UUID in
EIR for another OBEX-based service like PBAP in EIR might not be so
great, since those services are very different
The current implementation may be extended as following:
Since update_svcclass_list() is being called throughout sdpd-service.c in
all the places where EIR needs to be updated as well, I propose to modify
the corresponding function adapter_set_service_classes() (adapter.c) :
**********************
Before:
/* If we already have the CoD we want or the cache is enabled or an
* existing CoD write is in progress just bail out */
if (adapter->current_cod == adapter->wanted_cod ||
adapter->cache_enable || adapter->pending_cod)
return 0;
***********************
After:
/* If we already have the CoD we want or the cache is enabled or an
* existing CoD write is in progress just bail out */
if (adapter->cache_enable || adapter->pending_cod)
return 0;
/* If we already have the CoD we want, update EIR and return */
if (adapter->current_cod == adapter->wanted_cod ) {
update_ext_inquiry_response(adapter);
return 0;
}
**********************
Will that be acceptable? I tested this modification and its working with
both d-bus methods and sdptool.
Of course, it might be possible to cache the EIR currently written down,
compare the update, and decide whether the EIR needs to be updated. But
this is more involved, not entirely safe, as we might run into coherency
issues.
As a side note, in future it might be a good idea to expose EIR writes to
an application layer providing external API. The intent of EIR is to allow
quick scan of the surroundings to find a particular service that a device
is interested at the moment (and in turn, exposing the services that the
device choses to expose at the moment) without actually going into full
blown connection mode. EIR space is at a premium for sophisticated
devices with multiple services. Not every single service needs to be
exposed in EIR. It would be nice to be able to pick which one to add. For
example, if a device supports both headset and handsfree profiles (as all
of the phones do), it might not be necessary to advertise headset uuid in
EIR since the headsets out there are mostly legacy devices that cannot
perform EIR anyway
Also, as more new services that use uuid128 are
introduced, the EIR buffer pretty quickly if every single one of them is
added without discretion. Just something to throw out there :)
Regards,
Inga
next prev parent reply other threads:[~2010-07-28 20:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-22 16:06 [PATCH v4 0/5] Enhanced support for extended inquiry response Inga Stotland
2010-07-22 16:06 ` [PATCH 1/5] Spec constants for Extended Inquiry Response field types Inga Stotland
2010-07-22 16:06 ` [PATCH 2/5] Support for adding UUID128 to extended inquiry response Inga Stotland
2010-07-27 18:25 ` Luiz Augusto von Dentz
2010-07-27 20:08 ` ingas
2010-07-28 5:59 ` Luiz Augusto von Dentz
2010-07-22 16:06 ` [PATCH 3/5] Update EIR whenever record is added or removed Inga Stotland
2010-07-22 16:06 ` [PATCH 4/5] Handle arrays in device properties dictionary Inga Stotland
2010-07-22 16:06 ` [PATCH 5/5] Extended support for generating dictionary value of service UUIDs Inga Stotland
2010-07-23 8:20 ` [PATCH v4 0/5] Enhanced support for extended inquiry response Johan Hedberg
2010-07-23 8:27 ` Johan Hedberg
2010-07-23 8:43 ` Johan Hedberg
2010-07-25 22:48 ` ingas
2010-07-26 9:44 ` Johan Hedberg
2010-07-28 20:08 ` ingas [this message]
2010-08-02 18:55 ` Johan Hedberg
2010-08-02 21:24 ` ingas
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=feb3c412e1be4c1b7b42efdbc581aabb.squirrel@www.codeaurora.org \
--to=ingas@codeaurora.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=rshaffer@codeaurora.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.