socketcanendpoint

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package socketcanendpoint contains the SocketCANEndpoint struct described below

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSocketCANEndpoint

func NewSocketCANEndpoint(log *logrus.Logger, canInterfaceName string) endpoint.Endpoint

NewSocketCANEndpoint builds a new SocketCANEndpoint for the given CAN interface name

Types

type SocketCANEndpoint

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

SocketCANEndpoint is an endpoint backed by a live SocketCAN interface, pulling down CAN frames

func (*SocketCANEndpoint) Close

func (c *SocketCANEndpoint) Close() error

Close will stop the endpoint from processing further frames

func (*SocketCANEndpoint) Run

func (c *SocketCANEndpoint) 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 (*SocketCANEndpoint) SetOutput

func (c *SocketCANEndpoint) 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