mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
misc: updated go-nmea dependency and refactored code for v1.1.0
This commit is contained in:
parent
f8ede4ddbe
commit
3d1936ef61
22 changed files with 262 additions and 205 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue