satellite

package
v0.0.0-...-4d64c08 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

The satellite package contains code to handle MSM4 satellite data. The satellite cells follow the header in a type 4 Multiple Signal Message (MSM). Each cell contains the data about one satellite: the approximate (rough) range in terms of light milliseconds, ie the approximate transit time of the signals from the satellite to the GPS device in whole milliseconds and fractional milliseconds. The real transit time of each signal can be slightly different due to factors such as ionospheric distortion, and each signal cell contains a small delta which is added to the approximate values given here to give the transit time of that signal.

Index

Constants

View Source
const CellLengthInBits = lenWholeMillis + lenFractionalMillis

CellLengthInBits is the number of bits in each cell.

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

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

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

Cell holds the data for one satellite from an MSM message, type MSM4 (message type 1074, 1084 ...).

func GetSatelliteCells

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

GetSatelliteCells extracts the satellite cell data from an MSM4 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 uint, logLevel slog.Level) *Cell

New creates an MSM4 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