[dbus-cplusplus-devel] dbus_bus_request_name with bluez

Randell Jesup rjesup at wgate.com
Mon Oct 5 20:08:36 PDT 2009


>I'm developing the dbus-c++, but I think my problem is dbus specific.
>So I ask here.
>
>This is what I do on the terminal:
>
>> dbus-send --system --type=method_call --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter
>
>method return sender=:1.43 -> dest=:1.81 reply_serial=2
>   object path "/org/bluez/11832/hci0"
>
>This works well. So I tried the python code:
>
>bus = dbus.SystemBus()
>
>bluez = dbus.Interface(bus.get_object("org.bluez", "/"),
>						"org.bluez.Manager")
>
>print "DefaultAdapter: " + bluez.DefaultAdapter ()
>
>This prints:
>
>DefaultAdapter: /org/bluez/11832/hci0
>
>Also working, so I tested it with dbus-c++ and I get this error:
>
>> ./bluephone 
>terminate called after throwing an instance of 'DBus::Error'
>  what():  Connection ":1.83" is not allowed to own the service "org.bluez" due 
>  to security policies in the configuration file

You didn't give the code used with dbus-c++ - the error implies (end the
rest of what you wrote) it's NOT (just) calling
or.bluez.Manager.DefaultAdapter.  The error implies bluephone tried to
register the name org.bluez, which your dbus-send and python tests
didn't do.

-- 
Randell Jesup, Worldgate (developers of the Ojo videophone)
rjesup at wgate.com


More information about the dbus mailing list