source: project/release/4/dbus/trunk/examples/receive-car-turn.scm @ 31082

Last change on this file since 31082 was 31082, checked in by ecloud, 6 years ago

dump more info when failing to find a callback; updated remote-car example for Qt 5

File size: 763 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: 'org.example.CarExample
9        path: '/Car
10        interface: 'org.example.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.