Mac Developer Library

Developer

IOUSBController Class Reference

Options
Deployment Target:

On This Page
Language:

IOUSBController

Base class for USB hardware driver

Not many directly useful methods for USB device driver writers, IOUSBDevice, IOUSBInterface and IOUSBPipe provide more useful abstractions. The bulk of this class interfaces between IOKit and the low-level UIM, which is based on the MacOS9 UIM. To impliment a new controller type, subclass IOUSBController and impiment all the "UIM functions". AppleUSBOHCI is an example of this implementing all the functions necessary to drive an OHCI controller.

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import Kernel;

Availability


Available in OS X v10.0 and later.
  • Declaration

    C++

    virtual IOReturn AbortPipe( USBDeviceAddressaddress, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    Discussion

    Abort pending I/O to/from the specified endpoint, causing them to complete with return code kIOReturnAborted

  • Declaration

    C++

    virtual IOReturn AbortPipe( USBDeviceAddressaddress, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    Discussion

    Abort pending I/O to/from the specified endpoint, causing them to complete with return code kIOReturnAborted

  • Declaration

    C++

    virtual IOReturn AcquireDeviceZero( void );

    Discussion

    Get the device zero lock - call this before resetting a device, to ensure there's only one device with address 0

  • Declaration

    C++

    virtual IOReturn ClearPipeStall( USBDeviceAddressaddress, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    Discussion

    Clear a pipe stall.

  • Declaration

    C++

    virtual IOReturn ClearPipeStall( USBDeviceAddressaddress, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    Discussion

    Clear a pipe stall.

  • UIM function, set feature of root hub, As CLEAR_FEATURE control request.

    Declaration

    C++

    virtual IOReturn ClearRootHubFeature( UInt16wValue ) = 0;

    Parameters

    wValue

    The feature to clear, as would be transferred in wValue field of SETUP packet.

  • UIM function, clear feature of a root hub port, As CLEAR_FEATURE control request to a port.

    Declaration

    C++

    virtual IOReturn ClearRootHubPortFeature( UInt16wValue, UInt16port ) = 0;

    Parameters

    wValue

    The feature to clear, as would be transferred in wValue field of SETUP packet.

    port

    Port to clear feature for

  • UIM function, Impliments GET_BUS_STATE control request, now obsolete.

    Declaration

    C++

    virtual IOReturn GetRootHubPortState( UInt8 *state, UInt16 port ) = 0;

  • Declaration

    C++

    virtual IOReturn ClosePipe( USBDeviceAddressaddress, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    Discussion

    Close a pipe to the specified device endpoint

  • Declaration

    C++

    virtual IOReturn ClosePipe( USBDeviceAddressaddress, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    Discussion

    Close a pipe to the specified device endpoint

  • Declaration

    C++

    virtual IOReturn DeviceRequest( IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddressaddress, UInt8epNum );

    Parameters

    request

    parameter block for the control request

    completion

    describes action to take when the request has been executed

    address

    Address of the device on the USB bus

    epNum

    endpoint number

    Discussion

    Make a control request to the specified endpoint There are two versions of this method, one uses a simple void * to point to the data portion of the transfer, the other uses an IOMemoryDescriptor to point to the data.

  • Declaration

    C++

    virtual IOReturn DeviceRequest( IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddressaddress, UInt8epNum );

    Parameters

    request

    parameter block for the control request

    completion

    describes action to take when the request has been executed

    address

    Address of the device on the USB bus

    epNum

    endpoint number

    Discussion

    Make a control request to the specified endpoint There are two versions of this method, one uses a simple void * to point to the data portion of the transfer, the other uses an IOMemoryDescriptor to point to the data.

  • Declaration

    C++

    virtual IOReturn DeviceRequest( IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum, UInt32 noDataTimeout, UInt32 completionTimeout );

    Parameters

    request

    parameter block for the control request

    completion

    describes action to take when the request has been executed

    address

    Address of the device on the USB bus

    epNum

    endpoint number

    Discussion

    Make a control request to the specified endpoint There are two versions of this method, one uses a simple void * to point to the data portion of the transfer, the other uses an IOMemoryDescriptor to point to the data.

  • Declaration

    C++

    virtual IOReturn DeviceRequest( IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum, UInt32 noDataTimeout, UInt32 completionTimeout );

    Parameters

    request

    parameter block for the control request

    completion

    describes action to take when the request has been executed

    address

    Address of the device on the USB bus

    epNum

    endpoint number

    Discussion

    Make a control request to the specified endpoint There are two versions of this method, one uses a simple void * to point to the data portion of the transfer, the other uses an IOMemoryDescriptor to point to the data.

  • Declaration

    C++

    virtual UInt32 GetBandwidthAvailable( void ) = 0;

    Return Value

    maximum number of bytes that a new iso pipe could transfer per frame given current allocations.

    Discussion

    Returns the available bandwidth (in bytes) per frame or microframe for isochronous transfers.

  • Declaration

    C++

    virtual UInt64 GetFrameNumber( void ) = 0;

    Return Value

    The frame number.

    Discussion

    Returns the full current frame number.

  • Declaration

    C++

    virtual UInt32 GetFrameNumber32( void ) = 0;

    Return Value

    The lsb 32 bits of the frame number.

    Discussion

    Returns the least significant 32 bits of the frame number.

  • UIM function, retrun the configuration descriptor of the simulated root hub device As GET_DESCRIPTOR control request for configuration descrptor

    Declaration

    C++

    virtual IOReturn GetRootHubConfDescriptor( OSData *desc ) = 0;

    Parameters

    desc

    Descriptor structure to return data in

  • UIM function, return the hub descriptor of the simulated root hub device As GET_DESCRIPTOR control request for hub descrptor

    Declaration

    C++

    virtual IOReturn GetRootHubDescriptor( IOUSBHubDescriptor *desc ) = 0;

    Parameters

    desc

    Descriptor structure to return data in

  • UIM function, return the device descriptor of the simulated root hub device As GET_DESCRIPTOR control request for device descrptor

    Declaration

    C++

    virtual IOReturn GetRootHubDeviceDescriptor( IOUSBDeviceDescriptor *desc ) = 0;

    Parameters

    desc

    Descriptor structure to return data in

  • UIM function, Impliments GET_BUS_STATE control request, now obsolete.

    Declaration

    C++

    virtual IOReturn GetRootHubPortState( UInt8 *state, UInt16 port ) = 0;

  • UIM function, get the status of a root hub port. As GET_STATUS control request to the port.

    Declaration

    C++

    virtual IOReturn GetRootHubPortStatus( IOUSBHubPortStatus *status, UInt16port ) = 0;

    Parameters

    status

    Status structure to return

    port

    Port to get status for.

  • UIM function, get the status of the root hub. As GET_STATUS control request to device.

    Declaration

    C++

    virtual IOReturn GetRootHubStatus( IOUSBHubStatus *status ) = 0;

    Parameters

    status

    Status structure to return

  • Declaration

    C++

    virtual IOReturn IsocIO( IOMemoryDescriptor *buffer, UInt64frameStart, UInt32numFrames, IOUSBIsocFrame *frameList, USBDeviceAddressaddress, Endpoint *endpoint, IOUSBIsocCompletion *completion );

    Parameters

    buffer

    place to put the transferred data

    frameStart

    USB frame number of the frame to start transfer

    numFrames

    Number of frames to transfer

    frameList

    Bytes to transfer and result for each frame

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been filled

    Discussion

    Read from or write to an isochronous endpoint

  • Declaration

    C++

    virtual IOReturn IsocIO( IOMemoryDescriptor *buffer, UInt64frameStart, UInt32numFrames, IOUSBIsocFrame *frameList, USBDeviceAddressaddress, Endpoint *endpoint, IOUSBIsocCompletion *completion );

    Parameters

    buffer

    place to put the transferred data

    frameStart

    USB frame number of the frame to start transfer

    numFrames

    Number of frames to transfer

    frameList

    Bytes to transfer and result for each frame

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been filled

    Discussion

    Read from or write to an isochronous endpoint

  • Declaration

    C++

    virtual IOReturn IsocIO( IOMemoryDescriptor *buffer, UInt64frameStart, UInt32numFrames, IOUSBLowLatencyIsocFrame *frameList, USBDeviceAddressaddress, Endpoint *endpoint, IOUSBLowLatencyIsocCompletion *completion, UInt32updateFrequency );

    Parameters

    buffer

    place to put the transferred data

    frameStart

    USB frame number of the frame to start transfer

    numFrames

    Number of frames to transfer

    frameList

    Bytes to transfer and result for each frame

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been filled

    updateFrequency

    describes how often to update the framelist once the transfer has completed (in ms)

    Discussion

    Read from or write to an isochronous endpoint

  • Declaration

    C++

    virtual IOReturn OpenPipe( USBDeviceAddressaddress, UInt8speed, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    speed

    of the device: kUSBHighSpeed or kUSBLowSpeed

    endpoint

    description of endpoint to connect to

    Discussion

    Open a pipe to the specified device endpoint

  • Declaration

    C++

    virtual IOReturn OpenPipe( USBDeviceAddressaddress, UInt8speed, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    speed

    of the device: kUSBHighSpeed or kUSBLowSpeed

    endpoint

    description of endpoint to connect to

    Discussion

    Open a pipe to the specified device endpoint

  • Declaration

    C++

    virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddressaddress, Endpoint *endpoint, IOUSBCompletion *completion, UInt32noDataTimeout, UInt32completionTimeout, IOByteCountreqCount );

    Parameters

    buffer

    place to put the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been filled

    noDataTimeout

    number of milliseconds of no data movement before the request is aborted

    completionTimeout

    number of milliseonds after the command is on the bus in which it must complete

    reqCount

    number of bytes requested for the transfer (must not be greater than the length of the buffer)

    Discussion

    Read from an interrupt or bulk endpoint

  • Declaration

    C++

    virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddressaddress, Endpoint *endpoint, IOUSBCompletion *completion );

    Parameters

    buffer

    place to put the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been filled

    Discussion

    Read from an interrupt or bulk endpoint

  • Declaration

    C++

    virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddressaddress, Endpoint *endpoint, IOUSBCompletion *completion );

    Parameters

    buffer

    place to put the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been filled

    Discussion

    Read from an interrupt or bulk endpoint

  • Declaration

    C++

    virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout );

    Parameters

    buffer

    place to put the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been filled

    Discussion

    Read from an interrupt or bulk endpoint

  • Declaration

    C++

    virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout );

    Parameters

    buffer

    place to put the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been filled

    Discussion

    Read from an interrupt or bulk endpoint

  • Declaration

    C++

    virtual void ReleaseDeviceZero( void );

    Discussion

    Release the device zero lock - call this to release the device zero lock, when there is no longer a device at address 0

  • Declaration

    C++

    virtual IOReturn ResetPipe( USBDeviceAddressaddress, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    Discussion

    Abort pending I/O and clear stalled state - this method is a combination of abortPipe and clearPipeStall

  • Declaration

    C++

    virtual IOReturn ResetPipe( USBDeviceAddressaddress, Endpoint *endpoint );

    Parameters

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    Discussion

    Abort pending I/O and clear stalled state - this method is a combination of abortPipe and clearPipeStall

  • UIM function, set the address of the simulated root hub device, as SET_ADDRESS

    Declaration

    C++

    virtual IOReturn SetHubAddress( UInt16wValue ) = 0;

    Parameters

    wValue

    New address for root hub.

  • UIM function, optional. Set the hub descriptor data. As SET_DESCRIPTOR control request for hub descrptor

    Declaration

    C++

    virtual IOReturn SetRootHubDescriptor( OSData *buffer ) = 0;

    Parameters

    buffer

    Descriptor data

  • UIM function, set feature of root hub, As SET_FEATURE control request.

    Declaration

    C++

    virtual IOReturn SetRootHubFeature( UInt16wValue ) = 0;

    Parameters

    wValue

    The feature to set, as would be transferred in wValue field of SETUP packet.

  • UIM function, set feature of a root hub port, As SET_FEATURE control request to a port.

    Declaration

    C++

    virtual IOReturn SetRootHubPortFeature( UInt16wValue, UInt16port ) = 0;

    Parameters

    wValue

    The feature to set, as would be transferred in wValue field of SETUP packet.

    port

    Port to set feature for

  • UIM function Abort the specified endpoint, return all transactions queued on it.

    Declaration

    C++

    virtual IOReturn UIMAbortEndpoint( shortfunctionNumber, shortendpointNumber, shortdirection) = 0;

    Parameters

    functionNumber

    The USB device ID of the device to Abort

    endpointNumber

    The endpoint number to Abort

    direction

    Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut.

  • UIM function Clear stall on the specified endpoint, set data toggle to zero, return all transactions queued on it.

    Declaration

    C++

    virtual IOReturn UIMClearEndpointStall( shortfunctionNumber, shortendpointNumber, shortdirection) = 0;

    Parameters

    functionNumber

    The USB device ID of the device to Clear

    endpointNumber

    The endpoint number to Clear

    direction

    Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut.

  • UIM function, create a bulk endpoint for the controller.

    Declaration

    C++

    virtual IOReturn UIMCreateBulkEndpoint( UInt8functionNumber, UInt8endpointNumber, UInt8direction, UInt8speed, UInt8maxPacketSize) = 0;

    Parameters

    functionNumber

    The USB device ID of the device for this endpoint

    endpointNumber

    The endpoint number for this endpoint

    direction

    Specifies direction for the endpoint. kUSBIn or KUSBOut.

    speed

    speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull

    maxPacketSize

    Maximum packet size of this endpoint

  • UIM function, Do a transfer on a bulk endpoint. This method supercedes the method which takes multiple parameters.

    Declaration

    C++

    virtual IOReturn UIMCreateBulkTransfer( IOUSBCommand *command);

    Parameters

    command

    paramters for transfer.

  • UIM function, create a control endpoint for the controller.

    Declaration

    C++

    virtual IOReturn UIMCreateControlEndpoint( UInt8functionNumber, UInt8endpointNumber, UInt16maxPacketSize, UInt8speed) = 0;

    Parameters

    functionNumber

    The USB device ID of the device for this endpoint

    endpointNumber

    The endpoint number for this endpoint

    maxPacketSize

    Maximum packet size of this endpoint

    speed

    speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull

  • UIM function, Do a transfer on a control endpoint. This method supercedes the method which takes a void * parameter.

    Declaration

    C++

    virtual IOReturn UIMCreateControlTransfer( shortfunctionNumber, shortendpointNumber, IOUSBCompletioncompletion, IOMemoryDescriptor *CBP, boolbufferRounding, UInt32bufferSize, shortdirection) = 0;

    Parameters

    functionNumber

    The USB device ID of the device to perform the transaction with

    endpointNumber

    The endpoint number for the transaction

    completion

    Action to perform when I/O completes

    CBP

    Memory descriptor describing the buffer to transfer. Will never describe memory which has disjoint packets.

    bufferRounding

    If true, short packets are OK and do not cause an error

    bufferSize

    Size of the data to transfer in the data phase. (C

    direction

    Specifies direction and PID for transaction. kUSBIn, KUSBOut (DATA PID) or kUSBSetup (SETUP PID).

  • UIM function, create an interrupt endpoint for the controller.

    Declaration

    C++

    virtual IOReturn UIMCreateInterruptEndpoint( shortfunctionNumber, shortendpointNumber, UInt8direction, shortspeed, UInt16maxPacketSize, shortpollingRate) = 0;

    Parameters

    functionNumber

    The USB device ID of the device for this endpoint

    endpointNumber

    The endpoint number for this endpoint

    direction

    Specifies direction for the endpoint. kUSBIn or KUSBOut.

    speed

    speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull

    maxPacketSize

    Maximum packet size of this endpoint

    pollingRate

    The maximum polling interval from the endpoint descriptor.

  • UIM function, Do a transfer on an interrupt endpoint. This method supercedes the method which takes multiple parameters.

    Declaration

    C++

    virtual IOReturn UIMCreateInterruptTransfer( IOUSBCommand *command);

    Parameters

    command

    paramters for transfer.

  • Create an Isochronous endpoint in the controller.

    Declaration

    C++

    virtual IOReturn UIMCreateIsochEndpoint( shortfunctionNumber, shortendpointNumber, UInt32maxPacketSize, UInt8direction) = 0;

    Parameters

    functionNumber

    The USB device ID of the device for this endpoint

    endpointNumber

    The endpoint number for this endpoint

    maxPacketSize

    Maximum packet size of this endpoint

    direction

    Specifies direction for the endpoint. kUSBIn or KUSBOut.

  • UIM function, Do a transfer on an Isocchronous endpoint.

    Declaration

    C++

    virtual IOReturn UIMCreateIsochTransfer( IOUSBIsocCommand *command);

    Parameters

    command

    an IOUSBIsocCommand object with all the necessary information

  • UIM function, Do a transfer on an Isocchronous endpoint.

    Declaration

    C++

    virtual IOReturn UIMCreateIsochTransfer( shortfunctionNumber, shortendpointNumber, IOUSBIsocCompletioncompletion, UInt8direction, UInt64frameStart, IOMemoryDescriptor *pBuffer, UInt32frameCount, IOUSBIsocFrame *pFrames) = 0;

    Parameters

    functionNumber

    The USB device ID of the device to perform the transaction with

    endpointNumber

    The endpoint number for the transaction

    completion

    Action to perform when I/O completes

    direction

    Specifies direction for transfer. kUSBIn or KUSBOut.

    frameStart

    The frame number in which to start the transactions

    pBuffer

    describes memory buffer.

    frameCount

    number of frames to do transactions in

    pFrames

    Describes transactions in individual frames, gives sizes and reults for transactions.

  • UIM function, Do a transfer on an Isocchronous endpoint.

    Declaration

    C++

    virtual IOReturn UIMCreateIsochTransfer( shortfunctionNumber, shortendpointNumber, IOUSBIsocCompletioncompletion, UInt8direction, UInt64frameStart, IOMemoryDescriptor *pBuffer, UInt32frameCount, IOUSBLowLatencyIsocFrame *pFrames, UInt32updateFrequency);

    Parameters

    functionNumber

    The USB device ID of the device to perform the transaction with

    endpointNumber

    The endpoint number for the transaction

    completion

    Action to perform when I/O completes

    direction

    Specifies direction for transfer. kUSBIn or KUSBOut.

    frameStart

    The frame number in which to start the transactions

    pBuffer

    describes memory buffer.

    frameCount

    number of frames to do transactions in

    pFrames

    Describes transactions in individual frames, gives sizes and reults for transactions.

    updateFrequency

    Describes how often we update the frameList parameters (in ms)

  • UIM function Delete the specified endpoint, returning all transactions queued on it.

    Declaration

    C++

    virtual IOReturn UIMDeleteEndpoint( shortfunctionNumber, shortendpointNumber, shortdirection) = 0;

    Parameters

    functionNumber

    The USB device ID of the device to Delete

    endpointNumber

    The endpoint number to Delete

    direction

    Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut.

  • UIM function, finalise the controller and UIM data structures prior to removal.

    Declaration

    C++

    virtual IOReturn UIMFinalize() = 0;

  • UIM function, initialise the controller and UIM data structures.

    Declaration

    C++

    virtual IOReturn UIMInitialize( IOService *provider ) = 0;

  • UIM function UIMRootHubStatusChange - This method was internal to the UIM (never called by the superclass) until IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can still be used internally only. For subclasses of IOUSBControllerV3, however, the meaning has changed slightly. Now, it is used to determine if there is a status change on the root hub, and if so, it needs to update the IOUSBControllerV3 instance variable _rootHubStatusChangedBitmap

    Declaration

    C++

    virtual void UIMRootHubStatusChange( void) = 0;

  • UIM function UIMRootHubStatusChange(bool) - This method was internal to the UIM (never called by the superclass) until IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can still be used internally only. For subclasses of IOUSBControllerV3, however, it has become obsolete (it still needs to be implemented since it is pure virtual)

    Declaration

    C++

    virtual void UIMRootHubStatusChange( bool abort ) = 0;

  • UIM function UIMRootHubStatusChange(bool) - This method was internal to the UIM (never called by the superclass) until IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can still be used internally only. For subclasses of IOUSBControllerV3, however, it has become obsolete (it still needs to be implemented since it is pure virtual)

    Declaration

    C++

    virtual void UIMRootHubStatusChange( bool abort ) = 0;

  • Declaration

    C++

    virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddressaddress, Endpoint *endpoint, IOUSBCompletion *completion, UInt32noDataTimeout, UInt32completionTimeout, IOByteCountreqCount );

    Parameters

    buffer

    place to get the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been emptied

    noDataTimeout

    number of milliseconds of no data movement before the request is aborted

    completionTimeout

    number of milliseonds after the command is on the bus in which it must complete

    reqCount

    number of bytes requested for the transfer (must not be greater than the length of the buffer)

    Discussion

    Write to an interrupt or bulk endpoint

  • Declaration

    C++

    virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddressaddress, Endpoint *endpoint, IOUSBCompletion *completion );

    Parameters

    buffer

    place to get the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been emptied

    Discussion

    Write to an interrupt or bulk endpoint

  • Declaration

    C++

    virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddressaddress, Endpoint *endpoint, IOUSBCompletion *completion );

    Parameters

    buffer

    place to get the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been emptied

    Discussion

    Write to an interrupt or bulk endpoint

  • Declaration

    C++

    virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout );

    Parameters

    buffer

    place to get the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been emptied

    Discussion

    Write to an interrupt or bulk endpoint

  • Declaration

    C++

    virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout );

    Parameters

    buffer

    place to get the transferred data

    address

    Address of the device on the USB bus

    endpoint

    description of endpoint

    completion

    describes action to take when buffer has been emptied

    Discussion

    Write to an interrupt or bulk endpoint

Data Types

  • Declaration

    C++

    struct Endpoint { IOUSBEndpointDescriptor *descriptor; UInt8 number; UInt8 direction; // in, out UInt8 transferType; // cntrl , bulk, isoc, int UInt16 maxPacketSize; // MPS (includes the multiplier for HS High Bandwidth Isoch endpoints) UInt8 interval; };

    Fields

    descriptor

    The raw endpoint descriptor.

    number

    Endpoint number

    direction

    Endpoint direction: kUSBOut, kUSBIn, kUSBAnyDirn

    transferType

    Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt

    maxPacketSize

    Maximum packet size for endpoint, which will include the multiplier for HS High Bandwidth endpoints

    interval

    Polling interval in milliseconds (only relevent for Interrupt endpoints)

    Discussion

    Describes an endpoint of a device. Simply an easier to use version of the endpoint descriptor.