diff options
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 |