using the dbus low level C API

Tomas Pelka tompelka at gmail.com
Tue Oct 7 06:33:51 PDT 2008


Hi all,

I'm trying the low level C API for python. I've compiled dbus-examle.c 
from here: http://dbus.freedesktop.org/doc/dbus/dbus-example.c

Everything work, I' think. But I don't understand purpose of query 
switch. Let me give an example. I have three terminals
1) dbus-monitor
2) dbus-example listen
3) dbus-example query param

What should I get as param? If I'll try number (123)
./dbus-example query 123
Calling remote method with 123
Request Sent
Got Reply: 1, 21614

then  dbus-example listen answer with:

	/Method called with 123/

it seems OK, but dbus monitor returns:

signal sender=org.freedesktop.DBus -> dest=(null destination) 
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; 
member=NameOwnerChanged
    string ":1.88"
    string ""
    string ":1.88"
method call sender=:1.88 -> dest=org.freedesktop.DBus 
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
signal sender=org.freedesktop.DBus -> dest=(null destination) 
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; 
member=NameOwnerChanged
    string "test.method.caller"
    string ""
    string ":1.88"
method call sender=:1.88 -> dest=org.freedesktop.DBus 
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; 
member=RequestName
    string "test.method.caller"
    uint32 2
method call sender=:1.88 -> dest=test.method.server 
path=/test/method/Object; interface=test.method.Type; member=Method
    string "123"
method return sender=:1.75 -> dest=:1.88 reply_serial=3
    boolean true
    uint32 21614
signal sender=org.freedesktop.DBus -> dest=(null destination) 
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; 
member=NameOwnerChanged
    string "test.method.caller"
    string ":1.88"
    string ""
signal sender=org.freedesktop.DBus -> dest=(null destination) 
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; 
member=NameOwnerChanged
    string ":1.88"
    string ":1.88"
    string ""

Why is 123 in dbus-monitor represented as string, shouldn't it bee a 
uint32? Or which parameter should I type if I will obtain an integer or 
  boolean, ... (All parameters are represented as string) What is 
purpose of this example?

Thanks all for answers.

-- 

Tom




More information about the dbus mailing list