iousbhost

package
v0.6.18 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package iousbhost provides Go bindings for the IOUSBHost framework.

Create host-mode user space drivers for USB devices.

With the [IOUSBHost] framework, you can access custom and non–class-compliant USB devices from within your apps. Use this framework to connect to cameras, audio devices, scanners, printers, keyboards, mouse devices, MIDI keyboards, and USB hubs.

Function Drivers

Device Drivers

  • IOUSBHostDevice: The class that claims and configures devices, retrieves descriptors, and sends device requests.

Base Classes

IOServicePlane Properties

Version Number

Error Domain

Classes

Enumerations

Key Types

Code generated from Apple documentation. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	// IOUSBHostDefaultControlCompletionTimeout is the default completion timeout for input/output requests.
	//
	// See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostDefaultControlCompletionTimeout
	IOUSBHostDefaultControlCompletionTimeout foundation.NSTimeInterval
)
View Source
var IOUSBHostDevicePropertyKeys struct {
	// ContainerID: The device’s container ID.
	ContainerID IOUSBHostDevicePropertyKey
	// CurrentConfiguration: The device’s current configuration value.
	CurrentConfiguration IOUSBHostDevicePropertyKey
	// SerialNumberString: The device’s serial number as a string.
	SerialNumberString IOUSBHostDevicePropertyKey
	// VendorString: The device’s vendor name.
	VendorString IOUSBHostDevicePropertyKey
}

IOUSBHostDevicePropertyKeys provides typed accessors for IOUSBHostDevicePropertyKey constants.

View Source
var (
	// IOUSBHostErrorDomain is the error domain for the framework.
	//
	// See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostErrorDomain
	IOUSBHostErrorDomain foundation.NSErrorDomain
)
View Source
var IOUSBHostMatchingPropertyKeys struct {
	// ConfigurationValue: The matching property for the device’s current configuration value.
	ConfigurationValue IOUSBHostMatchingPropertyKey
	// DeviceClass: The matching property for the device’s class.
	DeviceClass IOUSBHostMatchingPropertyKey
	// DeviceProtocol: The matching property for the device’s protocol.
	DeviceProtocol IOUSBHostMatchingPropertyKey
	// DeviceReleaseNumber: The matching property for the device’s release number.
	DeviceReleaseNumber IOUSBHostMatchingPropertyKey
	// DeviceSubClass: The matching property for the device’s subclass.
	DeviceSubClass IOUSBHostMatchingPropertyKey
	// InterfaceClass: The matching property for the interface’s class ID.
	InterfaceClass IOUSBHostMatchingPropertyKey
	// InterfaceNumber: The matching property for the device’s interface number.
	InterfaceNumber IOUSBHostMatchingPropertyKey
	// InterfaceProtocol: The matching property for the interface’s protocol.
	InterfaceProtocol IOUSBHostMatchingPropertyKey
	// InterfaceSubClass: The matching property for the interface’s subclass ID.
	InterfaceSubClass IOUSBHostMatchingPropertyKey
	// ProductID: The matching property for the device’s product ID.
	ProductID IOUSBHostMatchingPropertyKey
	// ProductIDArray: The matching property on a list of product IDs.
	ProductIDArray IOUSBHostMatchingPropertyKey
	// ProductIDMask: The matching property on a mask of product IDs.
	ProductIDMask IOUSBHostMatchingPropertyKey
	// Speed: The matching property for the device’s enumeration speed.
	Speed IOUSBHostMatchingPropertyKey
	// VendorID: The matching property for the device’s vendor ID.
	VendorID IOUSBHostMatchingPropertyKey
}

IOUSBHostMatchingPropertyKeys provides typed accessors for IOUSBHostMatchingPropertyKey constants.

View Source
var (
	// IOUSBHostVersionNumber is the version number of the framework.
	//
	// See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostVersionNumber
	IOUSBHostVersionNumber float64
)
View Source
var (
	// IOUSBHostVersionString is a string representation of the framework’s version number.
	//
	// See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostVersionString
	IOUSBHostVersionString uint8
)

Functions

func IOUSBGetBillboardDescriptor

func IOUSBGetBillboardDescriptor(bosDescriptor uintptr) uintptr

IOUSBGetBillboardDescriptor obtains the first billboard capability descriptor in a BOS descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetBillboardDescriptor(_:)

func IOUSBGetConfigurationMaxPowerMilliAmps

func IOUSBGetConfigurationMaxPowerMilliAmps(usbDeviceSpeed uint32, descriptor uintptr) uint32

IOUSBGetConfigurationMaxPowerMilliAmps obtains the maximum bus current that a configuration descriptor requires.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetConfigurationMaxPowerMilliAmps(_:_:)

func IOUSBGetContainerIDDescriptor

func IOUSBGetContainerIDDescriptor(bosDescriptor uintptr) string

IOUSBGetContainerIDDescriptor obtains the first container ID capability descriptor in a BOS descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetContainerIDDescriptor(_:)

func IOUSBGetEndpointAddress

func IOUSBGetEndpointAddress(descriptor uintptr) uint8

IOUSBGetEndpointAddress obtains the direction and number of an endpoint from an endpoint descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointAddress(_:)

func IOUSBGetEndpointBurstSize

func IOUSBGetEndpointBurstSize(usbDeviceSpeed uint32, descriptor uintptr, companionDescriptor uintptr, sspCompanionDescriptor uintptr) uint32

IOUSBGetEndpointBurstSize.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointBurstSize(_:_:_:_:)

func IOUSBGetEndpointDirection

func IOUSBGetEndpointDirection(descriptor uintptr) uint8

IOUSBGetEndpointDirection obtains the direction of an endpoint from an endpoint descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointDirection(_:)

func IOUSBGetEndpointIntervalEncodedMicroframes

func IOUSBGetEndpointIntervalEncodedMicroframes(usbDeviceSpeed uint32, descriptor uintptr) uint32

IOUSBGetEndpointIntervalEncodedMicroframes obtains the interval of an endpoint descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointIntervalEncodedMicroframes(_:_:)

func IOUSBGetEndpointIntervalFrames

func IOUSBGetEndpointIntervalFrames(usbDeviceSpeed uint32, descriptor uintptr) uint32

IOUSBGetEndpointIntervalFrames obtains the interval of an endpoint descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointIntervalFrames(_:_:)

func IOUSBGetEndpointIntervalMicroframes

func IOUSBGetEndpointIntervalMicroframes(usbDeviceSpeed uint32, descriptor uintptr) uint32

IOUSBGetEndpointIntervalMicroframes obtains the interval of an endpoint descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointIntervalMicroframes(_:_:)

func IOUSBGetEndpointMaxPacketSize

func IOUSBGetEndpointMaxPacketSize(usbDeviceSpeed uint32, descriptor uintptr) uint16

IOUSBGetEndpointMaxPacketSize obtains the maximum packet size from an endpoint descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointMaxPacketSize(_:_:)

func IOUSBGetEndpointMaxStreams

func IOUSBGetEndpointMaxStreams(usbDeviceSpeed uint32, descriptor uintptr, companionDescriptor uintptr) uint32

IOUSBGetEndpointMaxStreams obtains the number of supported streams.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointMaxStreams(_:_:_:)

func IOUSBGetEndpointMaxStreamsEncoded

func IOUSBGetEndpointMaxStreamsEncoded(usbDeviceSpeed uint32, descriptor uintptr, companionDescriptor uintptr) uint32

IOUSBGetEndpointMaxStreamsEncoded obtains the number of streams that an endpoint supports.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointMaxStreamsEncoded(_:_:_:)

func IOUSBGetEndpointMult

func IOUSBGetEndpointMult(usbDeviceSpeed uint32, descriptor uintptr, companionDescriptor uintptr, sspCompanionDescriptor uintptr) uint8

IOUSBGetEndpointMult.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointMult(_:_:_:_:)

func IOUSBGetEndpointNumber

func IOUSBGetEndpointNumber(descriptor uintptr) uint8

IOUSBGetEndpointNumber obtains the number of an endpoint from an endpoint descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointNumber(_:)

func IOUSBGetEndpointSynchronizationType

func IOUSBGetEndpointSynchronizationType(descriptor uintptr) uint8

IOUSBGetEndpointSynchronizationType.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointSynchronizationType(_:)

func IOUSBGetEndpointType

func IOUSBGetEndpointType(descriptor uintptr) uint8

IOUSBGetEndpointType obtains the type of an endpoint from an endpoint descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointType(_:)

func IOUSBGetEndpointUsageType

func IOUSBGetEndpointUsageType(descriptor uintptr) uint8

IOUSBGetEndpointUsageType.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetEndpointUsageType(_:)

func IOUSBGetNextAssociatedDescriptor

func IOUSBGetNextAssociatedDescriptor(configurationDescriptor uintptr, parentDescriptor uintptr, currentDescriptor uintptr) uintptr

IOUSBGetNextAssociatedDescriptor obtains the next associated descriptor in a configuration descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetNextAssociatedDescriptor(_:_:_:)

func IOUSBGetNextAssociatedDescriptorWithType

func IOUSBGetNextAssociatedDescriptorWithType(configurationDescriptor uintptr, parentDescriptor uintptr, currentDescriptor uintptr, type_ uint8) uintptr

IOUSBGetNextAssociatedDescriptorWithType obtains the next associated descriptor in a configuration descriptor and matches the type.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetNextAssociatedDescriptorWithType(_:_:_:_:)

func IOUSBGetNextCapabilityDescriptor

func IOUSBGetNextCapabilityDescriptor(bosDescriptor uintptr, currentDescriptor uintptr) uintptr

IOUSBGetNextCapabilityDescriptor obtains the next device capability descriptor in a BOS descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetNextCapabilityDescriptor(_:_:)

func IOUSBGetNextCapabilityDescriptorWithType

func IOUSBGetNextCapabilityDescriptorWithType(bosDescriptor uintptr, currentDescriptor uintptr, type_ uint8) uintptr

IOUSBGetNextCapabilityDescriptorWithType obtains the next descriptor matching a specific type within a BOS descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetNextCapabilityDescriptorWithType(_:_:_:)

func IOUSBGetNextDescriptor

func IOUSBGetNextDescriptor(configurationDescriptor uintptr, currentDescriptor uintptr) uintptr

IOUSBGetNextDescriptor obtains the next descriptor in a configuration descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetNextDescriptor(_:_:)

func IOUSBGetNextDescriptorWithType

func IOUSBGetNextDescriptorWithType(configurationDescriptor uintptr, currentDescriptor uintptr, type_ uint8) uintptr

IOUSBGetNextDescriptorWithType obtains the next descriptor in a configuration descriptor that matches the type.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetNextDescriptorWithType(_:_:_:)

func IOUSBGetNextEndpointDescriptor

func IOUSBGetNextEndpointDescriptor(configurationDescriptor uintptr, interfaceDescriptor uintptr, currentDescriptor uintptr) uintptr

IOUSBGetNextEndpointDescriptor obtains the next endpoint descriptor for an interface descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetNextEndpointDescriptor(_:_:_:)

func IOUSBGetNextInterfaceAssociationDescriptor

func IOUSBGetNextInterfaceAssociationDescriptor(configurationDescriptor uintptr, currentDescriptor uintptr) uintptr

IOUSBGetNextInterfaceAssociationDescriptor obtains the next interface association descriptor in a configuration descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetNextInterfaceAssociationDescriptor(_:_:)

func IOUSBGetNextInterfaceDescriptor

func IOUSBGetNextInterfaceDescriptor(configurationDescriptor uintptr, currentDescriptor uintptr) uintptr

IOUSBGetNextInterfaceDescriptor obtains the next interface descriptor in a configuration descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetNextInterfaceDescriptor(_:_:)

func IOUSBGetPlatformCapabilityDescriptor

func IOUSBGetPlatformCapabilityDescriptor(bosDescriptor uintptr) uintptr

IOUSBGetPlatformCapabilityDescriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetPlatformCapabilityDescriptor(_:)

