Mac Developer Library

Developer

USB.h Reference

Options
Deployment Target:

On This Page

USB.h Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import Kernel;

Included Headers

  • <libkern/OSByteOrder.h>

  • <IOKit/IOMemoryDescriptor.h>

  • <libkern/OSByteOrder.h>

  • <IOKit/IOTypes.h>

Functions

  • Declaration

    Objective-C

    #define iokit_usb_err(return) (sys_iokit|sub_iokit_usb|return)

    Discussion

    Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

    See Also

    IOUSBFamilyerrorcodes

  • Declaration

    Objective-C

    #define iokit_usb_msg(message) (UInt32)(sys_iokit|sub_iokit_usb|message)

    Discussion

    Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.1 and later.

    See Also

    IOUSBFamilymessagecodes

  • Declaration

    Objective-C

    #define EncodeRequest(request, direction, type, recipient) \ (((UInt16)request << 8) + \ ((UInt16)recipient + \ ((UInt16)type << kUSBRqTypeShift) + \ ((UInt16)direction << kUSBRqDirnShift)))

    Discussion

    Macro that encodes the bRequest and bRequestType fields of a IOUSBDevRequest into a single value. It is useful when one needs to know what type of request the IOUSBDevRequest encodes and simplifies comparisons.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    #define USBmakebmRequestType(direction, type, recipient) \ (((direction & kUSBRqDirnMask) << kUSBRqDirnShift) | \ ((type & kUSBRqTypeMask) << kUSBRqTypeShift) | \ (recipient & kUSBRqRecipientMask))

    Discussion

    Macro to encode the bRequest field of a Device Request. It is used when constructing an IOUSBDevRequest.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

Callbacks

  • Declaration

    Objective-C

    typedef void ( *IOUSBCompletionAction)( void *target, void *parameter, IOReturn status, UInt32 bufferSizeRemaining);

    Parameters

    target

    The target specified in the IOUSBCompletion struct.

    parameter

    The parameter specified in the IOUSBCompletion struct.

    status

    Completion status.

    bufferSizeRemaining

    Bytes left to be transferred.

    Discussion

    Function called when USB I/O completes.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef void ( *IOUSBCompletionActionWithTimeStamp)( void *target, void *parameter, IOReturn status, UInt32 bufferSizeRemaining, AbsoluteTime timeStamp);

    Parameters

    target

    The target specified in the IOUSBCompletion struct.

    parameter

    The parameter specified in the IOUSBCompletion struct.

    status

    Completion status.

    bufferSizeRemaining

    Bytes left to be transferred.

    timeStamp

    Time at which the transaction was processed.

    Discussion

    Function called when USB I/O completes.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.3 and later.

  • Declaration

    Objective-C

    typedef void ( *IOUSBIsocCompletionAction)( void *target, void *parameter, IOReturn status, IOUSBIsocFrame *pFrames);

    Parameters

    target

    The target specified in the IOUSBIsocCompletionn struct.

    parameter

    The parameter specified in the IOUSBIsocCompletion struct.

    status

    Completion status.

    pFrames

    Pointer to the frame list containing the status for each frame transferred.

    Discussion

    Function called when Isochronous USB I/O completes.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef void ( *IOUSBLowLatencyIsocCompletionAction)( void *target, void *parameter, IOReturn status, IOUSBLowLatencyIsocFrame *pFrames);

    Parameters

    target

    The target specified in the IOUSBLowLatencyIsocCompletion struct.

    parameter

    The parameter specified in the IOUSBLowLatencyIsocCompletion struct.

    status

    Completion status.

    pFrames

    Pointer to the low latency frame list containing the status for each frame transferred.

    Discussion

    Function called when Low Latency Isochronous USB I/O completes.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.2 and later.

Data Types

See the Overview section above for header-level documentation.

  • Declaration

    Objective-C

    typedef struct IOUSBBOSDescriptor IOUSBBOSDescriptor;

    Discussion

    BOS Descriptor for a USB Device. .

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.7 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBCompletion { void *target; IOUSBCompletionAction action; void *parameter; } IOUSBCompletion;

    Discussion

    Struct specifying action to perform when a USB I/O completes.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBCompletionWithTimeStamp { void *target; IOUSBCompletionActionWithTimeStamp action; void *parameter; } IOUSBCompletionWithTimeStamp;

    Discussion

    Struct specifying action to perform when a USB I/O completes.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.3 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBConfigurationDescHeader IOUSBConfigurationDescHeader;

    Discussion

    Header of a IOUSBConfigurationDescriptor. Used to get the total length of the descriptor.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.1 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBConfigurationDescriptor IOUSBConfigurationDescriptor;

    Discussion

    Standard USB Configuration Descriptor. It is variable length, so this only specifies the known fields. We use the wTotalLength field to read the whole descriptor. See the USB Specification at http://www.usb.org.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBDescriptorHeader IOUSBDescriptorHeader;

    Discussion

    Standard header used for all USB descriptors. Used to read the length of a descriptor so that we can allocate storage for the whole descriptor later on.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBDeviceCapabilityContainerID IOUSBDeviceCapabilityContainerID;

    Discussion

    Device Capability Container ID

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.7 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBDeviceCapabilityDescriptorHeader IOUSBDeviceCapabilityDescriptorHeader;

    Discussion

    Header for a Device Capability Descriptor for a USB Device. .

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.7 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBDeviceCapabilitySuperSpeedUSB IOUSBDeviceCapabilitySuperSpeedUSB;

    Discussion

    Device Capability SuperSpeed USB

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.7 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBDeviceCapabilityUSB2Extension IOUSBDeviceCapabilityUSB2Extension;

    Discussion

    Device Capability USB 2.0 Extension

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.7 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBDeviceDescriptor IOUSBDeviceDescriptor;

    Discussion

    Descriptor for a USB Device. See the USB Specification at http://www.usb.org.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBDeviceQualifierDescriptor IOUSBDeviceQualifierDescriptor;

    Discussion

    USB Device Qualifier Descriptor. See the USB Specification at http://www.usb.org.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.2 and later.

  • Declaration

    Objective-C

    typedef struct { UInt8 bmRequestType; UInt8 bRequest; UInt16 wValue; UInt16 wIndex; UInt16 wLength; void *pData; UInt32 wLenDone; } IOUSBDevRequest;

    Discussion

    Parameter block for control requests, using a simple pointer for the data to be transferred.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct { UInt8 bmRequestType; UInt8 bRequest; UInt16 wValue; UInt16 wIndex; UInt16 wLength; IOMemoryDescriptor *pData; UInt32 wLenDone; } IOUSBDevRequestDesc;

    Discussion

    Parameter block for control requests, using a memory descriptor for the data to be transferred. Only available in the kernel.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.6 and later.

  • Declaration

    Objective-C

    typedef struct { UInt8 bmRequestType; UInt8 bRequest; UInt16 wValue; UInt16 wIndex; UInt16 wLength; void *pData; UInt32 wLenDone; UInt32 noDataTimeout; UInt32 completionTimeout; } IOUSBDevRequestTO;

    Discussion

    Parameter block for control requests with timeouts, using a simple pointer for the data to be transferred. Same as a IOUSBDevRequest except for the two extra timeout fields.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.1 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBDFUDescriptor IOUSBDFUDescriptor;

    Discussion

    USB Device Firmware Update Descriptor. See the USB Device Firmware Update Specification at http://www.usb.org.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.2 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBEndpointDescriptor IOUSBEndpointDescriptor;

    Discussion

    Descriptor for a USB Endpoint. See the USB Specification at http://www.usb.org.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBEndpointProperties IOUSBEndpointProperties;

    Discussion

    Structure used with the IOUSBLib GetEndpointPropertiesV3 and GetPipePropertiesV3 API. Most of the fields are taken directly from corresponding Standard Endpoint Descriptor and SuperSpeed Endpoint Companion Descriptor. wBytesPerInterval will be synthesized for High Speed High Bandwidth Isochronous endpoints.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.8 and later.

  • Declaration

    Objective-C

    typedef struct { UInt8 type; UInt8 direction; UInt16 maxPacketSize; UInt8 interval; } IOUSBFindEndpointRequest;

    Discussion

    Struct used to find endpoints of an interface type and direction are used to match endpoints, type, direction, maxPacketSize and interval are updated with the properties of the found endpoint.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct { UInt16 bInterfaceClass; // requested class UInt16 bInterfaceSubClass; // requested subclass UInt16 bInterfaceProtocol; // requested protocol UInt16 bAlternateSetting; // requested alt setting } IOUSBFindInterfaceRequest;

    Discussion

    Structure used with FindNextInterface.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct { UInt64 frame; AbsoluteTime timeStamp; } IOUSBGetFrameStruct;

    Discussion

    Structure used from user space to return the frame number and a timestamp on when the frame register was read.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBHIDDescriptor IOUSBHIDDescriptor;

    Discussion

    USB HID Descriptor. See the USB HID Specification at http://www.usb.org. (This structure should have used the #pragma pack(1) compiler directive to get byte alignment.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBHIDReportDesc IOUSBHIDReportDesc;

    Discussion

    USB HID Report Descriptor header. See the USB HID Specification at http://www.usb.org. (This structure should have used the #pragma pack(1) compiler directive to get byte alignment.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBInterfaceAssociationDescriptor IOUSBInterfaceAssociationDescriptor;

    Discussion

    USB Inerface Association Descriptor. ECN to the USB 2.0 Spec. See the USB Specification at http://www.usb.org.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.3 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBInterfaceDescriptor IOUSBInterfaceDescriptor;

    Discussion

    Descriptor for a USB Interface. See the USB Specification at http://www.usb.org.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBIsocCompletion { void *target; IOUSBIsocCompletionAction action; void *parameter; } IOUSBIsocCompletion;

    Discussion

    Struct specifying action to perform when an Isochronous USB I/O completes.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBIsocFrame { IOReturn frStatus; UInt16 frReqCount; UInt16 frActCount; } IOUSBIsocFrame;

    Discussion

    Structure used to encode information about each isoc frame.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBLowLatencyIsocCompletion { void *target; IOUSBLowLatencyIsocCompletionAction action; void *parameter; } IOUSBLowLatencyIsocCompletion;

    Discussion

    Struct specifying action to perform when an Low Latency Isochronous USB I/O completes.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.2 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBLowLatencyIsocFrame IOUSBLowLatencyIsocFrame;

    Discussion

    Structure used to encode information about each isoc frame that is processed at hardware interrupt time (low latency).

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.2 and later.

  • Declaration

    Objective-C

    typedef struct IOUSBSuperSpeedEndpointCompanionDescriptor IOUSBSuperSpeedEndpointCompanionDescriptor;

    Discussion

    Descriptor for a SuperSpeed USB Endpoint Companion. See the USB Specification at http://www.usb.org.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.7 and later.

  • Declaration

    Objective-C

    typedef struct UASPipeDescriptor UASPipeDescriptor;

    Discussion

    Structure used to specify the Mass Storage Specific UAS pipe usage descriptor

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.8 and later.

  • Declaration

    Objective-C

    typedef enum { kUSBInformationDeviceIsCaptiveBit = 0, kUSBInformationDeviceIsAttachedToRootHubBit = 1, kUSBInformationDeviceIsInternalBit = 2, kUSBInformationDeviceIsConnectedBit = 3, kUSBInformationDeviceIsEnabledBit = 4, kUSBInformationDeviceIsSuspendedBit = 5, kUSBInformationDeviceIsInResetBit = 6, kUSBInformationDeviceOvercurrentBit = 7, kUSBInformationDevicePortIsInTestModeBit = 8, kUSBInformationDeviceIsRootHub = 9, kUSBInformationRootHubisBuiltIn = 10, kUSBInformationRootHubIsBuiltInBit = 10, kUSBInformationDeviceIsRemote = 11, kUSBInformationDeviceIsAttachedToEnclosure = 12, kUSBInformationDeviceIsOnThunderboltBit = 13, kUSBInformationDeviceIsCaptiveMask = ( 1 << kUSBInformationDeviceIsCaptiveBit), kUSBInformationDeviceIsAttachedToRootHubMask = ( 1 << kUSBInformationDeviceIsAttachedToRootHubBit), kUSBInformationDeviceIsInternalMask = ( 1 << kUSBInformationDeviceIsInternalBit), kUSBInformationDeviceIsConnectedMask = ( 1 << kUSBInformationDeviceIsConnectedBit), kUSBInformationDeviceIsEnabledMask = ( 1 << kUSBInformationDeviceIsEnabledBit), kUSBInformationDeviceIsSuspendedMask = ( 1 << kUSBInformationDeviceIsSuspendedBit), kUSBInformationDeviceIsInResetMask = ( 1 << kUSBInformationDeviceIsInResetBit), kUSBInformationDeviceOvercurrentMask = ( 1 << kUSBInformationDeviceOvercurrentBit), kUSBInformationDevicePortIsInTestModeMask = ( 1 << kUSBInformationDevicePortIsInTestModeBit), kUSBInformationDeviceIsRootHubMask = ( 1 << kUSBInformationDeviceIsRootHub), kUSBInformationRootHubisBuiltInMask = ( 1 << kUSBInformationRootHubisBuiltIn), kUSBInformationRootHubIsBuiltInMask = ( 1 << kUSBInformationRootHubIsBuiltInBit), kUSBInformationDeviceIsRemoteMask = ( 1 << kUSBInformationDeviceIsRemote), kUSBInformationDeviceIsAttachedToEnclosureMask = ( 1 << kUSBInformationDeviceIsAttachedToEnclosure), kUSBInformationDeviceIsOnThunderboltMask = ( 1 << kUSBInformationDeviceIsOnThunderboltBit) } USBDeviceInformationBits;

    Constants

    • kUSBInformationDeviceIsCaptiveBit

      kUSBInformationDeviceIsCaptiveBit

      The USB device is directly attached to its hub and cannot be removed.

      Available in OS X v10.6 and later.

    • kUSBInformationDeviceIsAttachedToRootHubBit

      kUSBInformationDeviceIsAttachedToRootHubBit

      The USB device is directly attached to the root hub

      Available in OS X v10.6 and later.

    • kUSBInformationDeviceIsInternalBit

      kUSBInformationDeviceIsInternalBit

      The USB device is internal to the enclosure (all the hubs it attaches to are captive)

      Available in OS X v10.6 and later.

    • kUSBInformationDeviceIsConnectedBit

      kUSBInformationDeviceIsConnectedBit

      The USB device is connected to its hub

      Available in OS X v10.6 and later.

    • kUSBInformationDeviceIsEnabledBit

      kUSBInformationDeviceIsEnabledBit

      The hub port to which the USB device is attached is enabled

      Available in OS X v10.6 and later.

    • kUSBInformationDeviceIsSuspendedBit

      kUSBInformationDeviceIsSuspendedBit

      The hub port to which the USB device is attached is suspended

      Available in OS X v10.6 and later.

    • kUSBInformationDeviceIsInResetBit

      kUSBInformationDeviceIsInResetBit

      The hub port to which the USB device is attached is being reset

      Available in OS X v10.6 and later.

    • kUSBInformationDeviceOvercurrentBit

      kUSBInformationDeviceOvercurrentBit

      The USB device generated an overcurrent

      Available in OS X v10.6 and later.

    • kUSBInformationDevicePortIsInTestModeBit

      kUSBInformationDevicePortIsInTestModeBit

      The hub port to which the USB device is attached is in test mode

      Available in OS X v10.6 and later.

    • kUSBInformationDeviceIsRootHub

      kUSBInformationDeviceIsRootHub

      The device is the root hub simulation

      Available in OS X v10.6 and later.

    • kUSBInformationRootHubisBuiltIn

      kUSBInformationRootHubisBuiltIn

      If this is a root hub simulation and it's built into the enclosure, this bit is set. If it's on an expansion card, it will be cleared

      Available in OS X v10.6 and later.

    • kUSBInformationDeviceIsRemote

      kUSBInformationDeviceIsRemote

      This device is "attached" to the controller through a remote connection

      Available in OS X v10.7 and later.

    • kUSBInformationDeviceIsAttachedToEnclosure

      kUSBInformationDeviceIsAttachedToEnclosure

      The hub port to which the USB device is connected has a USB connector on the enclosure

      Available in OS X v10.7 and later.

    • kUSBInformationDeviceIsOnThunderbolt

      kUSBInformationDeviceIsOnThunderbolt

      The USB device is downstream of a controller that is attached through Thunderbolt

    Discussion

    GetUSBDeviceInformation will return a unit32_t value with bits set indicating that a particular state is present in the USB device. These bits are described here

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.6 and later.

  • Declaration

    Objective-C

    typedef enum { kUSBLowLatencyWriteBuffer = 0, kUSBLowLatencyReadBuffer = 1, kUSBLowLatencyFrameListBuffer = 2 } USBLowLatencyBufferType;

    Constants

    • kUSBLowLatencyWriteBuffer

      kUSBLowLatencyWriteBuffer

      The buffer will be used to write data out to a device.

      Available in OS X v10.2 and later.

    • kUSBLowLatencyReadBuffer

      kUSBLowLatencyReadBuffer

      The buffer will be used to read data from a device.

      Available in OS X v10.2 and later.

    • kUSBLowLatencyFrameListBuffer

      kUSBLowLatencyFrameListBuffer

      The buffer will be used for a low latency isoch frame list.

      Available in OS X v10.2 and later.

    Discussion

    Used to specify what kind of buffer to create when calling LowLatencyCreateBuffer().

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.2 and later.

  • Declaration

    Objective-C

    typedef enum { kUSBNotificationPreForcedSuspend = ( 1 << kUSBNotificationPreForcedSuspendBit), kUSBNotificationPostForcedSuspend = ( 1 << kUSBNotificationPostForcedSuspendBit), kUSBNotificationPreForcedResume = ( 1 << kUSBNotificationPreForcedResumeBit), kUSBNotificationPostForcedResume = ( 1 << kUSBNotificationPostForcedResumeBit), } USBNotificationTypes;

    Constants

    • kUSBNotificationPreForcedSuspend

      kUSBNotificationPreForcedSuspend

      A notification is sent prior to a forced suspend (e.g. system sleep).

      Available in OS X v10.9 and later.

    • kUSBNotificationPostForcedSuspend

      kUSBNotificationPostForcedSuspend

      A notification is sent after a forced suspend has been completed (e.g. system sleep).

      Available in OS X v10.9 and later.

    • kUSBNotificationPreForcedResume

      kUSBNotificationPreForcedResume

      A notification is sent before a resume which happens after a forced suspend (e.g. system wake).

      Available in OS X v10.9 and later.

    • kUSBNotificationPostForcedResume

      kUSBNotificationPostForcedResume

      A notification is sent after a resume which happens after a forced suspend (e.g. system wake).

      Available in OS X v10.9 and later.

    Discussion

    Used to register for USB notifications. These types may be OR'd together if more than one notification is desired. These notification are expected to be acknowledged before the process (e.g. system sleep or system wake) can be continued. See RegisterForNotification and AcknowledgeNotification in IOUSBDeviceInterface and IOUSBInterfaceInterface.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.9 and later.

  • Declaration

    Objective-C

    typedef enum { kUSBPowerDuringSleep = 0, kUSBPowerDuringWake = 1, kUSBPowerRequestWakeRelease = 2, kUSBPowerRequestSleepRelease = 3, kUSBPowerRequestWakeReallocate = 4, kUSBPowerRequestSleepReallocate = 5, kUSBPowerDuringWakeRevocable = 6, kUSBPowerDuringWakeUSB3 = 7 } USBPowerRequestTypes;

    Constants

    • kUSBPowerDuringSleep

      kUSBPowerDuringSleep

      The power is to be used during sleep.

      Available in OS X v10.6 and later.

    • kUSBPowerDuringWake

      kUSBPowerDuringWake

      The power is to be used while the system is awake (i.e not sleeping)

      Available in OS X v10.6 and later.

    • kUSBPowerRequestWakeRelease

      kUSBPowerRequestWakeRelease

      When used with ReturnExtraPower(), it will send a message to all devices to return any extra wake power if possible.

      Available in OS X v10.7 and later.

    • kUSBPowerRequestSleepRelease

      kUSBPowerRequestSleepRelease

      When used with ReturnExtraPower(), it will send a message to all devices to return any sleep power if possible.

      Available in OS X v10.7 and later.

    • kUSBPowerRequestWakeReallocate

      kUSBPowerRequestWakeReallocate

      When used with ReturnExtraPower(), it will send a message to all devices indicating that they can ask for more wake power, as some device has released it.

      Available in OS X v10.7 and later.

    • kUSBPowerRequestSleepReallocate

      kUSBPowerRequestSleepReallocate

      When used with ReturnExtraPower(), it will send a message to all devices indicating that they can ask for more sleep power, as some device has released it.

      Available in OS X v10.7 and later.

    • kUSBPowerDuringWakeRevocable

      kUSBPowerDuringWakeRevocable

      The power is to be used while the system is awake (i.e not sleeping), but can be taken away (via the kUSBPowerRequestWakeRelease message). The system can then allocate that extra power to another device.

      Available in OS X v10.8 and later.

    • kUSBPowerDuringWakeUSB3

      kUSBPowerDuringWakeUSB3

      This is used by the USB stack to allocate the 400mA extra for USB3, above the 500ma allocated by USB2

      Available in OS X v10.8 and later.

    Discussion

    Used to specify what kind of power will be reserved using the IOUSBDevice RequestExtraPower and ReturnExtraPower APIs.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.6 and later.

  • Declaration

    Objective-C

    typedef enum { kUSBAddExtraResetTimeBit = 31, kUSBAddExtraResetTimeMask = ( 1 << kUSBAddExtraResetTimeBit) } USBReEnumerateOptions;

    Constants

    • kUSBAddExtraResetTimeBit

      kUSBAddExtraResetTimeBit

      Setting this bit will cause the Hub driver to wait 100ms before addressing the device after the reset following the re-enumeration.

      Available in OS X v10.3 and later.

    Discussion

    Options used when calling ReEnumerateDevice.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.3 and later.

  • Declaration

    Objective-C

    typedef UInt16 USBStatus;

    Discussion

    Type used to get a DeviceStatus as a single quantity.

    Import Statement

    Objective-C

    #include <USB.h>;

    Availability

    Available in OS X v10.0 and later.

  • Declaration

    Objective-C

    struct IOUSBBOSDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt16 wTotalLength; UInt8 bNumDeviceCaps; };

    Discussion

    BOS Descriptor for a USB Device. .

  • Declaration

    Objective-C

    struct IOUSBConfigurationDescHeader { UInt8 bLength; UInt8 bDescriptorType; UInt16 wTotalLength; };

    Discussion

    Header of a IOUSBConfigurationDescriptor. Used to get the total length of the descriptor.

  • Declaration

    Objective-C

    struct IOUSBConfigurationDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt16 wTotalLength; UInt8 bNumInterfaces; UInt8 bConfigurationValue; UInt8 iConfiguration; UInt8 bmAttributes; UInt8 MaxPower; };

    Discussion

    Standard USB Configuration Descriptor. It is variable length, so this only specifies the known fields. We use the wTotalLength field to read the whole descriptor. See the USB Specification at http://www.usb.org.

  • Declaration

    Objective-C

    struct IOUSBDescriptorHeader { UInt8 bLength; UInt8 bDescriptorType; };

    Discussion

    Standard header used for all USB descriptors. Used to read the length of a descriptor so that we can allocate storage for the whole descriptor later on.

  • Declaration

    Objective-C

    struct IOUSBDeviceCapabilityContainerID { UInt8 bLength; UInt8 bDescriptorType; UInt8 bDevCapabilityType; UInt8 bReservedID; UInt8 containerID[16]; };

    Discussion

    Device Capability Container ID

  • Declaration

    Objective-C

    struct IOUSBDeviceCapabilityDescriptorHeader { UInt8 bLength; UInt8 bDescriptorType; UInt8 bDevCapabilityType; UInt8 bNumDeviceCaps; };

    Discussion

    Header for a Device Capability Descriptor for a USB Device. .

  • Declaration

    Objective-C

    struct IOUSBDeviceCapabilitySuperSpeedUSB { UInt8 bLength; UInt8 bDescriptorType; UInt8 bDevCapabilityType; UInt8 bmAttributes; UInt16 wSpeedsSupported; UInt8 bFunctionalitySupport; UInt8 bU1DevExitLat; UInt16 wU2DevExitLat; };

    Discussion

    Device Capability SuperSpeed USB

  • Declaration

    Objective-C

    struct IOUSBDeviceCapabilityUSB2Extension { UInt8 bLength; UInt8 bDescriptorType; UInt8 bDevCapabilityType; UInt32 bmAttributes; };

    Discussion

    Device Capability USB 2.0 Extension

  • Declaration

    Objective-C

    struct IOUSBDeviceDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt16 bcdUSB; UInt8 bDeviceClass; UInt8 bDeviceSubClass; UInt8 bDeviceProtocol; UInt8 bMaxPacketSize0; UInt16 idVendor; UInt16 idProduct; UInt16 bcdDevice; UInt8 iManufacturer; UInt8 iProduct; UInt8 iSerialNumber; UInt8 bNumConfigurations; };

    Discussion

    Descriptor for a USB Device. See the USB Specification at http://www.usb.org.

  • Declaration

    Objective-C

    struct IOUSBDeviceQualifierDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt16 bcdUSB; UInt8 bDeviceClass; UInt8 bDeviceSubClass; UInt8 bDeviceProtocol; UInt8 bMaxPacketSize0; UInt8 bNumConfigurations; UInt8 bReserved; };

    Discussion

    USB Device Qualifier Descriptor. See the USB Specification at http://www.usb.org.

  • Declaration

    Objective-C

    struct IOUSBDFUDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bmAttributes; UInt16 wDetachTimeout; UInt16 wTransferSize; };

    Discussion

    USB Device Firmware Update Descriptor. See the USB Device Firmware Update Specification at http://www.usb.org.

  • Declaration

    Objective-C

    struct IOUSBEndpointDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bEndpointAddress; UInt8 bmAttributes; UInt16 wMaxPacketSize; UInt8 bInterval; };

    Discussion

    Descriptor for a USB Endpoint. See the USB Specification at http://www.usb.org.

  • Declaration

    Objective-C

    struct IOUSBEndpointProperties { UInt8 bVersion; UInt8 bAlternateSetting; UInt8 bDirection; UInt8 bEndpointNumber; UInt8 bTransferType; UInt8 bUsageType; UInt8 bSyncType; UInt8 bInterval; UInt16 wMaxPacketSize; UInt8 bMaxBurst; UInt8 bMaxStreams; UInt8 bMult; UInt16 wBytesPerInterval; };

    Fields

    bVersion

    Version of the structure. Currently kUSBEndpointPropertiesVersion3. Need to set this when using this structure

    bAlternateSetting

    Used as an input for GetEndpointPropertiesV3. Used as an output for GetPipePropertiesV3

    bDirection

    Used as an input for GetEndpointPropertiesV3. Used as an output for GetPipePropertiesV3. One of kUSBIn or kUSBOut.

    bEndpointNumber

    Used as an input for GetEndpointPropertiesV3. Used as an output for GetPipePropertiesV3

    bTransferType

    One of kUSBControl, kUSBBulk, kUSBIsoc, or kUSBInterrupt

    bUsageType

    For interrupt and isoc endpoints, the usage type. For Bulk endpoints of the UAS Mass Storage Protocol, the pipe ID.

    bSyncType

    For isoc endpoints only

    bInterval

    The bInterval field from the Standard Endpoint descriptor.

    wMaxPacketSize

    The meaning of this value depends on whether this is called with GetPipePropertiesV3 or GetEndpointPropertiesV3. See the documentation of those calls for more info.

    bMaxBurst

    For SuperSpeed endpoints, maximum number of packets the endpoint can send or receive as part of a burst

    bMaxStreams

    For SuperSpeed bulk endpoints, maximum number of streams this endpoint supports.

    bMult

    For SuperSpeed isoc endpoints, this is the mult value from the SuperSpeed Endpoint Companion Descriptor. For High Speed isoc and interrupt endpoints, this is bits 11 and 12 of the Standard Endpoint Descriptor, which represents a similar value.

    wBytesPerInterval

    For SuperSpeed interrupt and isoc endpoints, this is the wBytesPerInterval from the SuperSpeed Endpoint Companion Descriptor. For High Speed High Bandwidth isoc endpoints, this will be equal to wMaxPacketSize * (bMult+1).

    Discussion

    Structure used with the IOUSBLib GetEndpointPropertiesV3 and GetPipePropertiesV3 API. Most of the fields are taken directly from corresponding Standard Endpoint Descriptor and SuperSpeed Endpoint Companion Descriptor. wBytesPerInterval will be synthesized for High Speed High Bandwidth Isochronous endpoints.

  • Declaration

    Objective-C

    struct IOUSBHIDDescriptor { UInt8 descLen; UInt8 descType; UInt16 descVersNum; UInt8 hidCountryCode; UInt8 hidNumDescriptors; UInt8 hidDescriptorType; UInt8 hidDescriptorLengthLo; UInt8 hidDescriptorLengthHi; };

    Discussion

    USB HID Descriptor. See the USB HID Specification at http://www.usb.org. (This structure should have used the #pragma pack(1) compiler directive to get byte alignment.

  • Declaration

    Objective-C

    struct IOUSBHIDReportDesc { UInt8 hidDescriptorType; UInt8 hidDescriptorLengthLo; UInt8 hidDescriptorLengthHi; };

    Discussion

    USB HID Report Descriptor header. See the USB HID Specification at http://www.usb.org. (This structure should have used the #pragma pack(1) compiler directive to get byte alignment.

  • Declaration

    Objective-C

    struct IOUSBInterfaceAssociationDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bFirstInterface; UInt8 bInterfaceCount; UInt8 bFunctionClass; UInt8 bFunctionSubClass; UInt8 bFunctionProtocol; UInt8 iFunction; };

    Discussion

    USB Inerface Association Descriptor. ECN to the USB 2.0 Spec. See the USB Specification at http://www.usb.org.

  • Declaration

    Objective-C

    struct IOUSBInterfaceDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bInterfaceNumber; UInt8 bAlternateSetting; UInt8 bNumEndpoints; UInt8 bInterfaceClass; UInt8 bInterfaceSubClass; UInt8 bInterfaceProtocol; UInt8 iInterface; };

    Discussion

    Descriptor for a USB Interface. See the USB Specification at http://www.usb.org.

  • Declaration

    Objective-C

    struct IOUSBLowLatencyIsocFrame { IOReturn frStatus; UInt16 frReqCount; UInt16 frActCount; AbsoluteTime frTimeStamp; };

    Fields

    frStatus

    Returns status associated with the frame.

    frReqCount

    Input specifiying how many bytes to read or write.

    frActCount

    Actual # of bytes transferred.

    frTimeStamp

    Time stamp that indicates time when frame was procesed.

    Discussion

    Structure used to encode information about each isoc frame that is processed at hardware interrupt time (low latency).

  • Declaration

    Objective-C

    struct IOUSBSuperSpeedEndpointCompanionDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bMaxBurst; UInt8 bmAttributes; UInt16 wBytesPerInterval; };

    Discussion

    Descriptor for a SuperSpeed USB Endpoint Companion. See the USB Specification at http://www.usb.org.

  • Declaration

    Objective-C

    struct UASPipeDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bPipeID; UInt8 bReserved; };

    Discussion

    Structure used to specify the Mass Storage Specific UAS pipe usage descriptor

Constants

See the Overview section above for header-level documentation.

  • Public Interfaces to the USB implementation in Mac OS X.

    Declaration

    Objective-C

    #define HostToUSBLong OSSwapHostToLittleInt32 #define HostToUSBWord OSSwapHostToLittleInt16 #define USBToHostLong OSSwapLittleToHostInt32 #define USBToHostWord OSSwapLittleToHostInt16

    Constants

    • HostToUSBLong

      HostToUSBLong

      The USB API's use a convention of specifying parameters in the host order. The USB spec specifies that multi-byte items should be formatted in little endian order. The following macros allow one to translate multi-byte values from Host order to USB order and vice versa. There are separate macros for in-kernel use and for user space use.

      Available in OS X v10.0 and later.

    • HostToUSBWord

      HostToUSBWord

      The USB API's use a convention of specifying parameters in the host order. The USB spec specifies that multi-byte items should be formatted in little endian order. The following macros allow one to translate multi-byte values from Host order to USB order and vice versa. There are separate macros for in-kernel use and for user space use.

      Available in OS X v10.0 and later.

    • USBToHostLong

      USBToHostLong

      The USB API's use a convention of specifying parameters in the host order. The USB spec specifies that multi-byte items should be formatted in little endian order. The following macros allow one to translate multi-byte values from Host order to USB order and vice versa. There are separate macros for in-kernel use and for user space use.

      Available in OS X v10.0 and later.

    • USBToHostWord

      USBToHostWord

      The USB API's use a convention of specifying parameters in the host order. The USB spec specifies that multi-byte items should be formatted in little endian order. The following macros allow one to translate multi-byte values from Host order to USB order and vice versa. There are separate macros for in-kernel use and for user space use.

      Available in OS X v10.0 and later.

    Discussion

    This header file contains definitions and structures that are used in the different USB API's in Mac OS X, both in the kernel and in the user space.

  • Declaration

    Objective-C

    #define kIOUSBBitstufErr // 0xe0004002 Pipe stall, bitstuffing #define kIOUSBBufferOverrunErr // 0xe000400c Buffer Overrun (Host hardware failure on data out, PCI busy?) #define kIOUSBBufferUnderrunErr // 0xe000400d Buffer Underrun (Host hardware failure on data out, PCI busy?) #define kIOUSBClearPipeStallNotRecursive // 0xe0004048 IOUSBPipe::ClearPipeStall should not be called recursively #define kIOUSBConfigNotFound // 0xe0004056 Configuration Not found #define kIOUSBCRCErr // 0xe0004001 Pipe stall, bad CRC #define kIOUSBDataToggleErr // 0xe0004003 Pipe stall, Bad data toggle #define kIOUSBDeviceCountExceeded // 0xe0004045 The device cannot be enumerated because the controller cannot support more devices #define kIOUSBDeviceNotHighSpeed // 0xe0004049 Name is deprecated, see below #define kIOUSBDevicePortWasNotSuspended // 0xe0004047 Port was not suspended #define kIOUSBDeviceTransferredToCompanion // 0xe0004049 The device has been tranferred to another controller for enumeration #define kIOUSBEndpointCountExceeded // 0xe0004046 The endpoint was not created because the controller cannot support more endpoints #define kIOUSBEndpointNotFound // 0xe0004057 Endpoint Not found #define kIOUSBHighSpeedSplitError // 0xe000404b Error to hub on high speed bus trying to do split transaction #define kIOUSBInterfaceNotFound // 0xe000404e Interface ref not recognized #define kIOUSBInvalidSSEndpoint // 0xe0004043 An endpoint found in a SuperSpeed device is invalid (usually because there is no Endpoint Companion Descriptor) /*! */ #define kIOUSBLinkErr // 0xe0004010 #define kIOUSBLowLatencyBufferNotPreviouslyAllocated // 0xe000404d Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the data buffer) first #define kIOUSBLowLatencyFrameListNotPreviouslyAllocated // 0xe000404c Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the frame list) first #define kIOUSBNoAsyncPortErr // 0xe000405f no async port #define kIOUSBNotEnoughPipesErr // 0xe000405e not enough pipes in interface #define kIOUSBNotEnoughPowerErr // 0xe000405d not enough power for selected configuration #define kIOUSBNotSent1Err // 0xe000400e Transaction not sent #define kIOUSBNotSent2Err // 0xe000400f Transaction not sent #define kIOUSBPIDCheckErr // 0xe0004006 Pipe stall, PID CRC error #define kIOUSBPipeStalled // 0xe000404f Pipe has stalled, error needs to be cleared #define kIOUSBReserved1Err // 0xe000400a Reserved #define kIOUSBReserved2Err // 0xe000400b Reserved #define kIOUSBStreamsNotSupported // 0xe0004044 The request cannot be completed because the XHCI controller does not support streams #define kIOUSBSyncRequestOnWLThread // 0xe000404a A synchronous USB request was made on the workloop thread (from a callback?). Only async requests are permitted in that case #define kIOUSBTooManyPipesErr // 0xe0004060 Too many pipes #define kIOUSBTooManyTransactionsPending // 0xe0004042 The transaction cannot be submitted because it would exceed the allowed number of pending transactions #define kIOUSBTransactionReturned // 0xe0004050 The transaction has been returned to the caller #define kIOUSBTransactionTimeout // 0xe0004051 Transaction timed out #define kIOUSBUnknownPipeErr // 0xe0004061 Pipe ref not recognized #define kIOUSBWrongPIDErr // 0xe0004007 Pipe stall, Bad or wrong PID

    Constants

    • kIOUSBBitstufErr

      kIOUSBBitstufErr

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBBufferOverrunErr

      kIOUSBBufferOverrunErr

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBBufferUnderrunErr

      kIOUSBBufferUnderrunErr

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBClearPipeStallNotRecursive

      kIOUSBClearPipeStallNotRecursive

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBConfigNotFound

      kIOUSBConfigNotFound

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.0 and later.

    • kIOUSBCRCErr

      kIOUSBCRCErr

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBDataToggleErr

      kIOUSBDataToggleErr

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBDeviceCountExceeded

      kIOUSBDeviceCountExceeded

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBDeviceNotHighSpeed

      kIOUSBDeviceNotHighSpeed

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.4 and later.

    • kIOUSBDevicePortWasNotSuspended

      kIOUSBDevicePortWasNotSuspended

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.6 and later.

    • kIOUSBDeviceTransferredToCompanion

      kIOUSBDeviceTransferredToCompanion

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBEndpointCountExceeded

      kIOUSBEndpointCountExceeded

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBEndpointNotFound

      kIOUSBEndpointNotFound

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.0 and later.

    • kIOUSBHighSpeedSplitError

      kIOUSBHighSpeedSplitError

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.3 and later.

    • kIOUSBInterfaceNotFound

      kIOUSBInterfaceNotFound

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.0 and later.

    • kIOUSBInvalidSSEndpoint

      kIOUSBInvalidSSEndpoint

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.8 and later.

    • kIOUSBLinkErr

      kIOUSBLinkErr

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBLowLatencyBufferNotPreviouslyAllocated

      kIOUSBLowLatencyBufferNotPreviouslyAllocated

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.2 and later.

    • kIOUSBLowLatencyFrameListNotPreviouslyAllocated

      kIOUSBLowLatencyFrameListNotPreviouslyAllocated

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.2 and later.

    • kIOUSBNoAsyncPortErr

      kIOUSBNoAsyncPortErr

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.0 and later.

    • kIOUSBNotEnoughPipesErr

      kIOUSBNotEnoughPipesErr

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.0 and later.

    • kIOUSBNotEnoughPowerErr

      kIOUSBNotEnoughPowerErr

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.0 and later.

    • kIOUSBNotSent1Err

      kIOUSBNotSent1Err

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBNotSent2Err

      kIOUSBNotSent2Err

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBPIDCheckErr

      kIOUSBPIDCheckErr

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBPipeStalled

      kIOUSBPipeStalled

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.0 and later.

    • kIOUSBReserved1Err

      kIOUSBReserved1Err

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBReserved2Err

      kIOUSBReserved2Err

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

    • kIOUSBStreamsNotSupported

      kIOUSBStreamsNotSupported

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBSyncRequestOnWLThread

      kIOUSBSyncRequestOnWLThread

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.3 and later.

    • kIOUSBTooManyPipesErr

      kIOUSBTooManyPipesErr

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.0 and later.

    • kIOUSBTooManyTransactionsPending

      kIOUSBTooManyTransactionsPending

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.9 and later.

    • kIOUSBTransactionReturned

      kIOUSBTransactionReturned

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBTransactionTimeout

      kIOUSBTransactionTimeout

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBUnknownPipeErr

      kIOUSBUnknownPipeErr

      Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.0 and later.

    • kIOUSBWrongPIDErr

      kIOUSBWrongPIDErr

      These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. For the following Completion codes, we return a generic IOKit error instead of a USB specific error.

      • Completion Code Error Returned Description
      • 9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
      • 8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
      • 5 kIOReturnNotResponding Device Not responding
      • 4 kIOUSBPipeStalled Endpoint returned a STALL PID

      Available in OS X v10.1 and later.

  • Declaration

    Objective-C

    #define kIOUSBMessageCompositeDriverReconfigured // 0xe0004011 Message from the composite driver indicating that it has finished re-configuring the device after a reset #define kIOUSBMessageController // 0xe0004015 Generic message sent from controller user client to controllers #define kIOUSBMessageDeviceCountExceeded // 0xe000401a Message sent by a hub when a device cannot be enumerated because the USB controller ran out of resources #define kIOUSBMessageEndpointCountExceeded // 0xe0004019 Message sent to a device when endpoints cannot be created because the USB controller ran out of resources #define kIOUSBMessageExpressCardCantWake // 0xe0004010 Message from a driver to a bus that an express card will disconnect on sleep and thus shouldn't wake #define kIOUSBMessageFromThirdParty // 0xe000400e Message sent from a third party. Uses IOUSBThirdPartyParam to encode the sender's ID #define kIOUSBMessageHubIsDeviceConnected // 0xe0004004 Message sent to a hub to inquire whether a particular port has a device connected or not #define kIOUSBMessageHubIsPortEnabled // 0xe0004005 Message sent to a hub to inquire whether a particular port is enabled or not #define kIOUSBMessageHubPortClearTT // 0xe000400c Message sent to a hub to clear the transaction translator #define kIOUSBMessageHubPortDeviceDisconnected // 0xe000401b Message sent by a built-in hub when a device was disconnected #define kIOUSBMessageHubReEnumeratePort // 0xe0004006 Message sent to a hub to reenumerate the device attached to a particular port #define kIOUSBMessageHubResetPort // 0xe0004001 Message sent to a hub to reset a particular port #define kIOUSBMessageHubResumePort // 0xe0004003 Message sent to a hub to resume a particular port #define kIOUSBMessageHubSetPortRecoveryTime // 0xe0004012 Message sent to a hub to set the # of ms required when resuming a particular port #define kIOUSBMessageHubSuspendPort // 0xe0004002 Message sent to a hub to suspend a particular port #define kIOUSBMessageNotEnoughPower // 0xe0004014 Message sent to the clients of the device's hub parent, when a device causes an low power notice to be displayed. The message argument contains the locationID of the device #define kIOUSBMessageOvercurrentCondition // 0xe0004013 Message sent to the clients of the device's hub parent, when a device causes an overcurrent condition. The message argument contains the locationID of the device #define kIOUSBMessagePortHasBeenReset // 0xe000400a Message sent to a device indicating that the port it is attached to has been reset #define kIOUSBMessagePortHasBeenResumed // 0xe000400b Message sent to a device indicating that the port it is attached to has been resumed #define kIOUSBMessagePortHasBeenSuspended // 0xe000400d Message sent to a device indicating that the port it is attached to has been suspended #define kIOUSBMessagePortWasNotSuspended // 0xe000400f Message indicating that the hub driver received a resume request for a port that was not suspended #define kIOUSBMessageReallocateExtraCurrent // 0xe0004018 Message to ask any clients using extra current to attempt to allocate it some more #define kIOUSBMessageReleaseExtraCurrent // 0xe0004017 Message to ask any clients using extra current to release it if possible #define kIOUSBMessageRootHubWakeEvent // 0xe0004016 Message from the HC Wakeup code indicating that a Root Hub port has a wake event #define kIOUSBMessageUnsupportedConfiguration // 0xe000401c Message sent to the clients of the device when a device is not supported in the current configuration. The message argument contains the locationID of the device

    Constants

    • kIOUSBMessageCompositeDriverReconfigured

      kIOUSBMessageCompositeDriverReconfigured

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.4 and later.

    • kIOUSBMessageController

      kIOUSBMessageController

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBMessageDeviceCountExceeded

      kIOUSBMessageDeviceCountExceeded

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBMessageEndpointCountExceeded

      kIOUSBMessageEndpointCountExceeded

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBMessageExpressCardCantWake

      kIOUSBMessageExpressCardCantWake

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.4 and later.

    • kIOUSBMessageFromThirdParty

      kIOUSBMessageFromThirdParty

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.3 and later.

    • kIOUSBMessageHubIsDeviceConnected

      kIOUSBMessageHubIsDeviceConnected

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBMessageHubIsPortEnabled

      kIOUSBMessageHubIsPortEnabled

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBMessageHubPortClearTT

      kIOUSBMessageHubPortClearTT

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.3 and later.

    • kIOUSBMessageHubPortDeviceDisconnected

      kIOUSBMessageHubPortDeviceDisconnected

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBMessageHubReEnumeratePort

      kIOUSBMessageHubReEnumeratePort

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBMessageHubResetPort

      kIOUSBMessageHubResetPort

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBMessageHubResumePort

      kIOUSBMessageHubResumePort

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBMessageHubSetPortRecoveryTime

      kIOUSBMessageHubSetPortRecoveryTime

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.5 and later.

    • kIOUSBMessageHubSuspendPort

      kIOUSBMessageHubSuspendPort

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBMessageNotEnoughPower

      kIOUSBMessageNotEnoughPower

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.6 and later.

    • kIOUSBMessageOvercurrentCondition

      kIOUSBMessageOvercurrentCondition

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.6 and later.

    • kIOUSBMessagePortHasBeenReset

      kIOUSBMessagePortHasBeenReset

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBMessagePortHasBeenResumed

      kIOUSBMessagePortHasBeenResumed

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.1 and later.

    • kIOUSBMessagePortHasBeenSuspended

      kIOUSBMessagePortHasBeenSuspended

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.3 and later.

    • kIOUSBMessagePortWasNotSuspended

      kIOUSBMessagePortWasNotSuspended

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.4 and later.

    • kIOUSBMessageReallocateExtraCurrent

      kIOUSBMessageReallocateExtraCurrent

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBMessageReleaseExtraCurrent

      kIOUSBMessageReleaseExtraCurrent

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBMessageRootHubWakeEvent

      kIOUSBMessageRootHubWakeEvent

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.7 and later.

    • kIOUSBMessageUnsupportedConfiguration

      kIOUSBMessageUnsupportedConfiguration

      Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.

      Available in OS X v10.9 and later.

  • Declaration

    Objective-C

    #define kConfigurationDescriptorOverride "ConfigurationDescriptorOverride" #define kOverrideIfAtLocationID "OverrideIfAtLocationID" #define kUSBControllerNeedsContiguousMemoryForIsoch "Need contiguous memory for isoch" #define kUSBDevicePropertyAddress "USB Address" #define kUSBDevicePropertyBusPowerAvailable "Bus Power Available" #define kUSBDevicePropertyLocationID "locationID" #define kUSBDevicePropertySpeed "Device Speed" #define kUSBDeviceResumeRecoveryTime "kUSBDeviceResumeRecoveryTime" #define kUSBExpressCardCantWake "ExpressCardCantWake" #define kUSBHubDontAllowLowPower "kUSBHubDontAllowLowPower" #define kUSBOutOfSpecMPSOK "Out of spec MPS OK" #define kUSBPreferredConfiguration "Preferred Configuration" #define kUSBProductIDMask "idProductMask" #define kUSBProductIdsArrayName "idProductArray" #define kUSBSuspendPort "kSuspendPort"

    Constants

    • kConfigurationDescriptorOverride

      kConfigurationDescriptorOverride

      Useful property names in USB land.

      Available in OS X v10.7 and later.

    • kOverrideIfAtLocationID

      kOverrideIfAtLocationID

      Useful property names in USB land.

      Available in OS X v10.7 and later.

    • kUSBControllerNeedsContiguousMemoryForIsoch

      kUSBControllerNeedsContiguousMemoryForIsoch

      Useful property names in USB land.

      Available in OS X v10.4 and later.

    • kUSBDevicePropertyAddress

      kUSBDevicePropertyAddress

      Useful property names in USB land.

      Available in OS X v10.0 and later.

    • kUSBDevicePropertyBusPowerAvailable

      kUSBDevicePropertyBusPowerAvailable

      Useful property names in USB land.

      Available in OS X v10.0 and later.

    • kUSBDevicePropertyLocationID

      kUSBDevicePropertyLocationID

      Useful property names in USB land.

      Available in OS X v10.0 and later.

    • kUSBDevicePropertySpeed

      kUSBDevicePropertySpeed

      Useful property names in USB land.

      Available in OS X v10.0 and later.

    • kUSBDeviceResumeRecoveryTime

      kUSBDeviceResumeRecoveryTime

      Useful property names in USB land.

      Available in OS X v10.5 and later.

    • kUSBExpressCardCantWake

      kUSBExpressCardCantWake

      Useful property names in USB land.

      Available in OS X v10.4 and later.

    • kUSBHubDontAllowLowPower

      kUSBHubDontAllowLowPower

      Useful property names in USB land.

      Available in OS X v10.5 and later.

    • kUSBOutOfSpecMPSOK

      kUSBOutOfSpecMPSOK

      Useful property names in USB land.

      Available in OS X v10.6 and later.

    • kUSBPreferredConfiguration

      kUSBPreferredConfiguration

      Useful property names in USB land.

      Available in OS X v10.4 and later.

    • kUSBProductIDMask

      kUSBProductIDMask

      Useful property names in USB land.

      Available in OS X v10.4 and later.

    • kUSBProductIdsArrayName

      kUSBProductIdsArrayName

      Useful property names in USB land.

      Available in OS X v10.7 and later.

    • kUSBSuspendPort

      kUSBSuspendPort

      Useful property names in USB land.

      Available in OS X v10.4 and later.

  • Declaration

    Objective-C

    #define kCallInterfaceOpenWithGate "kCallInterfaceOpenWithGate"

    Constants

    • kCallInterfaceOpenWithGate

      kCallInterfaceOpenWithGate

      If the USB Device has this property, drivers for any of its interfaces will have their handleOpen method called while holding the workloop gate.

      Available in OS X v10.3 and later.

  • Declaration

    Objective-C

    enum { kUSBRqDirnShift = 7, kUSBRqDirnMask = 1, kUSBRqTypeShift = 5, kUSBRqTypeMask = 3, kUSBRqRecipientMask = 0X1F };

    Discussion

    These are used to create the macro to encode the bRequest filed of a Device Request

  • Declaration

    Objective-C

    enum { kUSBDefaultControlNoDataTimeoutMS = 5000, kUSBDefaultControlCompletionTimeoutMS = 0 };

    Discussion

    default values used for data and completion timeouts.

  • Declaration

    Objective-C

    enum { kIOUSBInterfaceOpenAlt = 0x00010000, kIOUSBInterfaceOpenAlternateInterfaceBit = 16, kUSBOptionBitOpenExclusivelyBit = 17, kIOUSBInterfaceOpenAlternateInterfaceMask = ( 1 << kIOUSBInterfaceOpenAlternateInterfaceBit ), kUSBOptionBitOpenExclusivelyMask = ( 1 << kUSBOptionBitOpenExclusivelyBit ) };

    Constants

    • kIOUSBInterfaceOpenAlt

      kIOUSBInterfaceOpenAlt

      Open the alternate interface specified when creating the interface.

      Available in OS X v10.6 and later.

    • kUSBOptionBitOpenExclusivelyBit

      kUSBOptionBitOpenExclusivelyBit

      Used in open()'ing the IOUSBDevice or IOUSBInterface by the corresponding user client. Only 1 user client can have exclusive access to those objects

      Available in OS X v10.8 and later.

    Discussion

    Options used exclusively by the USB Family when calling calling IOService APIs, such as open() and close().

  • Declaration

    Objective-C

    enum { kIOUSBFindInterfaceDontCare = 0xFFFF };

    Discussion

    Constant that can be used for the fields of IOUSBFindInterfaceRequest to specify that they should not be matched.

  • Declaration

    Objective-C

    enum { kIOUSBVendorIDAppleComputer = 0x05AC, kIOUSBVendorIDApple = 0x05AC };

    Discussion

    USB Vendor ID for Apple, Inc.

  • Declaration

    Objective-C

    enum { kUSBMaxFSIsocEndpointReqCount = 1023, // max size (bytes ) of any one Isoc frame for 1 FS endpoint kUSBMaxHSIsocEndpointReqCount = 3072, // max size (bytes ) of any one Isoc frame for 1 HS endpoint kUSBMaxHSIsocFrameCount = 7168 // max size (bytes ) of all Isoc transfers in a HS frame };

    Discussion

    Maximum size in bytes allowed for one Isochronous frame

  • Declaration

    Objective-C

    enum { kUSBFullSpeedMicrosecondsInFrame = 1000, kUSBHighSpeedMicrosecondsInFrame = 125 };

    Constants

    • kUSBFullSpeedMicrosecondsInFrame

      kUSBFullSpeedMicrosecondsInFrame

      The device is attached to a bus running at full speed (1 ms / frame).

      Available in OS X v10.2 and later.

    • kUSBHighSpeedMicrosecondsInFrame

      kUSBHighSpeedMicrosecondsInFrame

      The device is attached to a bus running at high speed (125 microseconds / frame).

      Available in OS X v10.2 and later.

    Discussion

    Returns the number of microseconds in a USB frame.

  • Declaration

    Objective-C

    enum { kUSBDeviceIDShift = 7, kUSBMaxDevices = 128, kUSBMaxDevice = kUSBMaxDevices-1, kUSBDeviceIDMask = 0x7f, kUSBPipeIDMask = 0xf, kUSBMaxPipes = 32, // In and Out pipes can have same pipe number. kUSBInterfaceIDShift = 8, kUSBMaxInterfaces = 1 << kUSBInterfaceIDShift, kUSBInterfaceIDMask = kUSBMaxInterfaces-1, kUSBEndPtShift = 7, kUSBDeviceMask = ( ( 1 << kUSBEndPtShift ) -1), kUSBNoPipeIdx = -1, // Constants for streams kUSBStream0 = 0, kUSBMaxStream = 65533, kUSBPRimeStream = 0xfffe, kUSBNoStream = 0xffff, kUSBAllStreams = 0xffffffff };

  • Declaration

    Objective-C

    enum { kClearDeviceFeature = ( ( ( UInt16)kUSBRqClearFeature << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kClearInterfaceFeature = ( ( ( UInt16)kUSBRqClearFeature << 8) + ( ( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kClearEndpointFeature = ( ( ( UInt16)kUSBRqClearFeature << 8) + ( ( UInt16) kUSBEndpoint + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kGetConfiguration = ( ( ( UInt16)kUSBRqGetConfig << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kGetDescriptor = ( ( ( UInt16)kUSBRqGetDescriptor << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kGetInterface = ( ( ( UInt16)kUSBRqGetInterface << 8) + ( ( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kGetDeviceStatus = ( ( ( UInt16)kUSBRqGetStatus << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kGetInterfaceStatus = ( ( ( UInt16)kUSBRqGetStatus << 8) + ( ( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kGetEndpointStatus = ( ( ( UInt16)kUSBRqGetStatus << 8) + ( ( UInt16) kUSBEndpoint + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kSetAddress = ( ( ( UInt16)kUSBRqSetAddress << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kSetConfiguration = ( ( ( UInt16)kUSBRqSetConfig << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kSetDescriptor = ( ( ( UInt16)kUSBRqSetDescriptor << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kSetDeviceFeature = ( ( ( UInt16)kUSBRqSetFeature << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kSetInterfaceFeature = ( ( ( UInt16)kUSBRqSetFeature << 8) + ( ( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kSetEndpointFeature = ( ( ( UInt16)kUSBRqSetFeature << 8) + ( ( UInt16) kUSBEndpoint + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kSetInterface = ( ( ( UInt16)kUSBRqSetInterface << 8) + ( ( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kSyncFrame = ( ( ( UInt16)kUSBRqSyncFrame << 8) + ( ( UInt16) kUSBEndpoint + ( ( UInt16) kUSBStandard << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), };

    Discussion

    Encoding of the standard device requests.

    • bmRequestType bRequest wValue wIndex wLength Data
    • 00000000B CLEAR_FEATURE Feature Zero Zero None (device)
    • 00000001B Feature Interface Zero None (Interface)
    • 00000010B Feature Endpoint Zero None (Endpoint)
    • 10000000B GET_CONFIGURATION Zero Zero One Configuration
    • 10000000B GET_DESCRIPTOR Type LangID Length Descriptor
    • 10000001B GET_INTERFACE Zero Interface One Alternate
    • 10000000B GET_STATUS Zero Zero Two status (device)
    • 10000001B Zero Interface Two status (Interface)
    • 10000010B Zero Endpoint Two status (Endpoint)
    • 00000000B SET_ADDRESS Address Zero Zero None
    • 00000000B SET_CONFIGURATION Configuration Zero Zero None
    • 00000000B SET_DESCRIPTOR Type LangID Length Descriptor
    • 00000000B SET_FEATURE Feature Zero Zero None (device)
    • 00000001B Feature Interface Zero None (Interface)
    • 00000010B Feature Endpoint Zero None (Endpoint)
    • 00000001B SET_INTERFACE Alternate Interface Zero None
    • 10000010B SYNCH_FRAME Zero Endpoint Two Frame Number

  • Declaration

    Objective-C

    enum { kUSBDeviceSpeedLow = 0, kUSBDeviceSpeedFull = 1, kUSBDeviceSpeedHigh = 2, kUSBDeviceSpeedSuper = 3 };

    Constants

    • kUSBDeviceSpeedLow

      kUSBDeviceSpeedLow

      The device is a low speed device.

      Available in OS X v10.0 and later.

    • kUSBDeviceSpeedFull

      kUSBDeviceSpeedFull

      The device is a full speed device.

      Available in OS X v10.0 and later.

    • kUSBDeviceSpeedHigh

      kUSBDeviceSpeedHigh

      The device is a high speed device.

      Available in OS X v10.2 and later.

    • kUSBDeviceSpeedSuper

      kUSBDeviceSpeedSuper

      The device is a SuperSpeed device

      Available in OS X v10.7 and later.

    Discussion

    Returns the speed of a particular USB device.

  • Declaration

    Objective-C

    enum { kUSBEndpointPropertiesVersion3 = 0x03 };

    Constants

    • kUSBEndpointPropertiesVersion3

      kUSBEndpointPropertiesVersion3

      Version that has support for USB3 SuperSpeed Endpoint Companion fields.

      Available in OS X v10.8 and later.

    Discussion

    Version of the IOUSBEndpointProperties structure.