summaryrefslogtreecommitdiff
path: root/ebus-racket/parser.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'ebus-racket/parser.rkt')
-rw-r--r--ebus-racket/parser.rkt11
1 files changed, 8 insertions, 3 deletions
diff --git a/ebus-racket/parser.rkt b/ebus-racket/parser.rkt
index 1b9ed5b..51b9b55 100644
--- a/ebus-racket/parser.rkt
+++ b/ebus-racket/parser.rkt
@@ -19,7 +19,7 @@
(crc payloadSlaveLength payloadSlave crcSlave)
#:transparent)
-(struct ebus-paket (header body) #:transparent)
+(struct ebus-paket (header payload body) #:transparent)
(define parse-ebus-header (token (seq source <- any-byte
destination <- any-byte
@@ -64,7 +64,7 @@
payload <- (repeat ebus-payload (ebus-header-payloadLength header) (ebus-header-payloadLength header))
body <- (cond ((= (ebus-header-destination header) ebus-const-broadcastaddr) parse-ebus-broadcast)
(else parse-ebus-master-or-slave))
- (return (ebus-paket header body)))))
+ (return (ebus-paket header payload body)))))
(define ebus-sync (tokens syncs <- (seq (repeat (string->bytes/latin-1 "\xaa")))
(return (length syncs))))
@@ -95,4 +95,9 @@
(cond ((not (eof-object? paket)) (read-ebus-loop input-port)))))
(provide read-ebus
- read-ebus-loop) \ No newline at end of file
+ read-ebus-loop
+ (struct-out ebus-paket)
+ (struct-out ebus-header)
+ (struct-out ebus-body-broadcast)
+ (struct-out ebus-body-mastermaster)
+ (struct-out ebus-body-masterslave)) \ No newline at end of file