Skip to content

Commit

Permalink
Uncaught (in promise) DOMException: A transfer error has occurred. wi…
Browse files Browse the repository at this point in the history
…ndows workaround
  • Loading branch information
Gabriel committed Mar 13, 2021
1 parent 6104442 commit 5c168b5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions system/apps_featured/69_webusbosc/web/v3/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,18 @@ var serial = {};
})
.then(() => this.device_.claimInterface(this.interfaceNumber_))
.then(() => this.device_.selectAlternateInterface(this.interfaceNumber_, 0))
.then(() => {
// Windows workaround "Uncaught (in promise) DOMException: A transfer error has occurred."
if (window.navigator.userAgent.indexOf("Windows") != -1)
return Promise.resolve();

.then(() => this.device_.controlTransferOut({
return this.device_.controlTransferOut({
'requestType': 'class',
'recipient': 'interface',
'request': 0x22,
'value': 0x01,
'index': this.interfaceNumber_}))

'index': this.interfaceNumber_})
})
.then(() => {
readLoop();
});
Expand Down

0 comments on commit 5c168b5

Please sign in to comment.