_DBus_DOC-V0.01

March 27, 2018 | Author: anilrm | Category: Software Development, Computing, Technology, Computer Programming, Software


Comments



Description

HAVE NO FEAR WHEN SUPPORT IS HERE!!!BY ANIL R MURTHY ([email protected]) Start Dbus Tutorial–Ver. visual editor to view changes libqt4-dbus –Qt Bindings on Dbus for Qt applications My synoptic manager setup looks like 2.Dbus Tutorial • New to Dbus? Well if your answer is yes this document is for you. 0. The document gives basic information on all what is needed to get started with DBus.library & help files for dbus commands libdbus-glib-dev – Development libraries G-lib bindings for Dbus d-feet – GUI tool.1 Page 2 of 10 . 1. Basic Setup needed The below mentioned packages are important for installing DBus Communication Framework • • • • • dbus – messaging system libdbus-dev . ..1 ...Dbus Tutorial Verify the packages installed. the list of packages should contain dbus daemon service related with atleast one of the bindings either Glib/Qt or Java/C++ or Python $.> ps auxf | grep dbus • DBus-daemon Page 3 of 10 Dbus Tutorial–Ver. 0...> dpkg –l *dbus* Also verify if the dbus daemon and session buses are up! $. . you need to export DBUS Session Bus Address and Dbus Session PID • • • $. Multiple programs connect to the message bus daemon and can exchange messages with one • DBus-launch o In order to establish connection to session bus. please do configure and make on them $.....> dbus-launch $.gz Dbus Tutorial–Ver... 0.> tar –zxvf dbus-glib-0. Demo to transfer `Signal` transfer between Applications Untar the dbus-glib-0.. 3.1 Page 4 of 10 ../>export set DBUS_SESSION_BUS_ADDRESS=…..Dbus Tutorial o It is a message bus daemon o Provides one to one communication between applications o Is an application that uses this library to implement a message bus daemon.94 glib binding package and you should be able to see the demo applications./>export set DBUS_SESSION_BUS_PID=….94. $.tar. Dbus Tutorial Next is to configure and make it $.. make Dbus Tutorial–Ver...> . 0./configure.1 Page 5 of 10 . .> d-feet Dbus Tutorial–Ver./example-signal-recipient In another terminal start recipient too Now you could see that the TestService is available on Dbus try opening d-feet and browse for TestService $...> . 0...Dbus Tutorial The code should compile to give following executables • example-signal-emitter o It is the service which is available on dbus and it emits Hello Signal • • $.> ...1 Page 6 of 10 ../example-signal-emitter $.. next we would see the method call and the exchange of data between the service and clients As usual start the example service and verify it is available on session bus • $...> ... the recipient receives the string Hello from Server (signal-emitter) 4. 0... Synchronous Method Call What we have seen earlier is a signal transfer from one application to another on Dbus./example-signal-recipient The data gets marshaled to client.Dbus Tutorial • example-signal-recipient o It would have registered for the signal and it receives the one emitted by emitter • $.1 Page 7 of 10 .> ./example-service Dbus Tutorial–Ver. Asynchronous Method Call 6.> ..> d-feet Now use the example client and verify it is available on session bus • $.. 0. Other Demos Dbus Tutorial–Ver./example-client 5..Dbus Tutorial • $.1 Page 8 of 10 . Dbus-Error Object Transfer Call 7.... Dbus Tutorial • You can get the number of seconds the screensaver has been active by running the following: dbus-send --session \ --dest=org.ScreenSaver \ --type=method_call \ --print-reply \ --reply-timeout=20000 \ /org/gnome/ScreenSaver \ org.1 .interface='org.ScreenSaver'.me mber='SessionIdleChanged'" • There you go!!! 8. 0.gnome.org/wiki/Software/dbus Page 9 of 10 Dbus Tutorial–Ver.interface='org.gnome.ScreenSaver.ScreenSaver \ --type=method_call \ --print-reply \ --reply-timeout=20000 \ /org/gnome/ScreenSaver \ org.gnome.gnome.GetSessionIdleTime • You can activate the screensaver too dbus-send --session \ --dest=org.ScreenSaver'" • Or watch on a particular signal dbus-monitor --session \ "type='signal'. USEFUL LINKS • http://www.ScreenSaver.freedesktop.gnome.gnome.SetActive \ boolean:true • You can monitor changes of a service dbus-monitor --session \ "type='signal'. html -End of Document- Dbus Tutorial–Ver.1 Page 10 of 10 .freedesktop.org/doc/dbus-specification.Dbus Tutorial • http://dbus. 0.
Copyright © 2024 DOKUMEN.SITE Inc.