# HG changeset patch # User Michael Albinus # Date 1202330975 0 # Node ID 83afe69ce25e2b8014afde5dd42df66ab906a544 # Parent 46cbed0b179bf5dc9112cc140d94233d20d27169 * net/dbus.el (dbus-interface-peer): New defconst. (dbus-ping): New defun. diff -r 46cbed0b179b -r 83afe69ce25e lisp/net/dbus.el --- a/lisp/net/dbus.el Wed Feb 06 20:34:23 2008 +0000 +++ b/lisp/net/dbus.el Wed Feb 06 20:49:35 2008 +0000 @@ -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,16 @@ 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. + (condition-case nil + (progn + (dbus-call-method bus service dbus-path-dbus dbus-interface-peer "Ping") + t) + (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.