mbe

package
v0.0.0-...-8ab234a Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID_EASIMAP uint32 = 0xcbe1101
	ID_ECU     uint32 = 0xcbe0111
)

Variables

View Source
var DataReqPrefix = []byte{0x01, 0x0, 0x0, 0x0, 0x0}
View Source
var DataResPrefix = []byte{0x81}
View Source
var VersionReq = []byte{0x4, 0x0, 0xd}
View Source
var VersionResPrefix = []byte{0xe4, 0x0, 0xd}

Functions

func CreateDataRequest

func CreateDataRequest(page byte, offsets []byte) []byte

func ParseDataResponse

func ParseDataResponse(d []byte) ([]byte, error)

func ParseVersionResponse

func ParseVersionResponse(d []byte) (ver string, err error)

Types

type Conn

type Conn interface {
	Close() error
	Recv() (msg []byte, err error)
	Reopen() (error, Conn)
	Send(msg []byte) error
	SetTimeout(t time.Duration)
}

func NewConn

func NewConn(dev string, rx_id uint32, tx_id uint32) (Conn, error)

type Param

type Param struct {
	ID    string            `yaml:"id"`
	Page  uint8             `yaml:"page"`
	Addr  []uint8           `yaml:"addr"`
	Name  string            `yaml:"name"`
	Desc  string            `yaml:"desc"`
	Scale Scale             `yaml:"scale"`
	Bits  map[uint16]string `yaml:"bits"`
}

func LoadParams

func LoadParams(f string) ([]Param, error)

type Scale

type Scale struct {
	Units      string  `yaml:"units"`
	ScaleMin   float32 `yaml:"scale_min"`
	ScaleMax   float32 `yaml:"scale_max"`
	DisplayMin float32 `yaml:"display_min"`
	DisplayMax float32 `yaml:"display_max"`
	Precision  int     `yaml:"precision"`
}

Jump to

Keyboard shortcuts

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