rtkutils

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package rtkutils implements necessary functions to set and return NTRIP information here.

Package rtkutils implements functions that are used in the gpsrtkserial and gpsrtkpmtk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToVirtualBase added in v0.16.0

func ConnectToVirtualBase(ntripInfo *NtripInfo,
	logger logging.Logger,
) *bufio.ReadWriter

ConnectToVirtualBase is responsible for establishing a connection to a virtual base station using the NTRIP protocol.

func ContainsGGAMessage added in v0.16.0

func ContainsGGAMessage(data []byte) bool

ContainsGGAMessage returns true if data contains GGA message.

func FindLineWithMountPoint added in v0.16.0

func FindLineWithMountPoint(sourceTable *Sourcetable, mountPoint string) (bool, error)

FindLineWithMountPoint parses the given source-table returns the NMEA field associated with the given mountpoint.

func GetGGAMessage added in v0.16.0

func GetGGAMessage(correctionWriter io.ReadWriteCloser, logger logging.Logger) ([]byte, error)

GetGGAMessage checks if a GGA message exists in the buffer and returns it.

Types

type NtripConfig

type NtripConfig struct {
	NtripURL             string `json:"ntrip_url"`
	NtripConnectAttempts int    `json:"ntrip_connect_attempts,omitempty"`
	NtripMountpoint      string `json:"ntrip_mountpoint,omitempty"`
	NtripPass            string `json:"ntrip_password,omitempty"`
	NtripUser            string `json:"ntrip_username,omitempty"`
}

NtripConfig is used for converting attributes for a correction source.

type NtripInfo

type NtripInfo struct {
	URL                string
	Username           string
	Password           string
	MountPoint         string
	Client             *ntrip.Client
	Stream             io.ReadCloser
	MaxConnectAttempts int
}

NtripInfo contains the information necessary to connect to a mountpoint.

func NewNtripInfo

func NewNtripInfo(cfg *NtripConfig, logger logging.Logger) (*NtripInfo, error)

NewNtripInfo function validates and sets NtripConfig arributes and returns NtripInfo.

func (*NtripInfo) ParseSourcetable added in v0.20.0

func (n *NtripInfo) ParseSourcetable(logger logging.Logger) (*Sourcetable, error)

ParseSourcetable gets the sourcetable and parses it.

type Sourcetable added in v0.20.0

type Sourcetable struct {
	Streams []Stream
}

Sourcetable struct contains the stream.

func (*Sourcetable) HasStream added in v0.20.0

func (st *Sourcetable) HasStream(mountpoint string) (Stream, bool)

HasStream checks if the sourcetable contains the given mountpoint in it's stream.

type Stream added in v0.20.0

type Stream struct {
	MP             string   // Datastream mountpoint
	Identifier     string   // Source identifier (most time nearest city)
	Format         string   // Data format of generic type (https://software.rtcm-ntrip.org/wiki/STR#DataFormats)
	FormatDetails  string   // Specifics of data format (https://software.rtcm-ntrip.org/wiki/STR#DataFormats)
	Carrier        int      // Phase information about GNSS correction (https://software.rtcm-ntrip.org/wiki/STR#Carrier)
	NavSystem      []string // Multiple navigation system (https://software.rtcm-ntrip.org/wiki/STR#NavigationSystem)
	Network        string   // Network record in sourcetable (https://software.rtcm-ntrip.org/wiki/NET)
	Country        string   // ISO 3166 country code (https://en.wikipedia.org/wiki/ISO_3166-1)
	Latitude       float32  // Position, Latitude in degree
	Longitude      float32  // Position, Longitude in degree
	Nmea           bool     // Caster requires NMEA input (1) or not (0)
	Solution       int      // Generated by single base (0) or network (1)
	Generator      string   // Generating soft- or hardware
	Compression    string   // Compression algorithm
	Authentication string   // Access protection for data streams None (N), Basic (B) or Digest (D)
	Fee            bool     // User fee for data access: yes (Y) or no (N)
	BitRate        int      // Datarate in bits per second
	Misc           string   // Miscellaneous information
}

Stream contrains a stream record in sourcetable. https://software.rtcm-ntrip.org/wiki/STR

Jump to

Keyboard shortcuts

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