satellite

package
v0.0.0-...-05f1639 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

The satellite package contains code to handle the satellite cells of a type 7 Multiple Signal Message. The satellite cells follow the header in the message. Each cell contains the data about one satellite: the approximate (rough) range, the extended satellite information and the rough phase range rate. The rough range is expressed in light milliseconds, ie the approximate transit time of the signals from the satellite to the GPS device in whole milliseconds and fractional milliseconds. The fractional value is ten bits and is in units of 1/1024 seconds.

The real transit time of each signal can be slightly different due to factors such as ionospheric distortion. Each signal cell contains a small delta which is added to the rough value given here to give the transit time of that signal. The satellite cell also contains two other delta values. The phase range delta is combined with the satellite range value in a similar way to the range delta. The signal data also contains a phase range rate delta value which is used to correct the rough phase rang rate value.

Index

Constants

View Source
const CellLengthInBits = lenWholeMillis + lenExtendedInfo + lenFractionalMillis + lenPhaseRangeRate

CellLengthInBits is the total length of the cell

View Source
const InvalidPhaseRangeRate = -8192

invalidPhaseRangeRate is the invalid value for the phase range rate. 14 bit two's complement 10 0000 0000 0000

View Source
const InvalidRange = 0xff

InvalidRange is the invalid value for the whole millis range.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {

	// ID is the satellite ID, 1-64.
	ID uint

	// RangeWholeMillis - uint8 - the number of integer milliseconds in the
	// GNSS Satellite range (ie the transit time of the signals).  0xff
	// indicates an invalid value.  See also the RangeFractionalMillis value
	// here and the delta value in the signal cell.
	RangeWholeMillis uint

	// ExtendedInfo - uint4.  Extended Satellite Information.
	ExtendedInfo uint

	// RangeFractionalMillis - unit10.  The fractional part of the range
	// in milliseconds.
	RangeFractionalMillis uint

	// PhaseRangeRate - int14.  The approximate phase range rate for all signals
	// that come later in this MSM7 message.  The value is in metres per second.
	// Invalid if the top bit is set and all the others are zero
	// (InvalidPhaseRangeRate).  The value is signed, so the invalid value is a
	// negative number.  If the value is valid, the true phase range rate for a
	// signal is derived by merging this (positive or negative) value with the
	// signal's PhaseRangeRateDelta value.
	PhaseRangeRate int

	// LogLevel controls the data output by String.
	LogLevel slog.Level
}

Cell holds the data from one satellite cell from a type 7 Multiple Signal Message. (Message type 1077, 1087 ...).

func GetSatelliteCells

func GetSatelliteCells(
	bitStream []byte,
	startOfSatelliteData uint,
	Satellites []uint,
	logLevel slog.Level) ([]Cell, error)

GetSatelliteCells extracts the satellite cell data from an MSM7 message. It returns a slice of cell data. If the bitstream is not long enough to contain the message, it returns an error.

func New

func New(
	id,
	wholeMillis,
	fractionalMillis,
	extendedInfo uint,
	phaseRangeRate int,
	logLevel slog.Level,
) *Cell

New creates an MSM7 satellite cell from the given values.

func (*Cell) String

func (cell *Cell) String() string

Jump to

Keyboard shortcuts

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