write an nmea trace to a unix socket for indoor maps testing
while : ; do fennel fake-nmea.fnl foo.nmea ./fake-nmea.sock ; done
This commit is contained in:
parent
97440603f3
commit
015caf45c6
10
pkgs/maps/fake-nmea.fnl
Normal file
10
pkgs/maps/fake-nmea.fnl
Normal file
@ -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)
|
||||
)))
|
Loading…
Reference in New Issue
Block a user