summaryrefslogtreecommitdiff
path: root/examples/properties/README
blob: 2e7f3d7b049b9c5e84bcd1f08fe82ccafffdecfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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