[dbus-cplusplus-devel] dbus_bus_request_name with bluez

Andreas Volz lists at brachttal.net
Tue Oct 6 12:19:01 PDT 2009


Am Mon, 05 Oct 2009 23:08:36 -0400 schrieb Randell Jesup:

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

Ah, you're right. I made a copy&paste error from my own server
example. :-(

If I simply omit the request_name() call then it works like expected :-)

regards
Andreas


More information about the dbus mailing list