func IOUSBGetPlatformCapabilityDescriptorWithUUID

func IOUSBGetPlatformCapabilityDescriptorWithUUID(bosDescriptor uintptr, uuid [16]byte) uintptr

IOUSBGetPlatformCapabilityDescriptorWithUUID.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetPlatformCapabilityDescriptorWithUUID(_:_:)

func IOUSBGetSuperSpeedDeviceCapabilityDescriptor

func IOUSBGetSuperSpeedDeviceCapabilityDescriptor(bosDescriptor uintptr) uintptr

IOUSBGetSuperSpeedDeviceCapabilityDescriptor obtains the first SuperSpeed capability descriptor in a BOS descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetSuperSpeedDeviceCapabilityDescriptor(_:)

func IOUSBGetSuperSpeedPlusDeviceCapabilityDescriptor

func IOUSBGetSuperSpeedPlusDeviceCapabilityDescriptor(bosDescriptor uintptr) uintptr

IOUSBGetSuperSpeedPlusDeviceCapabilityDescriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetSuperSpeedPlusDeviceCapabilityDescriptor(_:)

func IOUSBGetUSB20ExtensionDeviceCapabilityDescriptor

func IOUSBGetUSB20ExtensionDeviceCapabilityDescriptor(bosDescriptor uintptr) uintptr

IOUSBGetUSB20ExtensionDeviceCapabilityDescriptor obtains the first USB 2.0 extension capability descriptor in a BOS descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBGetUSB20ExtensionDeviceCapabilityDescriptor(_:)

func IOUSBHostCIControllerStateToString

func IOUSBHostCIControllerStateToString(controllerState IOUSBHostCIControllerState) *byte

IOUSBHostCIControllerStateToString.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIControllerStateToString(_:)

func IOUSBHostCIDeviceStateToString

func IOUSBHostCIDeviceStateToString(deviceState IOUSBHostCIDeviceState) *byte

IOUSBHostCIDeviceStateToString.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIDeviceStateToString(_:)

func IOUSBHostCIEndpointStateToString

func IOUSBHostCIEndpointStateToString(endpointState IOUSBHostCIEndpointState) *byte

IOUSBHostCIEndpointStateToString.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIEndpointStateToString(_:)

func IOUSBHostCIExceptionTypeToString

func IOUSBHostCIExceptionTypeToString(exceptionType IOUSBHostCIExceptionType) *byte

IOUSBHostCIExceptionTypeToString.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIExceptionTypeToString(_:)

func IOUSBHostCILinkStateToString

func IOUSBHostCILinkStateToString(linkState IOUSBHostCILinkState) *byte

IOUSBHostCILinkStateToString.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCILinkStateToString(_:)

func IOUSBHostCIPortStateToString

func IOUSBHostCIPortStateToString(portState IOUSBHostCIPortState) *byte

IOUSBHostCIPortStateToString.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIPortStateToString(_:)

func NewIOUSBHostCompletionHandlerBlock

func NewIOUSBHostCompletionHandlerBlock(handler IOUSBHostCompletionHandler) (objc.ID, func())

NewIOUSBHostCompletionHandlerBlock wraps a Go IOUSBHostCompletionHandler as an Objective-C block. The caller must defer the returned cleanup function.

func NewIOUSBHostControllerInterfaceDoorbellHandlerBlock

func NewIOUSBHostControllerInterfaceDoorbellHandlerBlock(handler IOUSBHostControllerInterfaceDoorbellHandler) (objc.ID, func())

NewIOUSBHostControllerInterfaceDoorbellHandlerBlock wraps a Go IOUSBHostControllerInterfaceDoorbellHandler as an Objective-C block. The caller must defer the returned cleanup function.

func NewIOUSBHostInterestHandlerBlock

func NewIOUSBHostInterestHandlerBlock(handler IOUSBHostInterestHandler) (objc.ID, func())

NewIOUSBHostInterestHandlerBlock wraps a Go IOUSBHostInterestHandler as an Objective-C block. The caller must defer the returned cleanup function.

func NewIOUSBHostIsochronousCompletionHandlerBlock

func NewIOUSBHostIsochronousCompletionHandlerBlock(handler IOUSBHostIsochronousCompletionHandler) (objc.ID, func())

NewIOUSBHostIsochronousCompletionHandlerBlock wraps a Go IOUSBHostIsochronousCompletionHandler as an Objective-C block. The caller must defer the returned cleanup function.

func NewIOUSBHostIsochronousTransactionCompletionHandlerBlock

func NewIOUSBHostIsochronousTransactionCompletionHandlerBlock(handler IOUSBHostIsochronousTransactionCompletionHandler) (objc.ID, func())

NewIOUSBHostIsochronousTransactionCompletionHandlerBlock wraps a Go IOUSBHostIsochronousTransactionCompletionHandler as an Objective-C block. The caller must defer the returned cleanup function.

func NewInt32IOUSBHostIsochronousTransactionBlock

func NewInt32IOUSBHostIsochronousTransactionBlock(handler Int32IOUSBHostIsochronousTransactionHandler) (objc.ID, func())

NewInt32IOUSBHostIsochronousTransactionBlock wraps a Go Int32IOUSBHostIsochronousTransactionHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

func NewInt32Uint32Block

func NewInt32Uint32Block(handler Int32Uint32Handler) (objc.ID, func())

NewInt32Uint32Block wraps a Go Int32Uint32Handler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

Types

type IIOUSBHostCIPortStateMachine

type IIOUSBHostCIPortStateMachine interface {
	objectivec.IObject

	Connected() bool
	SetConnected(value bool)
	ControllerInterface() IIOUSBHostControllerInterface
	LinkState() IOUSBHostCILinkState
	Overcurrent() bool
	SetOvercurrent(value bool)
	PortNumber() uint
	PortState() IOUSBHostCIPortState
	PortStatus() uint32
	Powered() bool
	SetPowered(value bool)
	Speed() IOUSBHostCIDeviceSpeed

	InspectCommandError(command *IOUSBHostCIMessage) (bool, error)
	RespondToCommandStatusError(command *IOUSBHostCIMessage, status IOUSBHostCIMessageStatus) (bool, error)
	UpdateLinkStateSpeedInhibitLinkStateChangeError(linkState IOUSBHostCILinkState, speed IOUSBHostCIDeviceSpeed, inhibitLinkStateChange bool) (bool, error)
}

An interface definition for the IOUSBHostCIPortStateMachine class.

Instance Properties

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIPortStateMachine

type IIOUSBHostControllerInterface

type IIOUSBHostControllerInterface interface {
	objectivec.IObject

	Capabilities() *IOUSBHostCIMessage
	ControllerStateMachine() IIOUSBHostCIControllerStateMachine
	InterruptRateHz() uint
	SetInterruptRateHz(value uint)
	Queue() dispatch.Queue
	Uuid() foundation.NSUUID

	CapabilitiesForPort(port uint) *IOUSBHostCIMessage
	DescriptionForMessage(message *IOUSBHostCIMessage) string
	Destroy()
	EnqueueInterruptError(interrupt *IOUSBHostCIMessage) (bool, error)
	EnqueueInterruptExpediteError(interrupt *IOUSBHostCIMessage, expedite bool) (bool, error)
	EnqueueInterruptsCountError(interrupts *IOUSBHostCIMessage, count uint) (bool, error)
	EnqueueInterruptsCountExpediteError(interrupts *IOUSBHostCIMessage, count uint, expedite bool) (bool, error)
	GetPortStateMachineForCommandError(command *IOUSBHostCIMessage) (IIOUSBHostCIPortStateMachine, error)
	GetPortStateMachineForPortError(port uint) (IIOUSBHostCIPortStateMachine, error)
}

An interface definition for the IOUSBHostControllerInterface class.

Instance Properties

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostControllerInterface

type IIOUSBHostDevice

type IIOUSBHostDevice interface {
	IIOUSBHostObject

	// The currently selected configuration descriptor.
	ConfigurationDescriptor() objectivec.IObject

	// Terminates the device and attempts to re-enumerate it.
	ResetWithError() (bool, error)
}

An interface definition for the IOUSBHostDevice class.

Retrieving Device Descriptors

Resetting the Device

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostDevice

type IIOUSBHostIOSource

type IIOUSBHostIOSource interface {
	objectivec.IObject

	// The device’s bus address.
	DeviceAddress() uint
	// The pipe or stream’s endpoint address.
	EndpointAddress() uint
	// The interface for the input/output source.
	HostInterface() IIOUSBHostInterface
}

An interface definition for the IOUSBHostIOSource class.

Obtaining Device Information

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIOSource

type IIOUSBHostInterface

type IIOUSBHostInterface interface {
	IIOUSBHostObject

	// The configuration descriptor for the interface.
	ConfigurationDescriptor() objectivec.IObject
	// The descriptor for the interface.
	InterfaceDescriptor() objectivec.IObject

	// Selects an alternative setting for the interface.
	SelectAlternateSettingError(alternateSetting uint) (bool, error)
	// Copies a pipe for a specific endpoint address.
	CopyPipeWithAddressError(address uint) (IIOUSBHostPipe, error)

	// The current idle suspend timeout.
	IdleTimeout() foundation.NSTimeInterval
	// Sets the desired idle suspend timeout for the interface.
	SetIdleTimeoutError(idleTimeout foundation.NSTimeInterval) (bool, error)
}

An interface definition for the IOUSBHostInterface class.

Retrieving Function Descriptors

Managing Pipes

Enabling Power Savings

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterface

type IIOUSBHostObject

type IIOUSBHostObject interface {
	objectivec.IObject

	// A reference to the kernel object.
	IoService() uint32
	// The queue for servicing input/output requests.
	Queue() dispatch.Queue
	// Removes underlying allocations and connections from the USB host object.
	Destroy()

	// Allocates a buffer for input/output requests.
	IoDataWithCapacityError(capacity uint) (foundation.NSMutableData, error)

	// The device’s bus address.
	DeviceAddress() uint

	CapabilityDescriptors() objectivec.IObject
	DeviceDescriptor() objectivec.IObject

	ConfigurationDescriptorWithIndexError(index uint) (objectivec.IObject, error)
	ConfigurationDescriptorWithConfigurationValueError(configurationValue uint) (objectivec.IObject, error)
	DestroyWithOptions(options IOUSBHostObjectDestroyOptions)
}

An interface definition for the IOUSBHostObject class.

Managing the Object Life Cycle

Creating I/O Buffers

Getting Host Information

Instance Properties

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObject

type IIOUSBHostPipe

type IIOUSBHostPipe interface {
	IIOUSBHostIOSource

	// Enqueues an input/output request on the pipe.
	EnqueueIORequestWithDataCompletionTimeoutErrorCompletionHandler(data foundation.NSMutableData, completionTimeout foundation.NSTimeInterval, error_ foundation.NSError, completionHandler Int32Uint32Handler) bool
	// Clears the halt condition of the pipe.
	ClearStallWithError() (bool, error)

	// Adjusts the behavior of periodic endpoints to consume a different amount of bus bandwidth.
	AdjustPipeWithDescriptorsError(descriptors *IOUSBHostIOSourceDescriptors) (bool, error)
	// A property that retrieves the current endpoint descriptors controlling the endpoint.
	Descriptors() *IOUSBHostIOSourceDescriptors
	// A property that retrieves the original endpoint descriptors from the pipe at the point of creation.
	OriginalDescriptors() *IOUSBHostIOSourceDescriptors

	// Sets the desired idle suspend timeout for the interface.
	SetIdleTimeoutError(idleTimeout foundation.NSTimeInterval) (bool, error)
	// A property that retrieves the current idle suspend timeout.
	IdleTimeout() foundation.NSTimeInterval

	// Enables streams for the pipe.
	EnableStreamsWithError() (bool, error)
	// Returns the stream for a stream ID.
	CopyStreamWithStreamIDError(streamID uint) (IIOUSBHostStream, error)
	// Disables streams for the pipe.
	DisableStreamsWithError() (bool, error)

	EnqueueIORequestWithDataTransactionListTransactionListCountFirstFrameNumberOptionsErrorCompletionHandler(data foundation.NSMutableData, transactionList *IOUSBHostIsochronousTransaction, transactionListCount uint, firstFrameNumber uint64, options IOUSBHostIsochronousTransferOptions, error_ foundation.NSError, completionHandler Int32IOUSBHostIsochronousTransactionHandler) bool
	SendIORequestWithDataTransactionListTransactionListCountFirstFrameNumberOptionsError(data foundation.NSMutableData, transactionList *IOUSBHostIsochronousTransaction, transactionListCount uint, firstFrameNumber uint64, options IOUSBHostIsochronousTransferOptions) (bool, error)
}

