socketcan

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: BSD-3-Clause Imports: 6 Imported by: 6

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 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