diff --git a/services/serialPortService.js b/services/serialPortService.js index 427b66d..caff0cf 100644 --- a/services/serialPortService.js +++ b/services/serialPortService.js @@ -23,7 +23,7 @@ async function serialPortList(req, res) { console.log(111111, serialPort) const buff = Buffer.allocUnsafe(4); - buff.writeUInt8(`#0${req.params.id}$`); + buff.write(`#0${req.params.id}$`); serialPort.write(buff) }