An interface definition for the IOUSBHostPipe class.

Sending Bulk and Interrupt I/O

Managing Periodic Bandwidth

Enabling Power Savings

Managing Streams

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe

type IIOUSBHostStream

type IIOUSBHostStream interface {
	IIOUSBHostIOSource

	// Enqueues an input/output request on the stream.
	EnqueueIORequestWithDataErrorCompletionHandler(data foundation.NSMutableData, error_ foundation.NSError, completionHandler Int32Uint32Handler) bool
	// Aborts pending input/output requests.
	AbortWithOptionError(option IOUSBHostAbortOption) (bool, error)
	// Aborts pending input/output requests synchronously.
	AbortWithError() (bool, error)

	// The pipe that creates the stream.
	HostPipe() IIOUSBHostPipe

	// The ID for the stream.
	StreamID() uint
}

An interface definition for the IOUSBHostStream class.

Sending I/O

Getting the Pipe Object

Getting the Stream ID

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostStream

type IOUSBHostAbortOption

type IOUSBHostAbortOption uint

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostAbortOption

const (
	// IOUSBHostAbortOptionAsynchronous: The option to abort input/output requests asynchronously.
	IOUSBHostAbortOptionAsynchronous IOUSBHostAbortOption = 0
	// IOUSBHostAbortOptionSynchronous: The option to abort input/output requests synchronously.
	IOUSBHostAbortOptionSynchronous IOUSBHostAbortOption = 1
)

func (IOUSBHostAbortOption) String

func (e IOUSBHostAbortOption) String() string

type IOUSBHostCICapabilitiesMessage

type IOUSBHostCICapabilitiesMessage uint32
const (
	IOUSBHostCICapabilitiesMessageControlPortCount                  IOUSBHostCICapabilitiesMessage = 983040
	IOUSBHostCICapabilitiesMessageControlPortCountPhase             IOUSBHostCICapabilitiesMessage = 16
	IOUSBHostCICapabilitiesMessageData0CommandTimeoutThreshold      IOUSBHostCICapabilitiesMessage = 3
	IOUSBHostCICapabilitiesMessageData0CommandTimeoutThresholdPhase IOUSBHostCICapabilitiesMessage = 0
	IOUSBHostCICapabilitiesMessageData0ConnectionLatency            IOUSBHostCICapabilitiesMessage = 240
	IOUSBHostCICapabilitiesMessageData0ConnectionLatencyPhase       IOUSBHostCICapabilitiesMessage = 4
)

func (IOUSBHostCICapabilitiesMessage) String

type IOUSBHostCICommandMessage

type IOUSBHostCICommandMessage uint32
const (
	IOUSBHostCICommandMessageControlStatus             IOUSBHostCICommandMessage = 3840
	IOUSBHostCICommandMessageControlStatusPhase        IOUSBHostCICommandMessage = 8
	IOUSBHostCICommandMessageData0DeviceAddress        IOUSBHostCICommandMessage = 255
	IOUSBHostCICommandMessageData0DeviceAddressPhase   IOUSBHostCICommandMessage = 0
	IOUSBHostCICommandMessageData0EndpointAddress      IOUSBHostCICommandMessage = 65280
	IOUSBHostCICommandMessageData0EndpointAddressPhase IOUSBHostCICommandMessage = 8
	IOUSBHostCICommandMessageData0RootPort             IOUSBHostCICommandMessage = 15
	IOUSBHostCICommandMessageData0RootPortPhase        IOUSBHostCICommandMessage = 0
	IOUSBHostCICommandMessageData0StreamID             IOUSBHostCICommandMessage = 4294901760
	IOUSBHostCICommandMessageData0StreamIDPhase        IOUSBHostCICommandMessage = 16
)

func (IOUSBHostCICommandMessage) String

func (e IOUSBHostCICommandMessage) String() string

type IOUSBHostCIControllerState

type IOUSBHostCIControllerState uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIControllerState

const (
	IOUSBHostCIControllerStateActive IOUSBHostCIControllerState = 2
	IOUSBHostCIControllerStateOff    IOUSBHostCIControllerState = 0
	IOUSBHostCIControllerStatePaused IOUSBHostCIControllerState = 1
)

func (IOUSBHostCIControllerState) String

type IOUSBHostCIControllerStateMachine

type IOUSBHostCIControllerStateMachine struct {
	objectivec.Object
}

Instance Properties

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIControllerStateMachine

func IOUSBHostCIControllerStateMachineFromID

func IOUSBHostCIControllerStateMachineFromID(id objc.ID) IOUSBHostCIControllerStateMachine

IOUSBHostCIControllerStateMachineFromID constructs a IOUSBHostCIControllerStateMachine from an objc.ID.

func NewIOUSBHostCIControllerStateMachine

func NewIOUSBHostCIControllerStateMachine() IOUSBHostCIControllerStateMachine

NewIOUSBHostCIControllerStateMachine creates a new IOUSBHostCIControllerStateMachine instance.

func (IOUSBHostCIControllerStateMachine) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostCIControllerStateMachine) Init

Init initializes the instance.

type IOUSBHostCIControllerStateMachineClass

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

func GetIOUSBHostCIControllerStateMachineClass

func GetIOUSBHostCIControllerStateMachineClass() IOUSBHostCIControllerStateMachineClass

GetIOUSBHostCIControllerStateMachineClass returns the class object for IOUSBHostCIControllerStateMachine.

func (IOUSBHostCIControllerStateMachineClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostCIControllerStateMachineClass) Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostCIDeviceCreateCommandData0

type IOUSBHostCIDeviceCreateCommandData0 uint32
const (
	IOUSBHostCIDeviceCreateCommandData0RootPort      IOUSBHostCIDeviceCreateCommandData0 = 15
	IOUSBHostCIDeviceCreateCommandData0RootPortPhase IOUSBHostCIDeviceCreateCommandData0 = 0
	IOUSBHostCIDeviceCreateCommandData0Route         IOUSBHostCIDeviceCreateCommandData0 = 16777200
	IOUSBHostCIDeviceCreateCommandData0RoutePhase    IOUSBHostCIDeviceCreateCommandData0 = 4
)

func (IOUSBHostCIDeviceCreateCommandData0) String

type IOUSBHostCIDeviceCreateCommandData1Device

type IOUSBHostCIDeviceCreateCommandData1Device uint32
const (
	IOUSBHostCIDeviceCreateCommandData1DeviceAddress      IOUSBHostCIDeviceCreateCommandData1Device = 255
	IOUSBHostCIDeviceCreateCommandData1DeviceAddressPhase IOUSBHostCIDeviceCreateCommandData1Device = 0
)

func (IOUSBHostCIDeviceCreateCommandData1Device) String

type IOUSBHostCIDeviceSpeed

type IOUSBHostCIDeviceSpeed uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIDeviceSpeed

const (
	IOUSBHostCIDeviceSpeedFull         IOUSBHostCIDeviceSpeed = 1
	IOUSBHostCIDeviceSpeedHigh         IOUSBHostCIDeviceSpeed = 3
	IOUSBHostCIDeviceSpeedLow          IOUSBHostCIDeviceSpeed = 2
	IOUSBHostCIDeviceSpeedNone         IOUSBHostCIDeviceSpeed = 0
	IOUSBHostCIDeviceSpeedSuper        IOUSBHostCIDeviceSpeed = 4
	IOUSBHostCIDeviceSpeedSuperPlus    IOUSBHostCIDeviceSpeed = 5
	IOUSBHostCIDeviceSpeedSuperPlusBy2 IOUSBHostCIDeviceSpeed = 6
)

func (IOUSBHostCIDeviceSpeed) String

func (e IOUSBHostCIDeviceSpeed) String() string

type IOUSBHostCIDeviceState

type IOUSBHostCIDeviceState uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIDeviceState

const (
	IOUSBHostCIDeviceStateActive    IOUSBHostCIDeviceState = 2
	IOUSBHostCIDeviceStateDestroyed IOUSBHostCIDeviceState = 0
	IOUSBHostCIDeviceStatePaused    IOUSBHostCIDeviceState = 1
)

func (IOUSBHostCIDeviceState) String

func (e IOUSBHostCIDeviceState) String() string

type IOUSBHostCIDeviceStateMachine

type IOUSBHostCIDeviceStateMachine struct {
	objectivec.Object
}

Instance Properties

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIDeviceStateMachine

func IOUSBHostCIDeviceStateMachineFromID

func IOUSBHostCIDeviceStateMachineFromID(id objc.ID) IOUSBHostCIDeviceStateMachine

IOUSBHostCIDeviceStateMachineFromID constructs a IOUSBHostCIDeviceStateMachine from an objc.ID.

func NewIOUSBHostCIDeviceStateMachine

func NewIOUSBHostCIDeviceStateMachine() IOUSBHostCIDeviceStateMachine

NewIOUSBHostCIDeviceStateMachine creates a new IOUSBHostCIDeviceStateMachine instance.

func (IOUSBHostCIDeviceStateMachine) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostCIDeviceStateMachine) Init

Init initializes the instance.

type IOUSBHostCIDeviceStateMachineClass

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

func GetIOUSBHostCIDeviceStateMachineClass

func GetIOUSBHostCIDeviceStateMachineClass() IOUSBHostCIDeviceStateMachineClass

GetIOUSBHostCIDeviceStateMachineClass returns the class object for IOUSBHostCIDeviceStateMachine.

func (IOUSBHostCIDeviceStateMachineClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostCIDeviceStateMachineClass) Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostCIDeviceUpdateCommandData1Descriptor

type IOUSBHostCIDeviceUpdateCommandData1Descriptor uint
const (
	IOUSBHostCIDeviceUpdateCommandData1DescriptorAddress      IOUSBHostCIDeviceUpdateCommandData1Descriptor = 18446744073709551615
	IOUSBHostCIDeviceUpdateCommandData1DescriptorAddressPhase IOUSBHostCIDeviceUpdateCommandData1Descriptor = 0
)

func (IOUSBHostCIDeviceUpdateCommandData1Descriptor) String

type IOUSBHostCIDoorbell

type IOUSBHostCIDoorbell uint32
const (
	IOUSBHostCIDoorbellDeviceAddress        IOUSBHostCIDoorbell = 255
	IOUSBHostCIDoorbellDeviceAddressPhase   IOUSBHostCIDoorbell = 0
	IOUSBHostCIDoorbellEndpointAddress      IOUSBHostCIDoorbell = 65280
	IOUSBHostCIDoorbellEndpointAddressPhase IOUSBHostCIDoorbell = 8
	IOUSBHostCIDoorbellStreamID             IOUSBHostCIDoorbell = 4294901760
	IOUSBHostCIDoorbellStreamIDPhase        IOUSBHostCIDoorbell = 16
)

func (IOUSBHostCIDoorbell) String

func (e IOUSBHostCIDoorbell) String() string

type IOUSBHostCIEndpointCreateCommandData1

type IOUSBHostCIEndpointCreateCommandData1 uint
const (
	IOUSBHostCIEndpointCreateCommandData1Descriptor      IOUSBHostCIEndpointCreateCommandData1 = 18446744073709551615
	IOUSBHostCIEndpointCreateCommandData1DescriptorPhase IOUSBHostCIEndpointCreateCommandData1 = 0
)

func (IOUSBHostCIEndpointCreateCommandData1) String

type IOUSBHostCIEndpointResetCommandData1ClearStateConstants

