sbf

package
v0.13.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TwosComplementUint3

func TwosComplementUint3(b uint8) int

TwosComplementUint3 - Calculate 3-bit two's complement

func TwosComplementUint5

func TwosComplementUint5(b uint8) int

TwosComplementUint5 - Calculate 5-bit two's complement

Types

type AGCState

type AGCState struct {
	FrontEndID   byte   // Frontend code and antenna ID bit field
	Gain         int8   // AGC gain in dB
	SampleVar    byte   // Normalized variance of the IF samples
	BlankingStat byte   // Percentage of samples blanked by the pulse blanking unit
	Padding      []byte // Padding bytes
}

AGCState represents the sub-block for AGC state information.

type Block

type Block struct {
	// Sync1 is a 8-bit field that contains the first synchronization byte.
	// The value of this field is always 0x24.
	Sync1 byte
	// Sync2 is a 8-bit field that contains the second synchronization byte.
	// The value of this field is always 0x40.
	Sync2 byte
	// CRC is a 16-bit field that contains the CRC-CCITT checksum of the message.
	Crc uint16
	// ID is a 16-bit field that contains the message ID and the revision number.
	// The message ID is the lower 13 bits, and the revision number is the upper 3 bits.
	ID uint16
	// The lower 13 bits of the ID field contain the message ID.
	BlockNumber int
	// The upper 3 bits of the ID field contain the revision number.
	BlockRevision int
	// Length is a 16-bit field that contains the length of the payload in bytes.
	Length uint16
	// Payload is a variable length field that contains the message payload.
	Payload []byte `json:"-"`
}

Block - a container for an SBF block Each multi-byte binary type is transmitted as little-endian.

func Deserialize

func Deserialize(r *bufio.Reader) (block Block, err error)

Deserialize - reads from a buffer and return an SBF block.

func (Block) DeserializePayload_4001

func (block Block) DeserializePayload_4001() (b Block_4001, err error)

DeserializePayload_4001 reads the payload bytes into a Block_4001 struct

func (Block) DeserializePayload_4002

func (block Block) DeserializePayload_4002() (b Block_4002, err error)

func (Block) DeserializePayload_4006

func (block Block) DeserializePayload_4006() (b Block_4006, err error)

func (Block) DeserializePayload_4007

func (block Block) DeserializePayload_4007() (b Block_4007, err error)

func (Block) DeserializePayload_4008

func (block Block) DeserializePayload_4008() (b Block_4008, err error)

func (Block) DeserializePayload_4011

func (block Block) DeserializePayload_4011() (b Block_4011, err error)

func (Block) DeserializePayload_4012

func (block Block) DeserializePayload_4012() (b Block_4012, err error)

func (Block) DeserializePayload_4013

func (block Block) DeserializePayload_4013() (b Block_4013, err error)

func (Block) DeserializePayload_4014

func (block Block) DeserializePayload_4014() (b Block_4014, err error)

func (Block) DeserializePayload_4027

func (block Block) DeserializePayload_4027() (b Block_4027, err error)

DeserializePayload - read structured data from block 4027

func (Block) DeserializePayload_4044

func (block Block) DeserializePayload_4044() (b Block_4044, err error)

func (Block) DeserializePayload_4052 added in v0.9.0

func (block Block) DeserializePayload_4052() (b Block_4052, err error)

DeserializePayload_4052 reads the payload bytes into a Block_4052 struct

func (Block) DeserializePayload_4075

func (block Block) DeserializePayload_4075() (b Block_4075, err error)

func (Block) DeserializePayload_5891

func (block Block) DeserializePayload_5891() (b Block_5891, err error)

func (Block) DeserializePayload_5914

func (block Block) DeserializePayload_5914() (b Block_5914, err error)

func (Block) GetBlockNumber

func (block Block) GetBlockNumber() uint16

GetBlockNumber - returns the id

func (Block) GetBlockRevision

func (block Block) GetBlockRevision() uint16

GetBlockRevision - returns the revision number of the given message

func (Block) SerializeToWriter

func (block Block) SerializeToWriter(w io.Writer) (err error)

SerializeToWriter - writes an SBF block to a buffer.

func (Block) ToJSON

func (block Block) ToJSON(w io.Writer) error

