diff options
Diffstat (limited to 'ebus-racket/ebus/layer7.rkt')
-rw-r--r-- | ebus-racket/ebus/layer7.rkt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ebus-racket/ebus/layer7.rkt b/ebus-racket/ebus/layer7.rkt index b2947a0..f30e952 100644 --- a/ebus-racket/ebus/layer7.rkt +++ b/ebus-racket/ebus/layer7.rkt @@ -78,7 +78,7 @@ (list 'data1b (lambda (name field offset payload) (list name 'data1b (field-decoder-data1b (list-ref payload offset))))) (list 'data1c (lambda (name field offset payload) - (list name 'data1b (field-decoder-data1c (list-ref payload offset))))) + (list name 'data1c (field-decoder-data1c (list-ref payload offset))))) (list 'data2b (lambda (name field offset payload) (list name 'data2b (field-decoder-data2b (list-ref payload offset) @@ -106,7 +106,9 @@ (define (field-decoder-data1b value) (if (= value #x80) (ersatzwert) - value)) + (cond ((= 1 (arithmetic-shift value -7)) + (* -1 (+ 1 (bitwise-xor #xff value)))) + (else value)))) ;; type data1c (define (field-decoder-data1c value) |