2 Commits

Author SHA1 Message Date
b3711b62ad 添加git提交规范:提交信息必须包含中文说明
Some checks failed
test / native-os-build (macOS-latest) (push) Has been cancelled
test / native-os-build (ubuntu-latest) (push) Has been cancelled
test / native-os-build (windows-latest) (push) Has been cancelled
test / cross-os-build (freebsd amd64) (push) Has been cancelled
test / cross-os-build (linux ppc64le) (push) Has been cancelled
test / cross-os-build (openbsd 386) (push) Has been cancelled
test / cross-os-build (openbsd amd64) (push) Has been cancelled
test / cross-os-build (openbsd arm) (push) Has been cancelled
2026-03-03 10:36:03 +08:00
070b7685d5 Linux系统下串口Close相关实现的深度优化
1. 优化了Close方法的资源释放顺序,先释放独占访问权,再关闭实际的端口句柄
2. 添加了句柄有效性检查,避免对无效句柄进行操作
3. 确保所有资源都能正确清理,包括句柄和信号管道
4. 改进了错误处理机制,确保只返回第一个错误
5. 为所有方法添加了端口状态检查,确保在端口关闭后立即返回PortClosed错误
6. 统一了错误处理格式,使用PortError类型包装系统错误
7. 优化了Read方法的错误处理和超时逻辑
8. 为Write、Break、SetMode、SetDTR、SetRTS和GetModemStatusBits方法添加了端口状态检查
2026-03-03 10:27:03 +08:00