w1ndyb0y 419f25f0dd fix: comprehensive bug fixes and architecture restructuring
Phase 1 — Bug fixes (7 bugs):
- Bug 1: Pulsar mode data loss — always persist to SQLite regardless of mode
- Bug 2: PulsarSend closing TCP client — use independent resetPulsarProducer()
- Bug 3: Greedy regex — use non-greedy (?s)ZCZC.*?NNNN
- Bug 4: Data after NNNN discarded — keep remaining buffer data
- Bug 5: strings.Index > 0 boundary — use strings.Contains
- Bug 6: Variable shadowing in PulsarSend — use = not :=
- Bug 7: Accept failure nil panic — add continue + retry logic

Phase 2 — Architecture restructuring:
- Split utils/ into config/, serial/, telegram/, storage/, transport/
- Define Sender, Repository, Reader interfaces
- Introduce app/ layer with context.Context lifecycle
- Replace spinlock with sync.Mutex
- Unified Config struct replaces 15+ global vars

Phase 3 — Testing & tooling:
- telegram/parser_test.go (7 test cases)
- storage/store_test.go (5 test cases)
- transport/transport_test.go (4 test cases)
- Taskfile: add test, test-race, test-cover tasks
- Go version: 1.15 -> 1.21
2026-07-10 15:32:34 +08:00
2020-12-29 16:41:08 +08:00
2021-02-01 15:46:13 +08:00
2020-12-28 15:58:00 +08:00
2020-12-21 11:19:53 +08:00
2020-12-21 11:19:53 +08:00
2020-12-21 11:19:53 +08:00
2020-12-29 17:23:07 +08:00
2021-02-01 16:07:00 +08:00

电报接收

Build Status

机场串口电报数据缓存程序。从串口读取电报,保存,等待处理程序处理

下载

下载发布版本 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服务等待处理程序连接。 如果没有处理程序,电报则保存在本地数据库中。 等到处理程序连上端口,则把未处理电报以此发送给处理程序。

S
Description
No description provided
Readme Apache-2.0
170 KiB
Languages
Go 100%