26Cypress CyUsb3.sys Programmer's Reference5.5IOCTL_ADAPT_GET_ALT_INTERFACE_SETTING
Description
This command retrieves the alternate interface setting for a particular interface of the attached device.
A pointer to a byte indicating the interface number is passed as the lpInBuffer parameter to theDeviceIoControl( ) function.
A pointer to a byte into which the alternate interface setting will be reported is passed as the lpOutBufferparameter to the DeviceIoControl( ) function.
The length of the variables (1) is passed in the nInBufferSize and nOutBufferSize parameters.
Example
DWORD dwBytes = 0;UCHAR intfc = 0;UCHAR alt;
DeviceIoControl(hDevice, IOCTL_ADAPT_GET_ALT_INTERFACE_SETTING, &intfc, sizeof (alt), &alt, sizeof (alt), &dwBytes, NULL);
? 2012 Cypress Semiconductor
The IOCTL Interface275.6IOCTL_ADAPT_GET_CURRENT_FRAME
Description
This command returns the current frame number from the host controller driver.
A pointer to a 4-byte variable is passed as both the lpInBuffer and lpOutBuffer parameters to theDeviceIoControl( ) function.
The size of the variable (4) is passed in the nInBufferSize and nOutBufferSize parameters.
Example
DWORD dwBytes = 0;ULONG CurrentFrame;
DeviceIoControl(hDevice, IOCTL_ADAPT_GET_CURRENT_FRAME,
DeviceIoControl(hDevice, IOCTL_ADAPT_GET_CURRENT_FRAME, &CurrentFrame, sizeof (ULONG), &CurrentFrame, sizeof (ULONG), &dwBytes, NULL);
? 2012 Cypress Semiconductor
28Cypress CyUsb3.sys Programmer's Reference5.7IOCTL_ADAPT_GET_DEVICE_NAME
Description
This command retrieves the Product string descriptor value for the attached device.
A pointer to a character buffer is passed as both the lpInBuffer and lpOutBuffer parameters to theDeviceIoControl( ) function.
The length of the buffer is passed in the nInBufferSize and nOutBufferSize parameters.
Example
DWORD dwBytes = 0;ULONG len = 256;
UCHAR *buf = new UCHAR[len];
DeviceIoControl(hDevice, IOCTL_ADAPT_GET_DEVICE_NAME, buf, len, buf, len,
&dwBytes, NULL);
delete[] buf;
? 2012 Cypress Semiconductor
The IOCTL Interface295.8IOCTL_ADAPT_GET_DEVICE_POWER_STATE
Description
This IOCTL is no longer supported. It is available to keep backward compatibility with older interfacelibrary and application.
Microsoft WDF driver framework manages device power state internally.
? 2012 Cypress Semiconductor
30Cypress CyUsb3.sys Programmer's Reference5.9IOCTL_ADAPT_GET_DEVICE_SPEED
Description
This command attempts to report the current operating speed of the USB device. It uses the
IsDeviceHighSpeed routine, but this routine is only supported in Version 1 of the USBD interface.Windows 2K SP4, Windows XP and later all support Version 1 of the USBD interface. If the
IsDeviceHighSpeed routine is not available, DEVICE_SPEED_UNKNOWN is returned. The possiblereturn value of this IOCTL is defined in the cyioctl.h header file.
A pointer to a 4-byte variable is passed as both the lpInBuffer and lpOutBuffer parameters to theDeviceIoControl( ) function.
The size of the variable (4) is passed in the nInBufferSize and nOutBufferSize parameters.
Defines (cyioctl.h)
#define DEVICE_SPEED_UNKNOWN 0x00000000#define DEVICE_SPEED_LOW_FULL 0x00000001#define DEVICE_SPEED_HIGH 0x00000002
#define DEVICE_SPEED_SUPER 0x00000004
Example
DWORD dwBytes = 0;ULONG DevSpeed;
DeviceIoControl(hDevice, IOCTL_ADAPT_GET_DEVICE_SPEED, &DevSpeed, sizeof (ULONG), &DevSpeed, sizeof (ULONG), &dwBytes, NULL);
? 2012 Cypress Semiconductor