1 ;; This is a test program for the lsp-dbus provided dbus API.
4 ;; Loading that module sets up core framework API and connects to
5 ;; dbus' system bus registering this application. This includes
6 ;; Dbus:ROOT for the "/org/freedektop/DBus" path, and Dbus:DBus for
7 ;; the interrface "org.freedektop.DBus".
9 ;; Register a handler for the NameAcquired signal, to replace the one
10 ;; installed by lsp-dbus.lsp
12 ;; Request a bus name "au.rrq" for this client
13 (println "RequestName: "
14 (if (:invoke Dbus:ROOT (:m ObjectManager "RequestName(su)")
16 (!= ($it -1 -1 -1)) ; returns BOOLEAN
19 ;; Set up a Match rule to see stuff
21 (join (list "type='signal'"
22 ;;"sender='org.example.App2'"
23 ;;"path_namespace='/au/rrq'"
27 (println "AddMatch:\n" MATCH-RULE "\n"
28 (if (:invoke Dbus:ROOT (:m Dbus:DBus "AddMatch(s)")
30 ($it -1 -1 -1) ; returns OOM on error
36 (println (if (:invoke Dbus:ROOT
37 (print "GetNameOwner(s)")
38 (println (list "org.bluez")))
39 ($it -1 -1 -1) ; Return value
41 (Dbus:process-all-pending)
43 (println (setf org.bluez (Dbus "/" "org.bluez")))
44 (println (if (:invoke org.bluez (:m ObjectManager "GetManagedObjects()"))
45 ($it -1 -1 -1) ; Return value