diff options
-rw-r--r-- | simulation.scm | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/simulation.scm b/simulation.scm index 061c703..9b74577 100644 --- a/simulation.scm +++ b/simulation.scm @@ -146,9 +146,11 @@ (if confirmed? 'confirmed-data 'unconfirmed-data)))) (when confirmed? (atomic-box-compare-and-swap! to-confirm #f frame-number)) - (put-message upstream-chn (make-radio-event 'uplink-start event-id channel frame)) + (put-message upstream-chn + (make-radio-event 'uplink-start event-id channel frame)) (sleep time-on-air) - (put-message upstream-chn (make-radio-event 'uplink-end event-id channel frame)))) + (put-message upstream-chn + (make-radio-event 'uplink-end event-id channel frame)))) (define (receive-window channel time) @@ -164,7 +166,7 @@ (get-operation downstream-chn))))) (match msg ;; We got the preamble in time - (($ <radio-event> 'downlink-start message-id (= listening-to? chn) frame) + (($ <radio-event> 'downlink-start message-id (= listening-to? chn)) (ll "Device ~a got preamble" id) message-id) ;; No preamble in time @@ -246,9 +248,11 @@ ;; TODO: choose channel properly (let ((event-id (new-id))) (ll "Gateway ~a sending downlink ~a" id frame) - (put-message radio (make-radio-event 'downlink-start event-id 1 frame)) + (put-message radio + (make-radio-event 'downlink-start event-id 1 frame)) (sleep time-on-air) - (put-message radio (make-radio-event 'downlink-end event-id 1 frame)))))) + (put-message radio + (make-radio-event 'downlink-end event-id 1 frame)))))) (define (send-to-network-server x) (ll "Gateway ~a forwarding ~a" id x) @@ -328,8 +332,8 @@ (frame-FCnt frame) channel-n) (use-lorawan-channel! channel-n ev) - (let ((chan (device-channel (hash-table-ref end-devices - (frame-DeviceAddr frame)))) + (let ((chan (device-channel + (hash-table-ref end-devices (frame-DeviceAddr frame)))) (ints (interferences ev channel-n))) (put-message chan ev) (for-each |