blocks

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version410 = 410
	Version420 = 420
	Byte       = 8
)
View Source
const (
	AtID = "##AT"
	CaID = "##CA"
	CcID = "##CC"
	CgID = "##CG"
	ChID = "##CH"
	CnID = "##CN"
	DgID = "##DG"
	DlID = "##DL"
	DtID = "##DT"
	DvID = "##DV"
	EvID = "##EV"
	FhID = "##FH"
	HdID = "##HD"
	MdID = "##MD"
	SiID = "##SI"
	SrID = "##SR"
	TxID = "##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
	CcLinear                uint8 = 1
	CcRational              uint8 = 2
	CcAlgebraic             uint8 = 3
	CcVVLookUpInterpolation uint8 = 4
	CcVVLookUp              uint8 = 5
	CcVrVLookUp             uint8 = 6
	CcVTLookUp              uint8 = 7
	CcVrTLookUp             uint8 = 8
	CcTVLookUp              uint8 = 9
	CcTTLookUp              uint8 = 10
	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 added in v0.0.2

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

func CalculateDataSize

func CalculateDataSize(length uint64, linkCount uint64) uint64

func CalculateLinkSize

func CalculateLinkSize(linkCount uint64) uint64

func GetText

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

func IsBitSet

func IsBitSet(value int, bitPosition int) bool

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 added in v0.0.2

func SplitIdToArray(inputString string) [4]byte

Types

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

func GetBlockType added in v0.0.3

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

func GetHeader added in v0.0.2

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

func GetHeaderWithoutValidation added in v0.0.3

func GetHeaderWithoutValidation(file *os.File, startAdress int64) (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