Function: dbus-send-signal

dbus-send-signal is a byte-compiled function defined in dbus.el.gz.

Signature

(dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS)

Documentation

Send signal SIGNAL on the D-Bus BUS.

BUS is either a Lisp keyword, :system or :session, or a string denoting the bus address. The signal is sent from the D-Bus object Emacs is registered at BUS.

SERVICE is the D-Bus name SIGNAL is sent to. It can be either a known name or a unique name. If SERVICE is nil, the signal is sent as broadcast message. PATH is the D-Bus object path SIGNAL is sent from. INTERFACE is an interface available at PATH. It must provide signal SIGNAL.

All other arguments ARGS are passed to SIGNAL as arguments. They are converted into D-Bus types via the following rules:

  t and nil => DBUS_TYPE_BOOLEAN
  number => DBUS_TYPE_UINT32
  integer => DBUS_TYPE_INT32
  float => DBUS_TYPE_DOUBLE
  string => DBUS_TYPE_STRING
  list => DBUS_TYPE_ARRAY

All arguments can be preceded by a type keyword. For details about type keywords, see Info node (dbus)Type Conversion.

Example:

(dbus-send-signal
 :session nil "/org/gnu/Emacs" "org.gnu.Emacs.FileManager"
 "FileModified" "/home/albinus/.emacs")

Source Code

;; Defined in /usr/src/emacs/lisp/net/dbus.el.gz
(defun dbus-send-signal (bus service path interface signal &rest args)
  "Send signal SIGNAL on the D-Bus BUS.

BUS is either a Lisp keyword, `:system' or `:session', or a
string denoting the bus address.  The signal is sent from the
D-Bus object Emacs is registered at BUS.

SERVICE is the D-Bus name SIGNAL is sent to.  It can be either a known
name or a unique name.  If SERVICE is nil, the signal is sent as
broadcast message.  PATH is the D-Bus object path SIGNAL is sent from.
INTERFACE is an interface available at PATH.  It must provide signal
SIGNAL.

All other arguments ARGS are passed to SIGNAL as arguments.  They are
converted into D-Bus types via the following rules:

  t and nil => DBUS_TYPE_BOOLEAN
  number    => DBUS_TYPE_UINT32
  integer   => DBUS_TYPE_INT32
  float     => DBUS_TYPE_DOUBLE
  string    => DBUS_TYPE_STRING
  list      => DBUS_TYPE_ARRAY

All arguments can be preceded by a type keyword.  For details
about type keywords, see Info node `(dbus)Type Conversion'.

Example:

\(dbus-send-signal
 :session nil \"/org/gnu/Emacs\" \"org.gnu.Emacs.FileManager\"
 \"FileModified\" \"/home/albinus/.emacs\")"

  (or (featurep 'dbusbind)
      (signal 'dbus-error (list "Emacs not compiled with dbus support")))
  (or (memq bus '(:system :session :system-private :session-private))
      (stringp bus)
      (signal 'wrong-type-argument (list 'keywordp bus)))
  (or (null service) (stringp service)
      (signal 'wrong-type-argument (list 'stringp service)))
  (or (stringp path)
      (signal 'wrong-type-argument (list 'stringp path)))
  (or (stringp interface)
      (signal 'wrong-type-argument (list 'stringp interface)))
  (or (stringp signal)
      (signal 'wrong-type-argument (list 'stringp signal)))

  (apply #'dbus-message-internal dbus-message-type-signal
	 bus service path interface signal args))