2010-02-10 13:03:19 +01:00
<?xml version="1.0" encoding="ISO-8859-1"?>
2013-02-05 02:19:28 +01:00
< !DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
2010-02-10 13:03:19 +01:00
<refentry id= 'dbussend1' >
2013-02-05 02:19:28 +01:00
<!-- dbus\ - send manual page.
Copyright (C) 2003 Red Hat, Inc. -->
2010-02-10 13:03:19 +01:00
<refmeta >
<refentrytitle > dbus-send</refentrytitle>
<manvolnum > 1</manvolnum>
2013-02-12 16:01:56 +00:00
<refmiscinfo class= "manual" > User Commands</refmiscinfo>
<refmiscinfo class= "source" > D-Bus</refmiscinfo>
2013-02-14 13:23:52 +00:00
<refmiscinfo class= "version" > @DBUS_VERSION@</refmiscinfo>
2010-02-10 13:03:19 +01:00
</refmeta>
2013-02-05 02:19:28 +01:00
<refnamediv >
2010-02-10 13:03:19 +01:00
<refname > dbus-send</refname>
<refpurpose > Send a message to a message bus</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id= 'synopsis' >
<cmdsynopsis >
2013-02-14 13:30:19 +00:00
<command > dbus-send</command>
2013-05-31 17:36:04 +08:00
<group choice= 'opt' > <arg choice= 'plain' > --system </arg> <arg choice= 'plain' > --session </arg> <arg choice= 'plain' > --address=<replaceable > ADDRESS</replaceable> </arg> </group>
2010-02-10 13:03:19 +01:00
<arg choice= 'opt' > --dest=<replaceable > NAME</replaceable> </arg>
2013-02-05 02:19:28 +01:00
<arg choice= 'opt' > <arg choice= 'plain' > --print-reply </arg> <arg choice= 'opt' > <replaceable > =literal</replaceable> </arg> </arg>
<arg choice= 'opt' > --reply-timeout=<replaceable > MSEC</replaceable> </arg>
2010-02-10 13:03:19 +01:00
<arg choice= 'opt' > --type=<replaceable > TYPE</replaceable> </arg>
2013-02-05 02:19:28 +01:00
<arg choice= 'plain' > <replaceable > OBJECT_PATH</replaceable> </arg>
<arg choice= 'plain' > <replaceable > INTERFACE.MEMBER</replaceable> </arg>
<arg choice= 'opt' rep= 'repeat' > <replaceable > CONTENTS</replaceable> </arg>
2010-02-10 13:03:19 +01:00
<sbr />
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id= 'description' > <title > DESCRIPTION</title>
<para > The <command > dbus-send</command> command is used to send a message to a D-Bus message
2013-02-14 13:30:19 +00:00
bus. See <ulink url= 'http://www.freedesktop.org/software/dbus/' > http://www.freedesktop.org/software/dbus/</ulink> for more
2010-02-10 13:03:19 +01:00
information about the big picture.</para>
2013-02-14 13:30:19 +00:00
<para > There are two well-known message buses: the systemwide message bus
(installed on many systems as the "messagebus" service) and the
2010-02-10 13:03:19 +01:00
per-user-login-session message bus (started each time a user logs in).
2013-02-05 02:19:28 +01:00
The <option > --system</option> and <option > --session</option> options direct
<command > dbus-send</command> to send messages to the system or session buses respectively.
If neither is specified, <command > dbus-send</command> sends to the session bus.</para>
2010-02-10 13:03:19 +01:00
2013-02-05 02:19:28 +01:00
<para > Nearly all uses of <command > dbus-send</command> must provide the <option > --dest</option> argument
2010-02-10 13:03:19 +01:00
which is the name of a connection on the bus to send the message to. If
2013-02-05 02:19:28 +01:00
<option > --dest</option> is omitted, no destination is set.</para>
2010-02-10 13:03:19 +01:00
<para > The object path and the name of the message to send must always be
specified. Following arguments, if any, are the message contents
2013-02-14 13:30:19 +00:00
(message arguments). These are given as type-specified values and
2010-02-10 13:03:19 +01:00
may include containers (arrays, dicts, and variants) as described below.</para>
<literallayout remap= '.nf' >
< contents> ::= < item> | < container> [ < item> | < container> ...]
< item> ::= < type> :< value>
< container> ::= < array> | < dict> | < variant>
2013-02-14 13:30:19 +00:00
< array> ::= array:< type> :< value> [,< value> ...]
2010-02-10 13:03:19 +01:00
< dict> ::= dict:< type> :< type> :< key> ,< value> [,< key> ,< value> ...]
< variant> ::= variant:< type> :< value>
< type> ::= string | int16 | uint 16 | int32 | uint32 | int64 | uint64 | double | byte | boolean | objpath
</literallayout> <!-- .fi -->
<para > D-Bus supports more types than these, but <command > dbus-send</command> currently
does not. Also, <command > dbus-send</command> does not permit empty containers
or nested containers (e.g. arrays of variants).</para>
<para > Here is an example invocation:</para>
<literallayout remap= '.nf' >
2013-02-05 02:19:28 +01:00
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:"1st item","next item","last item" \
dict:string:int32:"one",1,"two",2,"three",3 \
variant:int32:-8 \
2013-02-14 13:30:19 +00:00
objpath:/org/freedesktop/sample/object/name
2010-02-10 13:03:19 +01:00
</literallayout> <!-- .fi -->
2013-02-14 13:30:19 +00:00
<para > Note that the interface is separated from a method or signal
2010-02-10 13:03:19 +01:00
name by a dot, though in the actual protocol the interface
and the interface member are separate fields.</para>
</refsect1>
<refsect1 id= 'options' > <title > OPTIONS</title>
<para > The following options are supported:</para>
<variablelist remap= 'TP' >
<varlistentry >
2013-02-05 02:19:28 +01:00
<term > <option > --dest=</option> <replaceable > NAME</replaceable> </term>
2010-02-10 13:03:19 +01:00
<listitem >
<para > Specify the name of the connection to receive the message.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --print-reply</option> </term>
<listitem >
2013-02-05 02:19:28 +01:00
<para > Block for a reply to the message sent, and print any reply received
2013-05-31 17:36:04 +08:00
in a human-readable form. It also means the message type (<option > --type=</option> ) is <emphasis remap= 'B' > method_call</emphasis> .</para>
2013-02-05 02:19:28 +01:00
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --print-reply=literal</option> </term>
<listitem >
<para > 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.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --reply-timeout=</option> <replaceable > MSEC</replaceable> </term>
<listitem >
<para > Wait for a reply for up to <emphasis remap= 'I' > MSEC</emphasis> milliseconds.
The default is implementation‐ defined, typically 25 seconds.</para>
2010-02-10 13:03:19 +01:00
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --system</option> </term>
<listitem >
<para > Send to the system message bus.</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --session</option> </term>
<listitem >
<para > Send to the session message bus. (This is the default.)</para>
2013-05-31 17:36:04 +08:00
</listitem>
</varlistentry>
<varlistentry >
<term > <option > --address=</option> <replaceable > ADDRESS</replaceable> </term>
<listitem >
<para > Send to <replaceable > ADDRESS</replaceable> .</para>
2010-02-10 13:03:19 +01:00
</listitem>
</varlistentry>
<varlistentry >
2013-02-05 02:19:28 +01:00
<term > <option > --type=</option> <replaceable > TYPE</replaceable> </term>
2010-02-10 13:03:19 +01:00
<listitem >
2013-02-05 02:19:28 +01:00
<para > Specify <emphasis remap= 'B' > method_call</emphasis> or <emphasis remap= 'B' > signal</emphasis> (defaults to "<emphasis remap= 'B' > signal</emphasis> ").</para>
2010-02-10 13:03:19 +01:00
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id= 'author' > <title > AUTHOR</title>
<para > dbus-send was written by Philip Blundell.</para>
</refsect1>
<refsect1 id= 'bugs' > <title > BUGS</title>
<para > Please send bug reports to the D-Bus mailing list or bug tracker,
see <ulink url= 'http://www.freedesktop.org/software/dbus/' > http://www.freedesktop.org/software/dbus/</ulink> </para>
</refsect1>
</refentry>