cli

package
v0.0.0-...-5759ea9 Latest Latest
Warning

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

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

Documentation

Overview

Package cli provides a CLI for analyzing NMEA 2000 PGN messages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

A CLI lets a user run the analyzer in a CLI environment.

func New

func New(args []string) (*CLI, error)

func (*CLI) PrintFieldBinary

func (c *CLI) PrintFieldBinary(
	field *analyzer.PGNField,
	_ string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

func (*CLI) PrintFieldBitLookup

func (c *CLI) PrintFieldBitLookup(
	field *analyzer.PGNField,
	_ string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

func (*CLI) PrintFieldDate

func (c *CLI) PrintFieldDate(
	_ *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

func (*CLI) PrintFieldDecimal

func (c *CLI) PrintFieldDecimal(
	_ *analyzer.PGNField,
	_ string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

Note(UNTESTED): See README.md.

func (*CLI) PrintFieldFloat

func (c *CLI) PrintFieldFloat(
	field *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

Note(UNTESTED): See README.md.

func (*CLI) PrintFieldKeyValue

func (c *CLI) PrintFieldKeyValue(
	field *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

Note(UNTESTED): See README.md.

func (*CLI) PrintFieldLatLon

func (c *CLI) PrintFieldLatLon(
	field *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

func (*CLI) PrintFieldLookup

func (c *CLI) PrintFieldLookup(
	field *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

func (*CLI) PrintFieldMMSI

func (c *CLI) PrintFieldMMSI(
	field *analyzer.PGNField,
	_ string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

This is only a different printer than fieldPrintNumber so the JSON can contain a string value.

func (*CLI) PrintFieldNumber

func (c *CLI) PrintFieldNumber(
	field *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

func (*CLI) PrintFieldReserved

func (c *CLI) PrintFieldReserved(
	field *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

* Only print reserved fields if they are NOT all ones, in that case we have an incorrect * PGN definition.

func (*CLI) PrintFieldSpare

func (c *CLI) PrintFieldSpare(
	field *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

* Only print spare fields if they are NOT all zeroes, in that case we have an incorrect * PGN definition.

func (*CLI) PrintFieldStringFix

func (c *CLI) PrintFieldStringFix(
	field *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

*

  • Fixed length string where the length is defined by the field definition.

func (*CLI) PrintFieldStringLAU

func (c *CLI) PrintFieldStringLAU(
	_ *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

func (*CLI) PrintFieldStringLZ

func (c *CLI) PrintFieldStringLZ(
	_ *analyzer.PGNField,
	_ string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

Note(UNTESTED): See README.md.

func (*CLI) PrintFieldTime

func (c *CLI) PrintFieldTime(
	field *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

func (*CLI) PrintFieldVariable

func (c *CLI) PrintFieldVariable(
	_ *analyzer.PGNField,
	fieldName string,
	data []byte,
	startBit int,
	bits *int,
) (bool, error)

func (*CLI) Run

func (c *CLI) Run() error

Run performs analysis.

Jump to

Keyboard shortcuts

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