ihex

package module
v0.0.0-...-ae078b6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2016 License: BSD-3-Clause Imports: 2 Imported by: 0

README

ihex

Golang library to decode and encode intel hex files.

Documentation

Index

Constants

View Source
const (
	RecTypeData         = 0x00
	RecTypeEOF          = 0x01
	RecTypeExtSegAddr   = 0x02
	RecTypeStartSegAddr = 0x03
	RecTypeExtLinAddr   = 0x04
	RecTypeStartLinAddr = 0x05

	LastValidRecType = RecTypeStartLinAddr
)
View Source
const (
	RecMinLen     = 11
	ExtLinAddrLen = 2
)
View Source
const (
	ErrInvalidRecLen             = Err("Invalid record length!")
	ErrInvalidRecStartCode       = Err("Invalid record start code!")
	ErrNonHexContent             = Err("Encountered non hex content!")
	ErrInvalidRecType            = Err("Invalid record type!")
	ErrInvalidChksum             = Err("Invalid checksum!")
	ErrSegAddressingNotSupported = Err("Segment addressing not supported!")
)

Variables

This section is empty.

Functions

func CalcChksum

func CalcChksum(aBytes []byte) uint8

CalcChksum calculates checksum for the given byte array

Types

type Decoder

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

func NewDecoder

func NewDecoder() *Decoder

func (*Decoder) DecodeRecord

func (meDec *Decoder) DecodeRecord(aRec Record) (uint32, []byte, error)

type Err

type Err string

Err contains information about the failure

func (Err) Error

func (meErr Err) Error() string

Error returns printable string of the failure

type RecType

type RecType int

type Record

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

func MakeRecord

func MakeRecord(aIn []byte) (*Record, error)

MakeRecord creates record from the record's content

func (Record) GetData

func (meRec Record) GetData() (uint16, []byte, error)

Jump to

Keyboard shortcuts

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