Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions dfu-util/dfu.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,18 @@ var dfu = {};
const altSetting = this.settings.alternate.alternateSetting;
let intf = this.device_.configuration.interfaces[intfNumber];
if (intf.alternate === null ||
intf.alternate.alternateSetting != altSetting) {
await this.device_.selectAlternateInterface(intfNumber, altSetting);
intf.alternate.alternateSetting != altSetting ||
intf.alternates.length > 1) {
try {
await this.device_.selectAlternateInterface(intfNumber, altSetting);
} catch (error) {
if (intf.alternate.alternateSetting == altSetting &&
error.endsWith("Unable to set device interface.")) {
this.logWarning(`Redundant SET_INTERFACE request to select altSetting ${altSetting} failed`);
} else {
throw error;
}
}
}
}

Expand Down