Documentation ¶
Overview ¶
package canbus provides high-level access to CAN bus sockets.
A typical usage might look like:
sck, err := canbus.New() err = sck.Bind("vcan0") for { id, data, err := sck.Recv() }
Index ¶
- type Socket
- func (sck *Socket) ApplyFilters(filters []unix.CanFilter)
- func (sck *Socket) Bind(addr string) error
- func (sck *Socket) Close() error
- func (sck *Socket) Name() string
- func (sck *Socket) Recv() (id uint32, data []byte, err error)
- func (sck *Socket) Send(id uint32, idMask uint32, data []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
Socket is a high-level representation of a CANBus socket.
func (*Socket) ApplyFilters ¶
ApplyFilters sets the CAN_RAW_FILTER option of the socket and stores the new filters in the Socket object for use by other methods such as Recv.
func (*Socket) Bind ¶
Bind binds the socket on the CAN bus with the given address.
Example:
err = sck.Bind("vcan0")
Click to show internal directories.
Click to hide internal directories.