Add meta feed functionality and enhance error handling in catalog API
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
const serialResultsDiv = document.getElementById("serialResults");
|
||||
|
||||
let port, textEncoder, writableStreamClosed, writer;
|
||||
let readableStreamClosed, reader, openPort = 0;
|
||||
let x, serial, fw, hw, sw, commitCode;
|
||||
let firmwarelocation, upgraded_version, hex_fw;
|
||||
|
||||
// Buffer for accumulating received data before logging
|
||||
let receivedDataBuffer = '';
|
||||
|
||||
@@ -113,13 +118,15 @@ async function connectDevice() {
|
||||
// Log connection failure details
|
||||
await logCommunication(`Serial connection failed: ${error.message || 'Unknown error'}`, 'disconnected');
|
||||
|
||||
if (openPort = 1){
|
||||
if (openPort === 1){
|
||||
closePort();
|
||||
console.log("Closing port");
|
||||
alert("System is still trying to close the serial port. If this message continues to come up please refresh this page.");
|
||||
window.location.reload();
|
||||
}
|
||||
else{
|
||||
alert("Your browser does not support this functionality. Please use latest Chrome or Edge browser.");
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,6 +168,7 @@ async function listenToPort() {
|
||||
|
||||
async function appendToTerminal(newStuff) {
|
||||
serialResultsDiv.innerHTML += newStuff;
|
||||
receivedDataBuffer += newStuff;
|
||||
|
||||
// Log received data
|
||||
await logCommunication(newStuff.trim(), 'received');
|
||||
|
||||
Reference in New Issue
Block a user