USBDev_AltSettingCurGet

USBDev_AltSettingCurGet

Description

Get the current alternate setting for the specified interface.

Files

usbdev_api.c

Prototype

UCHAR USBDev_AltSettingCurGet (HANDLE dev, UCHAR if_nbr, DWORD *p_err);

 

Arguments

dev

General handle to device.

if_nbr

Interface number.

p_err

Pointer to variable that will receive the return error code from this function:

ERROR_SUCCESS

ERROR_INVALID_HANDLE

ERROR_INVALID_PARAMETER

Returned Value

Current alternate setting number, if NO error(s).

0, otherwise.

Callers

Application.

Notes / Warnings

This function gets the current alternate setting number used internally by WinUSB and gets the one from the device by sending a GET_INTERFACE request. Both alternate setting numbers are compared. If they match, the current  alternate setting is returned.