This commit is contained in:
Nils
2025-08-30 20:48:59 +02:00
parent 119a5edd19
commit 1fa1127141
2 changed files with 9 additions and 5 deletions

7
eslint.config.js Normal file
View File

@@ -0,0 +1,7 @@
import js from "@eslint/js";
import globals from "globals";
import { defineConfig } from "eslint/config";
export default defineConfig([
{ files: ["**/*.{js,mjs,cjs}"], plugins: { js }, extends: ["js/recommended"], languageOptions: { globals: globals.browser } },
]);

View File

@@ -1,6 +1,7 @@
import { Constants, NodeJSSerialConnection } from "@liamcottle/meshcore.js";
// get port from cli arguments
/*eslint no-undef: "off"*/
const port = process.argv[2] || "/dev/cu.usbmodem1101";
console.log(`Connecting to ${port}`);
@@ -33,11 +34,7 @@ connection.on("disconnected", () => {
clearInterval(reconnectInterval);
}
reconnectInterval = setInterval(async () => {
try {
await connection.connect();
} catch (e) {
// ignore, we will retry
}
await connection.connect();
}, 3000);
});