7f65004cd435763227b71a328d21707f5181b26b
New test packages: - config/loader_test.go: 5 tests (valid, minimal, missing file, pulsar-only, defaults) - serial/serial_test.go: 6 tests (interface, read, EOF, close, empty) - app/app_test.go: 5 tests (New, dispatch store/send, error handling, ctx cancellation) Enhanced test packages: - storage/store_test.go: +3 tests (concurrent insert, close/reopen, init clears) - telegram/parser_test.go: +5 tests (concurrency, rawLog, empty, multiline, removeEmpty) - transport/transport_test.go: +7 tests, +fixes Fixes: - app.go: store field type *storage.Store -> storage.Repository (supports mocking) - transport_test: fix net.Pipe() sync deadlock in SetConnClosesPrevious - transport_test: fix MultiSender_ErrorPropagation expectations Results: 6 packages, 30+ tests, all pass with -race
电报接收
机场串口电报数据缓存程序。从串口读取电报,保存,等待处理程序处理
下载
下载发布版本 release
安装
解压下载文件 tele-recv-XXX.tag.gz
如果是linux
tar xzvf tele-recv-XXX.tar.gz
文件包中包含两个可执行文件和一个.yaml的配置文件
tele-recv-linux: linux 可执行文件 tele-recv-win64.exe: windows 64位可执行文件
配置
| 选项 | 含义 | 取值 | 例子 |
|---|---|---|---|
| device | 串口设备名称 | ttyS1 | win: COM1 linux: ttyS1 |
| baudrate | 波特率 | 9600 | 19200,38400 .... |
| lograw | 是否向控制台输出通讯内容 | ture | true/false |
| file | sqlite 文件名 | telegram.db | tele.db |
| init | 是否新建电报数据库 | true | true/false |
| address | 本地处理监听端口 | 127.0.0.1:6000 |
测试环境
linux:
./tele-recv-linux test
windows:
tele-recv-win64.exe test
测试运行的环境是否能正确开始串口设备,以及初始化数据库
开始接收电报
linux:
./tele-recv-linux start
windows:
tele-recv-win64.exe start
开始从串口设备读取数据,并开启TCP服务等待处理程序连接。 如果没有处理程序,电报则保存在本地数据库中。 等到处理程序连上端口,则把未处理电报以此发送给处理程序。
Languages
Go
100%