blocks

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version410 = 410
	Version420 = 420
	Byte       = 8
)
View Source
const (
	AtID string = "##AT"
	CaID string = "##CA"
	CcID string = "##CC"
	CgID string = "##CG"
	ChID string = "##CH"
	CnID string = "##CN"
	DgID string = "##DG"
	DlID string = "##DL"
	DtID string = "##DT"
	DvID string = "##DV"
	DzID string = "##DZ"
	EvID string = "##EV"
	FhID string = "##FH"
	HdID string = "##HD"
	HlID string = "##HL"
	MdID string = "##MD"
	SdID string = "##SD"
	SiID string = "##SI"
	SrID string = "##SR"
	TxID string = "##TX"
)
View Source
const (
	VlsdEvent     string = "VLSD"
	BusEvent      string = "BUS_EVENT"
	Event         string = "EVENT"
	PlainBusEvent string = "PLAIN_BUS_EVENT"
)
View Source
const (
	OtherSource string = "OTHER"
	EcuSource   string = "ECU"
	BusSource   string = "BUS"
	IOSource    string = "I/O"
	ToolSource  string = "TOOL"
	UserSource  string = "USER"
)
View Source
const (
	NoBusType       string = "NONE"
	NotFitBusType   string = "OTHER"
	CanBusType      string = "CAN"
	LinBusType      string = "LIN"
	MostBusType     string = "MOST"
	FlexRayBusType  string = "FLEXRAY"
	KLineBusType    string = "K_LINE"
	EthernetBusType string = "ETHERNET"
	USBBusType      string = "USB"
)
View Source
const (
	LinkSize    uint64 = 8
	HeaderSize  uint64 = 24
	IdblockSize int64  = 64
	HdblockSize uint64 = 104
	FhblockSize uint64 = 56
	AtblockSize uint64 = 96
	DgblockSize uint64 = 64
	CgblockSize uint64 = 104
	CnblockSize uint64 = 160
	ChblockSize uint64 = 160
	EvblockSize uint64 = 24
)
View Source
const (
	CcNoConversion uint8 = 0
	// Linear conversion
	CcLinear uint8 = 1

	// Rational conversion
	CcRational uint8 = 2

	// Algebraic conversion
	CcAlgebraic uint8 = 3

	// value to value tabular look-up with interpolation
	CcVVLookUpInterpolation uint8 = 4

	// value to value tabular look-up without interpolation
	CcVVLookUp uint8 = 5

	// value range to value tabular look-up
	CcVrVLookUp uint8 = 6

	// value to text/scale conversion tabular look-up
	CcVTLookUp uint8 = 7

	// value range to text/scale conversion tabular look-up
	CcVrTLookUp uint8 = 8

	// text to value tabular look-up
	CcTVLookUp uint8 = 9

	// text to text tabular look-up (translation)
	CcTTLookUp uint8 = 10

	// bitfield text table
	CcBitfield uint8 = 11
)
View Source
const (
	RemoteMaster string = "REMOTE_MASTER"
)

Variables

View Source
var (
	SourceTypeMap map[uint8]string = map[uint8]string{
		0: OtherSource,
		1: EcuSource,
		2: BusSource,
		3: IOSource,
		4: ToolSource,
		5: UserSource,
	}

	BusTypeMap map[uint8]string = map[uint8]string{
		0: NoBusType,
		1: NotFitBusType,
		2: CanBusType,
		3: LinBusType,
		4: MostBusType,
		5: FlexRayBusType,
		6: KLineBusType,
		7: EthernetBusType,
		8: USBBusType,
	}
)

Functions

func BinarySearch

func BinarySearch(vvKeys []float64, c float64) int

func CalculateDataSize

func CalculateDataSize(length uint64, linkCount uint64) uint64

func CalculateLinkSize

func CalculateLinkSize(linkCount uint64) uint64

func GetHeaderID

func GetHeaderID(file *os.File, startAddress int64) (string, error)

func GetLength added in v1.1.0

func GetLength(file *os.File, startAddress int64) (uint64, error)

func GetText

func GetText(file *os.File, startAdress int64, bufSize []byte, decode bool) []byte

func IsBitSet

func IsBitSet(value int, bitPosition int) bool

IsBitSet uses bitwise AND to check if the target bit is set

func LoadBuffer

func LoadBuffer(file *os.File, blockSize uint64) *bytes.Buffer

Create a buffer based on blocksize

func NewBuffer

func NewBuffer(file *os.File, startAdress int64, BLOCK_SIZE int) *bytes.Buffer

func ReadAllFromBinary

func ReadAllFromBinary(file *os.File) int64

func ReadInt64FromBinary

func ReadInt64FromBinary(file *os.File) int64

func SplitIdToArray

func SplitIdToArray(inputString string) [4]byte

Types

type Header struct {
	ID        [4]byte
	Reserved  [4]byte
	Length    uint64
	LinkCount uint64
}

func GetBlockType

func GetBlockType(file *os.File, startAddress int64) (Header, error)

func GetHeader

func GetHeader(file *os.File, startAddress int64, blockID string) (Header, error)

type LinkType

type LinkType map[string]int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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