Merge pull request #14 from espressif/fix_connect_issue

rollback webserial.js changes, failing to connect
This commit is contained in:
Adwait 2022-02-21 22:47:46 +05:30 committed by GitHub
commit 69b723ec50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,9 +100,9 @@ class Transport {
}
read = async ({timeout=0, min_data=12} = {}) => {
var t;
var packet = null;
var value, done;
let t;
let packet = null;
let value, done;
console.log("Read with timeout " + timeout);
const reader = this.device.readable.getReader();
if (timeout > 0) {
@ -127,15 +127,7 @@ class Transport {
if (done) {
break;
}
if (packet.includes(0xC0, 0) && packet.includes(0xC0, packet.length-1) && (packet.length != 1)) {
break;
}
if (this.slip_reader_enabled == false) {
if (packet.length >= min_data) {
break;
}
}
} while (true);
} while (packet.length < min_data);
if (done) {
console.log("timed out");