1This is probably the most simple D-Bus program you could conceive
2
3To test, run `DBUSXX_VERBOSE=1 ./echo-server` and try the following commands:
4
5dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Random
6
7dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Hello string:"world"
8
9dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Sum array:int32:10,100,250
10
11dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Info
12
13or, using python instead
14
15$ python
16import dbus
17bus = dbus.SessionBus()
18object = bus.get_object('org.freedesktop.DBus.Examples.Echo','/org/freedesktop/DBus/Examples/Echo')
19echo = dbus.Interface(object, dbus_interface='org.freedesktop.DBus.EchoDemo')
20echo.Random()
21echo.Hello("world")
22echo.Sum([123, 234, 95, 520])
23echo.Info()
24