type IOUSBHostCIEndpointResetCommandData1ClearStateConstants uint32
const (
	IOUSBHostCIEndpointResetCommandData1ClearState IOUSBHostCIEndpointResetCommandData1ClearStateConstants = 1
)

func (IOUSBHostCIEndpointResetCommandData1ClearStateConstants) String

type IOUSBHostCIEndpointSetNextTransferCommandData1

type IOUSBHostCIEndpointSetNextTransferCommandData1 uint
const (
	IOUSBHostCIEndpointSetNextTransferCommandData1Address      IOUSBHostCIEndpointSetNextTransferCommandData1 = 18446744073709551615
	IOUSBHostCIEndpointSetNextTransferCommandData1AddressPhase IOUSBHostCIEndpointSetNextTransferCommandData1 = 0
)

func (IOUSBHostCIEndpointSetNextTransferCommandData1) String

type IOUSBHostCIEndpointState

type IOUSBHostCIEndpointState uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIEndpointState

const (
	IOUSBHostCIEndpointStateActive    IOUSBHostCIEndpointState = 3
	IOUSBHostCIEndpointStateDestroyed IOUSBHostCIEndpointState = 0
	IOUSBHostCIEndpointStateHalted    IOUSBHostCIEndpointState = 1
	IOUSBHostCIEndpointStatePaused    IOUSBHostCIEndpointState = 2
)

func (IOUSBHostCIEndpointState) String

func (e IOUSBHostCIEndpointState) String() string

type IOUSBHostCIEndpointStateMachine

type IOUSBHostCIEndpointStateMachine struct {
	objectivec.Object
}

Instance Properties

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIEndpointStateMachine

func IOUSBHostCIEndpointStateMachineFromID

func IOUSBHostCIEndpointStateMachineFromID(id objc.ID) IOUSBHostCIEndpointStateMachine

IOUSBHostCIEndpointStateMachineFromID constructs a IOUSBHostCIEndpointStateMachine from an objc.ID.

func NewIOUSBHostCIEndpointStateMachine

func NewIOUSBHostCIEndpointStateMachine() IOUSBHostCIEndpointStateMachine

NewIOUSBHostCIEndpointStateMachine creates a new IOUSBHostCIEndpointStateMachine instance.

func (IOUSBHostCIEndpointStateMachine) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostCIEndpointStateMachine) Init

Init initializes the instance.

type IOUSBHostCIEndpointStateMachineClass

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

func GetIOUSBHostCIEndpointStateMachineClass

func GetIOUSBHostCIEndpointStateMachineClass() IOUSBHostCIEndpointStateMachineClass

GetIOUSBHostCIEndpointStateMachineClass returns the class object for IOUSBHostCIEndpointStateMachine.

func (IOUSBHostCIEndpointStateMachineClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostCIEndpointStateMachineClass) Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostCIEndpointUpdateCommandData1

type IOUSBHostCIEndpointUpdateCommandData1 uint
const (
	IOUSBHostCIEndpointUpdateCommandData1Descriptor      IOUSBHostCIEndpointUpdateCommandData1 = 18446744073709551615
	IOUSBHostCIEndpointUpdateCommandData1DescriptorPhase IOUSBHostCIEndpointUpdateCommandData1 = 0
)

func (IOUSBHostCIEndpointUpdateCommandData1) String

type IOUSBHostCIExceptionType

type IOUSBHostCIExceptionType uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIExceptionType

const (
	IOUSBHostCIExceptionTypeCapabilitiesInvalid   IOUSBHostCIExceptionType = 1
	IOUSBHostCIExceptionTypeCommandFailure        IOUSBHostCIExceptionType = 6
	IOUSBHostCIExceptionTypeCommandReadCollision  IOUSBHostCIExceptionType = 3
	IOUSBHostCIExceptionTypeCommandTimeout        IOUSBHostCIExceptionType = 5
	IOUSBHostCIExceptionTypeCommandWriteFailed    IOUSBHostCIExceptionType = 4
	IOUSBHostCIExceptionTypeDoorbellOverflow      IOUSBHostCIExceptionType = 10
	IOUSBHostCIExceptionTypeDoorbellReadCollision IOUSBHostCIExceptionType = 9
	IOUSBHostCIExceptionTypeFrameUpdateError      IOUSBHostCIExceptionType = 12
	IOUSBHostCIExceptionTypeInterruptInvalid      IOUSBHostCIExceptionType = 7
	IOUSBHostCIExceptionTypeInterruptOverflow     IOUSBHostCIExceptionType = 8
	IOUSBHostCIExceptionTypeProtocolError         IOUSBHostCIExceptionType = 11
	IOUSBHostCIExceptionTypeTerminated            IOUSBHostCIExceptionType = 2
	IOUSBHostCIExceptionTypeUnknown               IOUSBHostCIExceptionType = 0
)

func (IOUSBHostCIExceptionType) String

func (e IOUSBHostCIExceptionType) String() string

type IOUSBHostCIIsochronousTransferControl

type IOUSBHostCIIsochronousTransferControl uint32
const (
	IOUSBHostCIIsochronousTransferControlASAP             IOUSBHostCIIsochronousTransferControl = 0x1000000
	IOUSBHostCIIsochronousTransferControlFrameNumber      IOUSBHostCIIsochronousTransferControl = 16711680
	IOUSBHostCIIsochronousTransferControlFrameNumberPhase IOUSBHostCIIsochronousTransferControl = 16
)

func (IOUSBHostCIIsochronousTransferControl) String

type IOUSBHostCIIsochronousTransferData0

type IOUSBHostCIIsochronousTransferData0 uint32
const (
	IOUSBHostCIIsochronousTransferData0Length      IOUSBHostCIIsochronousTransferData0 = 268435455
	IOUSBHostCIIsochronousTransferData0LengthPhase IOUSBHostCIIsochronousTransferData0 = 0
)

func (IOUSBHostCIIsochronousTransferData0) String

type IOUSBHostCIIsochronousTransferData1

type IOUSBHostCIIsochronousTransferData1 uint
const (
	IOUSBHostCIIsochronousTransferData1Buffer      IOUSBHostCIIsochronousTransferData1 = 18446744073709551615
	IOUSBHostCIIsochronousTransferData1BufferPhase IOUSBHostCIIsochronousTransferData1 = 0
)

func (IOUSBHostCIIsochronousTransferData1) String

type IOUSBHostCILinkData1TransferStructure

type IOUSBHostCILinkData1TransferStructure uint
const (
	IOUSBHostCILinkData1TransferStructureAddress      IOUSBHostCILinkData1TransferStructure = 18446744073709551615
	IOUSBHostCILinkData1TransferStructureAddressPhase IOUSBHostCILinkData1TransferStructure = 0
)

func (IOUSBHostCILinkData1TransferStructure) String

type IOUSBHostCILinkState

type IOUSBHostCILinkState uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCILinkState

const (
	IOUSBHostCILinkStateCompliance IOUSBHostCILinkState = 10
	IOUSBHostCILinkStateDisabled   IOUSBHostCILinkState = 4
	IOUSBHostCILinkStateInactive   IOUSBHostCILinkState = 6
	IOUSBHostCILinkStatePolling    IOUSBHostCILinkState = 7
	IOUSBHostCILinkStateRecovery   IOUSBHostCILinkState = 8
	IOUSBHostCILinkStateReset      IOUSBHostCILinkState = 9
	IOUSBHostCILinkStateResume     IOUSBHostCILinkState = 15
	IOUSBHostCILinkStateRxDetect   IOUSBHostCILinkState = 5
	IOUSBHostCILinkStateTest       IOUSBHostCILinkState = 11
	IOUSBHostCILinkStateU0         IOUSBHostCILinkState = 0
	IOUSBHostCILinkStateU1         IOUSBHostCILinkState = 1
	IOUSBHostCILinkStateU2         IOUSBHostCILinkState = 2
	IOUSBHostCILinkStateU3         IOUSBHostCILinkState = 3
)

func (IOUSBHostCILinkState) String

func (e IOUSBHostCILinkState) String() string

type IOUSBHostCIMessage

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

IOUSBHostCIMessage

[Full Topic] [Full Topic]: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIMessage

func (*IOUSBHostCIMessage) Control

func (s *IOUSBHostCIMessage) Control() uint32

Control returns the Control field from the record's packed storage.

func (*IOUSBHostCIMessage) Data0

func (s *IOUSBHostCIMessage) Data0() uint32

Data0 returns the Data0 field from the record's packed storage.

func (*IOUSBHostCIMessage) Data1

func (s *IOUSBHostCIMessage) Data1() uint64

Data1 returns the Data1 field from the record's packed storage.

func (*IOUSBHostCIMessage) SetControl

func (s *IOUSBHostCIMessage) SetControl(v uint32)

SetControl updates the Control field in the record's packed storage.

func (*IOUSBHostCIMessage) SetData0

func (s *IOUSBHostCIMessage) SetData0(v uint32)

SetData0 updates the Data0 field in the record's packed storage.

func (*IOUSBHostCIMessage) SetData1

func (s *IOUSBHostCIMessage) SetData1(v uint64)

SetData1 updates the Data1 field in the record's packed storage.

type IOUSBHostCIMessageControl

type IOUSBHostCIMessageControl uint32
const (
	IOUSBHostCIMessageControlNoResponse  IOUSBHostCIMessageControl = 0x4000
	IOUSBHostCIMessageControlStatus      IOUSBHostCIMessageControl = 3840
	IOUSBHostCIMessageControlStatusPhase IOUSBHostCIMessageControl = 8
	IOUSBHostCIMessageControlType        IOUSBHostCIMessageControl = 63
	IOUSBHostCIMessageControlTypePhase   IOUSBHostCIMessageControl = 0
	IOUSBHostCIMessageControlValid       IOUSBHostCIMessageControl = 0x8000
)

func (IOUSBHostCIMessageControl) String

func (e IOUSBHostCIMessageControl) String() string

type IOUSBHostCIMessageStatus

type IOUSBHostCIMessageStatus uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIMessageStatus

const (
	IOUSBHostCIMessageStatusBadArgument        IOUSBHostCIMessageStatus = 4
	IOUSBHostCIMessageStatusEndpointStopped    IOUSBHostCIMessageStatus = 7
	IOUSBHostCIMessageStatusError              IOUSBHostCIMessageStatus = 13
	IOUSBHostCIMessageStatusMissedServiceError IOUSBHostCIMessageStatus = 12
	IOUSBHostCIMessageStatusNoResources        IOUSBHostCIMessageStatus = 6
	IOUSBHostCIMessageStatusNotPermitted       IOUSBHostCIMessageStatus = 3
	IOUSBHostCIMessageStatusOffline            IOUSBHostCIMessageStatus = 2
	IOUSBHostCIMessageStatusOverrunError       IOUSBHostCIMessageStatus = 10
	IOUSBHostCIMessageStatusProtocolError      IOUSBHostCIMessageStatus = 8
	IOUSBHostCIMessageStatusReserved           IOUSBHostCIMessageStatus = 0
	IOUSBHostCIMessageStatusStallError         IOUSBHostCIMessageStatus = 11
	IOUSBHostCIMessageStatusSuccess            IOUSBHostCIMessageStatus = 1
	IOUSBHostCIMessageStatusTimeout            IOUSBHostCIMessageStatus = 5
	IOUSBHostCIMessageStatusTransactionError   IOUSBHostCIMessageStatus = 9
)

func (IOUSBHostCIMessageStatus) String

func (e IOUSBHostCIMessageStatus) String() string

type IOUSBHostCIMessageType

type IOUSBHostCIMessageType uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIMessageType

