ubx

package
v0.0.0-...-0cb6901 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Tag gpsprot.Tag = "UBX"

Tag is the identifier for UBX protocol packets

Variables

View Source
var ErrTmodeLLHNotSupported = errors.New("TMODE does not support LLH coordinates, only ECEF")

ErrTmodeLLHNotSupported is returned when trying to convert tmodeConfig with LLH coordinates to TMODE. TMODE only supports ECEF coordinates.

View Source
var PacketFormat gpsprot.PacketFormat = packetFormat{}

PacketFormat is the UBX packet format

Functions

func NewNMEASVNumbering

func NewNMEASVNumbering() []gpsprot.NMEASVNumberingRange

NewNMEASVNumbering returns a slice of NMEASVNumberingRange describing the NMEA satellite numbering scheme used by u-blox.

Types

type CfgOld

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

func (*CfgOld) SetMsgRate

func (raw *CfgOld) SetMsgRate(msgID ubxbin.MsgID, rate byte)

type CfgVals

type CfgVals struct {
	ucv.Map
}

func MakeCfgVals

func MakeCfgVals() CfgVals

func (*CfgVals) AddData

func (raw *CfgVals) AddData(cfgData []byte) (map[uint8]struct{}, error)

AddData adds cfgData containing items to the CfgVals map. It returns a map of the groups that were added.

func (*CfgVals) BaudRate

func (known *CfgVals) BaudRate(target *gpsprot.ConfigTarget, port ucv.Port) []ucv.Item

func (*CfgVals) Cook

func (raw *CfgVals) Cook(ver *Version, cp *gpsprot.ConfigProps)

func (*CfgVals) EnableSignals

func (known *CfgVals) EnableSignals(enabled gpsprot.SignalSet, ver *Version) (gpsprot.SignalSet, []ucv.Item)

func (*CfgVals) NavMsgAuth

func (known *CfgVals) NavMsgAuth(props *gpsprot.ConfigProps) []ucv.Item

func (*CfgVals) Transaction

func (known *CfgVals) Transaction(target *gpsprot.ConfigTarget, ver *Version, port ucv.Port, monEnabledGNSS gpsprot.GNSSSet) ([]ucv.Item, []ucv.Key, error)

Transaction determines the transaction to achieve the specified target. The known argument gives what is known about the current configuration. The returned items specifies configuration database changes that are needed. If the specified changes cannot be determined because the value of some keys is not known, those keys are returned in the ucv.Key slice. Typically this function will get called twice. The first time, known will be empty, and some more keys will be needed. The caller will then fetch the additional keys, add them to known and call again.

type ConfigProtocol

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

func NewConfigProtocol

func NewConfigProtocol() *ConfigProtocol

func (*ConfigProtocol) Configure

func (px *ConfigProtocol) Configure(target *gpsprot.ConfigTarget) (gpsprot.Configurator, error)

Configure creates a Configurator for the given configuration target.

func (*ConfigProtocol) NativeMsg

func (px *ConfigProtocol) NativeMsg(tag gpsprot.Tag, msgID string, msg interface{}, tRead time.Time) error

func (*ConfigProtocol) ProbeOK

func (px *ConfigProtocol) ProbeOK() bool

func (*ConfigProtocol) ProbePacket

func (px *ConfigProtocol) ProbePacket() []byte

func (*ConfigProtocol) Version

func (px *ConfigProtocol) Version() *Version

type Configurator

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

func (*Configurator) ConfigProps

func (c *Configurator) ConfigProps() *gpsprot.ConfigProps

func (*Configurator) GenerateRequests

func (c *Configurator) GenerateRequests() error

GenerateRequests attempts to generate more requests, potentially increasing the slice size.

func (*Configurator) GetRequestCount

func (c *Configurator) GetRequestCount() (count int, complete bool)

GetRequestCount returns the current number of requests and whether the slice is complete.

func (*Configurator) ReceiverInfo

func (c *Configurator) ReceiverInfo() *gpsprot.ReceiverInfo

ReceiverInfo returns static information about the GPS receiver.

func (*Configurator) Request

func (c *Configurator) Request(index int) gpsprot.ConfigRequest

Request returns the ConfigRequest at the given index.

type FWVer

type FWVer struct {
	ProductCategory string `json:"productCategory"` // SPG, HPG, TIM etc
	Major           byte   `json:"major"`
	Minor           byte   `json:"minor"`
}

func (*FWVer) String

func (fwv *FWVer) String() string

type MsgRate

type MsgRate byte

type PacketProcessor

type PacketProcessor struct {
	gpsprot.DefaultPacketProcessor
	// contains filtered or unexported fields
}

PacketProcessor implements the gpsprot.PacketProcessor interface for UBX packets

func NewPacketProcessor

func NewPacketProcessor(mgr *gpsprot.NavEpochManager) *PacketProcessor

NewPacketProcessor creates a new UBX packet processor

func (*PacketProcessor) Dispatch

func (p *PacketProcessor) Dispatch(m ubxbin.Msg, tRead time.Time) bool

Dispatch converts a UBX message to protocol-agnostic messages and sends them to the message handler. It reports whether the message was handled.

func (*PacketProcessor) FlushNavEpoch

FlushNavEpoch implements gpsprot.EpochFlusher.

func (*PacketProcessor) ProcessPacket

func (p *PacketProcessor) ProcessPacket(data string, tRead time.Time) (string, error)

ProcessPacket processes a UBX packet's data and returns the message ID and any error

func (*PacketProcessor) SetMsgHandler

func (p *PacketProcessor) SetMsgHandler(handler gpsprot.MsgHandler)

SetMsgHandler sets the handler for protocol-agnostic messages

type ProtVer

type ProtVer struct {
	Major byte `json:"major"`
	Minor byte `json:"minor"`
}

func (ProtVer) String

func (pv ProtVer) String() string

type RawConfig

type RawConfig struct {
	CfgOld
	CfgVals // access with valsPtr() so it gets lazily initialized
	// contains filtered or unexported fields
}

func (*RawConfig) AddMsg

func (raw *RawConfig) AddMsg(m ubxbin.Msg) (bool, error)

func (*RawConfig) Config

func (raw *RawConfig) Config(ver *Version) *gpsprot.ConfigProps

type Version

type Version struct {
	HW            string          `json:"hw"`
	SW            string          `json:"sw"`
	Extensions    []string        `json:"extensions,omitempty"`
	FW            *FWVer          `json:"fw,omitempty"`
	Prot          *ProtVer        `json:"prot,omitempty"`
	Mod           string          `json:"mod"`
	RunsFromFlash bool            `json:"runsFromFlash"`
	GNSS          gpsprot.GNSSSet `json:"gnss,omitempty"`
}

func (*Version) ProductCategory

func (v *Version) ProductCategory() string

Jump to

Keyboard shortcuts

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