BridgeManager: skip libusb_set_interface_alt_setting if altsetting=0

Some (older) devices seem to have a problem with this:
https://github.com/Benjamin-Dobell/Heimdall/issues/497

As far as I can see from logs, alt_setting is always 0, so with this
change libusb_set_interface_alt_setting will probably never be run.

tests: flash and boot recovery onto SM-G955
This commit is contained in:
Henrik Grimler 2021-11-22 16:25:45 +01:00
parent 6317e88503
commit 2ecc98020c
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
1 changed files with 8 additions and 1 deletions

View File

@ -259,9 +259,16 @@ bool BridgeManager::ClaimDeviceInterface(void)
bool BridgeManager::SetupDeviceInterface(void)
{
// if altSettingIndex is 0 there should be no need
// to set alt_setting(?)
if (altSettingIndex == 0)
return (true);
Interface::Print("Setting up interface...\n");
int result = libusb_set_interface_alt_setting(deviceHandle, interfaceIndex, altSettingIndex);
int result = libusb_set_interface_alt_setting(deviceHandle,
interfaceIndex,
altSettingIndex);
if (result != LIBUSB_SUCCESS)
{