const (
	IOUSBHostCIMessageTypeCommandMax              IOUSBHostCIMessageType = 0x37
	IOUSBHostCIMessageTypeCommandMin              IOUSBHostCIMessageType = 0x10
	IOUSBHostCIMessageTypeControllerCapabilities  IOUSBHostCIMessageType = 0
	IOUSBHostCIMessageTypeControllerFrameNumber   IOUSBHostCIMessageType = 20
	IOUSBHostCIMessageTypeControllerPause         IOUSBHostCIMessageType = 19
	IOUSBHostCIMessageTypeControllerPowerOff      IOUSBHostCIMessageType = 17
	IOUSBHostCIMessageTypeControllerPowerOn       IOUSBHostCIMessageType = 0x10
	IOUSBHostCIMessageTypeControllerStart         IOUSBHostCIMessageType = 18
	IOUSBHostCIMessageTypeDeviceCreate            IOUSBHostCIMessageType = 0x20
	IOUSBHostCIMessageTypeDeviceDestroy           IOUSBHostCIMessageType = 33
	IOUSBHostCIMessageTypeDevicePause             IOUSBHostCIMessageType = 35
	IOUSBHostCIMessageTypeDeviceStart             IOUSBHostCIMessageType = 34
	IOUSBHostCIMessageTypeDeviceUpdate            IOUSBHostCIMessageType = 36
	IOUSBHostCIMessageTypeEndpointCreate          IOUSBHostCIMessageType = 0x28
	IOUSBHostCIMessageTypeEndpointDestroy         IOUSBHostCIMessageType = 41
	IOUSBHostCIMessageTypeEndpointPause           IOUSBHostCIMessageType = 43
	IOUSBHostCIMessageTypeEndpointReset           IOUSBHostCIMessageType = 45
	IOUSBHostCIMessageTypeEndpointSetNextTransfer IOUSBHostCIMessageType = 46
	IOUSBHostCIMessageTypeEndpointUpdate          IOUSBHostCIMessageType = 44
	IOUSBHostCIMessageTypeEndpoint_reserved_      IOUSBHostCIMessageType = 42
	IOUSBHostCIMessageTypeFrameNumberUpdate       IOUSBHostCIMessageType = 9
	IOUSBHostCIMessageTypeFrameTimestampUpdate    IOUSBHostCIMessageType = 10
	IOUSBHostCIMessageTypeIsochronousTransfer     IOUSBHostCIMessageType = 59
	IOUSBHostCIMessageTypeLink                    IOUSBHostCIMessageType = 60
	IOUSBHostCIMessageTypeNormalTransfer          IOUSBHostCIMessageType = 57
	IOUSBHostCIMessageTypePortCapabilities        IOUSBHostCIMessageType = 1
	IOUSBHostCIMessageTypePortDisable             IOUSBHostCIMessageType = 29
	IOUSBHostCIMessageTypePortEvent               IOUSBHostCIMessageType = 0x8
	IOUSBHostCIMessageTypePortPowerOff            IOUSBHostCIMessageType = 25
	IOUSBHostCIMessageTypePortPowerOn             IOUSBHostCIMessageType = 0x18
	IOUSBHostCIMessageTypePortReset               IOUSBHostCIMessageType = 28
	IOUSBHostCIMessageTypePortResume              IOUSBHostCIMessageType = 26
	IOUSBHostCIMessageTypePortStatus              IOUSBHostCIMessageType = 30
	IOUSBHostCIMessageTypePortSuspend             IOUSBHostCIMessageType = 27
	IOUSBHostCIMessageTypeSetupTransfer           IOUSBHostCIMessageType = 0x38
	IOUSBHostCIMessageTypeStatusTransfer          IOUSBHostCIMessageType = 58
	IOUSBHostCIMessageTypeTransferComplete        IOUSBHostCIMessageType = 61
)

func (IOUSBHostCIMessageType) String

func (e IOUSBHostCIMessageType) String() string

type IOUSBHostCINormalTransferData0

type IOUSBHostCINormalTransferData0 uint32
const (
	IOUSBHostCINormalTransferData0Length      IOUSBHostCINormalTransferData0 = 268435455
	IOUSBHostCINormalTransferData0LengthPhase IOUSBHostCINormalTransferData0 = 0
)

func (IOUSBHostCINormalTransferData0) String

type IOUSBHostCINormalTransferData1

type IOUSBHostCINormalTransferData1 uint
const (
	IOUSBHostCINormalTransferData1Buffer      IOUSBHostCINormalTransferData1 = 18446744073709551615
	IOUSBHostCINormalTransferData1BufferPhase IOUSBHostCINormalTransferData1 = 0
)

func (IOUSBHostCINormalTransferData1) String

type IOUSBHostCIPortCapabilitiesMessage

type IOUSBHostCIPortCapabilitiesMessage uint32
const (
	IOUSBHostCIPortCapabilitiesMessageControlConnectorType      IOUSBHostCIPortCapabilitiesMessage = 4278190080
	IOUSBHostCIPortCapabilitiesMessageControlConnectorTypePhase IOUSBHostCIPortCapabilitiesMessage = 24
	IOUSBHostCIPortCapabilitiesMessageControlInternalConnector  IOUSBHostCIPortCapabilitiesMessage = 0x800000
	IOUSBHostCIPortCapabilitiesMessageControlPortNumber         IOUSBHostCIPortCapabilitiesMessage = 983040
	IOUSBHostCIPortCapabilitiesMessageControlPortNumberPhase    IOUSBHostCIPortCapabilitiesMessage = 16
	IOUSBHostCIPortCapabilitiesMessageData0MaxPower             IOUSBHostCIPortCapabilitiesMessage = 255
	IOUSBHostCIPortCapabilitiesMessageData0MaxPowerPhase        IOUSBHostCIPortCapabilitiesMessage = 0
)

func (IOUSBHostCIPortCapabilitiesMessage) String

type IOUSBHostCIPortEventMessageData0Port

type IOUSBHostCIPortEventMessageData0Port uint32
const (
	IOUSBHostCIPortEventMessageData0PortNumber      IOUSBHostCIPortEventMessageData0Port = 15
	IOUSBHostCIPortEventMessageData0PortNumberPhase IOUSBHostCIPortEventMessageData0Port = 0
)

func (IOUSBHostCIPortEventMessageData0Port) String

type IOUSBHostCIPortState

type IOUSBHostCIPortState uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIPortState

const (
	IOUSBHostCIPortStateActive    IOUSBHostCIPortState = 3
	IOUSBHostCIPortStateOff       IOUSBHostCIPortState = 0
	IOUSBHostCIPortStatePowered   IOUSBHostCIPortState = 1
	IOUSBHostCIPortStateSuspended IOUSBHostCIPortState = 2
)

func (IOUSBHostCIPortState) String

func (e IOUSBHostCIPortState) String() string

type IOUSBHostCIPortStateMachine

type IOUSBHostCIPortStateMachine struct {
	objectivec.Object
}

Instance Properties

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIPortStateMachine

func IOUSBHostCIPortStateMachineFromID

func IOUSBHostCIPortStateMachineFromID(id objc.ID) IOUSBHostCIPortStateMachine

IOUSBHostCIPortStateMachineFromID constructs a IOUSBHostCIPortStateMachine from an objc.ID.

func NewIOUSBHostCIPortStateMachine

func NewIOUSBHostCIPortStateMachine() IOUSBHostCIPortStateMachine

NewIOUSBHostCIPortStateMachine creates a new IOUSBHostCIPortStateMachine instance.

func (IOUSBHostCIPortStateMachine) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostCIPortStateMachine) Init

Init initializes the instance.

func (IOUSBHostCIPortStateMachine) SetConnected

func (u IOUSBHostCIPortStateMachine) SetConnected(value bool)

func (IOUSBHostCIPortStateMachine) SetOvercurrent

func (u IOUSBHostCIPortStateMachine) SetOvercurrent(value bool)

func (IOUSBHostCIPortStateMachine) SetPowered

func (u IOUSBHostCIPortStateMachine) SetPowered(value bool)

type IOUSBHostCIPortStateMachineClass

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

func GetIOUSBHostCIPortStateMachineClass

func GetIOUSBHostCIPortStateMachineClass() IOUSBHostCIPortStateMachineClass

GetIOUSBHostCIPortStateMachineClass returns the class object for IOUSBHostCIPortStateMachine.

func (IOUSBHostCIPortStateMachineClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostCIPortStateMachineClass) Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostCIPortStatus

type IOUSBHostCIPortStatus uint32
const (
	IOUSBHostCIPortStatusChangeMask        IOUSBHostCIPortStatus = 1441792
	IOUSBHostCIPortStatusConnectChange     IOUSBHostCIPortStatus = 0x40000
	IOUSBHostCIPortStatusConnected         IOUSBHostCIPortStatus = 4
	IOUSBHostCIPortStatusLinkState         IOUSBHostCIPortStatus = 240
	IOUSBHostCIPortStatusLinkStateChange   IOUSBHostCIPortStatus = 0x100000
	IOUSBHostCIPortStatusLinkStatePhase    IOUSBHostCIPortStatus = 4
	IOUSBHostCIPortStatusOvercurrent       IOUSBHostCIPortStatus = 2
	IOUSBHostCIPortStatusOvercurrentChange IOUSBHostCIPortStatus = 0x20000
	IOUSBHostCIPortStatusPowered           IOUSBHostCIPortStatus = 1
	IOUSBHostCIPortStatusSpeed             IOUSBHostCIPortStatus = 1792
	IOUSBHostCIPortStatusSpeedPhase        IOUSBHostCIPortStatus = 8
)

func (IOUSBHostCIPortStatus) String

func (e IOUSBHostCIPortStatus) String() string

type IOUSBHostCIPortStatusCommandData1

type IOUSBHostCIPortStatusCommandData1 uint32
const (
	IOUSBHostCIPortStatusCommandData1ChangeMask        IOUSBHostCIPortStatusCommandData1 = 1441792
	IOUSBHostCIPortStatusCommandData1ConnectChange     IOUSBHostCIPortStatusCommandData1 = 262144
	IOUSBHostCIPortStatusCommandData1Connected         IOUSBHostCIPortStatusCommandData1 = 4
	IOUSBHostCIPortStatusCommandData1LinkState         IOUSBHostCIPortStatusCommandData1 = 240
	IOUSBHostCIPortStatusCommandData1LinkStateChange   IOUSBHostCIPortStatusCommandData1 = 1048576
	IOUSBHostCIPortStatusCommandData1LinkStatePhase    IOUSBHostCIPortStatusCommandData1 = 4
	IOUSBHostCIPortStatusCommandData1Overcurrent       IOUSBHostCIPortStatusCommandData1 = 2
	IOUSBHostCIPortStatusCommandData1OvercurrentChange IOUSBHostCIPortStatusCommandData1 = 131072
	IOUSBHostCIPortStatusCommandData1Powered           IOUSBHostCIPortStatusCommandData1 = 1
	IOUSBHostCIPortStatusCommandData1Speed             IOUSBHostCIPortStatusCommandData1 = 1792
	IOUSBHostCIPortStatusCommandData1SpeedPhase        IOUSBHostCIPortStatusCommandData1 = 8
)

func (IOUSBHostCIPortStatusCommandData1) String

type IOUSBHostCISetupTransfer

type IOUSBHostCISetupTransfer uint
const (
	IOUSBHostCISetupTransferData1bRequest           IOUSBHostCISetupTransfer = 65280
	IOUSBHostCISetupTransferData1bRequestPhase      IOUSBHostCISetupTransfer = 8
	IOUSBHostCISetupTransferData1bmRequestType      IOUSBHostCISetupTransfer = 255
	IOUSBHostCISetupTransferData1bmRequestTypePhase IOUSBHostCISetupTransfer = 0
	IOUSBHostCISetupTransferData1wIndex             IOUSBHostCISetupTransfer = 281470681743360
	IOUSBHostCISetupTransferData1wIndexPhase        IOUSBHostCISetupTransfer = 32
	IOUSBHostCISetupTransferData1wLength            IOUSBHostCISetupTransfer = 18446462598732840960
	IOUSBHostCISetupTransferData1wLengthPhase       IOUSBHostCISetupTransfer = 48
	IOUSBHostCISetupTransferData1wValue             IOUSBHostCISetupTransfer = 4294901760
	IOUSBHostCISetupTransferData1wValuePhase        IOUSBHostCISetupTransfer = 16
)

func (IOUSBHostCISetupTransfer) String

