Ссылка USBHub.h
Константы и определения используются с устройствами Концентратора.
Включенные заголовки
<IOKit/usb/USB.h>
<IOKit/usb/USBSpec.h>
Посмотрите раздел Overview выше для документации уровня заголовка.
-
Объявление
Objective C
typedef struct IOUSBHubPortReEnumerateParam IOUSBHubPortReEnumerateParam;
Обсуждение
Используемый для указания порта, который должен быть повторно перечислен
Оператор импорта
Objective C
#include <USBHub.h>;
Доступность
Доступный в OS X v10.1 и позже.
-
Объявление
Objective C
typedef struct IOUSBHubStatus IOUSBHubStatus;
Обсуждение
Используемый для получения состояния порта и использования флагов изменения GetPortStatus ()
Оператор импорта
Objective C
#include <USBHub.h>;
Доступность
Доступный в OS X v10.0 и позже.
-
Объявление
Objective C
struct IOUSBHubDescriptor { UInt8 length; UInt8 hubType; UInt8 numPorts; UInt16 characteristics __attribute__((packed)); UInt8 powerOnToGood; // Port settling time, in 2ms UInt8 hubCurrent; // These are received packed, will have to be unpacked UInt8 removablePortFlags[kNumPortBytes]; UInt8 pwrCtlPortFlags[kNumPortBytes]; };
Обсуждение
Дескриптор концентратора USB. Посмотрите USB спецификация HID в http://www .usb.org.
-
Объявление
Objective C
struct IOUSBHubStatus { UInt16 statusFlags; UInt16 changeFlags; };
Обсуждение
Используемый для получения состояния порта и использования флагов изменения GetPortStatus ()
Посмотрите раздел Overview выше для документации уровня заголовка.
-
Объявление
Objective C
enum { kUSBHubDescriptorType = 0x29, kUSB3HubDescriptorType = 0x2A };
-
Объявление
Objective C
enum { kClearHubFeature = ( ( ( UInt16)kUSBRqClearFeature << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kClearPortFeature = ( ( ( UInt16)kUSBRqClearFeature << 8) + ( ( UInt16) kUSBOther + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kGetPortState = ( ( ( UInt16)kUSBRqGetState << 8) + ( ( UInt16) kUSBOther + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kGetHubDescriptor = ( ( ( UInt16)kUSBRqGetDescriptor << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kGetHub3Descriptor = ( ( ( UInt16)kUSBRqGetDescriptor << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kGetHubStatus = ( ( ( UInt16)kUSBRqGetStatus << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kGetPortStatus = ( ( ( UInt16)kUSBRqGetStatus << 8) + ( ( UInt16) kUSBOther + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBIn << kUSBRqDirnShift ))), kSetHubDescriptor = ( ( ( UInt16)kUSBRqGetDescriptor << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kSetHubFeature = ( ( ( UInt16)kUSBRqSetFeature << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))), kSetPortFeature = ( ( ( UInt16)kUSBRqSetFeature << 8) + ( ( UInt16) kUSBOther + ( ( UInt16) kUSBClass << kUSBRqTypeShift ) + ( ( UInt16) kUSBOut << kUSBRqDirnShift ))) };
Обсуждение
Кодирование концентратора определенные стандартные запросы
Request bmRequestType bRequest wValue wIndex wLength Data
ClearHubFeature 0010 0000B CLEAR_FEATURE Feature Zero Zero None
ClearPortFeature 0010 0011B Feature Port Zero None
GetBusState 1010 0011B GET_STATE Zero Port One Port Bus State
GetHubDescriptor 1010 0000B GET_DESCRIPTOR Type Zero Length Descriptor
GetHubStatus 1010 0000B GET_STATUS Zero Zero Four Hub Status
GetPortStatus 1010 0011B Zero Port Four Port Status
SetHubDescriptor 0010 0000B SET_DESCRIPTOR Type Zero Length Descriptor
SetHubFeature 0010 0000B SET_FEATURE Feature Zero Zero None
SetPortFeature 0010 0011B Feature Port Zero None
-
Объявление
Objective C
enum { kPerPortSwitchingBit = ( 1 << 0), kNoPowerSwitchingBit = ( 1 << 1), kCompoundDeviceBit = ( 1 << 2), kPerPortOverCurrentBit = ( 1 << 3), kNoOverCurrentBit = ( 1 << 4), kUSBHubOvercurrentMask = 0x18, kUSBHubOvercurrentShift = 3, kHubTTThinkTimeMask = 0x60, kHubTTThinkTimeShift = 5, kHubPortIndicatorBit = 7, kHubPortIndicatorMask = 0x0080 };
-
Объявление
Objective C
enum { kUSBHubLocalPowerChangeFeature = 0, /* Hub features */ kUSBHubOverCurrentChangeFeature = 1, kUSBHubPortConnectionFeature = 0, /* port features */ kUSBHubPortEnableFeature = 1, kUSBHubPortSuspendFeature = 2, kUSBHubPortOverCurrentFeature = 3, kUSBHubPortResetFeature = 4, kUSBHubPortPowerFeature = 8, kUSBHubPortLowSpeedFeature = 9, kUSBHubPortConnectionChangeFeature = 16, kUSBHubPortEnableChangeFeature = 17, kUSBHubPortSuspendChangeFeature = 18, kUSBHubPortOverCurrentChangeFeature = 19, kUSBHubPortResetChangeFeature = 20, kUSBHubPortTestFeature = 21, kUSBHubPortIndicatorFeature = 22, // USB 3.0 kUSBHubPortLinkStateFeature = 5, /* port features */ kUSBHubPortU1TimeoutFeature = 23, kUSBHubPortU2TimeoutFeature = 24, kUSBHubPortLinkStateChangeFeature = 25, kUSBHubPortConfigErrorChangeFeature = 26, kUSBHubPortRemoteWakeMaskFeature = 27, kUSBHubPortBHPortResetFeature = 28, kUSBHubPortBHResetChangeFeature = 29, kUSBHubPortForceLinkPMAcceptFeature = 30, };
Обсуждение
Используемый с SET_FEATURE для установки концентратора и функций порта
-
Объявление
Objective C
enum { kSSHubPortStatusConnectionBit = 0, kSSHubPortStatusEnabledBit = 1, kSSHubPortStatusOverCurrentBit = 3, kSSHubPortStatusResetBit = 4, // USB 3.0 kSSHubPortStatusLinkStateShift = 5, kSSHubPortStatusPowerBit = 9, kSSHubPortStatusSpeedShift = 10, kSSHubPortChangeBHResetBit = 5, kSSHubPortChangePortLinkStateBit = 6, kSSHubPortChangePortConfigErrBit = 7, kHubPortConnection = 0x0001, kHubPortEnabled = 0x0002, kHubPortSuspend = 0x0004, kHubPortOverCurrent = 0x0008, kHubPortBeingReset = 0x0010, kHubPortPower = 0x0100, kHubPortLowSpeed = 0x0200, kHubPortHighSpeed = 0x0400, kHubPortTestMode = 0x0800, kHubPortIndicator = 0x1000, kHubPortSuperSpeed = 0x2000 , // This is a synthesized bit that is using a reserved bit from the Hub Port Status definition in USB 2.0. kHubPortBit14 = 0x4000 , // That bit is used by the hub driver to encode the USB3 link state into the USB2 PortStatus (using bits 5-7 as well, that are reserved in the USB 2 spec ) kHubPortDebouncing = 0x8000 , // This is a synthesized bit that is using a reserved bit from the Hub Port Status definition in USB 2.0. // USB 3.0 kSSHubPortStatusConnectionMask = ( 1 << kSSHubPortStatusConnectionBit ), kSSHubPortStatusEnabledMask = ( 1 << kSSHubPortStatusEnabledBit ), kSSHubPortStatusOverCurrentMask = ( 1 << kSSHubPortStatusOverCurrentBit ), kSSHubPortStatusBeingResetMask = ( 1 << kSSHubPortStatusResetBit ), kSSHubPortStatusLinkStateMask = 0x01E0, kSSHubPortStatusPowerMask = ( 1 << kSSHubPortStatusPowerBit ), kSSHubPortStatusSpeedMask = 0x1C00, kSSHubPortChangeBHResetMask = ( 1 << kSSHubPortChangeBHResetBit ), kSSHubPortChangePortLinkStateMask = ( 1 << kSSHubPortChangePortLinkStateBit ), kSSHubPortChangePortConfigErrMask = ( 1 << kSSHubPortChangePortConfigErrBit ), // these are the bits which cause the hub port state machine to keep moving (USB 3.0) kHubPortSuperSpeedStateChangeMask = ( kHubPortConnection | kHubPortEnabled | kHubPortSuspend | kHubPortOverCurrent | kHubPortBeingReset | kSSHubPortStatusBeingResetMask | kSSHubPortChangePortLinkStateMask | kSSHubPortChangePortConfigErrMask ), // these are the bits which cause the hub port state machine to keep moving (USB 2.0) kHubPortStateChangeMask = ( kHubPortConnection | kHubPortEnabled | kHubPortSuspend | kHubPortOverCurrent | kHubPortBeingReset ) };
Обсуждение
Используемый для декодирования Состояния порта и Изменения
-
Объявление
Objective C
enum { kHubLocalPowerStatus = 1, kHubOverCurrentIndicator = 2, kHubLocalPowerStatusChange = 1, kHubOverCurrentIndicatorChange = 2 };
Обсуждение
Используемый для декодирования Состояния Концентратора и Изменения
-
Объявление
Objective C
enum{ // Support a maximum of 64 ports, which will pack into 9 bytes kNumPortBytes = 9 }; typedef struct IOUSBHubDescriptor IOUSBHubDescriptor;
Обсуждение
Дескриптор концентратора USB. Посмотрите USB спецификация HID в http://www .usb.org.
Оператор импорта
Objective C
#include <USBHub.h>;
Доступность
Доступный в OS X v10.0 и позже.
-
Объявление
Objective C
enum { kSSHubPortLinkStateU0 = 0, kSSHubPortLinkStateU1 = 1, kSSHubPortLinkStateU2 = 2, kSSHubPortLinkStateU3 = 3, kSSHubPortLinkStateSSDisabled = 4, kSSHubPortLinkStateRxDetect = 5, kSSHubPortLinkStateSSInactive = 6, kSSHubPortLinkStatePolling = 7, kSSHubPortLinkStateRecovery = 8, kSSHubPortLinkStateHotReset = 9, kSSHubPortLinkStateComplianceMode = 10, kSSHubPortLinkStateLoopBack = 11, kSSHubPortSpeed5Gbps = 0 };
Обсуждение
Используемый для декодирования Состояния порта и Изменения
-
Объявление
Objective C
enum { kHubPortIndicatorAutomatic = 0, kHubPortIndicatorAmber, kHubPortIndicatorGreen, kHubPortIndicatorOff };
-
Объявление
Objective C
enum { kHubSupportsGangPower = 0, kHubSupportsIndividualPortPower = 1, kHubPortSetPowerOff = 0, kHubPortSetPowerOn = 1 };
-
Объявление
Objective C
enum { kPrdRootHubApple = 0x8005 , // ProductID for classic speed root hubs kPrdRootHubAppleE = 0x8006 , // ProductID for high speed root hubs kPrdRootHubAppleSS = 0x8007 , // ProductID for super speed root hubs kUSBRootHubPollingRate = 32 // Enpoint polling rate interval for root hubs };
-
Объявление
Objective C
enum { kUSBHubRqSetHubDepth = 12, kUSBHubRqGetPortErrorCount = 13 };
Обсуждение
Указывает значения для bRequest поля Запроса Устройства.