diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2012-03-04 22:22:51 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2012-03-04 22:22:51 +0100 |
commit | 78908906a5ebedba5762cb6ac392bfed651c7c7c (patch) | |
tree | 1f2323f458282d888efec1d2af4f7a98f0a8ad0f /ebus-racket/layer2.rkt | |
parent | 9a9b5befc963b32d91a85e14efb04d7ac4ca592f (diff) | |
download | ebus-alt-78908906a5ebedba5762cb6ac392bfed651c7c7c.tar.gz ebus-alt-78908906a5ebedba5762cb6ac392bfed651c7c7c.zip |
ebus-racket: inserter.rkt , overall improvements
Diffstat (limited to 'ebus-racket/layer2.rkt')
-rw-r--r-- | ebus-racket/layer2.rkt | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ebus-racket/layer2.rkt b/ebus-racket/layer2.rkt index e0f9fbd..9ed2118 100644 --- a/ebus-racket/layer2.rkt +++ b/ebus-racket/layer2.rkt @@ -2,6 +2,7 @@ (require racket/bool (planet bzlib/parseq:1:3)) +(define logger (make-logger 'ebus-layer2 (current-logger))) ;; Ebus SYN (define ebus-const-syn #xaa) ;; Ebus Escape-Sequence Start @@ -83,16 +84,15 @@ (define syn ((make-reader ebus-sync #:sof? #f #:eof? #f) input-port)) (define paket ((make-reader parse-ebus-paket #:sof? #f #:eof? #f) input-port)) (cond ((not (false? syn)) - (display (format "drop ~s x SYN (~s) ~n" syn ebus-const-syn)))) + (log-message logger 'debug (format "drop ~s x SYN (~s)" syn ebus-const-syn) #t))) (cond ((not (false? paket)) paket) ((eof-object? (peek-byte input-port)) eof) (else - (let ([byte (read-byte input-port)]) - (display (format "drop ~s 0x~x ~n" byte byte))) ;; skip one byte - (read-byte input-port) + (let ([byte (read-byte input-port)]) + (log-message logger 'debug (format "drop ~s 0x~x ~n" byte byte) #t)) (read-ebus input-port)))) (provide @@ -101,4 +101,5 @@ (prefix-out layer2- (struct-out ebus-paket)) (prefix-out layer2- (struct-out ebus-body-broadcast)) (prefix-out layer2- (struct-out ebus-body-mastermaster)) - (prefix-out layer2- (struct-out ebus-body-masterslave))) + (prefix-out layer2- (struct-out ebus-body-masterslave)) + (prefix-out layer2- logger))
\ No newline at end of file |