070b7685d5edda39d9a56fec73a1622e3e70e61f
1. 优化了Close方法的资源释放顺序,先释放独占访问权,再关闭实际的端口句柄 2. 添加了句柄有效性检查,避免对无效句柄进行操作 3. 确保所有资源都能正确清理,包括句柄和信号管道 4. 改进了错误处理机制,确保只返回第一个错误 5. 为所有方法添加了端口状态检查,确保在端口关闭后立即返回PortClosed错误 6. 统一了错误处理格式,使用PortError类型包装系统错误 7. 优化了Read方法的错误处理和超时逻辑 8. 为Write、Break、SetMode、SetDTR、SetRTS和GetModemStatusBits方法添加了端口状态检查
go.bug.st/serial
A cross-platform serial port library for Go.
Documentation and examples
See the package documentation here: https://pkg.go.dev/go.bug.st/serial
go.mod transition
This library supports go.mod with the import go.bug.st/serial.
If you came from the pre-go.mod era please update your import paths from go.bug.st/serial.v1 to go.bug.st/serial to receive updates. The latest v1 release is still available using the old import path.
Credits
✨ Thanks to all awesome contributors! ✨
License
This software is released under the BSD 3-clause license.
Description
Languages
Go
100%