biscuit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 015caf45c6735e3950ead2b12ec574cb59095d9c
parent 97440603f3ae0e87bc5609bfdd195997fc1d177d
Author: Daniel <dan@telent.net>
Date:   Sun, 18 May 2025 18:00:49 +0000

write an nmea trace to a unix socket for indoor maps testing

 while : ; do fennel fake-nmea.fnl foo.nmea ./fake-nmea.sock ; done

Diffstat:
Apkgs/maps/fake-nmea.fnl | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/pkgs/maps/fake-nmea.fnl b/pkgs/maps/fake-nmea.fnl @@ -0,0 +1,10 @@ +(local { : sleep } (require :posix.unistd)) + +(let [[filename socketname] arg + socket (io.popen (.. "socat - unix-listen:" socketname) :w)] + (with-open [handle (io.open filename :r)] + (each [l (handle:lines "L")] + (if (string.match l "GNS") (sleep 1)) + (socket:write l) + (socket:flush) + )))