forked from HVelosoETI/go-nmea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rte.go
36 lines (31 loc) · 1.09 KB
/
rte.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
34
35
36
package nmea
const (
// TypeRTE type for RTE sentences
TypeRTE = "RTE"
// ActiveRoute active route
ActiveRoute = "c"
// WaypointList list containing waypoints
WaypointList = "w"
)
// RTE is a route of waypoints
type RTE struct {
BaseSentence
NumberOfSentences int64 // Number of sentences in sequence
SentenceNumber int64 // Sentence number
ActiveRouteOrWaypointList string // Current active route or waypoint list
Name string // Name or number of active route
Idents []string // List of ident of waypoints
}
// newRTE constructor
func newRTE(s BaseSentence) (RTE, error) {
p := newParser(s)
p.AssertType(TypeRTE)
return RTE{
BaseSentence: s,
NumberOfSentences: p.Int64(0, "number of sentences"),
SentenceNumber: p.Int64(1, "sentence number"),
ActiveRouteOrWaypointList: p.EnumString(2, "active route or waypoint list", ActiveRoute, WaypointList),
Name: p.String(3, "name or number"),
Idents: p.ListString(4, "ident of waypoints"),
}, p.Err()
}