func (e IOUSBHostCISetupTransfer) String() string

type IOUSBHostCITransferCompletionMessageControl

type IOUSBHostCITransferCompletionMessageControl uint32
const (
	IOUSBHostCITransferCompletionMessageControlDeviceAddress        IOUSBHostCITransferCompletionMessageControl = 16711680
	IOUSBHostCITransferCompletionMessageControlDeviceAddressPhase   IOUSBHostCITransferCompletionMessageControl = 16
	IOUSBHostCITransferCompletionMessageControlEndpointAddress      IOUSBHostCITransferCompletionMessageControl = 4278190080
	IOUSBHostCITransferCompletionMessageControlEndpointAddressPhase IOUSBHostCITransferCompletionMessageControl = 24
	IOUSBHostCITransferCompletionMessageControlStatus               IOUSBHostCITransferCompletionMessageControl = 3840
	IOUSBHostCITransferCompletionMessageControlStatusPhase          IOUSBHostCITransferCompletionMessageControl = 8
)

func (IOUSBHostCITransferCompletionMessageControl) String

type IOUSBHostCITransferCompletionMessageData0Transfer

type IOUSBHostCITransferCompletionMessageData0Transfer uint32
const (
	IOUSBHostCITransferCompletionMessageData0TransferLength      IOUSBHostCITransferCompletionMessageData0Transfer = 268435455
	IOUSBHostCITransferCompletionMessageData0TransferLengthPhase IOUSBHostCITransferCompletionMessageData0Transfer = 0
)

func (IOUSBHostCITransferCompletionMessageData0Transfer) String

type IOUSBHostCITransferCompletionMessageData1Transfer

type IOUSBHostCITransferCompletionMessageData1Transfer uint
const (
	IOUSBHostCITransferCompletionMessageData1TransferStructure      IOUSBHostCITransferCompletionMessageData1Transfer = 18446744073709551615
	IOUSBHostCITransferCompletionMessageData1TransferStructurePhase IOUSBHostCITransferCompletionMessageData1Transfer = 0
)

func (IOUSBHostCITransferCompletionMessageData1Transfer) String

type IOUSBHostCIUserClientVersion

type IOUSBHostCIUserClientVersion uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCIUserClientVersion

const (
	IOUSBHostCIUserClientVersion100 IOUSBHostCIUserClientVersion = 0
)

func (IOUSBHostCIUserClientVersion) String

type IOUSBHostCompletionHandler

type IOUSBHostCompletionHandler = func(status int32, bytesTransferred uint32)

IOUSBHostCompletionHandler is the completion handler for asynchronous control, bulk, and interrupt transfers.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostCompletionHandler

type IOUSBHostControllerInterface

type IOUSBHostControllerInterface struct {
	objectivec.Object
}

Instance Properties

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostControllerInterface

func IOUSBHostControllerInterfaceFromID

func IOUSBHostControllerInterfaceFromID(id objc.ID) IOUSBHostControllerInterface

IOUSBHostControllerInterfaceFromID constructs a IOUSBHostControllerInterface from an objc.ID.

func NewIOUSBHostControllerInterface

func NewIOUSBHostControllerInterface() IOUSBHostControllerInterface

NewIOUSBHostControllerInterface creates a new IOUSBHostControllerInterface instance.

func (IOUSBHostControllerInterface) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostControllerInterface) Init

Init initializes the instance.

func (IOUSBHostControllerInterface) SetInterruptRateHz

func (u IOUSBHostControllerInterface) SetInterruptRateHz(value uint)

type IOUSBHostControllerInterfaceClass

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

func GetIOUSBHostControllerInterfaceClass

func GetIOUSBHostControllerInterfaceClass() IOUSBHostControllerInterfaceClass

GetIOUSBHostControllerInterfaceClass returns the class object for IOUSBHostControllerInterface.

func (IOUSBHostControllerInterfaceClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostControllerInterfaceClass) Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostDevice

type IOUSBHostDevice struct {
	IOUSBHostObject
}

The class that claims and configures devices, retrieves descriptors, and sends device requests.

Overview

This class enables management of the device state, including sending control requests to the default endpoint 0, configuring the device, and resetting the device. The interest handler also allows monitoring of the device state. The client creates the class and initializes it with initWithIOService:options:queue:error:interestHandler:.

Retrieving Device Descriptors

Resetting the Device

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostDevice

func IOUSBHostDeviceFromID

func IOUSBHostDeviceFromID(id objc.ID) IOUSBHostDevice

IOUSBHostDeviceFromID constructs a IOUSBHostDevice from an objc.ID.

The class that claims and configures devices, retrieves descriptors, and sends device requests.

func NewIOUSBHostDevice

func NewIOUSBHostDevice() IOUSBHostDevice

NewIOUSBHostDevice creates a new IOUSBHostDevice instance.

func (IOUSBHostDevice) Autorelease

func (u IOUSBHostDevice) Autorelease() IOUSBHostDevice

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostDevice) ConfigurationDescriptor

func (u IOUSBHostDevice) ConfigurationDescriptor() objectivec.IObject

The currently selected configuration descriptor.

Return Value

A pointer to the device’s configuration descriptor, or `nil` if no matching descriptor returns.

Discussion

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostDevice/configurationDescriptor

func (IOUSBHostDevice) Init

Init initializes the instance.

func (IOUSBHostDevice) ResetWithError

func (u IOUSBHostDevice) ResetWithError() (bool, error)

Terminates the device and attempts to re-enumerate it.

Discussion

This function resets and attempts to re-enumerate the USB device, and terminates the IOUSBHostDevice and all of its child IOService objects. If the reset is successful, it also creates and registers a new IOService object after terminating the previous object. After the call returns successfully, the framework IOUSBHostDevice no longer has a valid connection with the IOService object.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostDevice/reset()

type IOUSBHostDeviceClass

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

func GetIOUSBHostDeviceClass

func GetIOUSBHostDeviceClass() IOUSBHostDeviceClass

GetIOUSBHostDeviceClass returns the class object for IOUSBHostDevice.

func (IOUSBHostDeviceClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostDeviceClass) Class

func (ic IOUSBHostDeviceClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostDevicePropertyKey

type IOUSBHostDevicePropertyKey = string

IOUSBHostDevicePropertyKey is properties of a USB device that describe its state.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostDevicePropertyKey

type IOUSBHostIOSource

type IOUSBHostIOSource struct {
	objectivec.Object
}

This class provides basic functionality for deriving pipe and stream classes.

Overview

Don’t create objects of this class or use this class as a subclass. Instead, use IOUSBHostInterface.CopyPipeWithAddressError and IOUSBHostPipe.CopyStreamWithStreamIDError when creating an IOUSBHostIOSource.

Obtaining Device Information

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIOSource

func IOUSBHostIOSourceFromID

func IOUSBHostIOSourceFromID(id objc.ID) IOUSBHostIOSource

IOUSBHostIOSourceFromID constructs a IOUSBHostIOSource from an objc.ID.

This class provides basic functionality for deriving pipe and stream classes.

func NewIOUSBHostIOSource

func NewIOUSBHostIOSource() IOUSBHostIOSource

NewIOUSBHostIOSource creates a new IOUSBHostIOSource instance.

func (IOUSBHostIOSource) Autorelease

func (u IOUSBHostIOSource) Autorelease() IOUSBHostIOSource

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostIOSource) DeviceAddress

func (u IOUSBHostIOSource) DeviceAddress() uint

The device’s bus address.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIOSource/deviceAddress

func (IOUSBHostIOSource) EndpointAddress

func (u IOUSBHostIOSource) EndpointAddress() uint

The pipe or stream’s endpoint address.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIOSource/endpointAddress

func (IOUSBHostIOSource) HostInterface

func (u IOUSBHostIOSource) HostInterface() IIOUSBHostInterface

The interface for the input/output source.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIOSource/hostInterface

func (IOUSBHostIOSource) Init

Init initializes the instance.

type IOUSBHostIOSourceClass

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

func GetIOUSBHostIOSourceClass

func GetIOUSBHostIOSourceClass() IOUSBHostIOSourceClass

GetIOUSBHostIOSourceClass returns the class object for IOUSBHostIOSource.

func (IOUSBHostIOSourceClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostIOSourceClass) Class

func (ic IOUSBHostIOSourceClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostIOSourceDescriptors

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

IOUSBHostIOSourceDescriptors - The descriptors for a single endpoint.

[Full Topic] [Full Topic]: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIOSourceDescriptors

func (*IOUSBHostIOSourceDescriptors) BcdUSB

BcdUSB returns the BcdUSB field from the record's packed storage.

func (*IOUSBHostIOSourceDescriptors) Descriptor

func (s *IOUSBHostIOSourceDescriptors) Descriptor() [7]byte

Descriptor returns the Descriptor field from the record's packed storage.

func (*IOUSBHostIOSourceDescriptors) SetBcdUSB

func (s *IOUSBHostIOSourceDescriptors) SetBcdUSB(v uint16)

SetBcdUSB updates the BcdUSB field in the record's packed storage.

func (*IOUSBHostIOSourceDescriptors) SetDescriptor

func (s *IOUSBHostIOSourceDescriptors) SetDescriptor(v [7]byte)

SetDescriptor updates the Descriptor field in the record's packed storage.

func (*IOUSBHostIOSourceDescriptors) SetSsCompanionDescriptor

func (s *IOUSBHostIOSourceDescriptors) SetSsCompanionDescriptor(v [6]byte)

SetSsCompanionDescriptor updates the SsCompanionDescriptor field in the record's packed storage.

func (*IOUSBHostIOSourceDescriptors) SetSspCompanionDescriptor

func (s *IOUSBHostIOSourceDescriptors) SetSspCompanionDescriptor(v [8]byte)

SetSspCompanionDescriptor updates the SspCompanionDescriptor field in the record's packed storage.

func (*IOUSBHostIOSourceDescriptors) SsCompanionDescriptor

func (s *IOUSBHostIOSourceDescriptors) SsCompanionDescriptor() [6]byte

SsCompanionDescriptor returns the SsCompanionDescriptor field from the record's packed storage.

func (*IOUSBHostIOSourceDescriptors) SspCompanionDescriptor

func (s *IOUSBHostIOSourceDescriptors) SspCompanionDescriptor() [8]byte

SspCompanionDescriptor returns the SspCompanionDescriptor field from the record's packed storage.

type IOUSBHostInterestHandler

type IOUSBHostInterestHandler = func(hostObject IOUSBHostObject, messageType uint32, messageArgument unsafe.Pointer)

IOUSBHostInterestHandler is the callback that handles underlying service-state changes.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterestHandler

type IOUSBHostInterface

type IOUSBHostInterface struct {
	IOUSBHostObject
}

The class for accessing USB-related services.

Overview

Use this class to create pipes, retrieve descriptors, send device requests, and enable power savings. Create an instance of the class with initWithIOService:options:queue:error:interestHandler:.

Retrieving Function Descriptors

Managing Pipes

Enabling Power Savings

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterface

func IOUSBHostInterfaceFromID

func IOUSBHostInterfaceFromID(id objc.ID) IOUSBHostInterface

IOUSBHostInterfaceFromID constructs a IOUSBHostInterface from an objc.ID.

The class for accessing USB-related services.

func NewIOUSBHostInterface

func NewIOUSBHostInterface() IOUSBHostInterface

NewIOUSBHostInterface creates a new IOUSBHostInterface instance.

func (IOUSBHostInterface) Autorelease

func (u IOUSBHostInterface) Autorelease() IOUSBHostInterface

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostInterface) ConfigurationDescriptor

func (u IOUSBHostInterface) ConfigurationDescriptor() objectivec.IObject

The configuration descriptor for the interface.

Return Value

A pointer to the device’s configuration descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterface/configurationDescriptor

func (IOUSBHostInterface) CopyPipeWithAddressError

func (u IOUSBHostInterface) CopyPipeWithAddressError(address uint) (IIOUSBHostPipe, error)

Copies a pipe for a specific endpoint address.

