common-port-helper
v1.1.5
Published
Unified serial port processing functions
Downloads
1
Readme
Unified serial port processing function
安装
npm i common-port-helper
使用方法
import bindPortListen from "common-port-helper";
// 串口数据监听
// this.bindMainBoardPortListen() 注释掉老的
bindPortListen({
listener: this.$mainRenderer, // 监听者
listenPort: 'port1-data', // 监听的端口
handlePortData: this.handleMainPortData, // 处理回调
errorCallback: this.$log.save // 保存错误日志
})