| 1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> |
| 4 |
<refentry id='dbussend1'> |
| 5 |
|
| 6 |
<!-- dbus\-send manual page. |
| 7 |
Copyright (C) 2003 Red Hat, Inc. --> |
| 8 |
|
| 9 |
<refmeta> |
| 10 |
<refentrytitle>dbus-send</refentrytitle> |
| 11 |
<manvolnum>1</manvolnum> |
| 12 |
<refmiscinfo class="manual">User Commands</refmiscinfo> |
| 13 |
<refmiscinfo class="source">D-Bus</refmiscinfo> |
| 14 |
<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo> |
| 15 |
</refmeta> |
| 16 |
<refnamediv> |
| 17 |
<refname>dbus-send</refname> |
| 18 |
<refpurpose>Send a message to a message bus</refpurpose> |
| 19 |
</refnamediv> |
| 20 |
<!-- body begins here --> |
| 21 |
<refsynopsisdiv id='synopsis'> |
| 22 |
<cmdsynopsis> |
| 23 |
<command>dbus-send</command> |
| 24 |
<group choice='opt'><arg choice='plain'>--system </arg><arg choice='plain'>--session </arg><arg choice='plain'>--bus=<replaceable>ADDRESS</replaceable></arg><arg choice='plain'>--peer=<replaceable>ADDRESS</replaceable></arg></group> |
| 25 |
<arg choice='opt'>--sender=<replaceable>NAME</replaceable></arg> |
| 26 |
<arg choice='opt'>--dest=<replaceable>NAME</replaceable></arg> |
| 27 |
<arg choice='opt'><arg choice='plain'>--print-reply </arg><arg choice='opt'><replaceable>=literal</replaceable></arg></arg> |
| 28 |
<arg choice='opt'>--reply-timeout=<replaceable>MSEC</replaceable></arg> |
| 29 |
<arg choice='opt'>--type=<replaceable>TYPE</replaceable></arg> |
| 30 |
<arg choice='plain'><replaceable>OBJECT_PATH</replaceable></arg> |
| 31 |
<arg choice='plain'><replaceable>INTERFACE.MEMBER</replaceable></arg> |
| 32 |
<arg choice='opt' rep='repeat'><replaceable>CONTENTS</replaceable></arg> |
| 33 |
<sbr/> |
| 34 |
</cmdsynopsis> |
| 35 |
</refsynopsisdiv> |
| 36 |
|
| 37 |
|
| 38 |
<refsect1 id='description'><title>DESCRIPTION</title> |
| 39 |
<para>The <command>dbus-send</command> command is used to send a message to a D-Bus message |
| 40 |
bus. See <ulink url='https://www.freedesktop.org/wiki/Software/dbus/'>https://www.freedesktop.org/wiki/Software/dbus/</ulink> for more |
| 41 |
information about the big picture.</para> |
| 42 |
|
| 43 |
|
| 44 |
<para>There are two well-known message buses: the systemwide message bus |
| 45 |
(installed on many systems as the "messagebus" service) and the |
| 46 |
per-user-login-session message bus (started each time a user logs in). |
| 47 |
The <option>--system</option> and <option>--session</option> options direct |
| 48 |
<command>dbus-send</command> to send messages to the system or session buses respectively. |
| 49 |
If neither is specified, <command>dbus-send</command> sends to the session bus.</para> |
| 50 |
|
| 51 |
|
| 52 |
<para>Nearly all uses of <command>dbus-send</command> must provide the <option>--dest</option> argument |
| 53 |
which is the name of a connection on the bus to send the message to. If |
| 54 |
<option>--dest</option> is omitted, no destination is set.</para> |
| 55 |
|
| 56 |
|
| 57 |
<para>The object path and the name of the message to send must always be |
| 58 |
specified. Following arguments, if any, are the message contents |
| 59 |
(message arguments). These are given as type-specified values and |
| 60 |
may include containers (arrays, dicts, and variants) as described below.</para> |
| 61 |
|
| 62 |
<literallayout remap='.nf'> |
| 63 |
<contents> ::= <item> | <container> [ <item> | <container>...] |
| 64 |
<item> ::= <type>:<value> |
| 65 |
<container> ::= <array> | <dict> | <variant> |
| 66 |
<array> ::= array:<type>:<value>[,<value>...] |
| 67 |
<dict> ::= dict:<type>:<type>:<key>,<value>[,<key>,<value>...] |
| 68 |
<variant> ::= variant:<type>:<value> |
| 69 |
<type> ::= string | int16 | uint16 | int32 | uint32 | int64 | uint64 | double | byte | boolean | objpath |
| 70 |
</literallayout> <!-- .fi --> |
| 71 |
|
| 72 |
<para>D-Bus supports more types than these, but <command>dbus-send</command> currently |
| 73 |
does not. Also, <command>dbus-send</command> does not permit empty containers |
| 74 |
or nested containers (e.g. arrays of variants).</para> |
| 75 |
|
| 76 |
|
| 77 |
<para>Here is an example invocation:</para> |
| 78 |
<literallayout remap='.nf'> |
| 79 |
|
| 80 |
dbus-send --dest=org.freedesktop.ExampleName \ |
| 81 |
/org/freedesktop/sample/object/name \ |
| 82 |
org.freedesktop.ExampleInterface.ExampleMethod \ |
| 83 |
int32:47 string:'hello world' double:65.32 \ |
| 84 |
array:string:"1st item","next item","last item" \ |
| 85 |
dict:string:int32:"one",1,"two",2,"three",3 \ |
| 86 |
variant:int32:-8 \ |
| 87 |
objpath:/org/freedesktop/sample/object/name |
| 88 |
|
| 89 |
</literallayout> <!-- .fi --> |
| 90 |
|
| 91 |
<para>Note that the interface is separated from a method or signal |
| 92 |
name by a dot, though in the actual protocol the interface |
| 93 |
and the interface member are separate fields.</para> |
| 94 |
|
| 95 |
</refsect1> |
| 96 |
|
| 97 |
<refsect1 id='options'><title>OPTIONS</title> |
| 98 |
<para>The following options are supported:</para> |
| 99 |
<variablelist remap='TP'> |
| 100 |
<varlistentry> |
| 101 |
<term><option>--dest=</option><replaceable>NAME</replaceable></term> |
| 102 |
<listitem> |
| 103 |
<para>Specify the name of the connection to receive the message.</para> |
| 104 |
</listitem> |
| 105 |
</varlistentry> |
| 106 |
<varlistentry> |
| 107 |
<term><option>--print-reply</option></term> |
| 108 |
<listitem> |
| 109 |
<para>Block for a reply to the message sent, and print any reply received |
| 110 |
in a human-readable form. It also means the message type (<option>--type=</option>) is <emphasis remap='B'>method_call</emphasis>.</para> |
| 111 |
</listitem> |
| 112 |
</varlistentry> |
| 113 |
<varlistentry> |
| 114 |
<term><option>--print-reply=literal</option></term> |
| 115 |
<listitem> |
| 116 |
<para>Block for a reply to the message sent, and print the body of the |
| 117 |
reply. If the reply is an object path or a string, it is printed |
| 118 |
literally, with no punctuation, escape characters etc.</para> |
| 119 |
</listitem> |
| 120 |
</varlistentry> |
| 121 |
<varlistentry> |
| 122 |
<term><option>--reply-timeout=</option><replaceable>MSEC</replaceable></term> |
| 123 |
<listitem> |
| 124 |
<para>Wait for a reply for up to <emphasis remap='I'>MSEC</emphasis> milliseconds. |
| 125 |
The default is implementation‐defined, typically 25 seconds.</para> |
| 126 |
</listitem> |
| 127 |
</varlistentry> |
| 128 |
<varlistentry> |
| 129 |
<term><option>--system</option></term> |
| 130 |
<listitem> |
| 131 |
<para>Send to the system message bus.</para> |
| 132 |
</listitem> |
| 133 |
</varlistentry> |
| 134 |
<varlistentry> |
| 135 |
<term><option>--session</option></term> |
| 136 |
<listitem> |
| 137 |
<para>Send to the session message bus. (This is the default.)</para> |
| 138 |
</listitem> |
| 139 |
</varlistentry> |
| 140 |
<varlistentry> |
| 141 |
<term><option>--bus=</option><replaceable>ADDRESS</replaceable></term> |
| 142 |
<listitem> |
| 143 |
<para>Register on a message bus at <replaceable>ADDRESS</replaceable>, typically a <command>dbus-daemon</command>.</para> |
| 144 |
</listitem> |
| 145 |
</varlistentry> |
| 146 |
<varlistentry> |
| 147 |
<term><option>--peer=</option><replaceable>ADDRESS</replaceable></term> |
| 148 |
<listitem> |
| 149 |
<para>Send to a non-message-bus D-Bus server at <replaceable>ADDRESS</replaceable>. In this case <command>dbus-send</command> will not call the <literal>Hello</literal> method.</para> |
| 150 |
</listitem> |
| 151 |
</varlistentry> |
| 152 |
<varlistentry> |
| 153 |
<term><option>--sender=</option><replaceable>NAME</replaceable></term> |
| 154 |
<listitem> |
| 155 |
<para>Request ownership of name <replaceable>NAME</replaceable> before sending the message. The name will be released when <command>dbus-send</command> exits.</para> |
| 156 |
</listitem> |
| 157 |
</varlistentry> |
| 158 |
<varlistentry> |
| 159 |
<term><option>--type=</option><replaceable>TYPE</replaceable></term> |
| 160 |
<listitem> |
| 161 |
<para>Specify <emphasis remap='B'>method_call</emphasis> or <emphasis remap='B'>signal</emphasis> (defaults to "<emphasis remap='B'>signal</emphasis>").</para> |
| 162 |
|
| 163 |
</listitem> |
| 164 |
</varlistentry> |
| 165 |
</variablelist> |
| 166 |
</refsect1> |
| 167 |
|
| 168 |
<refsect1 id='exit-status'><title>EXIT STATUS</title> |
| 169 |
<para>Exit status 0 indicates success. A non-zero exit status indicates any failure, including invalid parameters, failure to connect to the --bus or --peer, failure to obtain the --sender name, a timeout while waiting for a reply to a method call, or receiving an error as the reply to a method call. |
| 170 |
</para> |
| 171 |
</refsect1> |
| 172 |
|
| 173 |
<refsect1 id='author'><title>AUTHOR</title> |
| 174 |
<para>dbus-send was written by Philip Blundell.</para> |
| 175 |
|
| 176 |
</refsect1> |
| 177 |
|
| 178 |
<refsect1 id='bugs'><title>BUGS</title> |
| 179 |
<para>Please send bug reports to the D-Bus mailing list or bug tracker, |
| 180 |
see <ulink url='https://www.freedesktop.org/wiki/Software/dbus/'>https://www.freedesktop.org/wiki/Software/dbus/</ulink></para> |
| 181 |
</refsect1> |
| 182 |
</refentry> |