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:
767 bytes
|
Line | |
---|
1 | (use (prefix dbus dbus:)) |
---|
2 | |
---|
3 | (define (turn-right) (printf "car is turning to the right~%")) |
---|
4 | (define (turn-left) (printf "car is turning to the left~%")) |
---|
5 | |
---|
6 | (define rc-car-context (dbus:make-context |
---|
7 | ; bus: dbus:session-bus ;; would be the session-bus by default anyway |
---|
8 | service: 'com.trolltech.CarExample |
---|
9 | path: '/Car |
---|
10 | interface: 'com.trolltech.Examples.CarInterface )) |
---|
11 | |
---|
12 | (dbus:enable-polling-thread! |
---|
13 | ; bus: dbus:session-bus ;; would be the session-bus by default anyway |
---|
14 | enable: #f) |
---|
15 | |
---|
16 | (dbus:register-method rc-car-context "turnRight" turn-right) |
---|
17 | (dbus:register-method rc-car-context "turnLeft" turn-left) |
---|
18 | |
---|
19 | (let loop () |
---|
20 | ; (printf "poll~%") |
---|
21 | ; (dbus:poll-for-message bus: dbus:session-bus) ;; would be the session-bus by default anyway |
---|
22 | (dbus:poll-for-message) |
---|
23 | (loop)) |
---|
Note: See
TracBrowser
for help on using the repository browser.