Documentation
¶
Index ¶
- Constants
- Variables
- func Checksum(str string) (sum uint8)
- func ParseDate(str string) (day, month, year int, err error)
- func ParseDegreeMinute(str string, degchars int) (deg int, min float32, err error)
- func ParseUTC(str string) (hour int, minute int, second int, secondf float32, err error)
- type EastWest
- type ErrInvalidChecksum
- type ErrInvalidFields
- type ErrInvalidLength
- type ErrInvalidPrefix
- type ErrInvalidType
- type ErrUnknownType
- type GPGLL
- type GPRMC
- type GPTXT
- type Message
- type NMEAMessage
- type NorthSouth
- type PositionMode
Constants ¶
View Source
const PREFIX = "$"
Variables ¶
View Source
var ( ErrEmptyMessage = errors.New("[NMEA] empty message") ErrNoChecksum = errors.New("[NMEA] no checksum") )
Functions ¶
func ParseDegreeMinute ¶
Types ¶
type ErrInvalidChecksum ¶
func (*ErrInvalidChecksum) Error ¶
func (err *ErrInvalidChecksum) Error() string
type ErrInvalidFields ¶
type ErrInvalidFields struct {
*Message
}
func (*ErrInvalidFields) Error ¶
func (err *ErrInvalidFields) Error() string
type ErrInvalidLength ¶
func (*ErrInvalidLength) Error ¶
func (err *ErrInvalidLength) Error() string
type ErrInvalidPrefix ¶
type ErrInvalidPrefix struct {
Field string
}
func (*ErrInvalidPrefix) Error ¶
func (err *ErrInvalidPrefix) Error() string
type ErrInvalidType ¶
func (*ErrInvalidType) Error ¶
func (err *ErrInvalidType) Error() string
type ErrUnknownType ¶
type ErrUnknownType struct {
Type string
}
func (*ErrUnknownType) Error ¶
func (err *ErrUnknownType) Error() string
type GPGLL ¶
type GPRMC ¶
type GPRMC struct {
UTCHour int
UTCMinute int
UTCSecond int
UTCSecondf float32
Valid bool
LatitudeDegree int
LatitudeMinute float32
NorthSouth NorthSouth
LongitudeDegree int
LongitudeMinute float32
EastWest EastWest
Speed float32 // speed over ground knots
COG int // course over ground in degree
DateDay int
DateMonth int
DateYear int
MagneticVariation int
MagneticVariationEW EastWest
PositionMode PositionMode
}
type GPTXT ¶
type Message ¶
func (*Message) GenChecksum ¶
type NMEAMessage ¶
type NMEAMessage interface {
Type() string
Serialize() string
Parse(m *Message) error
Pretty() string
}
func Parse ¶
func Parse(str string) (m NMEAMessage, err error)
type PositionMode ¶
type PositionMode uint8
const ( PositionNoFix PositionMode = iota PositionAutonomousGNSSFix PositionDifferentialGNSSFix )
Click to show internal directories.
Click to hide internal directories.