<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
<!--ArborText, Inc., 1988-1999, v.4002-->
<!--ARC : LSARC 2006/368 D-BUS Message Bus System -->
<!ENTITY cmd "dbus-send">
<!ENTITY % commonents SYSTEM "smancommon.ent">
%commonents;
<!ENTITY % booktitles SYSTEM "booktitles.ent">
%booktitles;
<!ENTITY suncopy "Copyright (c) 2007,2009 Sun Microsystems, Inc. All Rights Reserved.">
]>
<?Pub UDT _bookmark _target>
<?Pub Inc>
<refentry id="dbus-send-1">
<!-- %Z%%M% %I% %E% SMI; -->
<refmeta><refentrytitle>&cmd;</refentrytitle><manvolnum>1</manvolnum>
<refmiscinfo class="date">25 Feb 2009</refmiscinfo>
<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
<refmiscinfo class="software">&release;</refmiscinfo>
<refmiscinfo class="arch">generic</refmiscinfo>
<refmiscinfo class="copyright">&suncopy;</refmiscinfo>
</refmeta>
<indexterm><primary>&cmd;</primary></indexterm>
<indexterm><primary>Send a message to a message bus</primary></indexterm>
<refnamediv id="dbus-send-1-name">
<refname>&cmd;</refname><refpurpose>
Send a message to a message bus
</refpurpose>
</refnamediv>
<refsynopsisdiv id="dbus-send-1-synp"><title>&synp-tt;</title>
<cmdsynopsis><command>&cmd;</command>
<arg choice="opt"><option>-system</option> | <option>-session</option></arg>
<arg choice="opt"><option>-dest=<replaceable>name</replaceable></option></arg>
<arg choice="opt"><option>-help</option></arg>
<arg choice="opt"><option>-print-reply</option></arg>
<arg choice="opt"><option>-type=<replaceable>type</replaceable></option></arg>
<arg choice="plain"><option role="nodash">destination_object_path</option></arg>
<arg choice="plain"><option role="nodash">message_name</option></arg>
<arg rep="repeat"><option role="nodash">contents</option></arg>
</cmdsynopsis></refsynopsisdiv>

<refsect1 id="dbus-send-1-desc"><title>&desc-tt;</title>
<para>
The <command>&cmd;</command> command is used to send a message to a D\-Bus
message bus.
</para>

<para>
There are two standard message buses:
</para>

<itemizedlist>
<listitem><para>
systemwide message bus - Launched when the system is started and is always
available.  Additional systemwide services can be launched via D\-Bus
service activation.  However, D\-Bus service activation is disabled on Solaris.
</para></listitem>
<listitem><para>
per-user-login-session message bus - Launched each time a user logs in.
</para></listitem>
</itemizedlist>

<para>
The <option>-system</option> and <option>-session</option> options direct
<command>&cmd;</command> to send messages to the  system  or session buses
respectively.  If neither is specified, &cmd; sends to the session bus.
</para>

<para>
Nearly all uses of <command>&cmd;</command> must provide the
<option>-dest</option> argument which is the name of a connection on the bus to
send the message to.  If <option>-dest</option> is omitted, no destination is
set.
</para>

<para>
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.
</para>

<para>
<screen>
     &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 | uint 16 | int32 | uint32 |
                      int64 | uint64 | double | byte | boolean | objpath
</screen>
</para>

<para>
D\-Bus supports more types than these, but <command>&cmd;</command> currently
does not.  Also, <command>&cmd;</command> does not permit empty containers or
nested containers (e.g. arrays of variants).
</para>
</refsect1>

<refsect1 id="dbus-send-1-opts"><title>&opts-tt;</title>

<para>
The following options are supported:
</para>

<variablelist termlength="wholeline">
<varlistentry>
<term><option>-dest=<replaceable>name</replaceable></option></term>
<listitem><para>
Specify the <replaceable>name</replaceable> of the connection to receive the
message.
</para></listitem></varlistentry>

<varlistentry>
<term><option>-help</option></term>
<listitem><para>
Show help information on standard output and exit.
</para></listitem></varlistentry>

<varlistentry>
<term><option>-print-reply</option></term>
<listitem><para>
Block for a reply to the message sent, and print any reply received.
</para></listitem></varlistentry>

<varlistentry>
<term><option>-session</option></term>
<listitem><para>
Send to the session message bus (this is the default).
</para></listitem></varlistentry>

<varlistentry>
<term><option>-system</option></term>
<listitem><para>
Send to the system message bus.  The system bus is disabled and unsupported
on Solaris.
</para></listitem></varlistentry>

