usbcanendpoint

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package usbcanendpoint contains the USBCANEndpoint struct described below

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUSBCANEndpoint

func NewUSBCANEndpoint(log *logrus.Logger, serialPortName string) endpoint.Endpoint

NewUSBCANEndpoint builds a new SocketCANEndpoint for the given CAN interface name

Types

type USBCANEndpoint

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

USBCANEndpoint is an endpoint backed by a USBCAN interface, pulling down CAN frames

func (*USBCANEndpoint) Close

func (c *USBCANEndpoint) Close() error

Close will stop the endpoint from processing further frames

func (*USBCANEndpoint) Run

func (c *USBCANEndpoint) Run(ctx context.Context) error

Run should, in theory, run the endpoint and block until completion/error, but the canbus implementation doesn't work like that right now unfortunately, so it just spawns in the background and keeps running until Shutdown kills it...

func (*USBCANEndpoint) SetOutput

func (c *USBCANEndpoint) SetOutput(mh endpoint.MessageHandler)

SetOutput subscribes a callback handler for whenever a message is ready

Jump to

Keyboard shortcuts

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