Versions in this module Expand all Collapse all v0 v0.2.3 Sep 16, 2021 Changes in this version + const LengthOfControllerSpecificInformation + func Dial(network, address string) (net.Conn, error) + func DialContext(ctx context.Context, network, address string) (net.Conn, error) + func NoLogger(cfg *emulatorCfg) + type ControllerError uint8 + const ControllerErrorActive + const ControllerErrorRxBufferOverflow + const ControllerErrorRxPassive + const ControllerErrorRxWarning + const ControllerErrorTxBufferOverflow + const ControllerErrorTxPassive + const ControllerErrorTxWarning + const ControllerErrorUnspecified + func (i ControllerError) String() string + type Emulator struct + func NewEmulator(options ...EmulatorOption) (*Emulator, error) + func (e *Emulator) Addr() net.Addr + func (e *Emulator) Receiver() (*Receiver, error) + func (e *Emulator) Run(ctx context.Context) error + func (e *Emulator) TransmitFrame(ctx context.Context, f can.Frame) error + func (e *Emulator) TransmitMessage(ctx context.Context, m can.Message) error + func (e *Emulator) WaitForSenders(n int, timeout time.Duration) error + type EmulatorOption func(*emulatorCfg) + func WithLogger(l *log.Logger) EmulatorOption + func WithMulticastAddress(address string) EmulatorOption + type ErrorClass uint32 + const ErrorClassBusError + const ErrorClassBusOff + const ErrorClassController + const ErrorClassLostArbitration + const ErrorClassNoAck + const ErrorClassProtocolViolation + const ErrorClassRestarted + const ErrorClassTransceiver + const ErrorClassTxTimeout + func (i ErrorClass) String() string + type ErrorFrame struct + ControllerError ControllerError + ControllerSpecificInformation [3]byte + ErrorClass ErrorClass + LostArbitrationBit uint8 + ProtocolError ProtocolViolationError + ProtocolViolationErrorLocation ProtocolViolationErrorLocation + TransceiverError TransceiverError + func (e *ErrorFrame) String() string + type FrameInterceptor func(fr can.Frame) + type ProtocolViolationError uint8 + const ProtocolViolationErrorActive + const ProtocolViolationErrorBit0 + const ProtocolViolationErrorBit1 + const ProtocolViolationErrorBitStuffing + const ProtocolViolationErrorBusOverload + const ProtocolViolationErrorFrameFormat + const ProtocolViolationErrorSingleBit + const ProtocolViolationErrorTx + const ProtocolViolationErrorUnspecified + func (i ProtocolViolationError) String() string + type ProtocolViolationErrorLocation uint8 + const ProtocolViolationErrorLocationACKDelimiter + const ProtocolViolationErrorLocationACKSlot + const ProtocolViolationErrorLocationCRCDelimiter + const ProtocolViolationErrorLocationCRCSequence + const ProtocolViolationErrorLocationData + const ProtocolViolationErrorLocationDataLengthCode + const ProtocolViolationErrorLocationEndOfFrame + const ProtocolViolationErrorLocationID20To18 + const ProtocolViolationErrorLocationID28To21 + const ProtocolViolationErrorLocationIDBits04To00 + const ProtocolViolationErrorLocationIDBits12To05 + const ProtocolViolationErrorLocationIDBits17To13 + const ProtocolViolationErrorLocationIDExtension + const ProtocolViolationErrorLocationIntermission + const ProtocolViolationErrorLocationRTR + const ProtocolViolationErrorLocationReservedBit0 + const ProtocolViolationErrorLocationReservedBit1 + const ProtocolViolationErrorLocationStartOfFrame + const ProtocolViolationErrorLocationSubstituteRTR + const ProtocolViolationErrorLocationUnspecified + func (i ProtocolViolationErrorLocation) String() string + type Receiver struct + func NewReceiver(rc io.ReadCloser, opt ...ReceiverOption) *Receiver + func (r *Receiver) Close() error + func (r *Receiver) Err() error + func (r *Receiver) ErrorFrame() ErrorFrame + func (r *Receiver) Frame() can.Frame + func (r *Receiver) HasErrorFrame() bool + func (r *Receiver) Receive() bool + type ReceiverOption func(*receiverOpts) + func ReceiverFrameInterceptor(i FrameInterceptor) ReceiverOption + type TransceiverError uint8 + const TransceiverErrorCANHNoWire + const TransceiverErrorCANHShortToBat + const TransceiverErrorCANHShortToGND + const TransceiverErrorCANHShortToVCC + const TransceiverErrorCANLNoWire + const TransceiverErrorCANLShortToBat + const TransceiverErrorCANLShortToCANH + const TransceiverErrorCANLShortToGND + const TransceiverErrorCANLShortToVcc + const TransceiverErrorUnspecified + func (i TransceiverError) String() string + type Transmitter struct + func NewTransmitter(conn net.Conn, opt ...TransmitterOption) *Transmitter + func (t *Transmitter) Close() error + func (t *Transmitter) TransmitFrame(ctx context.Context, f can.Frame) error + func (t *Transmitter) TransmitMessage(ctx context.Context, m can.Message) error + type TransmitterOption func(*transmitterOpts) + func TransmitterFrameInterceptor(i FrameInterceptor) TransmitterOption