novatelbinary

package
v0.13.8 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const CRC32_POLYNOMIAL uint32 = 0xEDB88320

Variables

View Source
var SignalTypes = map[int]map[int]SignalType{

	0: {
		0:  {Code: "1C", Freq: 1575.42},
		5:  {Code: "2P", Freq: 1227.60},
		9:  {Code: "2W", Freq: 1227.60},
		14: {Code: "5Q", Freq: 1176.45},
		16: {Code: "1L", Freq: 1575.42},
		17: {Code: "2S", Freq: 1227.60},
	},

	1: {
		0: {Code: "1C", Freq: 1602.0},
		1: {Code: "2C", Freq: 1246.0},
		5: {Code: "2P", Freq: 1246.0},
		6: {Code: "3Q", Freq: 1202.025},
	},

	2: {
		0: {Code: "1C", Freq: 1575.42},
		6: {Code: "5I", Freq: 1176.45},
	},

	3: {
		2:  {Code: "1C", Freq: 1575.42},
		6:  {Code: "6B", Freq: 1278.75},
		7:  {Code: "6C", Freq: 1278.75},
		12: {Code: "5Q", Freq: 1176.45},
		17: {Code: "7Q", Freq: 1207.140},
		20: {Code: "8Q", Freq: 1191.795},
	},

	4: {
		0:  {Code: "2I", Freq: 1561.098},
		1:  {Code: "7I", Freq: 1207.140},
		2:  {Code: "6I", Freq: 1268.52},
		4:  {Code: "1D", Freq: 1575.42},
		5:  {Code: "5D", Freq: 1176.45},
		6:  {Code: "6D", Freq: 1268.52},
		7:  {Code: "1P", Freq: 1575.42},
		9:  {Code: "5P", Freq: 1176.45},
		11: {Code: "7D", Freq: 1207.140},
	},

	5: {
		0:  {Code: "1C", Freq: 1575.42},
		14: {Code: "5Q", Freq: 1176.45},
		16: {Code: "1L", Freq: 1575.42},
		17: {Code: "2M", Freq: 1227.60},
		27: {Code: "6P", Freq: 1278.75},
	},

	6: {
		0: {Code: "5A", Freq: 1575.42},
	},
}

Functions

func CRC32Value

func CRC32Value(i int) uint32

CRC32Value calculates the CRC value used in CRC calculations.

func CalculateBlockCRC32

func CalculateBlockCRC32(ulCount uint64, ucBuffer []byte) uint32

CalculateBlockCRC32 calculates the CRC-32 of a data block.

func ExtractBits

func ExtractBits(value uint32, n uint, m uint) (result uint8, err error)

func GPSWeekMilliSecondsOfWeekToTime

func GPSWeekMilliSecondsOfWeekToTime(gpsWeek uint16, tow uint32) (dt time.Time)

func GPSWeekSowToTime

func GPSWeekSowToTime(gpsWeek uint16, tow float64) (dt time.Time)

Types

type ChannelTrackingStatus

type ChannelTrackingStatus struct {
	TrackingState   uint8
	SVChanNum       uint8
	PhaseLockFlag   uint8
	ParityKnownFlag uint8
	CodeLockedFlag  uint8
	CorrelatorType  uint8
	SatSystem       uint8
	Reserved1       uint8
	Grouping        uint8
	SignalType      uint8
	Rererved2       uint8
	PrimaryL1Chan   uint8
	HalfCycle       uint8
	Filtering       uint8
	PRNLockFlag     uint8
	ChanAssignment  uint8
}

ChannelTrackingStatus contains the fields of the ChannelTrackingStatus uint32

type Message

type Message struct {
	// 0xAA
	Sync1 byte
	// 0x44
	Sync2 byte
	// 0x12
	Sync3 byte
	// Length of the header
	HeaderLength uint8
	MessageID    uint16
	MessageType  byte
	PortAddress  uint8
	// The length in bytes of the body of the message,
	// not including the header nor the CRC
	MessageLength uint16
	// Used for multiple related logs. It is a number that counts down from N-1
	// to 0 where N is the number of related logs and 0 means it is the last one of
	// the set. Most logs only come out one at a time in which case this number is 0
	Sequence uint16
	// Time the processor is idle, calculated once per second. Take
	// the time (0 – 200) and divide by two to give the percentage of time
	// (0 – 100%). 0% indicates the processor is fully occupied. Other values
	// indicate the availability of the processor to take on tasks.
	IdleTime uint8
	// Indicates the quality of the GPS reference time
	TimeStatus uint8
	// GPS reference week number
	Week uint16
	// Milliseconds from the beginning of the GPS reference week
	GPSMilliSecondsOfWeek uint32
	// 32-bits representing the status of various hardware and software
	// components of the receiver x
	ReceiverStatus uint32
	// Reserved for internal use
	Reserved uint16
	// A value (0 - 65535) representing the receiver software build number
	RecSWVersion uint16
	// Data
	Data []byte
	// Checksum - 32 bit CRC
	Checksum uint32
}

func DeserializeMessage

func DeserializeMessage(r *bufio.Reader) (message Message, err error)

func (*Message) DeserializeMessage140

func (msg *Message) DeserializeMessage140() Message_140

func (*Message) Serialize

func (msg *Message) Serialize(w io.Writer) (err error)

func (*Message) Time

func (msg *Message) Time() (t time.Time)

func (*Message) ToJSON

func (msg *Message) ToJSON(w io.Writer) error

type Message_140

type Message_140 struct {
	// The number of range records in the message
	NumberOfObs uint32
	// The range records
	RangeRecords []RangeRecord
}

Message_140 contains the fields of the RANGECMP message

func (*Message_140) SerializeGNSSEpoch

func (msg *Message_140) SerializeGNSSEpoch(t time.Time) (epoch observation.Epoch, err error)

func (*Message_140) ToJSON

func (msg *Message_140) ToJSON(w io.Writer) error

type RangeRecord

type RangeRecord struct {
	// 32 bits
	ChannelTrackingStatus uint32
	// 28 bits - 1/256 Hz
	DopplerFreq uint64
	// 36 bits - 1/128 m
	Pseudorange uint64
	// 32 bits - 1/256 cycles
	Phase uint64
	// 4 bits - m
	PseudorangeStd uint8
	// 4 bits - (n+1)/512 cycles
	PhaseStd uint8
	// 8 bits -
	PRN uint8
	// 21 bits - 1/32 s
	LockTime uint32
	// 5 bits - (20+n) dB-Hz
	SNR uint8
	// 6 bits - n+7
	FCN uint8
	// 16 bits
	Reserved uint16
}

RangeRecord contains the fields of the RangeRecord message

func DeserializeRangeRecord

func DeserializeRangeRecord(r *iobit.Reader) (rangeRecord RangeRecord)

func (*RangeRecord) GetChannelTrackingStatus

func (rangeRecord *RangeRecord) GetChannelTrackingStatus() (cts ChannelTrackingStatus, err error)

GetChannelTrackingStatus extracts the status fields of the ChannelTrackingStatus uint32

type Scanner

type Scanner struct {
	Reader *bufio.Reader
}

func NewScanner

func NewScanner(r io.Reader) Scanner

func (Scanner) NextMessage

func (scanner Scanner) NextMessage() (message Message, err error)

type SignalType

type SignalType struct {
	// Two-Character RINEX version 3,4 codes (e.g. "1C")
	Code string
	// Frequency in MHz
	Freq float64
}

Jump to

Keyboard shortcuts

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