type Block_4001

type Block_4001 struct {
	TOW      uint32  // Time of Week
	WNc      uint16  // Week Number
	NrSV     byte    // Number of satellites used in DOP computation
	Reserved byte    // Reserved byte for future use
	PDOP     uint16  // Position Dilution of Precision
	TDOP     uint16  // Time Dilution of Precision
	HDOP     uint16  // Horizontal Dilution of Precision
	VDOP     uint16  // Vertical Dilution of Precision
	HPL      float32 // Horizontal Protection Level
	VPL      float32 // Vertical Protection Level
}

Block_4001 - DOP

func (Block_4001) GetDOPValues

func (block Block_4001) GetDOPValues() DOPValues

AdjustDOPValues converts the DOP values from their encoded format to float64 for usability.

func (Block_4001) ToJSON

func (block Block_4001) ToJSON(w io.Writer) error

ToJSON serializes the Block_4001 struct to JSON

type Block_4002

type Block_4002 struct {

	// TOW (time-of-week)
	// Units: 0.001s
	// Do-not-use Value: 4294967295
	TOW uint32

	// WNc (week number)
	// continuous week count
	// Do-not-use Value: 65535
	WNc uint16

	// SvID (see 4.1.9)
	SvID uint8

	// Source
	Source uint8

	// SQRT_A
	// unit: 1 m^(1/2)
	Sqrt_A float64

	// M_0 mean anomaly at reference time
	// unit: 1 semi-circle
	M_0 float64

	// E Eccentricity
	E float64

	I_0 float64

	Omega float64

	Omega_0 float64

	OmegaDot float32

	IDot float32

	Del_N float32

	C_uc float32

	C_us float32

	C_rc float32

	C_rs float32

	C_ic float32

	T_oe uint32

	A_f2 float32

	A_f1 float32

	A_f0 float64

	WN_Toe uint16

	WN_Toc uint16

	IODNav uint16

	Health_OSSOL uint16

	Health_PRS uint16

	SISA_L1E5a uint8

	SISA_L1E5b uint8

	SISA_L1AE6A uint8

	BGD_L1E5a float32

	BGD_L1E5b float32

	BGD_L1AE6A float32

	CNAVenc uint8
}

Block_4002 - GALNav

func (Block_4002) Serialize

func (block Block_4002) Serialize() (data []byte, err error)

func (Block_4002) SerializeWithWriter

func (block Block_4002) SerializeWithWriter(w io.Writer) (err error)

func (Block_4002) ToJSON

func (block Block_4002) ToJSON(w io.Writer) error

type Block_4006

type Block_4006 struct {
	TOW         uint32  // Time of Week: Receiver time stamp in milliseconds
	WNc         uint16  // Week Number: GNSS week number
	Mode        byte    // Mode: Bit field indicating the PVT mode
	Error       byte    // PVT error code
	X           float64 // X coordinate in specified datum
	Y           float64 // Y coordinate in specified datum
	Z           float64 // Z coordinate in specified datum
	Undulation  float32 // Geoid undulation
	Vx          float32 // Velocity in the X direction
	Vy          float32 // Velocity in the Y direction
	Vz          float32 // Velocity in the Z direction
	COG         float32 // Course over ground in degrees
	RxClkBias   float64 // Receiver clock bias in milliseconds
	RxClkDrift  float32 // Receiver clock drift in parts per million
	TimeSystem  byte    // Time system used
	Datum       byte    // Datum in which coordinates are expressed
	NrSV        byte    // Total number of satellites used in the PVT computation
	WACorrInfo  byte    // Wide area correction information
	ReferenceID uint16  // Reference ID of differential information used
	MeanCorrAge uint16  // Mean age of differential corrections in hundredths of a second
	SignalInfo  uint32  // Bit field indicating the type of GNSS signals used
	AlertFlag   byte    // Integrity related information bit field
	NrBases     byte    // Number of base stations used in the PVT computation
	PPPInfo     uint16  // PPP-related information bit field
	Latency     uint16  // Latency in ten-thousandths of a second
	HAccuracy   uint16  // 2DRMS horizontal accuracy in centimeters
	VAccuracy   uint16  // 2-sigma vertical accuracy in centimeters
	Misc        byte    // Miscellaneous flags
}

