can

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BusConfigInterfaceIdTagVirtualif int32 = 0
	BusConfigInterfaceIdTagNativeif  int32 = 1
	BusConfigInterfaceIdTagSlcan     int32 = 2
	BusConfigInterfaceIdTagIndexed   int32 = 3
)
View Source
const (
	TransactionICanControllerGetSupportedInterfaceTypes = binder.FirstCallTransaction + 0
	TransactionICanControllerGetInterfaceName           = binder.FirstCallTransaction + 1
	TransactionICanControllerUpBus                      = binder.FirstCallTransaction + 2
	TransactionICanControllerDownBus                    = binder.FirstCallTransaction + 3
)
View Source
const (
	MethodICanControllerGetSupportedInterfaceTypes = "getSupportedInterfaceTypes"
	MethodICanControllerGetInterfaceName           = "getInterfaceName"
	MethodICanControllerUpBus                      = "upBus"
	MethodICanControllerDownBus                    = "downBus"
)
View Source
const (
	NativeInterfaceInterfaceIdTagIfname   int32 = 0
	NativeInterfaceInterfaceIdTagSerialno int32 = 1
)
View Source
const (
	SlcanInterfaceInterfaceIdTagTtyname  int32 = 0
	SlcanInterfaceInterfaceIdTagSerialno int32 = 1
)
View Source
const DescriptorICanController = "android.hardware.automotive.can.ICanController"

Variables

This section is empty.

Functions

This section is empty.

Types

type BusConfig

type BusConfig struct {
	Name        string
	InterfaceId BusConfigInterfaceId
	Bitrate     int32
}

func (*BusConfig) MarshalParcel

func (s *BusConfig) MarshalParcel(
	p *parcel.Parcel,
) error

func (*BusConfig) UnmarshalParcel

func (s *BusConfig) UnmarshalParcel(
	p *parcel.Parcel,
) error

type BusConfigInterfaceId

type BusConfigInterfaceId struct {
	Tag       int32
	Virtualif VirtualInterface
	Nativeif  *NativeInterface
	Slcan     *SlcanInterface
	Indexed   IndexedInterface
}

func (*BusConfigInterfaceId) GetIndexed

func (u *BusConfigInterfaceId) GetIndexed() (IndexedInterface, bool)

func (*BusConfigInterfaceId) GetNativeif

func (u *BusConfigInterfaceId) GetNativeif() (*NativeInterface, bool)

func (*BusConfigInterfaceId) GetSlcan

func (u *BusConfigInterfaceId) GetSlcan() (*SlcanInterface, bool)

func (*BusConfigInterfaceId) GetVirtualif

func (u *BusConfigInterfaceId) GetVirtualif() (VirtualInterface, bool)

func (*BusConfigInterfaceId) MarshalParcel

func (u *BusConfigInterfaceId) MarshalParcel(
	p *parcel.Parcel,
) error

func (*BusConfigInterfaceId) SetIndexed

func (u *BusConfigInterfaceId) SetIndexed(
	v IndexedInterface,
)

func (*BusConfigInterfaceId) SetNativeif

func (u *BusConfigInterfaceId) SetNativeif(
	v *NativeInterface,
)

func (*BusConfigInterfaceId) SetSlcan

func (u *BusConfigInterfaceId) SetSlcan(
	v *SlcanInterface,
)

func (*BusConfigInterfaceId) SetVirtualif

func (u *BusConfigInterfaceId) SetVirtualif(
	v VirtualInterface,
)

func (*BusConfigInterfaceId) UnmarshalParcel

func (u *BusConfigInterfaceId) UnmarshalParcel(
	p *parcel.Parcel,
) error

type CanControllerProxy

type CanControllerProxy struct {
	Remote binder.IBinder
}

func NewCanControllerProxy

func NewCanControllerProxy(
	remote binder.IBinder,
) *CanControllerProxy

func (*CanControllerProxy) AsBinder

func (p *CanControllerProxy) AsBinder() binder.IBinder

func (*CanControllerProxy) DownBus

func (p *CanControllerProxy) DownBus(
	ctx context.Context,
	name string,
) error

func (*CanControllerProxy) GetInterfaceName

func (p *CanControllerProxy) GetInterfaceName(
	ctx context.Context,
	busName string,
) (string, error)

func (*CanControllerProxy) GetSupportedInterfaceTypes

func (p *CanControllerProxy) GetSupportedInterfaceTypes(
	ctx context.Context,
) ([]InterfaceType, error)

func (*CanControllerProxy) UpBus

func (p *CanControllerProxy) UpBus(
	ctx context.Context,
	config BusConfig,
) (string, error)

type CanControllerStub

type CanControllerStub struct {
	Impl      ICanController
	Transport binder.VersionAwareTransport
}

CanControllerStub dispatches incoming binder transactions to a typed ICanController implementation.

func (*CanControllerStub) Descriptor

func (s *CanControllerStub) Descriptor() string

func (*CanControllerStub) OnTransaction

