ali-f 4 weeks ago
parent bfc1eb8796
commit c22005c817
  1. 5
      services/serialPortService.js

@ -6,8 +6,9 @@ import { autoDetect } from '@serialport/bindings-cpp'
async function serialPortList(req, res) { async function serialPortList(req, res) {
const data = autoDetect() const portList = await SerialPort.list()
console.log('data', await data.open()) console.log(portList)
res.send(portList)
// .then((ports) => { // .then((ports) => {
// console.log('Available serial ports:'); // console.log('Available serial ports:');
// ports.forEach((port) => { // ports.forEach((port) => {

Loading…
Cancel
Save