From: Michael Albinus Date: Wed, 6 Feb 2008 20:54:19 +0000 (+0000) Subject: * net/dbus.el (dbus-interface-peer): New defconst. X-Git-Tag: emacs-pretest-23.0.90~8134 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4ba11bcb85896ea1201edb4f03b7b0a30c93334b;p=emacs.git * net/dbus.el (dbus-interface-peer): New defconst. (dbus-ping): New defun. --- diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 6ecd0065606..4390f305b66 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -47,7 +47,11 @@ (defconst dbus-interface-dbus "org.freedesktop.DBus" "The interface exported by the object with `dbus-service-dbus' and `dbus-path-dbus'.") -(defconst dbus-interface-introspectable "org.freedesktop.DBus.Introspectable" +(defconst dbus-interface-peer (concat dbus-interface-dbus ".Peer") + "The interface for peer objects.") + +(defconst dbus-interface-introspectable + (concat dbus-interface-dbus ".Introspectable") "The interface supported by introspectable objects.") (defmacro dbus-ignore-errors (&rest body) @@ -319,6 +323,15 @@ The result is either a string, or nil if there is no name owner." bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus "GetNameOwner" service))) +(defun dbus-ping (bus service) + "Check whether SERVICE is registered for D-Bus BUS." + ;; "Ping" raises a D-Bus error if SERVICE does not exist. + ;; Otherwise, it returns silently with `nil'. + (condition-case nil + (not + (dbus-call-method bus service dbus-path-dbus dbus-interface-peer "Ping")) + (dbus-error nil))) + (defun dbus-introspect (bus service path) "Return the introspection data of SERVICE in D-Bus BUS at object path PATH. The data are in XML format.