From 9f7e24ff913b391ffbb0f065b1e43cadb55dbb0f Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 15 Dec 2024 19:40:45 +0100 Subject: simulation: uplink? --- simulation.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'simulation.scm') 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 + (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) -- cgit v1.2.3