FSO dbus Zhone -> bluetooth

Daniel Willmann daniel at openmoko.org
Mon Aug 4 14:25:26 CEST 2008

On Mon, 04 Aug 2008 02:07:07 +0200
Timo Drick <timo at drick.de> wrote:

> Hi Mickey,
> i used the dbus system to turn on bluetooth:
> (mdbus -s org.freesmartphone.frameworkd 
> /org/freesmartphone/Device/PowerControl/Bluetooth 
> org.freesmartphone.Device.PowerControl.SetPower 1)

Yeah you need to request the Resource from the Usage daemon. It will
keep track of users and activate/deactivate the resource accordingly.

What you need to do is issue
mdbus -s org.freesmartphone.frameworkd /org/freesmartphone/Usage
org.freesmartphone.Usage.RequestResource "Bluetooth"
ReleaseResource frees the resource again.
Be aware, though that the usage daemon tracks dbus users, so as soon as
mdbus drops off the bus ousaged sees that and concludes that you don't
need bluetooth any more. :-)
This is necessary for correct refcounting when applications crash or
forget to release the resource. You can also SetResourcePolicy
"Bluetooth" "on" which will keep bluetooth on at all times. "off" will
not activate a resource, even if requested and "auto" is the default

Daniel Willmann
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/devel/attachments/20080804/4d7f5946/attachment.pgp 

More information about the devel mailing list