Block 4006: PVT Geodetic Position

func (Block_4006) ToJSON

func (block Block_4006) ToJSON(w io.Writer) error

type Block_4007

type Block_4007 struct {
	TOW         uint32  // Time of Week in milliseconds
	WNc         uint16  // Week Number
	Mode        byte    // PVT mode bit field
	Error       byte    // PVT error code
	Latitude    float64 // Latitude in radians
	Longitude   float64 // Longitude in radians
	Height      float64 // Ellipsoidal height in meters
	Undulation  float32 // Geoid undulation in meters
	Vn          float32 // Velocity North in m/s
	Ve          float32 // Velocity East in m/s
	Vu          float32 // Velocity Up in m/s
	COG         float32 // Course Over Ground in degrees
	RxClkBias   float64 // Receiver clock bias in milliseconds
	RxClkDrift  float32 // Receiver clock drift in ppm
	TimeSystem  byte    // Time system
	Datum       byte    // Geodetic datum
	NrSV        byte    // Number of satellites used in solution
	WACorrInfo  byte    // Wide Area Correction information
	ReferenceID uint16  // Reference ID for differential data
	MeanCorrAge uint16  // Mean age of corrections in deciseconds
	SignalInfo  uint32  // GNSS signal type information
	AlertFlag   byte    // Integrity and alert flags
	NrBases     byte    // Number of base stations used
	PPPInfo     uint16  // PPP-related information
	Latency     uint16  // Latency in 0.0001 seconds
	HAccuracy   uint16  // Horizontal accuracy in 0.01 meters
	VAccuracy   uint16  // Vertical accuracy in 0.01 meters
	Misc        byte    // Miscellaneous flags
}

Block_4007 - Integrity information

func (Block_4007) ToJSON

func (block Block_4007) ToJSON(w io.Writer) error

type Block_4008

type Block_4008 struct {
	// Time of week
	TOW uint32
	// Week number
	WN uint16
	// Number of SatPos sub-blocks
	SBN uint8
	// Length of one sub-block
	SBLength uint8
	// SatPos Subblocks
	SBSatPos []Block_4008_SatPos
}

Block_4008 - PVTSatCartesian

func (Block_4008) GetTime

func (b Block_4008) GetTime() (dt time.Time, err error)

func (Block_4008) ToJSON

func (block Block_4008) ToJSON(w io.Writer) error

type Block_4008_SatPos

type Block_4008_SatPos struct {
	SvID   uint8
	FreqNr uint8
	IODE   uint16
	// Satellite coordinate
	Px float64
	Py float64
	Pz float64
	// Satellite velocity
	Vx float32
	Vy float32
	Vz float32
	// IonoMSB - [decimeter]
	IonoMSB int16
	// TropoMSB - [decimeter]
	TropoMSB int16
	// 0.1*(IonoMSB + IonoLSB/256)
	IonoLSB uint8
	// 0.1*(TropoMSB + TropoLSB/256)
	TropoLSB uint8
	// Model
	IonoModel uint8
}

Block_4008_SatPos - Subblock SatPos

func (Block_4008_SatPos) GetSysSat

func (b Block_4008_SatPos) GetSysSat() (sys, sat int, err error)

type Block_4011

type Block_4011 struct {
	TOW           uint32  // Time of Week in milliseconds
	WNc           uint16  // Week Number
	IntegrityFlag byte    // RAIM integrity flag: 0 - successful, 1 - failed, 2 - not available
	Reserved1     byte    // Reserved byte for future use
	HERLPosition  float32 // Horizontal external reliability level of the position in meters
	VERLPosition  float32 // Vertical external reliability level of the position in meters
	HERLVelocity  float32 // Horizontal external reliability level of the velocity in meters per second
	VERLVelocity  float32 // Vertical external reliability level of the velocity in meters per second
	OverallModel  uint16  // Overall model test statistic divided by the test threshold
}

func (Block_4011) ToJSON

func (block Block_4011) ToJSON(w io.Writer) error

type Block_4012

