pgn

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 1 Imported by: 0

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

View Source
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

func FMIDescription(fmi uint8) string

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

func VictronChargerErrorText(code uint32) string

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

PGN returns the PGN number this message is carried on.

type GarminDestinationNav added in v0.6.0

type GarminDestinationNav struct {
	DistanceToDestination *float64 `json:"distance_to_destination,omitempty"` // m
	EtaTime               *float64 `json:"eta_time,omitempty"`                // s (seconds of day, UTC)
	EtaDate               *uint16  `json:"eta_date,omitempty"`                // days since 1970-01-01
	DestinationId         *uint32  `json:"destination_id,omitempty"`
	DestinationLatitude   *float64 `json:"destination_latitude,omitempty"`  // deg
	DestinationLongitude  *float64 `json:"destination_longitude,omitempty"` // deg
}

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL