summaryrefslogtreecommitdiffstats
path: root/assets/js/rootLantiq.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/rootLantiq.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 '')
-rw-r--r--assets/js/rootLantiq.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/assets/js/rootLantiq.js b/assets/js/rootLantiq.js
index 480cf6e..ff0f478 100644
--- a/assets/js/rootLantiq.js
+++ b/assets/js/rootLantiq.js
@@ -64,11 +64,12 @@ async function waitFailbackShell(writer, reader, outputMsgCallback) {
}
async function lantiqRootUboot(port, sfpModel, outputMsgCallback, outputErrorCallback, baudRate = 115200) {
- outputMsgCallback(`Please disconnect the ${sfpModel} from the SFP adapter if it is currently plugged in!`);
-
- const { reader, writer, readableStreamClosed, writerStreamClosed } = await openPortLineBreak(port, baudRate, outputErrorCallback);
+ let reader,writer, readableStreamClosed, writerStreamClosed;
try {
+ outputMsgCallback(`Please disconnect the ${sfpModel} from the SFP adapter if it is currently plugged in!`);
+ ({ reader, writer, readableStreamClosed, writerStreamClosed } = await openPortLineBreak(port, baudRate));
+
await delay(10000);
outputMsgCallback(`Now you need to insert the ${sfpModel} into the SFP adapter, if the procedure does not go ahead, check the connections and then remove and reconnect the ${sfpModel} again`);
@@ -107,9 +108,10 @@ async function lantiqRootUboot(port, sfpModel, outputMsgCallback, outputErrorCal
}
async function unlockHuaweiShell(port, outputMsgCallback, outputErrorCallback, baudRate = 115200) {
- const { reader, writer, readableStreamClosed, writerStreamClosed } = await openPortLineBreak(port, baudRate, outputErrorCallback);
+ let reader,writer, readableStreamClosed, writerStreamClosed;
try {
+ ({ reader, writer, readableStreamClosed, writerStreamClosed } = await openPortLineBreak(port, baudRate));
outputMsgCallback("Root in progress: Rebooting...");
writer.write('reset\n');
await delay(1000);