Imported Upstream version 3.2.0
[platform/upstream/libwebsockets.git] / minimal-examples / dbus-client / minimal-dbus-client / README.md
1 # lws minimal dbus client
2
3 This demonstrates nonblocking, asynchronous dbus method calls as the client.
4
5 ## build
6
7 Using libdbus requires additional non-default include paths setting, same as
8 is necessary for lws build described in ./lib/roles/dbus/README.md
9
10 CMake can guess one path and the library name usually, see the README above
11 for details of how to override for custom libdbus and cross build.
12
13 Fedora example:
14 ```
15 $ cmake .. -DLWS_DBUS_INCLUDE2="/usr/lib64/dbus-1.0/include"
16 $ make
17 ```
18
19 Ubuntu example:
20 ```
21 $ cmake .. -DLWS_DBUS_INCLUDE2="/usr/lib/x86_64-linux-gnu/dbus-1.0/include"
22 $ make
23 ```
24
25 ## usage
26
27 Commandline option|Meaning
28 ---|---
29 -d <loglevel>|Debug verbosity in decimal, eg, -d15
30
31 The minimal client connects to the minimal dbus server example, which is
32 expected to be listening on its default abstract unix domain socket path.
33
34 It call the server Echo method with "Hello!" and returns to the event loop.
35 When the reply comes, it prints the returned message.
36
37 Afterwards it just sits there receiving unsolicited messages from the server
38 example, until closed by the user.
39
40 ```
41  $ ./lws-minimal-dbus-client
42 ctx
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