This commit is contained in:
2026-05-06 09:41:30 +02:00
commit fef960d4ce
11 changed files with 1896 additions and 0 deletions

16
front/serialapi.js Normal file
View File

@@ -0,0 +1,16 @@
const { SerialPort } = require("serialport");
async function serialList() {
const ports = await SerialPort.list();
return ports; // path, manufacturer, serialNumber, pnpId, locationId, friendlyName, vendorId, productId
}
async function serialOpen(port) {
const serial = new SerialPort({
path: port,
baudRate: 115200,
});
return serial;
}
module.exports = { serialList, serialOpen };