Documentation
¶
Index ¶
- Constants
- type GadgetFunction
- type IUsbGadget
- type IUsbGadgetCallback
- type IUsbGadgetCallbackServer
- type IUsbGadgetServer
- type Status
- type UsbGadgetCallbackProxy
- func (p *UsbGadgetCallbackProxy) AsBinder() binder.IBinder
- func (p *UsbGadgetCallbackProxy) GetCurrentUsbFunctionsCb(ctx context.Context, functions int64, status Status, transactionId int64) error
- func (p *UsbGadgetCallbackProxy) GetUsbSpeedCb(ctx context.Context, speed UsbSpeed, transactionId int64) error
- func (p *UsbGadgetCallbackProxy) ResetCb(ctx context.Context, status Status, transactionId int64) error
- func (p *UsbGadgetCallbackProxy) SetCurrentUsbFunctionsCb(ctx context.Context, functions int64, status Status, transactionId int64) error
- type UsbGadgetCallbackStub
- type UsbGadgetProxy
- func (p *UsbGadgetProxy) AsBinder() binder.IBinder
- func (p *UsbGadgetProxy) GetCurrentUsbFunctions(ctx context.Context, callback IUsbGadgetCallback, transactionId int64) error
- func (p *UsbGadgetProxy) GetUsbSpeed(ctx context.Context, callback IUsbGadgetCallback, transactionId int64) error
- func (p *UsbGadgetProxy) Reset(ctx context.Context, callback IUsbGadgetCallback, transactionId int64) error
- func (p *UsbGadgetProxy) SetCurrentUsbFunctions(ctx context.Context, functions int64, callback IUsbGadgetCallback, ...) error
- type UsbGadgetStub
- type UsbSpeed
Constants ¶
const ( GadgetFunctionNONE int64 = 0 GadgetFunctionADB int64 = 1 GadgetFunctionACCESSORY int64 = (1 << 1) GadgetFunctionMTP int64 = (1 << 2) GadgetFunctionMIDI int64 = (1 << 3) GadgetFunctionPTP int64 = (1 << 4) GadgetFunctionRNDIS int64 = (1 << 5) GadgetFunctionAudioSource int64 = (1 << 6) GadgetFunctionUVC int64 = (1 << 7) GadgetFunctionNCM int64 = (1 << 10) )
const ( TransactionIUsbGadgetSetCurrentUsbFunctions = binder.FirstCallTransaction + 0 TransactionIUsbGadgetGetCurrentUsbFunctions = binder.FirstCallTransaction + 1 TransactionIUsbGadgetGetUsbSpeed = binder.FirstCallTransaction + 2 TransactionIUsbGadgetReset = binder.FirstCallTransaction + 3 )
const ( MethodIUsbGadgetSetCurrentUsbFunctions = "setCurrentUsbFunctions" MethodIUsbGadgetGetCurrentUsbFunctions = "getCurrentUsbFunctions" MethodIUsbGadgetGetUsbSpeed = "getUsbSpeed" MethodIUsbGadgetReset = "reset" )
const ( TransactionIUsbGadgetCallbackSetCurrentUsbFunctionsCb = binder.FirstCallTransaction + 0 TransactionIUsbGadgetCallbackGetCurrentUsbFunctionsCb = binder.FirstCallTransaction + 1 TransactionIUsbGadgetCallbackGetUsbSpeedCb = binder.FirstCallTransaction + 2 TransactionIUsbGadgetCallbackResetCb = binder.FirstCallTransaction + 3 )
const ( MethodIUsbGadgetCallbackSetCurrentUsbFunctionsCb = "setCurrentUsbFunctionsCb" MethodIUsbGadgetCallbackGetCurrentUsbFunctionsCb = "getCurrentUsbFunctionsCb" MethodIUsbGadgetCallbackGetUsbSpeedCb = "getUsbSpeedCb" MethodIUsbGadgetCallbackResetCb = "resetCb" )
const DescriptorIUsbGadget = "android.hardware.usb.gadget.IUsbGadget"
const DescriptorIUsbGadgetCallback = "android.hardware.usb.gadget.IUsbGadgetCallback"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GadgetFunction ¶
type GadgetFunction struct {
}
func (*GadgetFunction) MarshalParcel ¶
func (s *GadgetFunction) MarshalParcel( p *parcel.Parcel, ) error
func (*GadgetFunction) UnmarshalParcel ¶
func (s *GadgetFunction) UnmarshalParcel( p *parcel.Parcel, ) error
type IUsbGadget ¶
type IUsbGadget interface {
AsBinder() binder.IBinder
SetCurrentUsbFunctions(ctx context.Context, functions int64, callback IUsbGadgetCallback, timeoutMs int64, transactionId int64) error
GetCurrentUsbFunctions(ctx context.Context, callback IUsbGadgetCallback, transactionId int64) error
GetUsbSpeed(ctx context.Context, callback IUsbGadgetCallback, transactionId int64) error
Reset(ctx context.Context, callback IUsbGadgetCallback, transactionId int64) error
}
func NewUsbGadgetStub ¶
func NewUsbGadgetStub( impl IUsbGadgetServer, ) IUsbGadget
NewUsbGadgetStub creates a server-side IUsbGadget wrapping the given server implementation. The returned value satisfies IUsbGadget 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 IUsbGadgetCallback ¶
type IUsbGadgetCallback interface {
AsBinder() binder.IBinder
SetCurrentUsbFunctionsCb(ctx context.Context, functions int64, status Status, transactionId int64) error
GetCurrentUsbFunctionsCb(ctx context.Context, functions int64, status Status, transactionId int64) error
GetUsbSpeedCb(ctx context.Context, speed UsbSpeed, transactionId int64) error
ResetCb(ctx context.Context, status Status, transactionId int64) error
}
func NewUsbGadgetCallbackStub ¶
func NewUsbGadgetCallbackStub( impl IUsbGadgetCallbackServer, ) IUsbGadgetCallback
NewUsbGadgetCallbackStub creates a server-side IUsbGadgetCallback wrapping the given server implementation. The returned value satisfies IUsbGadgetCallback 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 IUsbGadgetCallbackServer ¶
type IUsbGadgetCallbackServer interface {
SetCurrentUsbFunctionsCb(ctx context.Context, functions int64, status Status, transactionId int64) error
GetCurrentUsbFunctionsCb(ctx context.Context, functions int64, status Status, transactionId int64) error
GetUsbSpeedCb(ctx context.Context, speed UsbSpeed, transactionId int64) error
ResetCb(ctx context.Context, status Status, transactionId int64) error
}
IUsbGadgetCallbackServer is the server-side interface that user implementations provide to NewUsbGadgetCallbackStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).
type IUsbGadgetServer ¶
type IUsbGadgetServer interface {
SetCurrentUsbFunctions(ctx context.Context, functions int64, callback IUsbGadgetCallback, timeoutMs int64, transactionId int64) error
GetCurrentUsbFunctions(ctx context.Context, callback IUsbGadgetCallback, transactionId int64) error
GetUsbSpeed(ctx context.Context, callback IUsbGadgetCallback, transactionId int64) error
Reset(ctx context.Context, callback IUsbGadgetCallback, transactionId int64) error
}
IUsbGadgetServer is the server-side interface that user implementations provide to NewUsbGadgetStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).
type UsbGadgetCallbackProxy ¶
func NewUsbGadgetCallbackProxy ¶
func NewUsbGadgetCallbackProxy( remote binder.IBinder, ) *UsbGadgetCallbackProxy
func (*UsbGadgetCallbackProxy) AsBinder ¶
func (p *UsbGadgetCallbackProxy) AsBinder() binder.IBinder
func (*UsbGadgetCallbackProxy) GetCurrentUsbFunctionsCb ¶
func (*UsbGadgetCallbackProxy) GetUsbSpeedCb ¶
func (*UsbGadgetCallbackProxy) SetCurrentUsbFunctionsCb ¶
type UsbGadgetCallbackStub ¶
type UsbGadgetCallbackStub struct {
Impl IUsbGadgetCallback
Transport binder.VersionAwareTransport
}
UsbGadgetCallbackStub dispatches incoming binder transactions to a typed IUsbGadgetCallback implementation.
func (*UsbGadgetCallbackStub) Descriptor ¶
func (s *UsbGadgetCallbackStub) Descriptor() string
func (*UsbGadgetCallbackStub) OnTransaction ¶
func (s *UsbGadgetCallbackStub) OnTransaction( ctx context.Context, code binder.TransactionCode, _data *parcel.Parcel, ) (*parcel.Parcel, error)
type UsbGadgetProxy ¶
func NewUsbGadgetProxy ¶
func NewUsbGadgetProxy( remote binder.IBinder, ) *UsbGadgetProxy
func (*UsbGadgetProxy) AsBinder ¶
func (p *UsbGadgetProxy) AsBinder() binder.IBinder
func (*UsbGadgetProxy) GetCurrentUsbFunctions ¶
func (p *UsbGadgetProxy) GetCurrentUsbFunctions( ctx context.Context, callback IUsbGadgetCallback, transactionId int64, ) error
func (*UsbGadgetProxy) GetUsbSpeed ¶
func (p *UsbGadgetProxy) GetUsbSpeed( ctx context.Context, callback IUsbGadgetCallback, transactionId int64, ) error
func (*UsbGadgetProxy) Reset ¶
func (p *UsbGadgetProxy) Reset( ctx context.Context, callback IUsbGadgetCallback, transactionId int64, ) error
func (*UsbGadgetProxy) SetCurrentUsbFunctions ¶
func (p *UsbGadgetProxy) SetCurrentUsbFunctions( ctx context.Context, functions int64, callback IUsbGadgetCallback, timeoutMs int64, transactionId int64, ) error
type UsbGadgetStub ¶
type UsbGadgetStub struct {
Impl IUsbGadget
Transport binder.VersionAwareTransport
}
UsbGadgetStub dispatches incoming binder transactions to a typed IUsbGadget implementation.
func (*UsbGadgetStub) Descriptor ¶
func (s *UsbGadgetStub) Descriptor() string
func (*UsbGadgetStub) OnTransaction ¶
func (s *UsbGadgetStub) OnTransaction( ctx context.Context, code binder.TransactionCode, _data *parcel.Parcel, ) (*parcel.Parcel, error)
type UsbSpeed ¶
type UsbSpeed int32
const ( UsbSpeedUNKNOWN UsbSpeed = -1 UsbSpeedLOWSPEED UsbSpeed = 0 UsbSpeedFULLSPEED UsbSpeed = 1 UsbSpeedHIGHSPEED UsbSpeed = 2 UsbSpeedSUPERSPEED UsbSpeed = 3 UsbSpeedSUPERSPEED_10Gb UsbSpeed = 4 UsbSpeedSUPERSPEED_20Gb UsbSpeed = 5 UsbSpeedUSB4_GEN2_10Gb UsbSpeed = 6 UsbSpeedUSB4_GEN2_20Gb UsbSpeed = 7 UsbSpeedUSB4_GEN3_20Gb UsbSpeed = 8 UsbSpeedUSB4_GEN3_40Gb UsbSpeed = 9 )