type Block_4012 struct {
	TOW uint32 // Time of Week in milliseconds
	WNc uint16 // Week Number
	// 	N u1 Number of satellites for which information is provided in this SBF block,
	// i.e. number of SatInfo sub-blocks.
	NumberOfSats uint8 `struct:"sizeof=SatInfo"`
	// SBLength u1 1 byte Length of one SatInfo sub-bloc
	SBLength uint8
	SatInfo  []SatInfo
}

func (Block_4012) ToJSON

func (block Block_4012) ToJSON(w io.Writer) error

type Block_4013

type Block_4013 struct {
	TOW       uint32           // Time of Week
	WNc       uint16           // Week Number
	N1        byte             `struct:"sizeof=SatInfo"` // Number of channels
	SB1Length byte             // Length of a ChannelSatInfo sub-block
	SB2Length byte             // Length of a ChannelStateInfo sub-block
	Reserved  [3]byte          // Reserved for future use
	SatInfo   []ChannelSatInfo // Satellite information for each channel
	Padding   []byte           // Variable length padding
}

Block_4013 - ChannelStatus represents the main structure for status blocks.

func (Block_4013) ToJSON

func (block Block_4013) ToJSON(w io.Writer) error

type Block_4014

type Block_4014 struct {
	TOW               uint32     // Time of Week
	WNc               uint16     // Week Number
	CPULoad           byte       // CPU load percentage
	ExtError          byte       // External error bit field
	UpTime            uint32     // Uptime in seconds
	RxState           uint32     // Receiver state bit field
	RxError           uint32     // Receiver error bit field
	N                 byte       `struct:"sizeof=AGCStateSubBlocks"` // Number of AGCState sub-blocks
	SBLength          byte       // Length of an AGCState sub-block
	CmdCount          byte       // Command cyclic counter
	Temperature       byte       // Receiver temperature (offset by 100)
	AGCStateSubBlocks []AGCState // Array of AGCState sub-blocks
}

Block_4014 - ReceiverStatus

func (Block_4014) GetExtError

func (b Block_4014) GetExtError() ExtError

func (Block_4014) GetRxError

func (b Block_4014) GetRxError() RxError

func (Block_4014) GetRxState

func (block Block_4014) GetRxState() RxState

func (Block_4014) GetTemperature

func (b Block_4014) GetTemperature() float64

func (Block_4014) ToJSON

func (block Block_4014) ToJSON(w io.Writer) error

type Block_4027

type Block_4027 struct {
	// Time-tag, expressed in whole milliseconds from the beginning of the
	// current GPS week.
	// do-not-use: 4294967295
	TOW uint32
	// WNc is a continuous week count. It is not affected by GPS week
	// rollovers, which occur every 1024 weeks
	// do-not-use: 65535
	WN uint16
	// Number of MeasEpochChannelType1 sub-blocks in this MeasEpoch block
	N1 uint8 `struct:"sizeof=Type1"`
	// Length of a MeasEpochChannelType1 sub-block, excluding the nested
	// MeasEpochChannelType2 sub-blocks
	SB1Length uint8
	// Length of a MeasEpochChannelType2 sub-block
	SB2Length uint8
	// Bit field containing flags common to all measurements.
	CommonFlags uint8
	// Cumulative millisecond clock jumps since start-up, with an ambiguity
	// of k*256 ms.
	CumClkJumps uint8
	// Reserved for future use, to be ignored by decoding software
	Reserved uint8
	// A succession of N1 MeasEpochChannelType1 sub-blocks, see definition
	// below
	Type1 []Block_4027_Type1
}

Block_4027 - MeasEpoch

func (Block_4027) GetClkSteering

func (b Block_4027) GetClkSteering() bool

GetClkSteering - check if clock steering is enabled

func (Block_4027) GetDynamics

func (b Block_4027) GetDynamics() bool

GetDynamics - check if receiver is in dynamic tracking mode

func (Block_4027) GetEpoch

func (b Block_4027) GetEpoch() (dt time.Time, err error)

GetEpoch - Convert the week number and time-of-week to Golang datetime

func (Block_4027) GetMultipathMitigation

func (b Block_4027) GetMultipathMitigation() bool

GetMultipathMitigation - check if multipath mitigation is enabled

func (Block_4027) GetPhaseAlign

func (b Block_4027) GetPhaseAlign() bool

