mirror of
https://github.com/thegecko/web-bluetooth-dfu.git
synced 2025-12-06 17:12:51 +08:00
Merge pull request #59 from xsorifc28/patch-1
sendControl causing "uncaught in promise" error
This commit is contained in:
@@ -306,10 +306,12 @@ export class SecureDfu extends EventDispatcher {
|
||||
}
|
||||
|
||||
private sendControl(operation: Array<number>, buffer?: ArrayBuffer): Promise<DataView> {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.sendOperation(this.controlChar, operation, buffer)
|
||||
.then(resp => {
|
||||
setTimeout(() => resolve(resp), this.delay);
|
||||
}).catch(err => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user