• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# lws minimal dbus client
2
3This demonstrates nonblocking, asynchronous dbus method calls as the client.
4
5## build
6
7Using libdbus requires additional non-default include paths setting, same as
8is necessary for lws build described in ./lib/roles/dbus/README.md
9
10CMake can guess one path and the library name usually, see the README above
11for details of how to override for custom libdbus and cross build.
12
13Fedora example:
14```
15$ cmake .. -DLWS_DBUS_INCLUDE2="/usr/lib64/dbus-1.0/include"
16$ make
17```
18
19Ubuntu example:
20```
21$ cmake .. -DLWS_DBUS_INCLUDE2="/usr/lib/x86_64-linux-gnu/dbus-1.0/include"
22$ make
23```
24
25## usage
26
27Commandline option|Meaning
28---|---
29-d <loglevel>|Debug verbosity in decimal, eg, -d15
30
31The minimal client connects to the minimal dbus server example, which is
32expected to be listening on its default abstract unix domain socket path.
33
34It call the server Echo method with "Hello!" and returns to the event loop.
35When the reply comes, it prints the returned message.
36
37Afterwards it just sits there receiving unsolicited messages from the server
38example, until closed by the user.
39
40```
41 $ ./lws-minimal-dbus-client
42ctx
43[2018/10/05 06:08:31:4901] NOTICE: pending_call_notify
44[2018/10/05 06:08:31:4929] USER: pending_call_notify: received 'Hello!'
45^C[2018/10/05 06:09:22:4409] NOTICE: destroy_dbus_client_conn
46[2018/10/05 06:09:22:4691] NOTICE: Exiting cleanly
47...
48```
49
50