GetPhaseAlign - check if the phase is aligned

func (Block_4027) GetScrambling

func (b Block_4027) GetScrambling() bool

GetScramblling - Galileo service

func (Block_4027) GetSmoothing

func (b Block_4027) GetSmoothing() bool

GetSmoothing - check if smoothing is enabled

func (Block_4027) SerializeGNSSEpoch

func (b Block_4027) SerializeGNSSEpoch() (epoch observation.Epoch, err error)

SerializeGNSSEpoch - serialize observations from block 4027 to observation.Epoch

func (Block_4027) ToJSON

func (block Block_4027) ToJSON(w io.Writer) error

type Block_4027_Type1

type Block_4027_Type1 struct {
	// Receiver channel on which this satellite is currently tracked
	RxChannel uint8
	// Bit field indicating the signal type and antenna ID:
	//   Bits 0-4: SigIdxLo: if not 31, this is the signal number, otherwise
	//   the signal number can be found in the ObsInfo field below
	//   Bits 5-7: Antenna ID: 0 for main, 1 for Aux1 and 2 for Aux2
	Type uint8
	// Satellite ID
	SvID uint8
	// Bit field containing the MSB of the pseudorange.
	//   Bits 0-3: CodeMSB: MSB of the pseudorange (this is an un-signed value).
	//   Bits 4-7: Reserved
	// The pseudorange is invalid if both CodeMSB is 0 and CodeLSB is 0
	Misc uint8
	// LSB of the pseudorange
	// The pseudorange is invalid if both CodeMSB is 0 and CodeLSB is 0
	CodeLSB uint32
	// Carrier Doppler (positive for approaching satellites).
	// do-not-use: −2147483648
	Doppler int32
	// LSB of the carrier phase relative to the pseudorange
	// do-not-use: 0
	CarrierLSB uint16
	// MSB of the carrier phase relative to the pseudorange.
	// do-not-use: -128
	CarrierMSB int8
	// The C/N0 in dB-Hz
	// do-not-use: 255
	Cn0 uint8
	// Duration of continuous carrier phase
	// do-not-use: 65535
	LockTime uint16
	// Bitfield - see docs
	ObsInfo uint8
	// Number of MeasEpochChannelType2 sub-blocks contained in this
	// MeasEpochChannelType1 sub-block.
	N2 uint8 `struct:"sizeof=Type2"`
	// padding
	// A succession of N2 MeasEpochChannelType2 sub-blocks, see definition below
	Type2 []Block_4027_Type2
}

Block_4027_Type1 - The first subfield type in Block 4027

func (Block_4027_Type1) GetSVID

func (b Block_4027_Type1) GetSVID() int

GetSVID - map SvID value to constellation specific PRNs or Slot numbers

type Block_4027_Type2

type Block_4027_Type2 struct {
	// Bit field indicating the signal type and antenna ID
	Type uint8
	// See corresponding field in the MeasEpochChannelType1 sub-block above,
	// except that the value is clipped to 254 instead of 65534
	// do-not-use: 255
	LockTime uint8
	// The C/N0 in dB-H
	// do-not-use: 255
	Cn0 uint8
	// Code and Doppler offsets
	// do-not-use code:  -4
	// do-not-use dopp: -16
	OffsetsMSB uint8
	// MSB of the carrier phase relative to the pseudorange
	// do-not-use: -128
	CarrierMSB int8
	// Bit field - see docs for mapping
	ObsInfo uint8
	// LSB of the code offset with respect to pseudorange in the
	// MeasEpochChannelType1 sub-block.
	// do-not-use: 0
	CodeOffsetLSB uint16
	// LSB of the carrier phase relative to the pseudorange.
	// do-not-use: 0
	CarrierLSB uint16
	// LSB of the Doppler offset relative to the Doppler in the
	// MeasEpochChannelType1 sub-block. To compute the Doppler
	// do-not-use: 0
	DopplerOffsetLSB uint16
}

Block_4027_Type2 - the second subfield type in Block 4027

type Block_4044

