aboutsummaryrefslogtreecommitdiff
path: root/tools/obu-guess-trip
diff options
context:
space:
mode:
authorstuebinm2023-05-26 21:07:48 +0200
committerstuebinm2023-05-26 21:14:20 +0200
commite029a031050e08599f9d6d5fa654c17d985039c1 (patch)
tree3b4dd35bf6f6a8495b47ac5158a954151c9c0b55 /tools/obu-guess-trip
parent8737181eac0dce062ff0541e263ba0bf6a772c66 (diff)
expose sequence length of trip to onboard unit
Diffstat (limited to '')
-rwxr-xr-xtools/obu-guess-trip5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/obu-guess-trip b/tools/obu-guess-trip
index 305ec8d..b9264f6 100755
--- a/tools/obu-guess-trip
+++ b/tools/obu-guess-trip
@@ -43,7 +43,10 @@ Arguments:
(define stops (fetch-stations url))
(define pos
(with-input-from-process `(obu-ping -s ,statefile -n 1 -d) read))
- (define trip (assoc-ref (closest-stop-to stops pos) 'trip))
+ (define guessed
+ (closest-stop-to stops pos))
+ (define trip (assoc-ref guessed 'trip))
+ (do-process `(obu-config -s ,statefile sequencelength ,(assoc-ref guessed 'sequencelength)))
(display trip))
(define (closest-stop-to stops pos)