ublox

package
v0.0.0-...-c156f7f Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CMD_PROTO_VERSION ...
	CMD_PROTO_VERSION = " -p MON-VER"
	// CMD_VOLTAGE_CONTROLER ...
	CMD_VOLTAGE_CONTROLER = " -v 1 -z CFG-HW-ANT_CFG_VOLTCTRL,%d"
	// CMD_NAV_STATUS ...
	CMD_NAV_STATUS  = " -t -p NAV-STATUS"
	UBXCommand      = "/usr/local/bin/ubxtool"
	UBXTOOL_NEW     = 0
	UBXTOOL_ACTIVE  = 1
	UBXTOOL_DEAD    = 2
	UBXTOOL_STOPPED = 3
)

Variables

View Source
var (
	// PorotoVersionRegEx ...
	PorotoVersionRegEx = regexp.MustCompile(`PROTVER=+(\d+)`)
	// AntennaStatusRegEx ...
	AntennaStatusRegEx = regexp.MustCompile(`antStatus[[:space:]]+(\d+)[[:space:]]antPower[[:space:]]+(\d+)`)
	// NavStatusRegEx ...
	NavStatusRegEx = regexp.MustCompile(`gpsFix[[:space:]]+(\d+)`)
)

Functions

func ExtractNavStatus

func ExtractNavStatus(output string) int64

func ExtractOffset

func ExtractOffset(output string) int64

Types

type ANT_STATUS

type ANT_STATUS int

ANT_STATUS ...

const (
	// NOT_OK ...
	NOT_OK ANT_STATUS = iota
	// UNKNOWN ...
	UNKNOWN
	// OK ...
	OK
)

func (ANT_STATUS) IntString

func (a ANT_STATUS) IntString() string

IntString ...

func (ANT_STATUS) String

func (a ANT_STATUS) String() string

type GNSSAntStatus

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

GNSSAntStatus ... Passed: Status of the Antenna is OK (i.e., antStatus equals 2) and Antena power status is Ok (i.e., antPower equals 1) Failure: antStatus not equals 2 and antPower not equals 1 GNSSAntStatus ...

func NewAntStatus

func NewAntStatus(ant ANT_STATUS, power POWER_STATUS) GNSSAntStatus

NewAntStatus ... get antenna status

func (*GNSSAntStatus) AntennaOk

func (g *GNSSAntStatus) AntennaOk() bool

AntennaOk ...

func (*GNSSAntStatus) Power

func (g *GNSSAntStatus) Power() POWER_STATUS

Power ...

func (*GNSSAntStatus) SetAntPower

func (g *GNSSAntStatus) SetAntPower(power POWER_STATUS)

SetAntPower ..

func (*GNSSAntStatus) SetAntStatus

func (g *GNSSAntStatus) SetAntStatus(antStatus ANT_STATUS)

SetAntStatus ...

func (*GNSSAntStatus) Status

func (g *GNSSAntStatus) Status() ANT_STATUS

Status ...

type POWER_STATUS

type POWER_STATUS int

POWER_STATUS ...

const (
	// OFF ...
	OFF POWER_STATUS = iota
	// ON ...
	ON
)

func (POWER_STATUS) IntString

func (p POWER_STATUS) IntString() string

IntString ...

func (POWER_STATUS) String

func (p POWER_STATUS) String() string

type TimeLs

type TimeLs struct {
	//Information source for the current number
	// of leap seconds
	SrcOfCurrLs uint8
	// Current number of leap seconds since
	// start of GPS time (Jan 6, 1980). It reflects
	// how much GPS time is ahead of UTC time.
	// Galileo number of leap seconds is the
	// same as GPS. BeiDou number of leap
	// seconds is 14 less than GPS. GLONASS
	// follows UTC time, so no leap seconds
	CurrLs int8
	// Information source for the future leap
	// second event.
	SrcOfLsChange uint8
	// Future leap second change if one is
	// scheduled. +1 = positive leap second, -1 =
	// negative leap second, 0 = no future leap
	// second event scheduled or no information
	// available. If the value is 0, then the
	// amount of leap seconds did not change
	// and the event should be ignored
	LsChange int8
	// Number of seconds until the next leap
	// second event, or from the last leap second
	// event if no future event scheduled. If > 0
	// event is in the future, = 0 event is now, < 0
	// event is in the past. Valid only if
	// validTimeToLsEvent = 1
	TimeToLsEvent int
	// GPS week number (WN) of the next leap
	// second event or the last one if no future
	// event scheduled. Valid only if
	// validTimeToLsEvent = 1.
	DateOfLsGpsWn uint
	// GPS day of week number (DN) for the next
	// leap second event or the last one if no
	// future event scheduled. Valid only if
	// validTimeToLsEvent = 1. (GPS and Galileo
	// DN: from 1 = Sun to 7 = Sat. BeiDou DN:
	// from 0 = Sun to 6 = Sat.
	DateOfLsGpsDn uint8
	// Validity flags
	// 1<<0 validCurrLs 1 = Valid current number of leap seconds value.
	// 1<<1 validTimeToLsEvent 1 = Valid time to next leap second event
	// or from the last leap second event if no future event scheduled.
	Valid uint8
}

func ExtractLeapSec

func ExtractLeapSec(output []string) *TimeLs

type UBlox

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

UBlox ... UBlox type

func NewUblox

func NewUblox() (*UBlox, error)

NewUblox ... create new Ublox

func (*UBlox) DisableBinary

func (u *UBlox) DisableBinary()

DisableBinary ... disable binary

func (*UBlox) EnableDisableVoltageController

func (u *UBlox) EnableDisableVoltageController(command string, value int) ([]byte, error)

EnableDisableVoltageController ... UBX-ACK-ACK: ACK to Class x06 (CFG) ID x8a (VALSET) TODO: Should read ACK-ACK to confirm right and read the item

func (*UBlox) EnableNMEA

func (u *UBlox) EnableNMEA()

EnableNMEA ... enable nmea

func (*UBlox) Init

func (u *UBlox) Init() (err error)

Init ...

func (*UBlox) MonVersion

func (u *UBlox) MonVersion(command string, regEx *regexp.Regexp) (*string, error)

MonVersion ... get monitor version

func (*UBlox) Query

func (u *UBlox) Query(command string, promptRE *regexp.Regexp) (result string, matches []string, err error)

Query ... used for testing only

func (*UBlox) UbloxPollInit

func (u *UBlox) UbloxPollInit()

func (*UBlox) UbloxPollPull

func (u *UBlox) UbloxPollPull() string

func (*UBlox) UbloxPollPushThread

func (u *UBlox) UbloxPollPushThread()

func (*UBlox) UbloxPollReset

func (u *UBlox) UbloxPollReset()

func (*UBlox) UbloxPollStop

func (u *UBlox) UbloxPollStop()

Jump to

Keyboard shortcuts

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