Version 2 of dbus-intf

Updated 2010-12-14 21:44:48 by sbron
What: dbus-intf
Where: http://sourceforge.net/projects/dbus-tcl 
Description: The DBus-Intf project provides a Tcl interface to the dbus message
        bus system. It allows Tcl programs to create and publish a fully
        introspectable dbus interface.
Updated: 12/2009
Contact: Schelte Bron

The dbus-intf package builds on the dbus-tcl package to allow you to provide a fully functional dbus interface for your application that other programs can use to communicate with your application.


As an example, you can use dbus-intf to add some debugging facility to your application by including something similar to the following code (Note: use your own domain and application name instead of 'tk.tcl.wiki' and 'demo'):

package require dbus-intf
dbif connect tk.tcl.wiki.demo
dbif method /debug eval Expression Result {
    uplevel #0 $Expression
}

Then, while your application is running, executing the qdbus command will include 'tk.tcl.wiki.demo' in the list of reported names. Next, running 'qdbus tk.tcl.wiki.demo' shows:

/
/debug

Drilling down deeper using 'qdbus tk.tcl.wiki.demo /debug' returns:

method QString tk.tcl.wiki.demo.eval(QString Expression)
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()

To execute a Tcl command in your running application, you would use:

# qdbus tk.tcl.wiki.demo /debug tk.tcl.wiki.demo.eval "info patchlevel"
8.5.9