<div dir="ltr"><div><div class="gmail_extra"><div>On Mon, Apr 22, 2013 at 2:25 AM, <span dir="ltr"><<a href="mailto:bino@indoakses-online.com" target="_blank">bino@indoakses-online.com</a>></span> wrote:<br></div><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear All<br>
I take<br>
<a href="https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_server" target="_blank">https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_server</a><br>
and save it to /home/bino/Documents/mbink/pythons/coretac/dbus00.py<br>
<br>
It's work as expected when 'called' using<br>
<a href="https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_client" target="_blank">https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_client</a><br>
<br>
Now I need to callable using dbus-send<br>
I wrote '/usr/share/dbus-1/services/org.example.service' as :<br>
<br>
[D-BUS Service]<br>
Name=org.example.MyObjPath<br>
Exec=/home/bino/Documents/mbink/pythons/coretac/dbus00.py<br></blockquote><div><br>The "Name" in the org.example.services file refers to the bus name(s) exported by the application. The file should instead read:<br>
<br>[D-BUS Service]<br>
Name=org.example<br>
Exec=/home/bino/Documents/mbink/pythons/coretac/dbus00.py<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I try to call :<br>
dbus-send --system --print-reply \<br>
--type=method_call \<br>
--dest='org.example.MyObjPath' '/org/example/MyObjPath' \<br>
org.example.MyObjPath.exampleMethod string:'MYTEXT'<br>
<br>
But I got error msg ... <snip><br></blockquote><div><br>There are several problems here. The command should be:<br><br>dbus-send
--session --print-reply --type=method_call --dest='org.example'
'/MyObjPath' org.example.MyIFace.exampleMethod string:'MYTEXT'<br><br>--session
means you're using the session bus instead of the system bus (which
requires a .service file in a different directory and, possibly, an
entry in /etc/dbus-1/..). The --dest flag, similar to the Name of the
.service file, refers to the bus name rather than the object.
'/MyObjPath' is the full object path exported by the server application.
Lastly, the fully-qualified method name is the interface name plus the
method name rather than the object name plus method name. It's pretty easy
to confuse the various names and paths in DBus. I did so more than once
while writing up this reply. <br><br>Tom</div></div></div></div></div>