Documentation
¶
Overview ¶
Package pgn provides generated Go types for decoding and encoding NMEA 2000 PGN messages.
The types in this package are generated from PGN definition files (.pgn DSL) in the pgn/defs/ directory using the pgngen tool. Do not edit the generated files directly; modify the .pgn definitions and regenerate.
Index ¶
Constants ¶
const VictronChargerErrorRegister = 0xEDDA
VictronChargerErrorRegister is the Victron register ID (0xEDDA) that carries the charger error code in PGN 61184.
Variables ¶
This section is empty.
Functions ¶
func FMIDescription ¶ added in v0.6.0
FMIDescription maps a J1939 Failure Mode Identifier (0-31) to its standard text. FMI 31 means "condition exists / not available" (no specific mode).
func VictronChargerErrorText ¶ added in v0.6.0
VictronChargerErrorText maps common Victron charger error codes to text. Unknown codes return "" so callers can fall back to the numeric code.
Types ¶
type GarminActiveWaypoint ¶ added in v0.6.0
type GarminActiveWaypoint struct {
DistanceToWaypoint *float64 `json:"distance_to_waypoint,omitempty"` // m
EtaTime *float64 `json:"eta_time,omitempty"` // s (seconds of day, UTC)
EtaDate *uint16 `json:"eta_date,omitempty"` // days since 1970-01-01
WaypointLatitude *float64 `json:"waypoint_latitude,omitempty"` // deg
WaypointLongitude *float64 `json:"waypoint_longitude,omitempty"` // deg
}
GarminActiveWaypoint is Garmin proprietary PGN 126720, sub-type (0x61,0x06): navigation to the active (next) waypoint of the current route.
func (GarminActiveWaypoint) PGN ¶ added in v0.6.0
func (GarminActiveWaypoint) PGN() uint32
PGN returns the PGN number this message is carried on.
type GarminDestinationNav ¶ added in v0.6.0
type GarminDestinationNav struct {
}
GarminDestinationNav is Garmin proprietary PGN 126720, sub-type (0x12,0x07): navigation to the final destination of the current route.
func (GarminDestinationNav) PGN ¶ added in v0.6.0
func (GarminDestinationNav) PGN() uint32
PGN returns the PGN number this message is carried on.
type UtilityACBasicQuantities ¶
type UtilityACBasicQuantities struct {
LineLineVoltage *float64 `json:"line_line_voltage"` // V
LineNeutralVoltage *float64 `json:"line_neutral_voltage"` // V
ACFrequency *float64 `json:"ac_frequency"` // Hz
ACRMSCurrent *float64 `json:"ac_rms_current"` // A
}
UtilityACBasicQuantities represents PGNs 65011/65014 — Basic AC Quantities.
func (UtilityACBasicQuantities) PGN ¶
func (UtilityACBasicQuantities) PGN() uint32
type UtilityACPower ¶
type UtilityACPower struct {
RealPower *float64 `json:"real_power"` // W
ApparentPower *float64 `json:"apparent_power"` // VA
}
UtilityACPower represents PGNs 65009/65010/65013/65016 — AC Power.
func (UtilityACPower) PGN ¶
func (UtilityACPower) PGN() uint32
Typed PGN methods for interface compliance.