type Block_4044 struct {
	TOW         uint32  // Time of Week
	WNc         uint16  // Week Number
	Mode        uint8   // PVT mode
	Error       uint8   // PVT error code
	X           float64 // X coordinate
	Y           float64 // Y coordinate
	Z           float64 // Z coordinate
	Base2RoverX float64 // X baseline component (from base to rover)
	Base2RoverY float64 // Y baseline component (from base to rover)
	Base2RoverZ float64 // Z baseline component (from base to rover)
	Cov_xx      float32 // Variance of the x estimate
	Cov_yy      float32 // Variance of the y estimate
	Cov_zz      float32 // Variance of the z estimate
	Cov_xy      float32 // Covariance between the x and y estimates
	Cov_xz      float32 // Covariance between the x and z estimates
	Cov_yz      float32 // Covariance between the y and z estimates
	PDOP        uint16  // Position Dilution of Precision
	HDOP        uint16  // Horizontal Dilution of Precision
	VDOP        uint16  // Vertical Dilution of Precision
	Misc        uint8   // Miscellaneous flags
	Reserved3   uint8   // Reserved for future use
	AlertFlag   uint8   // Integrity-related information
	Datum       uint8   // Coordinate datum
	NrSV        uint8   // Number of satellites used in the PVT computation
	WACorrInfo  uint8   // Wide Area Correction information
	ReferenceId uint16  // Reference ID of the differential information
	MeanCorrAge uint16  // Mean age of the differential corrections
	SignalInfo  uint32  // Type of GNSS signals used in the PVT computations

}

func (Block_4044) GetMiscFlags

func (b Block_4044) GetMiscFlags() MiscFlags

func (Block_4044) ToJSON

func (b Block_4044) ToJSON(w io.Writer) error

type Block_4052 added in v0.9.0

type Block_4052 struct {
	TOW   uint32  // TOW u4
	WNc   uint16  // WNc u2
	Mode  byte    // Mode u1
	Error byte    // Error u1
	Lat   float64 // Lat f8
	Lon   float64 // Lon f8
	Alt   float64 // Alt f8
}

Block_4052 - ReceiverPosition

func (Block_4052) ToJSON added in v0.9.0

func (block Block_4052) ToJSON(w io.Writer) error

ToJSON serializes the Block_4052 struct to JSON

type Block_4075

type Block_4075 struct {
	TOW         uint32
	WNc         uint16
	CD          byte
	Reserved1   [3]byte
	StringLn    uint16
	SensorModel [20]byte
	SensorType  [20]byte
	Reserved2   [20]byte
	ASCIIString string `struct:"sizeof=StringLn"`
}

Block ID 4075 - ASCII Sensor Description

func (Block_4075) ToJSON

func (block Block_4075) ToJSON(w io.Writer) error

type Block_5891

