Skip to content

ser2mcp V0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 04 Aug 11:43
2e136b3

Added

  • 事件驱动/非阻塞读线程 src/reader.rs(平台适配层):Unix(Linux/macOS)基于 poll(2) 与自建管道实现事件驱动,停止时可即时唤醒;Windows 采用 1ms 轮询 + bytes_to_read() 门控 + timeBeginPeriod(1),仅在数据就绪时执行 read()。读写延迟不再受读超时参数影响

Changed

  • 默认 read_timeout_ms 由 10ms 调整为 500ms:新读线程模型下该参数仅作为 read() 的安全上限(用于检测异常超时),不影响读写延迟,可兼容板端命令执行时间较长的场景
  • uart_close 延迟由 ~116ms 降至 ~1.4ms(事件等待可被停止令牌中断);uart_write 净开销中位降至 ~0.4ms

Fixed

  • 修复 Windows USB 转串口驱动按读超时边界成批交付数据导致的延迟尖峰(该现象基于 CH340 与 CP210x 两款芯片实测确认,其他芯片未逐一验证):read_timeout_ms=1000 时读写往返不再呈 ~1s 整数倍,COM9 回环中位延迟 59ms,与默认配置一致(优化前为 2966ms)