diff options
Diffstat (limited to 'simulation.scm')
-rw-r--r-- | simulation.scm | 9 |
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) |