Hi Sedat,<br><br>Thanks. But it works like Johannes's advice, <br>dbus-send --session --type=method_call --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/device/computer_backlight org.freedesktop.Hal.Device.LaptopPanel.GetBrightness<br>
<br>And the --dest argument, like pointed by Dean, is the well known bus name (connection name, or called service name by Qt. I am relieved that I am not the only one who got confused). <br><br>By the way, I have to say I am not quite clear why this argument is necessary. Sure it represents the connection to the bus, but in our method calling case, isn't it enough to have 1) object path and 2) method name (including interface)? It is also my question in the Qt API <font><font size="2">createMethodCall</font></font> I pasted before. I always get confused about these concepts.<br>
<br>Cheers,<br>Wei<br><br><div class="gmail_quote">On Thu, Jun 10, 2010 at 6:40 PM, Sedat Cakir <span dir="ltr"><<a href="mailto:cakir_sedat@yahoo.com">cakir_sedat@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">Try this one:<br><br>dbus-send --session --type=method_call --print-reply --dest=org.freedesktop.Hal.Device.LaptopPanel /org/freedesktop/Hal/device/computer_backlight org.freedesktop.Hal.Device.LaptopPanel.GetBrightness<br>
<br>Regards,<br>Sedat<br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1">
<b><span style="font-weight: bold;">From:</span></b> ttlee1984 <<a href="mailto:ttlee1984@gmail.com" target="_blank">ttlee1984@gmail.com</a>><br><b><span style="font-weight: bold;">To:</span></b> danny <<a href="mailto:tornadory@163.com" target="_blank">tornadory@163.com</a>><div class="im">
<br><b><span style="font-weight: bold;">Cc:</span></b> <a href="mailto:dbus@lists.freedesktop.org" target="_blank">dbus@lists.freedesktop.org</a><br></div><b><span style="font-weight: bold;">Sent:</span></b> Thu, June 10, 2010 10:11:32 AM<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: dbus-send use?<br></font><div><div></div><div class="h5"><br>
Thanks for the advice. I will check it. But may I say it is a little bit different from what I wanted to know? My original question is, if I already know the object path (for example /org/freedesktop/Hal/device/computer_backlight), the interface (org.freedesktop.Hal.Device.LaptopPanel), and the method (GetBrightness(void)), how should I inquiry this mehtod by dbus-send? Or isn't it enough to know just this three pieces of information call it? <br>
<br>Because I am also using Qt binding, and for example there is a API<br><h3 style="font-weight: normal;"><font size="2">QDBusMessage QDBusMessage::createMethodCall ( const <a rel="nofollow" href="http://doc.qt.nokia.com/4.6/qstring.html" target="_blank">QString</a> & <i>service</i>, const <a rel="nofollow" href="http://doc.qt.nokia.com/4.6/qstring.html" target="_blank">QString</a> & <i>path</i>, const <a rel="nofollow" href="http://doc.qt.nokia.com/4.6/qstring.html" target="_blank">QString</a> & <i>interface</i>, const <a rel="nofollow" href="http://doc.qt.nokia.com/4.6/qstring.html" target="_blank">QString</a> & <i>method</i> )</font></h3>
But I can't figure out what is this argument "service". There is no corresponding concept in the DBus specification. Or as I asked, does it mean the well-known connection name? <br><br>Thanks for the help!<br>
<br><div class="gmail_quote">2010/6/10 danny <span dir="ltr"><<a rel="nofollow" href="mailto:tornadory@163.com" target="_blank">tornadory@163.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Perhaps you could try the "d-feet" tool. It could list all of the running dbus services.<br><br>For others, you should check the documents for specific program.<br><br><div>--<br>
<div> Best Regards,<br>
<br></div>
</div><br>在2010-06-10 05:18:13,ttlee1984 <<a rel="nofollow" href="mailto:ttlee1984@gmail.com" target="_blank">ttlee1984@gmail.com</a>> 写道:<div><br> <blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
Hi all,<br><br>I have a question in the use of dbus-send. It requires the --dest argument. But what is it? In the man page it says it is the name of the connection, I assume it refers to what is called "well-known bus name" in the specification. But how should I use it or even know this name? For example, I want to check the brightness of the computer. I now know the object path ,which is /org/freedesktop/Hal/device/computer_backlight The interface is org.freedesktop.Hal.Device.LaptopPanel and the method is GetBrightness(void). So how shoud I use dbus-send to call this method? I have tried several combinations but did not get any luck. Any help will be appreciated.<br>
<br>Cheers<br>
</blockquote><br><br><span title="neteasefooter"></span></div><hr>
<a rel="nofollow" href="http://ym.163.com/?from=od3" target="_blank">网易为中小企业免费提供企业邮箱(自主域名)</a>
</blockquote></div><br>
</div></div></div></div>
</div><br>
</div></blockquote></div><br>