Next: , Previous: , Up: D-Bus integration in Emacs   [Contents][Index]

5 Calling methods non-blocking.

Function: dbus-call-method-asynchronously bus service path interface method handler &optional :timeout timeout &rest args

This function calls method on the D-Bus bus asynchronously. bus is either the keyword :system or the keyword :session.

service is the D-Bus service name to be used. path is the D-Bus object path, service is registered at. interface is an interface offered by service. It must provide method.

handler is a Lisp function, which is called when the corresponding return message arrives. If handler is nil, no return message will be expected.

If the parameter :timeout is given, the following integer timeout specifies the maximum number of milliseconds before a reply message must arrive. The default value is 25,000. If there is no reply message in time, a D-Bus error is raised (see Errors and events.).

The remaining arguments args are passed to method as arguments. They are converted into D-Bus types as described in Mapping Lisp types and D-Bus types..

If handler is a Lisp function, the function returns a key into the hash table dbus-registered-objects-table. The corresponding entry in the hash table is removed, when the return message arrives, and handler is called. Example:

 :system "org.freedesktop.Hal"
 "org.freedesktop.Hal.Device" "GetPropertyString"
 (lambda (msg) (message "%s" msg))

-| i686

⇒ (:serial :system 2)