dbus-cplusplus/examples/properties
2008-06-14 15:40:27 +02:00
..
Makefile.am Use autoconf convention for the configuration header (Glenn Murphy) 2008-06-14 15:40:27 +02:00
props-introspect.xml * Fixed implementation of D-Bus properties 2006-10-24 11:12:29 +00:00
props-server.cpp * Fixed implementation of D-Bus properties 2006-10-24 11:12:29 +00:00
props-server.h * Fixed implementation of D-Bus properties 2006-10-24 11:12:29 +00:00
README * Added another simple D-Bus C++ example 2006-10-24 21:01:36 +00:00

This very simple example shows how to export properties (from objects implementing the org.freedesktop.DBus.Properties interface)

To test, run `DBUSXX_VERBOSE=1 ./props-server` and try the following commands:

dbus-send --dest=org.freedesktop.DBus.Examples.Properties --type=method_call --print-reply  /org/freedesktop/DBus/Examples/Properties org.freedesktop.DBus.Properties.Get string:"org.freedesktop.DBus.PropsDemo" string:"Version"

dbus-send --dest=org.freedesktop.DBus.Examples.Properties --type=method_call --print-reply  /org/freedesktop/DBus/Examples/Properties org.freedesktop.DBus.Properties.Set string:"org.freedesktop.DBus.PropsDemo" string:"Version" int32:2

dbus-send --dest=org.freedesktop.DBus.Examples.Properties --type=method_call --print-reply  /org/freedesktop/DBus/Examples/Properties org.freedesktop.DBus.Properties.Set string:"org.freedesktop.DBus.PropsDemo" string:"Message" variant:string:"Hello D-Bus"

dbus-send --dest=org.freedesktop.DBus.Examples.Properties --type=method_call --print-reply  /org/freedesktop/DBus/Examples/Properties org.freedesktop.DBus.Properties.Set string:"org.freedesktop.DBus.PropsDemo" string:"Message" variant:int32:200

dbus-send --dest=org.freedesktop.DBus.Examples.Properties --type=method_call --print-reply  /org/freedesktop/DBus/Examples/Properties org.freedesktop.DBus.Properties.Get string:"org.freedesktop.DBus.PropsDemo" string:"Message"

dbus-send --dest=org.freedesktop.DBus.Examples.Properties --type=method_call --print-reply  /org/freedesktop/DBus/Examples/Properties org.freedesktop.DBus.Properties.Get string:"org.freedesktop.DBus.PropsDemo" string:"Something"

dbus-send --dest=org.freedesktop.DBus.Examples.Properties --type=method_call --print-reply  /org/freedesktop/DBus/Examples/Properties org.freedesktop.DBus.Properties.Get string:"org.freedesktop.DBus.PropsDemo" int32:100