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

Last change on this file since 25880 was 19799, checked in by felix winkelmann, 11 years ago

applied dbus porting patch by andrei barbu

File size: 959 bytes
Line 
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
6
7(use dbus)
8
9(define (turn-right) (printf "rolls eyes and turns to the right~%"))
10(define (turn-left) (printf "rolls eyes and turns to the left~%"))
11
12(define (query . params)
13        (printf "got some sort of banal query; params: ~s~%" params)
14        ;; the response to the query:
15        `(#t 42))
16
17(define rc-car-context (dbus:make-context
18        service: 'com.trolltech.CarExample
19        path: '/Car
20        interface: 'com.trolltech.Examples.CarInterface ))
21
22(define query-context (dbus:make-context
23        service: 'test.method.server
24        interface: 'test.method.Type
25        path: '/test/method/Object))
26
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.