Documentation
¶
Index ¶
Constants ¶
View Source
const ( READY = uint8(0x00) RUNNING = uint8(0x01) STOPPING = uint8(0x02) INVALID = uint8(0x03) )
Constants for Bus.status
View Source
const ACK = 0x06
View Source
const ERROR = 0x15
View Source
const READ_REQUEST = 0x0b
View Source
const WRITE_REQUEST = 0x0c
Variables ¶
View Source
var Operations = map[uint8]string{ ACK: "ACK", READ_REQUEST: "READ_REQUEST", WRITE_REQUEST: "WRITE_REQUEST", ERROR: "ERROR", }
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus defines frame-based interactions atop a Transceiver
func (*Bus) Probe ¶
func (bus *Bus) Probe(received OnFrameReceived)
type FileReplayer ¶
type FileReplayer struct {
// contains filtered or unexported fields
}
FileReplayer is a Transceiver that turns writes into 'no-ops', but allows for probing previously recorded bus logs. if a FileReplayer hits an EOF, it's considered no longer valid.
func NewFileBusReplayer ¶
func NewFileBusReplayer(file string) *FileReplayer
func (*FileReplayer) Close ¶
func (fb *FileReplayer) Close() error
func (*FileReplayer) IsOpen ¶
func (fb *FileReplayer) IsOpen() bool
func (*FileReplayer) Open ¶
func (fb *FileReplayer) Open() error
func (*FileReplayer) Valid ¶
func (fb *FileReplayer) Valid() bool
type Frame ¶
type Frame struct {
Header Header
// contains filtered or unexported fields
}
A Communication Frame (message)
func NewProbeDeviceFrame ¶
type Header ¶
type Header struct {
Destination uint16
Source uint16
Length uint8
Operation uint8
// contains filtered or unexported fields
}
A Frame Header
type SerialTransceiver ¶
type SerialTransceiver struct {
// contains filtered or unexported fields
}
SerialTransceiver is a Transceiver that operations on serial ports. Surprise!
func NewSerialTransceiver ¶
func NewSerialTransceiver(device string) *SerialTransceiver
func (*SerialTransceiver) Close ¶
func (st *SerialTransceiver) Close() error
func (*SerialTransceiver) IsOpen ¶
func (st *SerialTransceiver) IsOpen() bool
func (*SerialTransceiver) Open ¶
func (st *SerialTransceiver) Open() error
func (*SerialTransceiver) Valid ¶
func (st *SerialTransceiver) Valid() bool
type Transceiver ¶
type Transceiver interface {
io.ReadWriteCloser
Open() error
IsOpen() bool
Valid() bool
}
Transceiver abstracts a ReadWriteCloser and the functions expected by Bus for opening / closing streams.
Click to show internal directories.
Click to hide internal directories.