using the dbus low level C API

Tomas Pelka tompelka at gmail.com
Tue Oct 7 07:05:12 PDT 2008


Marco Cavallini wrote:
> Tomas Pelka ha scritto:
>> 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
>>
> 
> .snip.
> 
>> 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.
>>
> 
> I am facing to limitations of this example, which actually is the best
> one I found in the internet ;-)
+1
> What happens to you seems correct, maybe I don't understand clearly your
> question.
> You call remote method with 123 and you get back dbus_uint32_t level =
> 21614;
> 
This value is hard-coded into the source code (see line 191).
My question is, why 123 (the parameter)

method call sender=:1.88 -> dest=test.method.server
path=/test/method/Object; interface=test.method.Type; member=Method
    string "123"

is a string. Or may I specify type of param (integer, string, etc.),
because than it is bootless, don't you think? Maybe I'm wrong.

> /marco

-- 

Tom




More information about the dbus mailing list