forked from HVelosoETI/go-nmea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gll.go
33 lines (30 loc) · 772 Bytes
/
gll.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
33
package nmea
const (
// TypeGLL type for GLL sentences
TypeGLL = "GLL"
// ValidGLL character
ValidGLL = "A"
// InvalidGLL character
InvalidGLL = "V"
)
// GLL is Geographic Position, Latitude / Longitude and time.
// http://aprs.gids.nl/nmea/#gll
type GLL struct {
BaseSentence
Latitude float64 // Latitude
Longitude float64 // Longitude
Time Time // Time Stamp
Validity string // validity - A-valid
}
// newGLL constructor
func newGLL(s BaseSentence) (GLL, error) {
p := newParser(s)
p.AssertType(TypeGLL)
return GLL{
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()
}