Documentation
¶
Index ¶
- Constants
- Variables
- type UsbGadget
- type UsbGadgetAdb
- type UsbGadgetContext
- type UsbGadgetController
- func (this *UsbGadgetController) AddFunction(function UsbGadgetFunction) error
- func (this *UsbGadgetController) Apply() map[string]error
- func (this *UsbGadgetController) ClearFunctions() []error
- func (this *UsbGadgetController) GetFunctions() map[string]UsbGadgetFunction
- func (this *UsbGadgetController) RemoveFunction(function UsbGadgetFunction) error
- func (this *UsbGadgetController) ReplaceFunction(function UsbGadgetFunction, replace_only bool) error
- func (this *UsbGadgetController) UpdateGadget() []error
- type UsbGadgetFunction
- type UsbGadgetFunctionBase
- type UsbGadgetFunctionCode
- type UsbGadgetRndis
- type UsbGadgetState
- type UsbGadgetSubpath
- type UsbGadgetSubpathStrings
Constants ¶
View Source
const ( GC_LIST_STATE_IGNORE gcListState = iota GC_LIST_STATE_IGNORE_ACTION GC_LIST_STATE_GLOBAL_FIELD GC_LIST_STATE_LANGUAGE GC_LIST_STATE_LANGUAGE_FIELD GC_LIST_STATE_FUNCTION GC_LIST_STATE_FUNCTION_FIELD GC_LIST_STATE_CONFIG GC_LIST_STATE_CONFIG_FIELD GC_LIST_STATE_CONFIG_LANGUAGE )
View Source
const ( GC_LIST_MATCHER_ID = "ID " GC_LIST_MATCHER_LANGUAGE = "Language: " GC_LIST_MATCHER_FUNCTION = "Function, type: " GC_LIST_MATCHER_FUNCTION_INSTANCE = "instance: " GC_LIST_MATCHER_CONFIG = "Configuration: " )
View Source
const RNDIS_USE_GADGET_FUNCTION = "rndis"
Variables ¶
View Source
var MAX_USB_GADGET_SUBPATH_FILESIZE = int(max( 1<<20, min(memory.TotalMemory()>>1, 1<<30), )) // at least 1 MiB
Functions ¶
This section is empty.
Types ¶
type UsbGadget ¶
type UsbGadget struct {
base.SubpathWriter
base.PathChecker
// contains filtered or unexported fields
}
func NewUsbGadget ¶
func (*UsbGadget) GetBasepath ¶
type UsbGadgetAdb ¶
type UsbGadgetAdb struct {
UsbGadgetFunctionBase
// contains filtered or unexported fields
}
func NewUsbGadgetAdb ¶
func NewUsbGadgetAdb(ffs_path string) *UsbGadgetAdb
func SnapshotUsbGadgetAdb ¶
func SnapshotUsbGadgetAdb(instance string) *UsbGadgetAdb
type UsbGadgetContext ¶
type UsbGadgetContext = *UsbGadget
type UsbGadgetController ¶
type UsbGadgetController struct {
// contains filtered or unexported fields
}
func NewUsbGadgetController ¶
func NewUsbGadgetController( config_fs string, gc_path string, ) (*UsbGadgetController, error)
func (*UsbGadgetController) AddFunction ¶
func (this *UsbGadgetController) AddFunction(function UsbGadgetFunction) error
add function to `this.target_functions` or overwrite the function which have the same path
func (*UsbGadgetController) Apply ¶
func (this *UsbGadgetController) Apply() map[string]error
func (*UsbGadgetController) ClearFunctions ¶
func (this *UsbGadgetController) ClearFunctions() []error
func (*UsbGadgetController) GetFunctions ¶
func (this *UsbGadgetController) GetFunctions() map[string]UsbGadgetFunction
func (*UsbGadgetController) RemoveFunction ¶
func (this *UsbGadgetController) RemoveFunction(function UsbGadgetFunction) error
remove function which `getType()` matched in `this.target_functions`
func (*UsbGadgetController) ReplaceFunction ¶
func (this *UsbGadgetController) ReplaceFunction(function UsbGadgetFunction, replace_only bool) error
replace function which `getType()` matched in `this.target_functions`, the action as same as `AddFunction()` if not found and `replace_only` is not true
also, whenever `getInstance()` is empty, the action as same as `AddFunction()` if `replace_only` is not true
func (*UsbGadgetController) UpdateGadget ¶
func (this *UsbGadgetController) UpdateGadget() []error
type UsbGadgetFunction ¶
type UsbGadgetFunction interface {
// contains filtered or unexported methods
}
func AdaptUsbGadgetFunction ¶
type UsbGadgetFunctionBase ¶
type UsbGadgetFunctionBase struct {
// contains filtered or unexported fields
}
type UsbGadgetFunctionCode ¶
type UsbGadgetFunctionCode uint32
const ( USB_GADGET_FUNCTION_CODE_NONE UsbGadgetFunctionCode = 0 USB_GADGET_FUNCTION_CODE_RNDIS UsbGadgetFunctionCode = 0b1 USB_GADGET_FUNCTION_CODE_ADB UsbGadgetFunctionCode = 0b01 )
type UsbGadgetRndis ¶
type UsbGadgetRndis struct {
UsbGadgetFunctionBase
// contains filtered or unexported fields
}
func NewUsbGadgetRndis ¶
func SnapshotUsbGadgetRndis ¶
func SnapshotUsbGadgetRndis(instance string) *UsbGadgetRndis
type UsbGadgetState ¶
type UsbGadgetSubpath ¶
type UsbGadgetSubpath string
const ( USB_GADGET_SUBPATH_VENDOR UsbGadgetSubpath = "idVendor" USB_GADGET_SUBPATH_PRODUCT UsbGadgetSubpath = "idProduct" USB_GADGET_SUBPATH_BCD_USB UsbGadgetSubpath = "bcdUSB" USB_GADGET_SUBPATH_DEVICE_CLASS UsbGadgetSubpath = "bDeviceClass" USB_GADGET_SUBPATH_DEVICE_SUBCLASS UsbGadgetSubpath = "bDeviceSubClass" USB_GADGET_SUBPATH_DEVICE_PROTOCOL UsbGadgetSubpath = "bDeviceProtocol" )
type UsbGadgetSubpathStrings ¶
type UsbGadgetSubpathStrings string
const ( USB_GADGET_SUBPATH_STRINGS_SERIALNUMBER UsbGadgetSubpathStrings = "serialnumber" USB_GADGET_SUBPATH_STRINGS_MANUFACTURER UsbGadgetSubpathStrings = "manufacturer" USB_GADGET_SUBPATH_STRINGS_PRODUCT UsbGadgetSubpathStrings = "product" )
Click to show internal directories.
Click to hide internal directories.