adapter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 35 Imported by: 4

Documentation

Index

Constants

View Source
const (
	OBDLinkSX = "OBDLink SX"
	OBDLinkEX = "OBDLink EX"
	STN1170   = "STN1170"
	STN2120   = "STN2120"
)

Variables

View Source
var (
	ErrDroppedFrame = fmt.Errorf("incoming buffer full")
)

Functions

func FindDevices

func FindDevices() (dev []string)

func GetAdapterMap

func GetAdapterMap() map[string]*AdapterInfo

func List

func List() []string

func New

func New(adapterName string, cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewCanusb

func NewCanusb(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewELM327

func NewELM327(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewGRPCClient

func NewGRPCClient() (*grpc.ClientConn, proto.GocanClient, error)

func NewJust4Trionic

func NewJust4Trionic(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewOBDXProWifi

func NewOBDXProWifi(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewSLCan

func NewSLCan(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewSTN

func NewSTN(name string) func(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewSocketCAN

func NewSocketCAN(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewSocketCANFromDevName

func NewSocketCANFromDevName(dev string) func(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewTemplate

func NewTemplate(name string, cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewTxbridge

func NewTxbridge(name string) func(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func NewYACA

func NewYACA(cfg *gocan.AdapterConfig) (gocan.Adapter, error)

func Register

func Register(adapter *AdapterInfo) error

Types

type AdapterCapabilities

type AdapterCapabilities struct {
	HSCAN bool
	SWCAN bool
	KLine bool
}

type AdapterInfo

type AdapterInfo struct {
	Name               string
	Description        string
	Capabilities       AdapterCapabilities
	RequiresSerialPort bool
	New                func(*gocan.AdapterConfig) (gocan.Adapter, error)
}

func ListAdapters

func ListAdapters() []AdapterInfo

type BaseAdapter

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

func NewBaseAdapter

func NewBaseAdapter(name string, cfg *gocan.AdapterConfig) BaseAdapter

func (*BaseAdapter) Close

func (base *BaseAdapter) Close()

func (*BaseAdapter) Err

func (base *BaseAdapter) Err() <-chan error

func (*BaseAdapter) Name

func (base *BaseAdapter) Name() string

func (*BaseAdapter) Recv

func (base *BaseAdapter) Recv() <-chan gocan.CANFrame

func (*BaseAdapter) Send

func (base *BaseAdapter) Send() chan<- gocan.CANFrame

func (*BaseAdapter) SetError

func (base *BaseAdapter) SetError(err error)

type Canusb

type Canusb struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func (*Canusb) Close

func (cu *Canusb) Close() error

func (*Canusb) Connect

func (cu *Canusb) Connect(ctx context.Context) error

func (*Canusb) SetFilter

func (cu *Canusb) SetFilter(filters []uint32) error

type Client

type Client struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func NewClient

func NewClient(adapterName string, cfg *gocan.AdapterConfig) (*Client, error)

func (*Client) Close

func (c *Client) Close() (err error)

func (*Client) Connect

func (c *Client) Connect(gctx context.Context) error

func (*Client) SetFilter

func (c *Client) SetFilter([]uint32) error

type ELM327

type ELM327 struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func (*ELM327) Close

func (elm *ELM327) Close() error

func (*ELM327) Connect

func (elm *ELM327) Connect(ctx context.Context) error

func (*ELM327) SetFilter

func (elm *ELM327) SetFilter(filters []uint32) error

type Just4Trionic

type Just4Trionic struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func (*Just4Trionic) Close

func (a *Just4Trionic) Close() error

func (*Just4Trionic) Connect

func (a *Just4Trionic) Connect(ctx context.Context) error

func (*Just4Trionic) SetFilter

func (a *Just4Trionic) SetFilter(filters []uint32) error

type OBDXProWifi

type OBDXProWifi struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func (*OBDXProWifi) Close

func (a *OBDXProWifi) Close() error

func (*OBDXProWifi) Connect

func (a *OBDXProWifi) Connect(ctx context.Context) error

func (*OBDXProWifi) SetFilter

func (a *OBDXProWifi) SetFilter(filters []uint32) error

type SLCan

type SLCan struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func (*SLCan) Close

func (sl *SLCan) Close() error

func (*SLCan) Connect

func (sl *SLCan) Connect(ctx context.Context) error

func (*SLCan) SetFilter

func (sl *SLCan) SetFilter(filters []uint32) error

type STN

type STN struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func (*STN) Close

func (stn *STN) Close() error

func (*STN) Connect

func (stn *STN) Connect(ctx context.Context) error

func (*STN) SetFilter

func (stn *STN) SetFilter(filters []uint32) error

type SocketCAN

type SocketCAN struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func (*SocketCAN) Close

func (a *SocketCAN) Close() error

func (*SocketCAN) Connect

func (a *SocketCAN) Connect(ctx context.Context) error

func (*SocketCAN) SetFilter

func (a *SocketCAN) SetFilter(uint32s []uint32) error

type Template

type Template struct {
	BaseAdapter
}

func (*Template) Close

func (a *Template) Close() error

func (*Template) Connect

func (a *Template) Connect(ctx context.Context) error

func (*Template) SetFilter

func (a *Template) SetFilter(filters []uint32) error

type Txbridge

type Txbridge struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func (*Txbridge) Close

func (tx *Txbridge) Close() error

func (*Txbridge) Connect

func (tx *Txbridge) Connect(ctx context.Context) error

func (*Txbridge) SetFilter

func (tx *Txbridge) SetFilter(filters []uint32) error

type UnboundedChan

type UnboundedChan[T any] struct {
	// contains filtered or unexported fields
}

UnboundedChan is a channel with an unbounded buffer for caching Func objects. A channel must be closed via Close method.

func NewUnboundedChan

func NewUnboundedChan[T any]() *UnboundedChan[T]

NewUnboundedChan returns a unbounded channel with unlimited capacity.

func (*UnboundedChan[T]) Close

func (ch *UnboundedChan[T]) Close()

Close closes the channel.

func (*UnboundedChan[T]) In

func (ch *UnboundedChan[T]) In() chan<- T

In returns the send channel of the given channel, which can be used to send values to the channel.

func (*UnboundedChan[T]) Out

func (ch *UnboundedChan[T]) Out() <-chan T

Out returns the receive channel of the given channel, which can be used to receive values from the channel.

type YACA

type YACA struct {
	BaseAdapter
	// contains filtered or unexported fields
}

func (*YACA) Close

func (ya *YACA) Close() error

func (*YACA) Connect

func (ya *YACA) Connect(ctx context.Context) error

func (*YACA) SetFilter

func (ya *YACA) SetFilter(filters []uint32) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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