type Block_5891 struct {

	// TOW (time-of-week)
	// Units: 0.001s
	// Do-not-use Value: 4294967295
	TOW uint32

	// WNc (week number)
	// continuous week count
	// Do-not-use Value: 65535
	WNc uint16

	// PRN or SvID
	// see 4.1.9 for mapping
	SvID uint8

	// reserved
	Reserved uint8

	// WN (week number)
	// subframe 1, word 3
	WN uint16

	// Code(s) on L2 channel (2 bits from subframe 1, word 3)
	CAorPonL2 uint8

	// User Range accuracy index (4 bits from subframe 1 word 3)
	URA uint8

	// 6-bit health from subframe 1, word 3 (6 bits from subframe 1, word 3)
	Health uint8

	// Data flag for L2 P-code (1 bit from subframe 1, word 4)
	L2DataFlag uint8

	// Issue of data, clock (10 bits from subframe 1)
	IODC uint16

	// Issue of data, ephemeris (8 bits from subframe 2)
	IODE2 uint8

	// Issue of data, ephemeris (8 bits from subframe 3)
	IODE3 uint8

	// Curve Fit Interval, (1 bit from subframe 2, word 10)
	FitIntFlg uint8

	// Reserved
	Reserved2 uint8

	// Estimated group delay
	T_gd float32

	// clock data reference time
	T_oc uint32

	// clock aging
	// units: 1 s/s^2
	A_f2 float32

	// clock drift
	// uints: 1 s/s
	A_f1 float32

	// clock bias
	// units: 1 s
	A_f0 float32

	// Amplitude of the sine harmonic correction term to the orbit radius
	// units: 1 m
	C_rs float32

	// Mean motion difference from computed value
	// units: 1 semi-circle / s
	Del_N float32

	// Mean anomaly at reference time
	// units: 1 semi-circle
	M_0 float64

	// Amplitude of the cosine harmonic correction term to the argument of latitude
	// units: 1 rad
	C_uc float32

	// Eccentricity
	Ecc float64

	// Amplitude of the sine harmonic correction term to the argument of latitude
	// units: 1 rad
	C_us float32

	// Square root of the semi-major axis
	// units: 1 m^(1/2)
	Sqrt_A float64

	// Reference time ephemeris
	// units: 1 s
	T_oe uint32

	// Amplitude of the cosine harmonic correction term to the angle of inclination
	// units: 1 rad
	C_ic float32

	// Longitude of ascending node of orbit plane at weekly epoch
	// units: 1 semi-circle
	Omega_0 float64

	// Amplitude of the sine harmonic correction term to the angle of inclination
	// units: 1 rad
	C_is float32

	// Inclination angle at reference time
	// units: 1 semi-circle
	I_0 float64

	// Amplitude of the cosine harmonic correction term to the orbit radius
	// units: 1 m
	C_rc float32

	// Argument of perigee
	// units: 1 semi-circle
	Omega float64

	// Rate of right ascension
	// units: 1 semi-circle / s
	Omega_Dot float32

	// Rate of inclination angle
	// units: 1 semi-circle / s
	I_Dot float32

	// WN associated with t_oc, modulo 1024
	// units: 1 w
	WN_Toc uint16

	// WN associated with t_oe, modulo 1024
	// units: 1 w
	WN_Toe uint16
}

Block_5891 - GPSNav

func (Block_5891) GetFitInterval

func (block Block_5891) GetFitInterval() (float64, error)

func (Block_5891) GetToEWeek

func (block Block_5891) GetToEWeek() int

func (Block_5891) GetURA

func (block Block_5891) GetURA() float64

func (Block_5891) SerializeToGPSLNAV

func (block Block_5891) SerializeToGPSLNAV(edid string) (ephemeris.GPSLNAVMessage, error)

func (Block_5891) ToJSON

func (block Block_5891) ToJSON(w io.Writer) error

type Block_5914

type Block_5914 struct {
	TOW       uint32
	WNc       uint16
	UTCYear   int8
	UTCMonth  int8
	UTCDay    int8
	UTCHour   int8
	UTCMin    int8
	UTCSec    int8
	DeltaLS   int8
	SyncLevel uint8
}

Block_5914 Receiver Time

func (Block_5914) ToJSON

func (block Block_5914) ToJSON(w io.Writer) error

type ChannelSatInfo

type ChannelSatInfo struct {
	SVID           byte               // Satellite ID
	Reserved1      [2]byte            // Reserved for future use
	AzimuthRiseSet uint16             // Bit field for azimuth and rise/set indicator
	FreqNr         byte               // Frequency number (for GLONASS FDMA signals)
	HealthStatus   uint16             // Sequence of 2-bit health status fields
	Elevation      int8               // Elevation [-90, 90] relative to local horizontal plane
	N2             uint8              `struct:"sizeof=StateInfo"` // number of ChannelStateInfo sub-blocks
	RxChannel      byte               // Channel number
	Reserved2      byte               // Reserved for future use
	StateInfo      []ChannelStateInfo // State information for each antenna
	Padding        []byte             // Padding bytes
}

ChannelSatInfo describes satellite-dependent information.

type ChannelStateInfo

type ChannelStateInfo struct {
	Antenna        byte   // Antenna number (0 for main antenna)
	Reserved       byte   // Reserved for future use
	TrackingStatus uint16 // Sequence of 2-bit tracking status fields
	PVTStatus      uint16 // Sequence of 2-bit PVT status fields
	PVTInfo        uint16 // Internal info
	Padding        []byte // Padding bytes
}

ChannelStateInfo reports tracking and PVT status for each signal type.

type DOPValues

type DOPValues struct {
	PDOP float64
	TDOP float64
	HDOP float64
	VDOP float64
}

DOPValues contains the decoded DOP values

type ExtError

