ecmd

package
v0.0.0-...-28d9e09 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandFramerMaxDatagramsLen = 1470
)
View Source
const (
	DefaultFramelossTries = 3
)

Variables

View Source
var NoFrame = errors.New("frame did not arrive")
View Source
var NoOverlay = errors.New("failed to overlay")

Functions

func ChooseDefaultError

func ChooseDefaultError(cmd *ExecutingCommand) error

func ChooseWorkingCounterError

func ChooseWorkingCounterError(ec *ExecutingCommand, expwc uint16) error

func ExecuteRead

func ExecuteRead(c Commander, addr ecfr.DatagramAddress, n int, expwc uint16) (d []byte, err error)

func ExecuteRead16

func ExecuteRead16(c Commander, addr ecfr.DatagramAddress, expwc uint16) (d uint16, err error)

func ExecuteRead16Options

func ExecuteRead16Options(c Commander, addr ecfr.DatagramAddress, expwc uint16, opt Options) (d uint16, err error)

func ExecuteRead32

func ExecuteRead32(c Commander, addr ecfr.DatagramAddress, expwc uint16) (d uint32, err error)

func ExecuteRead32Options

func ExecuteRead32Options(c Commander, addr ecfr.DatagramAddress, expwc uint16, opt Options) (d uint32, err error)

func ExecuteRead8

func ExecuteRead8(c Commander, addr ecfr.DatagramAddress, expwc uint16) (d uint8, err error)

func ExecuteRead8Options

func ExecuteRead8Options(c Commander, addr ecfr.DatagramAddress, expwc uint16, opts Options) (d uint8, err error)

func ExecuteReadOptions

func ExecuteReadOptions(c Commander, addr ecfr.DatagramAddress, n int, expwc uint16, opts Options) (d []byte, err error)

func ExecuteWrite

func ExecuteWrite(c Commander, addr ecfr.DatagramAddress, w []byte, expwc uint16) (err error)

func ExecuteWrite16

func ExecuteWrite16(c Commander, addr ecfr.DatagramAddress, w uint16, expwc uint16) (err error)

func ExecuteWrite16Options

func ExecuteWrite16Options(c Commander, addr ecfr.DatagramAddress, w uint16, expwc uint16, opts Options) (err error)

func ExecuteWrite32

func ExecuteWrite32(c Commander, addr ecfr.DatagramAddress, w uint32, expwc uint16) (err error)

func ExecuteWrite32Options

func ExecuteWrite32Options(c Commander, addr ecfr.DatagramAddress, w uint32, expwc uint16, opts Options) (err error)

func ExecuteWrite8

func ExecuteWrite8(c Commander, addr ecfr.DatagramAddress, w uint8, expwc uint16) (err error)

func ExecuteWrite8Options

func ExecuteWrite8Options(c Commander, addr ecfr.DatagramAddress, w uint8, expwc uint16, opts Options) (err error)

func ExecuteWriteOptions

func ExecuteWriteOptions(c Commander, addr ecfr.DatagramAddress, w []byte, expwc uint16, opts Options) (err error)

func IsNoFrame

func IsNoFrame(err error) bool

func IsWorkingCounterError

func IsWorkingCounterError(err error) bool

Types

type CommandFramer

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

func NewCommandFramer

func NewCommandFramer(framer Framer) *CommandFramer

func (*CommandFramer) Close

func (cf *CommandFramer) Close() error

func (*CommandFramer) Cycle

func (cf *CommandFramer) Cycle() error

func (*CommandFramer) DebugMessage

func (cf *CommandFramer) DebugMessage(m string)

func (*CommandFramer) New

func (cf *CommandFramer) New(datalen int) (*ExecutingCommand, error)

type Commander

type Commander interface {
	New(datalen int) (*ExecutingCommand, error)
	Cycle() error
	Close() error
}

type ExecutingCommand

type ExecutingCommand struct {
	DatagramOut *ecfr.Datagram

	DatagramIn *ecfr.Datagram
	Arrived    bool
	Overlayed  bool
	Error      error
}

type Framer

type Framer interface {
	New(maxdatalen int) (*ecfr.Frame, error)
	Cycle() ([]*ecfr.Frame, error)
}

type Multiplexer

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

func NewMultiplexer

func NewMultiplexer(c Commander) (m *Multiplexer, err error)

func (*Multiplexer) Cycle

func (c *Multiplexer) Cycle() error

func (*Multiplexer) OpenCommander

func (m *Multiplexer) OpenCommander() (Commander, error)

type Options

type Options struct {
	FramelossTries int
	WCDeadline     time.Time
}

type WorkingCounterError

type WorkingCounterError struct {
	Command    ecfr.CommandType
	Addr32     uint32
	Want, Have uint16
}

func (WorkingCounterError) Error

func (e WorkingCounterError) Error() string

Jump to

Keyboard shortcuts

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