From d0bf83f17a40bc140828c58b6d5f8d583bd847ad Mon Sep 17 00:00:00 2001 From: Ernesto Castellotti Date: Wed, 11 Jan 2023 19:36:30 +0100 Subject: Remove outputErrorCallback from openPortLineBreak --- assets/js/rootLantiq.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'assets/js/rootLantiq.js') 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); -- cgit v1.2.3