CN

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnsignedIntegerLE uint8 = iota // 0
	UnsignedIntegerBE              // 1
	SignedIntegerLE                // 2
	SignedIntegerBE                // 3
	IEEE754FloatLE                 // 4
	IEEE754FloatBE                 // 5
	StringSBC                      // 6
	StringUTF8                     // 7
	StringUTF16LE                  // 8
	StringUTF16BE                  // 9
	ByteArrayUnknown               // 10
	MIMESample                     // 11
	MIMEStream                     // 12
	CANopenDate                    // 13
	CANopenTime                    // 14
	// Version 4.2
	ComplexNumberLE // 15
	ComplexNumberBE // 16
)

Variables

This section is empty.

Functions

func LittleEndianArray added in v0.0.3

func LittleEndianArray() []int

Types

type Block

type Block struct {
	Header blocks.Header
	Link   Link
	Data   Data
}

func New

func New(file *os.File, version uint16, startAdress int64) *Block

func (*Block) BlankBlock

func (b *Block) BlankBlock() *Block

func (*Block) ByteOrder added in v0.0.3

func (b *Block) ByteOrder() binary.ByteOrder

func (*Block) GetChannelName

func (b *Block) GetChannelName(f *os.File) string

func (*Block) GetCommentMd

func (b *Block) GetCommentMd() int64

func (*Block) GetConversion added in v0.0.2

func (b *Block) GetConversion(file *os.File, channelDataType uint8) CC.Conversion

GetConversion return Conversion structs that hold the formula to convert raw sample to desired value.

func (*Block) GetDataType added in v0.0.2

func (b *Block) GetDataType() uint8

func (*Block) GetSyncType added in v0.0.2

func (b *Block) GetSyncType() uint8

func (*Block) GetType added in v0.0.2

func (b *Block) GetType() uint8

func (*Block) InvalBitPos added in v0.0.2

func (b *Block) InvalBitPos() uint32

func (*Block) IsAllValuesInvalid added in v0.0.2

func (b *Block) IsAllValuesInvalid() bool

func (*Block) IsAllValuesValid added in v0.0.2

func (b *Block) IsAllValuesValid() bool

func (*Block) IsComposed added in v0.0.2

func (b *Block) IsComposed() bool

func (*Block) LoadDataType added in v0.0.2

func (b *Block) LoadDataType(lenSize int) interface{}

func (*Block) NewConversion added in v0.0.2

func (b *Block) NewConversion(file *os.File) *CC.Block

NewConversion create a new CCBlock according to the Link.CcConvertion field.

func (*Block) Next

func (b *Block) Next() int64

func (*Block) SignalBytesRange added in v0.0.3

func (b *Block) SignalBytesRange() uint32

LengthSignalInRow is number of Bytes required to store (cn_bit_count + cn_bit_offset) bits

type Data

type Data struct {
	Type        uint8
	SyncType    uint8
	DataType    uint8
	BitOffset   uint8
	ByteOffset  uint32
	BitCount    uint32
	Flags       uint32
	InvalBitPos uint32
	Precision   uint8
	// Use [1]byte for versions >= 4.1
	Reserved uint8
	//Version 4.1
	AttachmentCount uint16
	ValRangeMin     float64
	ValRangeMax     float64
	LimitMin        float64
	LimitMax        float64
	LimitExtMin     float64
	LimitExtMax     float64
}
type Link struct {
	Next         int64
	Composition  int64
	TxName       int64
	SiSource     int64
	CcConvertion int64
	Data         int64
	MdUnit       int64
	MdComment    int64
	//Version 4.1
	AtReference int64
	//Version 4.1
	DefaultX [3]int64
}

Jump to

Keyboard shortcuts

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