linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* add dbus api to set class of device?
@ 2010-07-28 15:33 Tim Renouf
  2010-07-28 16:45 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Renouf @ 2010-07-28 15:33 UTC (permalink / raw)
  To: linux-bluetooth

Hi all

I am putting a JSR82 implementation on an Android device that uses
BlueZ, accessing BlueZ via the dbus api.

JSR82 has an API where you can set service class bits for a particular
service you have registered. So the JSR82 implementation needs to be
able to set the class of device in some way. I would like to add a dbus
method to do this, and I'd like to know the opinion of BlueZ developers
on this:

1. Is this a reasonable thing to do and submit a patch for ?

2. What would be a good approach, out of the following (or any other
possibility I have missed) ?

2a. Add a dbus method to set service class bits for a registered
service. This would set a new field in sdp_record_t. The existing
function update_adapter_svclass_list in sdpd-service.c would read this
new field in every service record when determining the service class
bits to set. The setting gets cleared automatically when the service is
removed. This seems like the cleanest solution.

2b. Add a dbus method to set service class bits, or all device class
bits, globally for the dbus connection. There would have to be a list of
dbus connections, each storing the connection's requested class.
manager_update_svc would scan that list. The setting gets cleared
automatically when the dbus connection is lost.

2c. Add a dbus method to set service class bits, or all device class
bits, globally. This can just call the BlueZ internal method directly.
The problems with this are (i) it doesn't work if multiple apps are
trying to use it; (ii) the setting gets lost next time a service gets
registered or removed, so the app needs to be aware of this and reapply
its setting, and (iii) the setting remains if the app exits or crashes
without removing it.

I note that Bluecove-on-BlueZ does not implement this, therefore it
fails the same conformance test that I am looking at.

Thanks.

-tpr

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-28 17:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28 15:33 add dbus api to set class of device? Tim Renouf
2010-07-28 16:45 ` Marcel Holtmann
2010-07-28 16:59   ` Tim Renouf
2010-07-28 17:40     ` Marcel Holtmann

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).