gps

package
v0.0.0-...-f5aacf5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const BYTES_READY_REG uint8 = 0xFD
View Source
const DefaultAddr = 0x10
View Source
const READ_REG uint8 = 0xFF

Variables

This section is empty.

Functions

This section is empty.

Types

type GPS

type GPS interface {
	NextSentence() (nmea.Sentence, error)
	NextFix() (nmea.GGA, error)
	Readline() (string, error)
}

GPS is the end-user GPS structure to use.

type GPSCore

type GPSCore struct {
	// contains filtered or unexported fields
}

GPSCore is high level methods for GPS devices that uses a GPSDevice for low level access

func (*GPSCore) NextFix

func (g *GPSCore) NextFix() (nmea.GGA, error)

func (*GPSCore) NextSentence

func (g *GPSCore) NextSentence() (nmea.Sentence, error)

type GPSDevice

type GPSDevice interface {
	Readline() (string, error)
}

GPSDevice is an interface to a GPS device. This should be implemented for different types of devices and gives the ability to read/write NMEA strings with the device A specific implementation of a GPS device should implement GPSDevice and then composite GPSCore into its struct so that it provides a complete GPS intergace

type I2CGPS

type I2CGPS struct {
	GPSCore
	Conn conn.Conn
	// contains filtered or unexported fields
}

func NewI2CGPS

func NewI2CGPS(bus i2c.BusCloser, opts *Opts) (*I2CGPS, error)

NewI2CGPS opens a handle to an i2c gps

func (*I2CGPS) Readline

func (g *I2CGPS) Readline() (string, error)

type Opts

type Opts struct {
}

type SerialGPS

type SerialGPS struct {
	GPSCore
	// contains filtered or unexported fields
}

func NewSerialGPSReader

func NewSerialGPSReader(port string, baudRate uint, dataBits uint, stopBits uint) (gps *SerialGPS, err error)

func (*SerialGPS) Readline

func (g *SerialGPS) Readline() (string, error)

Jump to

Keyboard shortcuts

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