4
有没有人有任何示例代码以阻塞/同步方式使用node.js serialport模块?Node.js Serialport同步写入读取
我想要做的是发送一个命令给微控制器,并在发送下一个命令之前等待响应。
我已经发送/接收工作,但数据只是听者
serial.on("data", function(data) {
console.log(data);
});
进来有没有办法做一个
serial.write("Send Command");
我应该后等待返回的数据设置一个全球标志或什么?
我还是新的Node.js的异步编程风格
感谢