minor test update
[rrq/lsp-utils.git] / lsp-dbus-test.lsp
1 ;; This is a test program for the lsp-dbus provided dbus API.
2
3 (load "lsp-dbus.lsp")
4
5 ;; Connect to system bus and set up core framework API
6
7 ;; Install my own framework object
8 (die nil (setf au.rrq (Dbus "/au/rrq")))
9
10 ;; Request a bus name
11 (println (if (:invoke Dbus:ROOT
12                       (print (:m ObjectManager "RequestName(su)"))
13                       (println (list (:%name au.rrq) 0)))
14              (!= ($it -1 -1 -1)) ; returns BOOLEAN
15            ))
16 (Dbus:process-all-pending)
17
18 (println (if (:invoke Dbus:ROOT
19                       (print "GetNameOwner(s)")
20                       (println (list "org.bluez")))
21              ($it -1 -1 -1) ; Return value
22            ))
23 (Dbus:process-all-pending)
24
25 (println (setf org.bluez (Dbus "/" "org.bluez")))
26 (println (if (:invoke org.bluez
27                       (println (:m ObjectManager "GetManagedObjects()")))
28              ($it -1 -1 -1) ; Return value
29            ))
30
31
32 (reset) ; 
33
34 "lsp-dbus-test.lsp"