-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3399a67
commit de0755a
Showing
3 changed files
with
4 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ export class WebSerialTransport implements ISerialTransport { | |
* @param {Uint8Array} packet Unsigned 8 bit array from the device read stream. | ||
Check warning on line 98 in src/transport/WebSerialTransport.ts GitHub Actions / ci
|
||
* @returns {Promise<Uint8Array>} 8 bit unsigned data array read from device. | ||
*/ | ||
async read(timeout: number = 0, minData: number = 0, packet?: Uint8Array): Promise<Uint8Array> { | ||
async read(timeout: number = 0, minData: number = 0): Promise<Uint8Array> { | ||
if (this.leftOver.length != 0) { | ||
const p = this.leftOver; | ||
this.leftOver = new Uint8Array(0); | ||
|
@@ -109,9 +109,7 @@ export class WebSerialTransport implements ISerialTransport { | |
} | ||
this.reader = this.device.readable.getReader(); | ||
let t; | ||
if (!packet) { | ||
packet = this.leftOver; | ||
} | ||
let packet = this.leftOver; | ||
try { | ||
if (timeout > 0) { | ||
t = setTimeout(() => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters