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) => {