<varlistentry>
<term><option>-type=<replaceable>type</replaceable></option></term>
<listitem><para>
Specify &quot;method_call&quot; or &quot;signal&quot; (defaults to
&quot;signal&quot;).
</para></listitem></varlistentry>
</variablelist></refsect1>

<refsect1 id="dbus-send-1-oper"><title>&oper-tt;</title>

<para>
The following operands are supported:
</para>

<variablelist termlength="medium">
<varlistentry>
<term><option role="nodash"><replaceable>destination_object_path</replaceable></option></term>
<listitem><para>
The object path of the message to send must always be specified.
</para></listitem></varlistentry>

<varlistentry>
<term><option role="nodash"><replaceable>message_name</replaceable></option></term>
<listitem><para>
The name of the message to send must always be specified.
</para></listitem></varlistentry>

<varlistentry>
<term><option role="nodash"><replaceable>contents</replaceable></option></term>
<listitem><para>
Following arguments, if any, are the message contents (message arguments).
These are given as a type name, a colon, and then the value of the argument.
</para></listitem></varlistentry>
</variablelist></refsect1>

<refsect1 id="dbus-send-1-exam"><title>&exam-tt;</title>
<example role="example">
<title>How to use <command>&cmd;</command> with a sh-compatible shell to start
the per-session bus daemon</title>

<para>
<screen>example% <userinput>&cmd; --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                                 \\
                   objpath:/org/freedesktop/sample/object/name
</userinput>
</screen></para>

<para>
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.
</para>
</example>
</refsect1>

<refsect1 id="dbus-send-1-exit"><title>&exit-tt;</title>
<para>
The following exit values are returned:
</para>

<variablelist termlength="xtranarrow">
<varlistentry>
<term><returnvalue>0</returnvalue></term>
<listitem><para>
Application exited successfully
</para>
</listitem></varlistentry>

<varlistentry>
<term><returnvalue>>0</returnvalue></term>
<listitem><para>
Application exited with failure
</para>
</listitem></varlistentry>
</variablelist></refsect1>

<refsect1 id="dbus-send-1-file"><title>&file-tt;</title>
<para>
The following files are used by this application:
</para>

<variablelist termlength="wide">
<varlistentry>
<term><filename>/usr/bin/&cmd;</filename></term>
<listitem><para>
Executable for <command>&cmd;</command>
</para>
</listitem></varlistentry>

</variablelist>
</refsect1>

<refsect1 id="dbus-send-1-attr"><title>&attr-tt;</title>
<para>
See
<olink targetdocent="REFMAN5" localinfo="attributes-5">
<citerefentry><refentrytitle>attributes</refentrytitle>
<manvolnum>5</manvolnum></citerefentry></olink>
for descriptions of the following attributes:
</para>

<informaltable frame="all">
<tgroup cols="2" colsep="1" rowsep="1">
<colspec colname="COLSPEC0" colwidth="1*">
<colspec colname="COLSPEC1" colwidth="1*">
<thead>
<row>
<entry align="center" valign="middle">ATTRIBUTE TYPE</entry>
<entry align="center"
valign="middle">ATTRIBUTE VALUE</entry></row>
</thead>
<tbody>
<row>
<entry><para>Availability</para></entry>
<entry><para>system/library/dbus</para></entry>
</row>
<row>
<entry colname="COLSPEC0"><para>Interface stability</para></entry>
<entry colname="COLSPEC1"><para>Volatile</para></entry>
</row>
</tbody></tgroup>
</informaltable>
</refsect1>

<refsect1 id="dbus-send-1-also"><title>&also-tt;</title>
<!--Reference to another man page-->
<!--Reference to a Help manual-->
<!--Reference to a book.-->
<para>
More information can be found at:
</para>

<para>
<literal>http://www.freedesktop.org/software/dbus/</literal>
</para>

<para>
<citerefentry><refentrytitle>dbus-binding-tool</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-cleanup-sockets</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-launch</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-monitor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-uuidgen</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libdbus-glib-1</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry>
</para>

</refsect1>
<refsect1 id="dbus-send-1-note"><title>&note-tt;</title>
<para>
For authorship information refer to
<literal>http://www.freedesktop.org/software/dbus/doc/AUTHORS</literal>.
Updated by Brian Cameron, Sun Microsystems Inc., 2007.
</para>
<para>
<command>&cmd;</command> was written by Philip Blundell.
</para>
<para>
Please send bug reports to the D\-Bus mailing list or bug
tracker, see
<literal>http://www.freedesktop.org/software/dbus/</literal>
</para>
</refsect1>
</refentry>
