summaryrefslogtreecommitdiffstats
path: root/assets/js/serialUtil.js
diff options
context:
space:
mode:
authorErnesto Castellotti <mail@ernestocastellotti.it>2023-01-11 19:36:30 +0100
committerSimone <26844016+simonebortolin@users.noreply.github.com>2023-01-12 00:02:02 +0100
commitd0bf83f17a40bc140828c58b6d5f8d583bd847ad (patch)
tree0212d2e5d4d79e00d8325e6d95a8268c63e541b8 /assets/js/serialUtil.js
parentclosePortLineBreak prevent undefined errors (diff)
downloadhack-gpon.github.io-d0bf83f17a40bc140828c58b6d5f8d583bd847ad.tar
hack-gpon.github.io-d0bf83f17a40bc140828c58b6d5f8d583bd847ad.tar.gz
hack-gpon.github.io-d0bf83f17a40bc140828c58b6d5f8d583bd847ad.tar.bz2
hack-gpon.github.io-d0bf83f17a40bc140828c58b6d5f8d583bd847ad.tar.lz
hack-gpon.github.io-d0bf83f17a40bc140828c58b6d5f8d583bd847ad.tar.xz
hack-gpon.github.io-d0bf83f17a40bc140828c58b6d5f8d583bd847ad.tar.zst
hack-gpon.github.io-d0bf83f17a40bc140828c58b6d5f8d583bd847ad.zip
Diffstat (limited to 'assets/js/serialUtil.js')
-rw-r--r--assets/js/serialUtil.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/assets/js/serialUtil.js b/assets/js/serialUtil.js
index c4d6d84..6e9d155 100644
--- a/assets/js/serialUtil.js
+++ b/assets/js/serialUtil.js
@@ -2,14 +2,8 @@ function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
-async function openPortLineBreak(port, baudRate, outputErrorCallback) {
- try {
- await port.open({ baudRate: baudRate });
- } catch (err) {
- outputErrorCallback(`Error: ${err.message}`);
- return;
- }
-
+async function openPortLineBreak(port, baudRate) {
+ await port.open({ baudRate: baudRate });
const textDecoder = new TextDecoderStream();
const readableStreamClosed = port.readable.pipeTo(textDecoder.writable);
const reader = await textDecoder.readable.pipeThrough(new TransformStream(new LineBreakTransformer())).getReader();