From c22005c8173db80c283cad0aa5a3785b7b74db5c Mon Sep 17 00:00:00 2001 From: ali-f Date: Thu, 17 Oct 2024 18:27:59 +0330 Subject: [PATCH] 1 --- services/serialPortService.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/serialPortService.js b/services/serialPortService.js index c313bfa..7eaeeb4 100644 --- a/services/serialPortService.js +++ b/services/serialPortService.js @@ -6,8 +6,9 @@ import { autoDetect } from '@serialport/bindings-cpp' async function serialPortList(req, res) { - const data = autoDetect() - console.log('data', await data.open()) + const portList = await SerialPort.list() + console.log(portList) + res.send(portList) // .then((ports) => { // console.log('Available serial ports:'); // ports.forEach((port) => {