func (s *CanControllerStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

type ICanController

type ICanController interface {
	AsBinder() binder.IBinder
	GetSupportedInterfaceTypes(ctx context.Context) ([]InterfaceType, error)
	GetInterfaceName(ctx context.Context, busName string) (string, error)
	UpBus(ctx context.Context, config BusConfig) (string, error)
	DownBus(ctx context.Context, name string) error
}

func NewCanControllerStub

func NewCanControllerStub(
	impl ICanControllerServer,
) ICanController

NewCanControllerStub creates a server-side ICanController wrapping the given server implementation. The returned value satisfies ICanController and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ICanControllerServer

type ICanControllerServer interface {
	GetSupportedInterfaceTypes(ctx context.Context) ([]InterfaceType, error)
	GetInterfaceName(ctx context.Context, busName string) (string, error)
	UpBus(ctx context.Context, config BusConfig) (string, error)
	DownBus(ctx context.Context, name string) error
}

ICanControllerServer is the server-side interface that user implementations provide to NewCanControllerStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type IndexedInterface

type IndexedInterface struct {
	Index byte
}

func (*IndexedInterface) MarshalParcel

func (s *IndexedInterface) MarshalParcel(
	p *parcel.Parcel,
) error

func (*IndexedInterface) UnmarshalParcel

func (s *IndexedInterface) UnmarshalParcel(
	p *parcel.Parcel,
) error

type InterfaceType

type InterfaceType byte
const (
	InterfaceTypeVIRTUAL InterfaceType = 0
	InterfaceTypeNATIVE  InterfaceType = 1
	InterfaceTypeSLCAN   InterfaceType = 2
	InterfaceTypeINDEXED InterfaceType = 3
)

type NativeInterface

type NativeInterface struct {
	InterfaceId NativeInterfaceInterfaceId
}

func (*NativeInterface) MarshalParcel

func (s *NativeInterface) MarshalParcel(
	p *parcel.Parcel,
) error

func (*NativeInterface) UnmarshalParcel

func (s *NativeInterface) UnmarshalParcel(
	p *parcel.Parcel,
) error

type NativeInterfaceInterfaceId

type NativeInterfaceInterfaceId struct {
	Tag      int32
	Ifname   string
	Serialno []string
}

func (*NativeInterfaceInterfaceId) GetIfname

func (u *NativeInterfaceInterfaceId) GetIfname() (string, bool)

func (*NativeInterfaceInterfaceId) GetSerialno

func (u *NativeInterfaceInterfaceId) GetSerialno() ([]string, bool)

func (*NativeInterfaceInterfaceId) MarshalParcel

func (u *NativeInterfaceInterfaceId) MarshalParcel(
	p *parcel.Parcel,
) error

func (*NativeInterfaceInterfaceId) SetIfname

func (u *NativeInterfaceInterfaceId) SetIfname(
	v string,
)

func (*NativeInterfaceInterfaceId) SetSerialno

func (u *NativeInterfaceInterfaceId) SetSerialno(
	v []string,
)

func (*NativeInterfaceInterfaceId) UnmarshalParcel

func (u *NativeInterfaceInterfaceId) UnmarshalParcel(
	p *parcel.Parcel,
) error

type Result

type Result int32
const (
	ResultOK             Result = 0
	ResultUnknownError   Result = 1
	ResultInvalidState   Result = 2
	ResultNotSupported   Result = 3
	ResultBadInterfaceId Result = 4
	ResultBadBitrate     Result = 5
	ResultBadBusName     Result = 6
	ResultInterfaceDown  Result = 7
)

type SlcanInterface

type SlcanInterface struct {
	InterfaceId SlcanInterfaceInterfaceId
}

func (*SlcanInterface) MarshalParcel

func (s *SlcanInterface) MarshalParcel(
	p *parcel.Parcel,
) error

func (*SlcanInterface) UnmarshalParcel

func (s *SlcanInterface) UnmarshalParcel(
	p *parcel.Parcel,
) error

type SlcanInterfaceInterfaceId

type SlcanInterfaceInterfaceId struct {
	Tag      int32
	Ttyname  string
	Serialno []string
}

func (*SlcanInterfaceInterfaceId) GetSerialno

func (u *SlcanInterfaceInterfaceId) GetSerialno() ([]string, bool)

func (*SlcanInterfaceInterfaceId) GetTtyname

func (u *SlcanInterfaceInterfaceId) GetTtyname() (string, bool)

func (*SlcanInterfaceInterfaceId) MarshalParcel

func (u *SlcanInterfaceInterfaceId) MarshalParcel(
	p *parcel.Parcel,
) error

func (*SlcanInterfaceInterfaceId) SetSerialno

func (u *SlcanInterfaceInterfaceId) SetSerialno(
	v []string,
)

func (*SlcanInterfaceInterfaceId) SetTtyname

func (u *SlcanInterfaceInterfaceId) SetTtyname(
	v string,
)

func (*SlcanInterfaceInterfaceId) UnmarshalParcel

func (u *SlcanInterfaceInterfaceId) UnmarshalParcel(
	p *parcel.Parcel,
) error

type VirtualInterface

type VirtualInterface struct {
	Ifname string
}

func (*VirtualInterface) MarshalParcel

func (s *VirtualInterface) MarshalParcel(
	p *parcel.Parcel,
) error

func (*VirtualInterface) UnmarshalParcel

func (s *VirtualInterface) UnmarshalParcel(
	p *parcel.Parcel,
) error

Jump to

Keyboard shortcuts

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