misc: updated go-nmea dependency and refactored code for v1.1.0

This commit is contained in:
evilsocket 2018-07-31 16:19:59 +02:00
commit 3d1936ef61
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
22 changed files with 262 additions and 205 deletions

View file

@ -129,13 +129,10 @@ func (gps *GPS) Start() error {
for gps.Running() {
if line, err := gps.readLine(); err == nil {
if info, err := nmea.Parse(line); err == nil {
s := info.Sentence()
if s, err := nmea.Parse(line); err == nil {
// http://aprs.gids.nl/nmea/#gga
if s.Type == "GNGGA" {
gps.Session.GPS = info.(nmea.GNGGA)
} else {
log.Debug("Skipping message %s: %v", s.Type, s)
if m, ok := s.(nmea.GNGGA); ok {
gps.Session.GPS = m
}
} else {
log.Debug("Error parsing line '%s': %s", line, err)