# mockmessagetoserial **Repository Path**: maxuedong/mockmessagetoserial ## Basic Information - **Project Name**: mockmessagetoserial - **Description**: 读取CSV文件中的AFTN或SITA报文,发送到本地串口 - **Primary Language**: NodeJS - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-04 - **Last Updated**: 2021-11-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mockmessagetoserial #### 介绍 读取CSV文件中的AFTN或SITA报文,发送到本地串口 #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 1. npm install 2. 配置参数 ``` const portName = 'COM5'; //定义串口名1 const csvFile = 'am_tele_message_202110191314.csv';//报文数据文件 const originalTextField = 'original_text';//报文字段名称,CSV的标题行 const sendInterval=1000;//发报间隔,单位毫秒 const serialPort = new SerialPort( //设置串口属性 portName, {   baudRate: 9600,  //波特率   dataBits: 8,    //数据位   parity: 'none',  //奇偶校验   stopBits: 1,  //停止位   flowControl: false ,   autoOpen:false //不自动打开 }, false); //过滤报文条件,返回true则发送该报 function doFilter(row){ let bSend=true; bSend = row['msg_category']!=='NOTAM'&&row['msg_category']!=='METAR'&&row['msg_category']!=='SNOWTAM'&&row['msg_category']!=='TAF'; return bSend; } ``` 3. node serial.js #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)