nexmon – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 '\" t
2 .\" Title: gdbus
3 .\" Author: David Zeuthen <zeuthen@gmail.com>
4 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
5 .\" Date: 04/27/2016
6 .\" Manual: User Commands
7 .\" Source: GIO
8 .\" Language: English
9 .\"
10 .TH "GDBUS" "1" "" "GIO" "User Commands"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 gdbus \- Tool for working with D\-Bus objects
32 .SH "SYNOPSIS"
33 .HP \w'\fBgdbus\fR\ 'u
34 \fBgdbus\fR introspect [\-\-system | \-\-session | \-\-address\ \fIaddress\fR] \-\-dest\ \fIbus_name\fR \-\-object\-path\ \fI/path/to/object\fR [\-\-xml] [\-\-recurse] [\-\-only\-properties]
35 .HP \w'\fBgdbus\fR\ 'u
36 \fBgdbus\fR monitor [\-\-system | \-\-session | \-\-address\ \fIaddress\fR] \-\-dest\ \fIbus_name\fR [\-\-object\-path\ \fI/path/to/object\fR]
37 .HP \w'\fBgdbus\fR\ 'u
38 \fBgdbus\fR call [\-\-system | \-\-session | \-\-address\ \fIaddress\fR] \-\-dest\ \fIbus_name\fR \-\-object\-path\ \fI/path/to/object\fR \-\-method\ \fIorg\&.project\&.InterfaceName\&.MethodName\fR [\-\-timeout\ \fIseconds\fR] ARG1 ARG2...
39 .HP \w'\fBgdbus\fR\ 'u
40 \fBgdbus\fR emit [\-\-system | \-\-session | \-\-address\ \fIaddress\fR] \-\-object\-path\ \fI/path/to/object\fR \-\-signal\ \fIorg\&.project\&.InterfaceName\&.SignalName\fR [\-\-dest\ \fIunique_bus_name\fR] ARG1 ARG2...
41 .HP \w'\fBgdbus\fR\ 'u
42 \fBgdbus\fR help
43 .SH "DESCRIPTION"
44 .PP
45 \fBgdbus\fR
46 is a simple tool for working with D\-Bus objects\&.
47 .SH "COMMANDS"
48 .PP
49 \fBintrospect\fR
50 .RS 4
51 Prints out interfaces and property values for a remote object\&. For this to work, the owner of the object needs to implement the
52 org\&.freedesktop\&.DBus\&.Introspectable
53 interface\&. If the
54 \fB\-\-xml\fR
55 option is used, the returned introspection XML is printed, otherwise a parsed pretty representation is printed\&. The
56 \fB\-\-recurse\fR
57 option can be used to introspect children (and their children and so on) and the
58 \fB\-\-only\-properties\fR
59 option can be used to only print the interfaces with properties\&.
60 .RE
61 .PP
62 \fBmonitor\fR
63 .RS 4
64 Monitors one or all objects owned by the owner of
65 \fIbus_name\fR\&.
66 .RE
67 .PP
68 \fBcall\fR
69 .RS 4
70 Invokes a method on a remote object\&. Each argument to pass to the method must be specified as a serialized
71 \fBGVariant\fR
72 except that strings do not need explicit quotes\&. The return values are printed out as serialized
73 \fBGVariant\fR
74 values\&.
75 .RE
76 .PP
77 \fBemit\fR
78 .RS 4
79 Emits a signal\&. Each argument to include in the signal must be specified as a serialized
80 \fBGVariant\fR
81 except that strings do not need explicit quotes\&.
82 .RE
83 .PP
84 \fBhelp\fR
85 .RS 4
86 Prints help and exit\&.
87 .RE
88 .SH "BASH COMPLETION"
89 .PP
90 \fBgdbus\fR
91 ships with a bash completion script to complete commands, destinations, bus names, object paths and interface/method names\&.
92 .SH "EXAMPLES"
93  
94 This shows how to introspect an object \- note that the value of each
95 property is displayed:
96 .sp
97 .if n \{\
98 .RS 4
99 .\}
100 .nf
101 $ gdbus introspect \-\-system \e
102 \-\-dest org\&.freedesktop\&.NetworkManager \e
103 \-\-object\-path /org/freedesktop/NetworkManager/Devices/0
104 node /org/freedesktop/NetworkManager/Devices/0 {
105 interface org\&.freedesktop\&.DBus\&.Introspectable {
106 methods:
107 Introspect(out s data);
108 };
109 interface org\&.freedesktop\&.DBus\&.Properties {
110 methods:
111 Get(in s interface,
112 in s propname,
113 out v value);
114 Set(in s interface,
115 in s propname,
116 in v value);
117 GetAll(in s interface,
118 out a{sv} props);
119 };
120 interface org\&.freedesktop\&.NetworkManager\&.Device\&.Wired {
121 signals:
122 PropertiesChanged(a{sv} arg_0);
123 properties:
124 readonly b Carrier = false;
125 readonly u Speed = 0;
126 readonly s HwAddress = \*(Aq00:1D:72:88:BE:97\*(Aq;
127 };
128 interface org\&.freedesktop\&.NetworkManager\&.Device {
129 methods:
130 Disconnect();
131 signals:
132 StateChanged(u arg_0,
133 u arg_1,
134 u arg_2);
135 properties:
136 readonly u DeviceType = 1;
137 readonly b Managed = true;
138 readwrite o Ip6Config = \*(Aq/\*(Aq;
139 readwrite o Dhcp4Config = \*(Aq/\*(Aq;
140 readwrite o Ip4Config = \*(Aq/\*(Aq;
141 readonly u State = 2;
142 readwrite u Ip4Address = 0;
143 readonly u Capabilities = 3;
144 readonly s Driver = \*(Aqe1000e\*(Aq;
145 readwrite s Interface = \*(Aqeth0\*(Aq;
146 readonly s Udi = \*(Aq/sys/devices/pci0000:00/0000:00:19\&.0/net/eth0\*(Aq;
147 };
148 };
149 .fi
150 .if n \{\
151 .RE
152 .\}
153 .PP
154 The
155 \fB\-\-recurse\fR
156 and
157 \fB\-\-only\-properties\fR
158 options can be useful when wanting to inspect all objects owned by a particular process:
159 .sp
160 .if n \{\
161 .RS 4
162 .\}
163 .nf
164 $ gdbus introspect \-\-system \-\-dest org\&.freedesktop\&.UPower \-\-object\-path / \-\-recurse \-\-only\-properties
165 node / {
166 node /org {
167 node /org/freedesktop {
168 node /org/freedesktop/UPower {
169 interface org\&.freedesktop\&.UPower {
170 properties:
171 readonly b IsDocked = true;
172 readonly b LidForceSleep = false;
173 readonly b LidIsPresent = false;
174 readonly b LidIsClosed = false;
175 readonly b OnLowBattery = false;
176 readonly b OnBattery = false;
177 readonly b CanHibernate = true;
178 readonly b CanSuspend = true;
179 readonly s DaemonVersion = \*(Aq0\&.9\&.10\*(Aq;
180 };
181 node /org/freedesktop/UPower/Policy {
182 };
183 node /org/freedesktop/UPower/Wakeups {
184 interface org\&.freedesktop\&.UPower\&.Wakeups {
185 properties:
186 readonly b HasCapability = true;
187 };
188 };
189 };
190 };
191 };
192 };
193 .fi
194 .if n \{\
195 .RE
196 .\}
197 .PP
198 In a similar fashion, the
199 \fBintrospect\fR
200 command can be used to learn details about the
201 Notify
202 method:
203 .sp
204 .if n \{\
205 .RS 4
206 .\}
207 .nf
208 [\&.\&.\&.]
209 interface org\&.freedesktop\&.Notifications {
210 methods:
211 GetServerInformation(out s return_name,
212 out s return_vendor,
213 out s return_version,
214 out s return_spec_version);
215 GetCapabilities(out as return_caps);
216 CloseNotification(in u id);
217 Notify(in s app_name,
218 in u id,
219 in s icon,
220 in s summary,
221 in s body,
222 in as actions,
223 in a{sv} hints,
224 in i timeout,
225 out u return_id);
226 };
227 [\&.\&.\&.]
228 .fi
229 .if n \{\
230 .RE
231 .\}
232 .PP
233 With this information, it\*(Aqs easy to use the
234 \fBcall\fR
235 command to display a notification
236 .sp
237 .if n \{\
238 .RS 4
239 .\}
240 .nf
241 $ gdbus call \-\-session \e
242 \-\-dest org\&.freedesktop\&.Notifications \e
243 \-\-object\-path /org/freedesktop/Notifications \e
244 \-\-method org\&.freedesktop\&.Notifications\&.Notify \e
245 my_app_name \e
246 42 \e
247 gtk\-dialog\-info \e
248 "The Summary" \e
249 "Here\*(Aqs the body of the notification" \e
250 [] \e
251 {} \e
252 5000
253 (uint32 12,)
254 .fi
255 .if n \{\
256 .RE
257 .\}
258 .PP
259 Monitoring all objects on a service:
260 .sp
261 .if n \{\
262 .RS 4
263 .\}
264 .nf
265 $ gdbus monitor \-\-system \-\-dest org\&.freedesktop\&.ConsoleKit
266 Monitoring signals from all objects owned by org\&.freedesktop\&.ConsoleKit
267 The name org\&.freedesktop\&.ConsoleKit is owned by :1\&.15
268 /org/freedesktop/ConsoleKit/Session2: org\&.freedesktop\&.ConsoleKit\&.Session\&.ActiveChanged (false,)
269 /org/freedesktop/ConsoleKit/Seat1: org\&.freedesktop\&.ConsoleKit\&.Seat\&.ActiveSessionChanged (\*(Aq\*(Aq,)
270 /org/freedesktop/ConsoleKit/Session2: org\&.freedesktop\&.ConsoleKit\&.Session\&.ActiveChanged (true,)
271 /org/freedesktop/ConsoleKit/Seat1: org\&.freedesktop\&.ConsoleKit\&.Seat\&.ActiveSessionChanged (\*(Aq/org/freedesktop/ConsoleKit/Session2\*(Aq,)
272 .fi
273 .if n \{\
274 .RE
275 .\}
276 .PP
277 Monitoring a single object on a service:
278 .sp
279 .if n \{\
280 .RS 4
281 .\}
282 .nf
283 $ gdbus monitor \-\-system \-\-dest org\&.freedesktop\&.NetworkManager \-\-object\-path /org/freedesktop/NetworkManager/AccessPoint/4141
284 Monitoring signals on object /org/freedesktop/NetworkManager/AccessPoint/4141 owned by org\&.freedesktop\&.NetworkManager
285 The name org\&.freedesktop\&.NetworkManager is owned by :1\&.5
286 /org/freedesktop/NetworkManager/AccessPoint/4141: org\&.freedesktop\&.NetworkManager\&.AccessPoint\&.PropertiesChanged ({\*(AqStrength\*(Aq: <byte 0x5c>},)
287 /org/freedesktop/NetworkManager/AccessPoint/4141: org\&.freedesktop\&.NetworkManager\&.AccessPoint\&.PropertiesChanged ({\*(AqStrength\*(Aq: <byte 0x64>},)
288 /org/freedesktop/NetworkManager/AccessPoint/4141: org\&.freedesktop\&.NetworkManager\&.AccessPoint\&.PropertiesChanged ({\*(AqStrength\*(Aq: <byte 0x5e>},)
289 /org/freedesktop/NetworkManager/AccessPoint/4141: org\&.freedesktop\&.NetworkManager\&.AccessPoint\&.PropertiesChanged ({\*(AqStrength\*(Aq: <byte 0x64>},)
290 .fi
291 .if n \{\
292 .RE
293 .\}
294 .PP
295 Emitting a signal:
296 .sp
297 .if n \{\
298 .RS 4
299 .\}
300 .nf
301 $ gdbus emit \-\-session \-\-object\-path /foo \-\-signal org\&.bar\&.Foo "[\*(Aqfoo\*(Aq, \*(Aqbar\*(Aq, \*(Aqbaz\*(Aq]"
302 .fi
303 .if n \{\
304 .RE
305 .\}
306 .PP
307 Emitting a signal to a specific process:
308 .sp
309 .if n \{\
310 .RS 4
311 .\}
312 .nf
313 $ gdbus emit \-\-session \-\-object\-path /bar \-\-signal org\&.bar\&.Bar someString \-\-dest :1\&.42
314 .fi
315 .if n \{\
316 .RE
317 .\}
318 .SH "BUGS"
319 .PP
320 Please send bug reports to either the distribution bug tracker or the upstream bug tracker at
321 \m[blue]\fB\%https://bugzilla.gnome.org/enter_bug.cgi?product=glib\fR\m[]\&.
322 .SH "SEE ALSO"
323 .PP
324 \fBdbus-send\fR(1)