source: project/release/4/dbus/trunk/examples/paranoid-android.scm @ 25884

Last change on this file since 25884 was 25884, checked in by ecloud, 9 years ago

Removed dbus: prefix; you can add it back like this: (use (prefix dbus dbus:))

File size: 974 bytes
1;; What do you get when you merge a remote-control car
2;; with a supercomputer capable of deep thought?
3;; A paranoid android!
4;; Well actually it should walk rather than roll...
5;; but the remote-control API can still be the same
7(use (prefix dbus dbus:))
9(define (turn-right) (printf "rolls eyes and turns to the right~%"))
10(define (turn-left) (printf "rolls eyes and turns to the left~%"))
12(define (query . params)
13        (printf "got some sort of banal query; params: ~s~%" params)
14        ;; the response to the query:
15        `(#t 42))
17(define rc-car-context (dbus:make-context
18        service: 'com.trolltech.CarExample
19        path: '/Car
20        interface: 'com.trolltech.Examples.CarInterface ))
22(define query-context (dbus:make-context
23        service: 'test.method.server
24        interface: 'test.method.Type
25        path: '/test/method/Object))
27(dbus:register-method query-context "Method" query)
28(dbus:register-method rc-car-context "turnRight" turn-right)
29(dbus:register-method rc-car-context "turnLeft" turn-left)
Note: See TracBrowser for help on using the repository browser.