libusb 提供 libusb_set_interface_alt_setting() 方法为接口提供备用设置。我的问题是为界面设置备用设置是什么意思。
if ((ret = libusb_claim_interface(handle, interface)) == LIBUSB_SUCCESS)
{
printf("%s: interface %d claimed.\n", __FUNCTION__, interface);
/* Set alternate interface */
if ((ret = libusb_set_interface_alt_setting(handle, interface, alternate)) == LIBUSB_SUCCESS)
{
printf("%s: alternate interface %d set.\n", __FUNCTION__, alternate);
return CIMAX_USB_NO_ERROR;
}
else
printf("%s: setting alternate interface %d failed (%s)!\n", __FUNCTION__, alternate, libusb_error_name(ret));
}
else
printf("%s: claim interface %d failed (%s)!\n", __FUNCTION__, interface, libusb_error_name(ret));