candevice

package
v0.0.0-...-d0567cd Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateErrorActive  = unix.CAN_STATE_ERROR_ACTIVE
	StateErrorWarning = unix.CAN_STATE_ERROR_WARNING
	StateErrorPassive = unix.CAN_STATE_ERROR_PASSIVE
	StateBusOff       = unix.CAN_STATE_BUS_OFF
	StateStopped      = unix.CAN_STATE_STOPPED
	StateSleeping     = unix.CAN_STATE_SLEEPING
	StateMax          = unix.CAN_STATE_MAX
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitTiming

type BitTiming struct {
	unix.CANBitTiming
}

type BitTimingConst

type BitTimingConst struct {
	unix.CANBitTimingConst
}

type BusErrorCounters

type BusErrorCounters struct {
	unix.CANBusErrorCounters
}

type Clock

type Clock struct {
	unix.CANClock
}

type CtrlMode

type CtrlMode struct {
	unix.CANCtrlMode
}

type Device

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

func New

func New(deviceName string) (*Device, error)

Creates a handle to a CAN device specified by name, e.g. can0.

func (*Device) Bitrate

func (d *Device) Bitrate() (uint32, error)

func (*Device) Info

func (d *Device) Info() (Info, error)

func (*Device) IsUp

func (d *Device) IsUp() (bool, error)

func (*Device) SetBitrate

func (d *Device) SetBitrate(bitrate uint32) error

func (*Device) SetDown

func (d *Device) SetDown() error

Corresponds to "ip link set down".

func (*Device) SetUp

func (d *Device) SetUp() error

Corresponds to "ip link set up".

type Info

type Info struct {
	BitTiming        BitTiming
	BitTimingConst   BitTimingConst
	Clock            Clock
	CtrlMode         CtrlMode
	BusErrorCounters BusErrorCounters

	State     uint32
	RestartMs uint32
}

type Stats

type Stats struct {
	unix.CANDeviceStats
}

Jump to

Keyboard shortcuts

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