forked from adrianmo/go-nmea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpgll.go
32 lines (29 loc) · 792 Bytes
/
gpgll.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package nmea
const (
// PrefixGPGLL prefix for GPGLL sentence type
PrefixGPGLL = "GPGLL"
// ValidGLL character
ValidGLL = "A"
// InvalidGLL character
InvalidGLL = "V"
)
// GPGLL is Geographic Position, Latitude / Longitude and time.
// http://aprs.gids.nl/nmea/#gll
type GPGLL struct {
BaseSentence
Latitude float64 // Latitude
Longitude float64 // Longitude
Time Time // Time Stamp
Validity string // validity - A-valid
}
// newGPGLL constructor
func newGPGLL(s BaseSentence) (GPGLL, error) {
p := newParser(s, PrefixGPGLL)
return GPGLL{
BaseSentence: s,
Latitude: p.LatLong(0, 1, "latitude"),
Longitude: p.LatLong(2, 3, "longitude"),
Time: p.Time(4, "time"),
Validity: p.EnumString(5, "validity", ValidGLL, InvalidGLL),
}, p.Err()
}