Python / C++ application D-Bus usage issues
Tanu Kaskinen
tanuk at iki.fi
Mon Dec 17 00:26:17 PST 2012
On Mon, 2012-12-17 at 10:08 +0200, Kalle Vahlman wrote:
> 2012/12/17 Kip Warner <kip at thevertigo.com>:
> > On Mon, 2012-12-17 at 17:35 +1100, Andrey Sidorov wrote:
> >> Yes, '0' is also invalid signature (see spec). I'm not sure about
> >> Python API but probably 'no arguments' signature is empty string.
> >
> > Hey Andrey. I thought the 0 was a sentinel marker, but I guess I
> > misunderstood the spec. I don't know why I didn't think to try the empty
> > string.
> >
> > My problem now is that I am still seeing the following non-fatal error:
> >
> > ERROR:dbus.proxies:Introspect error
> > on :1.341:/com/myproject/MyObject:
> > dbus.exceptions.DBusException:
> > org.freedesktop.DBus.Error.NoReply: Did not receive a reply.
> > Possible causes include: the remote application did not send a
> > reply, the message bus security policy blocked the reply, the
> > reply timeout expired, or the network connection was broken.
> >
> > I am not really sure how to deal with the Introspect message. I am
> > guessing the receiving C++ application is suppose to respond to this
> > message by sending back an XML description of its supported interface
> > (which it shouldn't have any).
The Introspect message is sent by the proxy object that you create in
the Python application. Since the C++ application doesn't export any
objects to D-Bus, there's no point in creating any proxy objects in the
Python application.
> However, I don't actually see this
> > message ever received in the C++ application.
>
> In the code you posted you specifically add a match only for signals,
> so that would most likely be the reason.
>
> Add a match for
> "type='method_call',interface='org.freedesktop.DBus.Introspectable',member='Introspect',path='/your/path'"
> and you probably should receive it.
Method calls are always delivered, there's no need to register match
rules for them. The original code does nothing if the message type is
signal, so that would explain why it looks like the Introspect message
isn't received.
--
Tanu
More information about the dbus
mailing list