parse nmea from socket
This commit is contained in:
parent
59c7b53022
commit
bf7eac5fac
@ -1,5 +1,6 @@
|
||||
; (local { : view } (require :fennel))
|
||||
(local { : fdopen } (require :posix.stdio))
|
||||
(local nmea (require :nmea))
|
||||
|
||||
(local {
|
||||
: Gtk
|
||||
@ -71,7 +72,10 @@ label.readout {
|
||||
|
||||
(fn read-gnss [socket]
|
||||
(each [l #(socket:read "l")]
|
||||
(print "gnss" l))
|
||||
; (print "gnss" l)
|
||||
(if (not (= l ""))
|
||||
(print (view (nmea.parse l)))))
|
||||
|
||||
true)
|
||||
|
||||
(let [sock (gnss-socket:get_socket)
|
||||
|
@ -3,9 +3,8 @@
|
||||
;; 3-5 are the message type
|
||||
;; fields are comma-delimited
|
||||
|
||||
;; we assume that we can parse the message based only on type
|
||||
;; (i.e. that the same type should always be parsed the same way no
|
||||
;; matter who the talker)
|
||||
;; we can parse the message based only on type (i.e. the same type is
|
||||
;; always parsed the same way no matter who the talker)
|
||||
|
||||
;; outline: split message into lines, extract values between
|
||||
;; $ and * as talker, type, fields
|
||||
@ -177,3 +176,5 @@
|
||||
:speed-kmh 2.9
|
||||
:mode :A
|
||||
})
|
||||
|
||||
{ :parse parse-line }
|
||||
|
Loading…
Reference in New Issue
Block a user