man-pages/man1/dbus-send.1.html
2021-03-31 01:06:50 +01:00

233 lines
5.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of DBUS-SEND</TITLE>
</HEAD><BODY>
<H1>DBUS-SEND</H1>
Section: User Commands (1)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
dbus-send - Send a message to a message bus
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<DL COMPACT>
<DT id="1">
<B>dbus-send</B> [--system | --session | --address=<I>ADDRESS</I>] [--dest=<I>NAME</I>] [--print-reply&nbsp;[<I>=literal</I>]] [--reply-timeout=<I>MSEC</I>] [--type=<I>TYPE</I>] <I>OBJECT_PATH</I> <I>INTERFACE.MEMBER</I> [<I>CONTENTS</I>...]
<DD>
<P>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<DD>The
<B>dbus-send</B>
command is used to send a message to a D-Bus message bus. See
m[blue]<B><A HREF="http://www.freedesktop.org/software/dbus/">http://www.freedesktop.org/software/dbus/</A></B>m[]
for more information about the big picture.
<P>
There are two well-known message buses: the systemwide message bus (installed on many systems as the &quot;messagebus&quot; service) and the per-user-login-session message bus (started each time a user logs in). The
<B>--system</B>
and
<B>--session</B>
options direct
<B>dbus-send</B>
to send messages to the system or session buses respectively. If neither is specified,
<B>dbus-send</B>
sends to the session bus.
<P>
Nearly all uses of
<B>dbus-send</B>
must provide the
<B>--dest</B>
argument which is the name of a connection on the bus to send the message to. If
<B>--dest</B>
is omitted, no destination is set.
<P>
The object path and the name of the message to send must always be specified. Following arguments, if any, are the message contents (message arguments). These are given as type-specified values and may include containers (arrays, dicts, and variants) as described below.
<P>
<DL COMPACT><DT id="2"><DD>
<PRE>
&lt;contents&gt; ::= &lt;item&gt; | &lt;container&gt; [ &lt;item&gt; | &lt;container&gt;...]
&lt;item&gt; ::= &lt;type&gt;:&lt;value&gt;
&lt;container&gt; ::= &lt;array&gt; | &lt;dict&gt; | &lt;variant&gt;
&lt;array&gt; ::= array:&lt;type&gt;:&lt;value&gt;[,&lt;value&gt;...]
&lt;dict&gt; ::= dict:&lt;type&gt;:&lt;type&gt;:&lt;key&gt;,&lt;value&gt;[,&lt;key&gt;,&lt;value&gt;...]
&lt;variant&gt; ::= variant:&lt;type&gt;:&lt;value&gt;
&lt;type&gt; ::= string | int16 | uint16 | int32 | uint32 | int64 | uint64 | double | byte | boolean | objpath
</PRE>
</DL>
<P>
D-Bus supports more types than these, but
<B>dbus-send</B>
currently does not. Also,
<B>dbus-send</B>
does not permit empty containers or nested containers (e.g. arrays of variants).
<P>
Here is an example invocation:
<P>
<DL COMPACT><DT id="3"><DD>
<PRE>
dbus-send --dest=org.freedesktop.ExampleName \
/org/freedesktop/sample/object/name \
org.freedesktop.ExampleInterface.ExampleMethod \
int32:47 string:'hello world' double:65.32 \
array:string:&quot;1st item&quot;,&quot;next item&quot;,&quot;last item&quot; \
dict:string:int32:&quot;one&quot;,1,&quot;two&quot;,2,&quot;three&quot;,3 \
variant:int32:-8 \
objpath:/org/freedesktop/sample/object/name
</PRE>
</DL>
<P>
Note that the interface is separated from a method or signal name by a dot, though in the actual protocol the interface and the interface member are separate fields.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<P>
The following options are supported:
<P>
<B>--dest=</B><I>NAME</I>
<DL COMPACT><DT id="4"><DD>
Specify the name of the connection to receive the message.
</DL>
<P>
<B>--print-reply</B>
<DL COMPACT><DT id="5"><DD>
Block for a reply to the message sent, and print any reply received in a human-readable form. It also means the message type (<B>--type=</B>) is
<B>method_call</B>.
</DL>
<P>
<B>--print-reply=literal</B>
<DL COMPACT><DT id="6"><DD>
Block for a reply to the message sent, and print the body of the reply. If the reply is an object path or a string, it is printed literally, with no punctuation, escape characters etc.
</DL>
<P>
<B>--reply-timeout=</B><I>MSEC</I>
<DL COMPACT><DT id="7"><DD>
Wait for a reply for up to
<I>MSEC</I>
milliseconds. The default is implementation-defined, typically 25 seconds.
</DL>
<P>
<B>--system</B>
<DL COMPACT><DT id="8"><DD>
Send to the system message bus.
</DL>
<P>
<B>--session</B>
<DL COMPACT><DT id="9"><DD>
Send to the session message bus. (This is the default.)
</DL>
<P>
<B>--address=</B><I>ADDRESS</I>
<DL COMPACT><DT id="10"><DD>
Send to
<I>ADDRESS</I>.
</DL>
<P>
<B>--type=</B><I>TYPE</I>
<DL COMPACT><DT id="11"><DD>
Specify
<B>method_call</B>
or
<B>signal</B>
(defaults to &quot;<B>signal</B>&quot;).
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>AUTHOR</H2>
<P>
dbus-send was written by Philip Blundell.
<A NAME="lbAG">&nbsp;</A>
<H2>BUGS</H2>
<P>
Please send bug reports to the D-Bus mailing list or bug tracker, see
m[blue]<B><A HREF="http://www.freedesktop.org/software/dbus/">http://www.freedesktop.org/software/dbus/</A></B>m[]
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="12"><A HREF="#lbAB">NAME</A><DD>
<DT id="13"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="14"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="15"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="16"><A HREF="#lbAF">AUTHOR</A><DD>
<DT id="17"><A HREF="#lbAG">BUGS</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:09 GMT, March 31, 2021
</BODY>
</HTML>