gnss

package
v0.0.0-...-080cee2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugGpsd = false

	GpsdDbusObjectPath    = "/org/gpsd"
	GpsdDbusInterface     = "org.gpsd"
	GpsdDbusFixSignalName = GpsdDbusInterface + ".fix"

	GpsdDataMaxSignalAge = 5000 // 5000 ms is 5 seconds of maximal signal age
	GpsdSystemdUnitName  = "gpsd.service"

	GpsdInitialFixRetries = 3 // Try 3 times to get a fix signal from gpsd before giving up
)

Variables

This section is empty.

Functions

func IsDataReliable

func IsDataReliable(fs *GPSDFixSignal) bool

func IsGPSTimeValid

func IsGPSTimeValid(timestamp float64) bool

Types

type BackendType

type BackendType int32
const (
	// STUB implementation
	STUB BackendType = -1

	// GPSD based
	GPSD BackendType = 0
)

func (BackendType) String

func (e BackendType) String() string

type GPSDFixSignal

type GPSDFixSignal struct {
	DeviceName        string
	AltMSL            float64
	Course            float64
	Lat               float64
	Lon               float64
	HorizUncertainty  float64
	Time              float64
	AltUncertainty    float64
	TimeUncertainty   float64
	CourseUncertainty float64
	Speed             float64
	SpeedUncertainty  float64
	Climb             float64
	ClimbUncertainty  float64
	Mode              int32
}

type GPSData

type GPSData struct {
	// Time is supposed to come from the GPS, do not set if no valid gps data was received
	Time   float64
	Lat    float64
	Lon    float64
	AltMSL float64
	Speed  float64
}

The GPSData that is needed by the application

func (GPSData) String

func (d GPSData) String() string

func (GPSData) Valid

func (d GPSData) Valid() bool

Valid checks if the GPSData is valid, Invalid data has no proper timestamp

type Service

type Service interface {
	GetData() GPSData
	Shutdown() error
	IsGPSTimeValid() bool
	// contains filtered or unexported methods
}

Service interface methods

func NewService

func NewService(backend BackendType, systemd *systemd.Connector) (Service, error)

Jump to

Keyboard shortcuts

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