address: The endpoint address of the pipe.

Return Value

An IOUSBHostPipe or nil if the system can’t create the pipe.

Discussion

If the pipe returns successfully, the method maintains a reference to the IOUSBHostInterface.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterface/copyPipe(withAddress:)

func (IOUSBHostInterface) IdleTimeout

The current idle suspend timeout.

Return Value

The amount of time after all pipes are idle to wait before suspending the device.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterface/idleTimeout

func (IOUSBHostInterface) Init

Init initializes the instance.

func (IOUSBHostInterface) InterfaceDescriptor

func (u IOUSBHostInterface) InterfaceDescriptor() objectivec.IObject

The descriptor for the interface.

Return Value

A pointer to the interface’s descriptor.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterface/interfaceDescriptor

func (IOUSBHostInterface) SelectAlternateSettingError

func (u IOUSBHostInterface) SelectAlternateSettingError(alternateSetting uint) (bool, error)

Selects an alternative setting for the interface.

alternateSetting: The alternative interface number to activate.

Discussion

Use this method to select an alternative setting for the interface. The operation aborts all pending input/output requests on the interface’s pipes, and closes all open pipes. It also selects the new alternative setting through the `SET_INTERFACE` control request (See USB 3.2, 9.4.10.).

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterface/selectAlternateSetting(_:)

func (IOUSBHostInterface) SetIdleTimeoutError

func (u IOUSBHostInterface) SetIdleTimeoutError(idleTimeout foundation.NSTimeInterval) (bool, error)

Sets the desired idle suspend timeout for the interface.

idleTimeout: The amount of time after all pipes are idle to wait before suspending the device.

Discussion

After the interface idles, it defers electrical suspension of the device for the specified duration.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterface/setIdleTimeout(_:)

type IOUSBHostInterfaceClass

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

func GetIOUSBHostInterfaceClass

func GetIOUSBHostInterfaceClass() IOUSBHostInterfaceClass

GetIOUSBHostInterfaceClass returns the class object for IOUSBHostInterface.

func (IOUSBHostInterfaceClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostInterfaceClass) Class

func (ic IOUSBHostInterfaceClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostInterfacePropertyKey

type IOUSBHostInterfacePropertyKey = string

IOUSBHostInterfacePropertyKey is properties of a USB interface that describe its state.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterfacePropertyKey

var (
	// IOUSBHostInterfacePropertyKeyAlternateSetting is the USB interface’s current alternative setting value.
	//
	// See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostInterfacePropertyKey/alternateSetting
	IOUSBHostInterfacePropertyKeyAlternateSetting IOUSBHostInterfacePropertyKey
)

type IOUSBHostIsochronousCompletionHandler

type IOUSBHostIsochronousCompletionHandler = func(status int32, frameList *IOUSBHostIsochronousFrame)

IOUSBHostIsochronousCompletionHandler is a completion handler for asynchronous isochronous transfers.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIsochronousCompletionHandler

type IOUSBHostIsochronousFrame

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

IOUSBHostIsochronousFrame - A structure that represents a single frame in an isochronous transfer.

[Full Topic] [Full Topic]: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIsochronousFrame

func (*IOUSBHostIsochronousFrame) CompleteCount

func (s *IOUSBHostIsochronousFrame) CompleteCount() uint32

CompleteCount returns the CompleteCount field from the record's packed storage.

func (*IOUSBHostIsochronousFrame) RequestCount

func (s *IOUSBHostIsochronousFrame) RequestCount() uint32

RequestCount returns the RequestCount field from the record's packed storage.

func (*IOUSBHostIsochronousFrame) Reserved

func (s *IOUSBHostIsochronousFrame) Reserved() uint32

Reserved returns the Reserved field from the record's packed storage.

func (*IOUSBHostIsochronousFrame) SetCompleteCount

func (s *IOUSBHostIsochronousFrame) SetCompleteCount(v uint32)

SetCompleteCount updates the CompleteCount field in the record's packed storage.

func (*IOUSBHostIsochronousFrame) SetRequestCount

func (s *IOUSBHostIsochronousFrame) SetRequestCount(v uint32)

SetRequestCount updates the RequestCount field in the record's packed storage.

func (*IOUSBHostIsochronousFrame) SetReserved

func (s *IOUSBHostIsochronousFrame) SetReserved(v uint32)

SetReserved updates the Reserved field in the record's packed storage.

func (*IOUSBHostIsochronousFrame) SetStatus

func (s *IOUSBHostIsochronousFrame) SetStatus(v int32)

SetStatus updates the Status field in the record's packed storage.

func (*IOUSBHostIsochronousFrame) SetTimeStamp

func (s *IOUSBHostIsochronousFrame) SetTimeStamp(v IOUSBHostTime)

SetTimeStamp updates the TimeStamp field in the record's packed storage.

func (*IOUSBHostIsochronousFrame) Status

func (s *IOUSBHostIsochronousFrame) Status() int32

Status returns the Status field from the record's packed storage.

func (*IOUSBHostIsochronousFrame) TimeStamp

TimeStamp returns the TimeStamp field from the record's packed storage.

type IOUSBHostIsochronousTransaction

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

IOUSBHostIsochronousTransaction

[Full Topic] [Full Topic]: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIsochronousTransaction

func (*IOUSBHostIsochronousTransaction) CompleteCount

func (s *IOUSBHostIsochronousTransaction) CompleteCount() uint32

CompleteCount returns the CompleteCount field from the record's packed storage.

func (*IOUSBHostIsochronousTransaction) Offset

Offset returns the Offset field from the record's packed storage.

func (*IOUSBHostIsochronousTransaction) Options

Options returns the Options field from the record's packed storage.

func (*IOUSBHostIsochronousTransaction) RequestCount

func (s *IOUSBHostIsochronousTransaction) RequestCount() uint32

RequestCount returns the RequestCount field from the record's packed storage.

func (*IOUSBHostIsochronousTransaction) SetCompleteCount

func (s *IOUSBHostIsochronousTransaction) SetCompleteCount(v uint32)

SetCompleteCount updates the CompleteCount field in the record's packed storage.

func (*IOUSBHostIsochronousTransaction) SetOffset

func (s *IOUSBHostIsochronousTransaction) SetOffset(v uint32)

SetOffset updates the Offset field in the record's packed storage.

func (*IOUSBHostIsochronousTransaction) SetOptions

SetOptions updates the Options field in the record's packed storage.

func (*IOUSBHostIsochronousTransaction) SetRequestCount

func (s *IOUSBHostIsochronousTransaction) SetRequestCount(v uint32)

SetRequestCount updates the RequestCount field in the record's packed storage.

func (*IOUSBHostIsochronousTransaction) SetStatus

func (s *IOUSBHostIsochronousTransaction) SetStatus(v int32)

SetStatus updates the Status field in the record's packed storage.

func (*IOUSBHostIsochronousTransaction) SetTimeStamp

SetTimeStamp updates the TimeStamp field in the record's packed storage.

func (*IOUSBHostIsochronousTransaction) Status

Status returns the Status field from the record's packed storage.

func (*IOUSBHostIsochronousTransaction) TimeStamp

TimeStamp returns the TimeStamp field from the record's packed storage.

type IOUSBHostIsochronousTransactionOptions

type IOUSBHostIsochronousTransactionOptions uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIsochronousTransactionOptions

const (
	IOUSBHostIsochronousTransactionOptionsNone IOUSBHostIsochronousTransactionOptions = 0
	IOUSBHostIsochronousTransactionOptionsWrap IOUSBHostIsochronousTransactionOptions = 1
)

func (IOUSBHostIsochronousTransactionOptions) String

type IOUSBHostIsochronousTransferOptions

type IOUSBHostIsochronousTransferOptions uint32

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostIsochronousTransferOptions

const (
	IOUSBHostIsochronousTransferOptionsNone IOUSBHostIsochronousTransferOptions = 0
)

func (IOUSBHostIsochronousTransferOptions) String

type IOUSBHostMatchingPropertyKey

type IOUSBHostMatchingPropertyKey = string

IOUSBHostMatchingPropertyKey is properties for implementing the matching service.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostMatchingPropertyKey

type IOUSBHostObject

type IOUSBHostObject struct {
	objectivec.Object
}

This class provides basic functionality for sending device requests and retrieving descriptors.

Managing the Object Life Cycle

Creating I/O Buffers

Getting Host Information

Instance Properties

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObject

func IOUSBHostObjectFromID

func IOUSBHostObjectFromID(id objc.ID) IOUSBHostObject

IOUSBHostObjectFromID constructs a IOUSBHostObject from an objc.ID.

This class provides basic functionality for sending device requests and retrieving descriptors.

func NewIOUSBHostObject

func NewIOUSBHostObject() IOUSBHostObject

NewIOUSBHostObject creates a new IOUSBHostObject instance.

func (IOUSBHostObject) Autorelease

func (u IOUSBHostObject) Autorelease() IOUSBHostObject

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostObject) Destroy

func (u IOUSBHostObject) Destroy()

Removes underlying allocations and connections from the USB host object.

Discussion

When you no longer need the IOUSBHostObject, call IOUSBHostObject.Destroy. This method destroys the connection with the kernel object and deregisters interest on io_service_t. Calling IOUSBHostObject.Destroy multiple times has no effect.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObject/destroy()

func (IOUSBHostObject) DestroyWithOptions

func (u IOUSBHostObject) DestroyWithOptions(options IOUSBHostObjectDestroyOptions)

Discussion

Removes underlying allocations of the IOUSBHostObject object along with user client

Extends destroy to take an options to modify the destroy behavior. Currently only the IOUSBHostObjectDestroyOptionsDeviceSurrender is defined to support surrendering ownersip of the kernel service. To be used when accepting the kUSBHostMessageDeviceIsRequestingClose message.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObject/destroy(options:)

func (IOUSBHostObject) DeviceAddress

func (u IOUSBHostObject) DeviceAddress() uint

The device’s bus address.

Return Value

The current bus address of the device.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObject/deviceAddress

func (IOUSBHostObject) Init

Init initializes the instance.

func (IOUSBHostObject) IoDataWithCapacityError

func (u IOUSBHostObject) IoDataWithCapacityError(capacity uint) (foundation.NSMutableData, error)

Allocates a buffer for input/output requests.

capacity: The size, in bytes, of the buffer to allocate.

Return Value

A pointer to an allocated buffer.

Discussion

This method allocates and maps a kernel buffer that the underlying controller hardware has optimized. Using this method, the buffer doesn’t bounce to perform DMA operations.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObject/ioData(withCapacity:)

func (IOUSBHostObject) IoService

func (u IOUSBHostObject) IoService() uint32

A reference to the kernel object.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObject/ioService

func (IOUSBHostObject) Queue

func (u IOUSBHostObject) Queue() dispatch.Queue

The queue for servicing input/output requests.

Discussion

Use this queue only for asynchronous input/output requests.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObject/queue

type IOUSBHostObjectClass

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

func GetIOUSBHostObjectClass

func GetIOUSBHostObjectClass() IOUSBHostObjectClass

GetIOUSBHostObjectClass returns the class object for IOUSBHostObject.

func (IOUSBHostObjectClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostObjectClass) Class

