socketcan

package module
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: BSD-3-Clause Imports: 7 Imported by: 1

README

golang-socketcan

forked from https://github.com/atuleu/golang-socketcan

only for linux

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
)
View Source
const (
	BAUD_1M   = 1000000
	BAUD_500K = 500000
	BAUD_250K = 250000
	BAUD_125K = 125000
	BAUD_100K = 100000
	BAUD_50K  = 50000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CanFrame

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

type RawInterface

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

func NewCanItf

func NewCanItf(ifName string) (*RawInterface, error)

func (*RawInterface) AddfilterPass

func (itf *RawInterface) AddfilterPass(recv_ids []uint32, len uint32) error

func (*RawInterface) Close

func (itf *RawInterface) Close() error

func (*RawInterface) Receive

func (itf *RawInterface) Receive() (CanFrame, error)

func (*RawInterface) Send

func (itf *RawInterface) Send(f CanFrame) error

func (*RawInterface) SetBaud added in v0.2.3

func (itf *RawInterface) SetBaud(baud uint32) error

func (*RawInterface) SetTxQueueLen added in v0.2.3

func (itf *RawInterface) SetTxQueueLen(size uint32) error

Jump to

Keyboard shortcuts

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