summaryrefslogtreecommitdiff
path: root/simulation.scm
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-12-15 19:40:45 +0100
committerEkaitz Zarraga <ekaitz@elenq.tech>2024-12-15 19:41:36 +0100
commit9f7e24ff913b391ffbb0f065b1e43cadb55dbb0f (patch)
tree46d00cb8fdc3c2154c2fa40718b751f14f8d6af5 /simulation.scm
parent51c39772864d50f36aa2fda9fc54a71e3d9a832d (diff)
simulation: uplink?
Diffstat (limited to 'simulation.scm')
-rw-r--r--simulation.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/simulation.scm b/simulation.scm
index d21aef6..34bf901 100644
--- a/simulation.scm
+++ b/simulation.scm
@@ -19,12 +19,13 @@
(let ((now (gettimeofday)))
(format #t "~a~a - ~?~%" (car now) (cdr now) f data)))
-(define-record-type message
- (make-message id device-id channel-n body)
+(define-record-type <message>
+ (make-message id device-id channel-n uplink? body)
message?
(id message-id)
(device-id message-device-id)
(channel-n message-channel-n)
+ (uplink? message-uplink?)
(body message-body))
@@ -48,9 +49,9 @@
(define current-message 0)
(forever
(sleep (rand-time))
- (put-message upstream-chn (make-message current-message id channel 'data-start))
+ (put-message upstream-chn (make-message current-message id channel #t 'data-start))
(sleep time-on-air)
- (put-message upstream-chn (make-message current-message id channel 'data-end))
+ (put-message upstream-chn (make-message current-message id channel #t 'data-end))
(set! current-message (1+ current-message))
(sleep receive-delay-1)
(atomic-box-set! listening? #t)