type ExtError struct {
	// External error bit field
	SISERROR       bool // Bit 0: SIS error detected
	DIFFCORRERROR  bool // Bit 1: Differential correction error detected
	EXTSENSORERROR bool // Bit 2: External sensor error detected
	SETUPERROR     bool // Bit 3: Configuration error detected

}

type MiscFlags

type MiscFlags struct {
	// set if the antenna reference point is at the base; clear if it is at the antenna phase center or unknown
	AttennaReferencePoint bool
	// set if the phase center offset compensation is applied; clear if it is not applied or unknown
	PhaseCenterOffsetCompensation bool
}

type RxError

type RxError struct {
	// Receiver error bit field
	// Reserved0     bool // Bit 0: Reserved
	// Reserved1     bool // Bit 1: Reserved
	// Reserved2     bool // Bit 2: Reserved
	SOFTWARE   bool // Bit 3: Software warning or error detected
	WATCHDOG   bool // Bit 4: Watchdog expired
	ANTENNA    bool // Bit 5: Antenna overcurrent condition detected
	CONGESTION bool // Bit 6: Output data congestion detected
	// Reserved7     bool // Bit 7: Reserved
	MISSEDEVENT   bool // Bit 8: External event congestion detected
	CPUOVERLOAD   bool // Bit 9: CPU load is larger than 90%
	INVALIDCONFIG bool // Bit 10: Invalid or absent configuration file
	OUTOFGEOFENCE bool // Bit 11: Receiver is out of permitted region of operation (geofencing)

}

type RxState

type RxState struct {
	// Receiver state bit field
	EXT_FREQ              bool // Bit 2
	EXT_TIME              bool // Bit 3
	WNSET                 bool // Bit 4
	TOWSET                bool // Bit 5
	FINETIME              bool // Bit 6
	INTERNALDISK_ACTIVITY bool // Bit 7
	INTERNALDISK_FULL     bool // Bit 8
	INTERNALDISK_MOUNTED  bool // Bit 9
	INT_ANT               bool // Bit 10
	REFOUT_LOCKED         bool // Bit 11
	LBAND_ANT             bool // Bit 12
	EXTERNALDISK_ACTIVITY bool // Bit 13
	EXTERNALDISK_FULL     bool // Bit 14
	EXTERNALDISK_MOUNTED  bool // Bit 15
	PPS_IN_CAL            bool // Bit 16
	DIFFCORR_IN           bool // Bit 17
	INTERNET              bool // Bit 18
}

type SatInfo

type SatInfo struct {
	// 	SVID u1 Satellite ID, see 4.1.9
	SVID uint8
	// FreqNr u1 0 For GLONASS FDMA signals, this is the frequency number, with an
	// offset of 8. It ranges from 1 (corresponding to an actual frequency
	// number of -7) to 21 (corresponding to an actual frequency number
	// of 13). Otherwise, FreqNr is reserved and must be ignored by the
	// decoding software.
	FreqNr uint8
	// Azimuth u2 0.01 degrees 65535 Azimuth. 0 is North, and azimuth increases towards East.
	Azimuth uint16
	// Elevation i2 0.01 degrees −32768 Elevation relative to local horizontal plane.
	Elevation int16
	// RiseSet u1 Rise/set indicator:
	// 0: satellite setting
	// 1: satellite rising
	// 255: elevation rate unknown
	RiseSet uint8
	// SatelliteInfo u1 Satellite visibility info based on:
	// 1: almanac
	// 2: ephemeris
	// 255: unknown
	SatelliteInfo uint8
}

type SbfCode

type SbfCode struct {
	Code   string
	System int
	Freq   float64
}

type Scanner

type Scanner struct {
	Reader *bufio.Reader
	Sync   byte
}

func NewScanner

func NewScanner(r io.Reader) Scanner

func (Scanner) NextBlock

func (scanner Scanner) NextBlock() (block Block, err error)

type Slant

type Slant struct {
	Time       time.Time
	System     int
	SvID       int
	XSat       float64
	YSat       float64
	ZSat       float64
	IonoDelay  float64
	TropoDelay float64
}

func SerializeSlantIono

func SerializeSlantIono(b Block_4008) (slants []Slant, err error)

Jump to

Keyboard shortcuts

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