func (ic IOUSBHostObjectClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostObjectDataOptions

type IOUSBHostObjectDataOptions uint

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObjectDataOptions

const (
	IOUSBHostObjectDataOptionsKernelUserShared IOUSBHostObjectDataOptions = 0
)

func (IOUSBHostObjectDataOptions) String

type IOUSBHostObjectDestroyOptions

type IOUSBHostObjectDestroyOptions uint

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObjectDestroyOptions

const (
	IOUSBHostObjectDestroyOptionsDeviceSurrender IOUSBHostObjectDestroyOptions = 1
	IOUSBHostObjectDestroyOptionsNone            IOUSBHostObjectDestroyOptions = 0
)

func (IOUSBHostObjectDestroyOptions) String

type IOUSBHostObjectInitOptions

type IOUSBHostObjectInitOptions uint

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostObjectInitOptions

const (
	// IOUSBHostObjectInitOptionsDeviceCapture: The option to capture the device and terminate existing drivers.
	IOUSBHostObjectInitOptionsDeviceCapture IOUSBHostObjectInitOptions = 1
	IOUSBHostObjectInitOptionsDeviceSeize   IOUSBHostObjectInitOptions = 2
	// IOUSBHostObjectInitOptionsNone: The default argument for initializing the host object.
	IOUSBHostObjectInitOptionsNone IOUSBHostObjectInitOptions = 0
)

func (IOUSBHostObjectInitOptions) String

type IOUSBHostPipe

type IOUSBHostPipe struct {
	IOUSBHostIOSource
}

The class that sends control, bulk, interrupt, and isochronous input/output requests for function drivers, and manages stream capabilities.

Overview

The client creates pipe objects using IOUSBHostInterface.CopyPipeWithAddressError.

Sending Bulk and Interrupt I/O

Managing Periodic Bandwidth

Enabling Power Savings

Managing Streams

Instance Methods

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe

func IOUSBHostPipeFromID

func IOUSBHostPipeFromID(id objc.ID) IOUSBHostPipe

IOUSBHostPipeFromID constructs a IOUSBHostPipe from an objc.ID.

The class that sends control, bulk, interrupt, and isochronous input/output requests for function drivers, and manages stream capabilities.

func NewIOUSBHostPipe

func NewIOUSBHostPipe() IOUSBHostPipe

NewIOUSBHostPipe creates a new IOUSBHostPipe instance.

func (IOUSBHostPipe) AdjustPipeWithDescriptorsError

func (u IOUSBHostPipe) AdjustPipeWithDescriptorsError(descriptors *IOUSBHostIOSourceDescriptors) (bool, error)

Adjusts the behavior of periodic endpoints to consume a different amount of bus bandwidth.

descriptors: A reference to IOUSBHostIOSourceDescriptors describing the new endpoint policy.

Discussion

During creation, periodic (interrupt and isochronous) endpoints reserve bus bandwidth to allow for maximum packet size, mult (the maximum number of packets that this endpoint supports), burst size, and the endpoint service interval.

If an endpoint won’t use all of the allocated bandwidth, use IOUSBHostPipe.AdjustPipeWithDescriptorsError to reduce the bandwidth reserved for the endpoint. Copy the original endpoint descriptors, adjust maximum packet size, mult, burst size, and interval, then pass to IOUSBHostPipe.AdjustPipeWithDescriptorsError. The altered descriptors must pass validation from the kernel for policy changes to process.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/adjust(with:)

func (IOUSBHostPipe) Autorelease

func (u IOUSBHostPipe) Autorelease() IOUSBHostPipe

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostPipe) ClearStallWithError

func (u IOUSBHostPipe) ClearStallWithError() (bool, error)

Clears the halt condition of the pipe.

Discussion

When a bulk or interrupt USB endpoint encounters any input/output error other than a timeout, it transitions to a halted state. It must also clear to perform additional input/output requests on the endpoint.

This method clears the halted condition for the endpoint. It also sends a `CLEAR_TT_BUFFER` control request (See USB 2.0, 11.24.2.3.) to an intermediate hub, if necessary. All pending input/output requests on the endpoint abort, and the data toggle for the endpoint resets.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/clearStall()

func (IOUSBHostPipe) CopyStreamWithStreamIDError

func (u IOUSBHostPipe) CopyStreamWithStreamIDError(streamID uint) (IIOUSBHostStream, error)

Returns the stream for a stream ID.

streamID: A stream ID in the range of 1 to n. Retrieve n can by calling IOUSBGetEndpointMaxStreams with the IOUSBEndpointDescriptor.

Return Value

A pointer to an IOUSBHostStream; otherwise, `nil` if the device or the underlying host controller doesn’t support the specified stream ID.

Discussion

Call IOUSBHostPipe.EnableStreamsWithError before this method.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/copyStream(withStreamID:)

func (IOUSBHostPipe) Descriptors

A property that retrieves the current endpoint descriptors controlling the endpoint.

Return Value

The current IOUSBHostIOSourceDescriptors.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/descriptors

func (IOUSBHostPipe) DisableStreamsWithError

func (u IOUSBHostPipe) DisableStreamsWithError() (bool, error)

Disables streams for the pipe.

Discussion

This method changes the operational mode of the IOUSBHostPipe to disable streaming endpoint transfers. Before calling this method, set all stream contexts as nonactive on the device through an out-of-band (class-defined) mechanism, in accordance with USB 3.2, 8.12.1.4. This is necessary, as the method synchronously aborts any outstanding calls on existing IOUSBHostStream objects.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/disableStreams()

func (IOUSBHostPipe) EnableStreamsWithError

func (u IOUSBHostPipe) EnableStreamsWithError() (bool, error)

Enables streams for the pipe.

Discussion

This method changes the operational mode of the pipe to allow streaming endpoint transfers. Call this method before IOUSBHostPipe.CopyStreamWithStreamIDError.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/enableStreams()

func (IOUSBHostPipe) EnqueueIORequestWithDataCompletionTimeoutErrorCompletionHandler

func (u IOUSBHostPipe) EnqueueIORequestWithDataCompletionTimeoutErrorCompletionHandler(data foundation.NSMutableData, completionTimeout foundation.NSTimeInterval, error_ foundation.NSError, completionHandler Int32Uint32Handler) bool

Enqueues an input/output request on the pipe.

data: An NSMutableData object defining the memory to use for the transfer. Use nil to send a zero-length packet.

completionTimeout: A TimeInterval value representing the timeout of the request. If `0`, the request never times out. Use IOUSBHostDefaultControlCompletionTimeout unless there’s a need for a specific timeout.

completionHandler: An IOUSBHostCompletionHandler that runs when the request completes, or times out after the call returns successfully. If the method returns with an error, the completion handler doesn’t run.

Discussion

Use this method to issue an asynchronous input/output request on a bulk or interrupt pipe.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/enqueueIORequest(with:completionTimeout:completionHandler:)

func (IOUSBHostPipe) IdleTimeout

func (u IOUSBHostPipe) IdleTimeout() foundation.NSTimeInterval

A property that retrieves the current idle suspend timeout.

Return Value

The amount of time after all pipes are idle to wait before suspending the device.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/idleTimeout

func (IOUSBHostPipe) Init

func (u IOUSBHostPipe) Init() IOUSBHostPipe

Init initializes the instance.

func (IOUSBHostPipe) OriginalDescriptors

func (u IOUSBHostPipe) OriginalDescriptors() *IOUSBHostIOSourceDescriptors

A property that retrieves the original endpoint descriptors from the pipe at the point of creation.

Return Value

The original IOUSBHostIOSourceDescriptors.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/originalDescriptors

func (IOUSBHostPipe) SetIdleTimeoutError

func (u IOUSBHostPipe) SetIdleTimeoutError(idleTimeout foundation.NSTimeInterval) (bool, error)

Sets the desired idle suspend timeout for the interface.

idleTimeout: The amount of time after all pipes are idle to wait before suspending the device.

Discussion

After the interface idles, it defers electrical suspension of the device for the specified duration.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPipe/setIdleTimeout(_:)

type IOUSBHostPipeClass

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

func GetIOUSBHostPipeClass

func GetIOUSBHostPipeClass() IOUSBHostPipeClass

GetIOUSBHostPipeClass returns the class object for IOUSBHostPipe.

func (IOUSBHostPipeClass) Alloc

func (ic IOUSBHostPipeClass) Alloc() IOUSBHostPipe

Alloc allocates memory for a new instance of the class.

func (IOUSBHostPipeClass) Class

func (ic IOUSBHostPipeClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostPropertyKey

type IOUSBHostPropertyKey = string

IOUSBHostPropertyKey is properties that the USB host device and interface classes share.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPropertyKey

var (
	// IOUSBHostPropertyKeyLocationID is the location ID of the USB host device.
	//
	// See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostPropertyKeyLocationID
	IOUSBHostPropertyKeyLocationID IOUSBHostPropertyKey
)

type IOUSBHostStream

type IOUSBHostStream struct {
	IOUSBHostIOSource
}

The class responsible for sending stream data for function drivers.

Overview

The IOUSBHostPipe.CopyStreamWithStreamIDError method creates stream objects.

Sending I/O

Getting the Pipe Object

Getting the Stream ID

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostStream

func IOUSBHostStreamFromID

func IOUSBHostStreamFromID(id objc.ID) IOUSBHostStream

IOUSBHostStreamFromID constructs a IOUSBHostStream from an objc.ID.

The class responsible for sending stream data for function drivers.

func NewIOUSBHostStream

func NewIOUSBHostStream() IOUSBHostStream

NewIOUSBHostStream creates a new IOUSBHostStream instance.

func (IOUSBHostStream) AbortWithError

func (u IOUSBHostStream) AbortWithError() (bool, error)

Aborts pending input/output requests synchronously.

Discussion

Set the stream context as nonactive on the device with an out-of-band (class-defined) mechanism before calling this method, in accordance with USB 3.2, 8.12.1.4. The device won’t select a nonactive stream to become the current stream on the endpoint.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostStream/abort()

func (IOUSBHostStream) AbortWithOptionError

func (u IOUSBHostStream) AbortWithOptionError(option IOUSBHostAbortOption) (bool, error)

Aborts pending input/output requests.

option: A set of options. IOUSBHostAbortOption.synchronous is the default.

Discussion

Set the stream context as nonactive on the device with an out-of-band (class-defined) mechanism before calling this method, in accordance with USB 3.2, 8.12.1.4. The device won’t select a nonactive stream to become the current stream on the endpoint.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostStream/abort(with:)

func (IOUSBHostStream) Autorelease

func (u IOUSBHostStream) Autorelease() IOUSBHostStream

Autorelease adds the receiver to the current autorelease pool.

func (IOUSBHostStream) EnqueueIORequestWithDataErrorCompletionHandler

func (u IOUSBHostStream) EnqueueIORequestWithDataErrorCompletionHandler(data foundation.NSMutableData, error_ foundation.NSError, completionHandler Int32Uint32Handler) bool

Enqueues an input/output request on the stream.

data: An NSMutableData object defining the memory to use for the transfer.

completionHandler: An IOUSBHostCompletionHandler that runs when the request completes. The `completionHandler` doesn’t run if the method returns an error.

Discussion

This method sends an asynchronous request on the stream.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostStream/enqueueIORequest(with:completionHandler:)

func (IOUSBHostStream) HostPipe

func (u IOUSBHostStream) HostPipe() IIOUSBHostPipe

The pipe that creates the stream.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostStream/hostPipe

func (IOUSBHostStream) Init

Init initializes the instance.

func (IOUSBHostStream) StreamID

func (u IOUSBHostStream) StreamID() uint

The ID for the stream.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostStream/streamID

type IOUSBHostStreamClass

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

func GetIOUSBHostStreamClass

func GetIOUSBHostStreamClass() IOUSBHostStreamClass

GetIOUSBHostStreamClass returns the class object for IOUSBHostStream.

func (IOUSBHostStreamClass) Alloc

Alloc allocates memory for a new instance of the class.

func (IOUSBHostStreamClass) Class

func (ic IOUSBHostStreamClass) Class() objc.Class

Class returns the underlying Objective-C class pointer.

type IOUSBHostTime

type IOUSBHostTime = uint64

IOUSBHostTime is the absolute time.

See: https://developer.apple.com/documentation/IOUSBHost/IOUSBHostTime

type Int32IOUSBHostIsochronousTransactionHandler

type Int32IOUSBHostIsochronousTransactionHandler = func(int32, *IOUSBHostIsochronousTransaction)

Int32IOUSBHostIsochronousTransactionHandler handles completion with primitive and object results.

Used by:

type Int32Uint32Handler

type Int32Uint32Handler = func(int32, uint32)

Int32Uint32Handler handles An IOUSBHostCompletionHandler that runs when the request completes, or times out after the call returns successfully.

Used by:

Jump to

Keyboard shortcuts

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