socketcan

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: BSD-3-Clause Imports: 10 Imported by: 8

README

golang-socketcan

Documentation

Index

Constants

View Source
const (
	CAN_EFF_MASK uint32 = unix.CAN_EFF_MASK
	CAN_SFF_MASK uint32 = unix.CAN_SFF_MASK
	CAN_RTR_FLAG uint32 = unix.CAN_RTR_FLAG
	CAN_EFF_FLAG uint32 = unix.CAN_EFF_FLAG
)

Variables

This section is empty.

Functions

func IsClosedInterfaceError

func IsClosedInterfaceError(err error) bool

func ListCANInterfaces added in v0.2.2

func ListCANInterfaces() ([]string, error)

func SetRecvTimeout

func SetRecvTimeout(i Interface, timeout time.Duration) error

func SetSendTimeout

func SetSendTimeout(i Interface, timeout time.Duration) error

Types

type CanFrame

type CanFrame struct {
	ID       uint32
	Dlc      byte
	Data     []byte
	Extended bool
	RTR      bool
}

type Interface

type Interface interface {
	SocketFD() int
}

type RawInterface

type RawInterface interface {
	Send(CanFrame) error
	Receive() (CanFrame, error)
	Close() error
}

func NewRawInterface

func NewRawInterface(ifName string) (RawInterface, error)

Jump to

Keyboard shortcuts

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