Documentation ¶
Index ¶
- func Run(ctx context.Context, n Node) error
- func RunMessageReceiver(ctx context.Context, rx FrameReceiver, n Node, c clock.Clock) error
- func RunMessageTransmitter(ctx context.Context, tx FrameTransmitter, l sync.Locker, m TransmittedMessage, ...) error
- type FrameReceiver
- type FrameTransmitter
- type Node
- type ReceivedMessage
- type TransmittedMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMessageReceiver ¶
func RunMessageTransmitter ¶
func RunMessageTransmitter( ctx context.Context, tx FrameTransmitter, l sync.Locker, m TransmittedMessage, c clock.Clock, ) error
Types ¶
type FrameReceiver ¶
FrameReceiver is an interface for the CAN frame receiver used by the runner.
type FrameTransmitter ¶
FrameTransmitter is an interface for the the CAN frame transmitter used by the runner.
type Node ¶
type Node interface { sync.Locker Connect() (net.Conn, error) Descriptor() *descriptor.Node TransmittedMessages() []TransmittedMessage ReceivedMessage(id uint32) (ReceivedMessage, bool) }
Node is an interface for a CAN node to be run by the runner.
type ReceivedMessage ¶
type ReceivedMessage interface { generated.Message // SetReceiveTime sets the time the message was last received. SetReceiveTime(time.Time) // AfterReceiveHook returns a function to be called after the message has been received. // // If the hook returns an error, the receiver will halt. AfterReceiveHook() func(context.Context) error }
ReceivedMessage is an interface for a message to be received by the runner.
type TransmittedMessage ¶
type TransmittedMessage interface { generated.Message // SetTransmitTime sets the time the message was last transmitted. SetTransmitTime(time.Time) // IsCyclicTransmissionEnabled returns true when cyclic transmission is enabled. IsCyclicTransmissionEnabled() bool // WakeUpChan returns a channel for waking up and checking if cyclic transmission is enabled. WakeUpChan() <-chan struct{} // TransmitEventChan returns channel for event-based transmission of the message. TransmitEventChan() <-chan struct{} // BeforeTransmitHook returns a function to be called before the message is transmitted. // // If the hook returns an error, the transmitter halt. BeforeTransmitHook() func(context.Context) error }
TransmittedMessage is an interface for a message to be transmitted by the runner.
Click to show internal directories.
Click to hide internal directories.