Documentation
¶
Overview ¶
- @Author: Wangjun - @Date: 2021-05-21 14:44:32
- @LastEditTime: 2025-05-01 15:23:48
- @LastEditors: wangjun [email protected]
- @Description: - @FilePath: copy form libs/buffer.go - hnxr
Index ¶
- Variables
- type Buffer
- type Option
- type Serial
- type TimeoutRWC
- func (m *TimeoutRWC) Close() (err error)
- func (m *TimeoutRWC) IsClose() bool
- func (m *TimeoutRWC) Peek(n int) (data []byte, err error)
- func (m *TimeoutRWC) Read(data []byte) (num int, err error)
- func (m *TimeoutRWC) ReafFull(data []byte) (num int, err error)
- func (m *TimeoutRWC) Reset()
- func (m *TimeoutRWC) SetRWC(conn io.ReadWriteCloser)
- func (m *TimeoutRWC) Setup(conn io.ReadWriteCloser, readSize int, timeoutMs int64) *TimeoutRWC
- func (m *TimeoutRWC) Write(data []byte) (num int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFull = errors.New("缓冲区空间不够")
View Source
var ErrNotEnoughData = errors.New("缓冲区没有足够的数据")
View Source
var (
ErrNotOpen = errors.New("serial not open")
)
View Source
var ErrTimeout = errors.New("timeout")
Functions ¶
This section is empty.
Types ¶
type Serial ¶
type Serial struct {
//Connect string //linux 下 COM 会自动替换为/dev/ttyO
ReadBufSize int //读取数据的缓冲区
HaveRecv bool //是否开启数据接收线程
TimeoutRWC
// contains filtered or unexported fields
}
Serial 串口
func (*Serial) OptionString ¶
type TimeoutRWC ¶
type TimeoutRWC struct {
io.ReadWriteCloser
Err error
// contains filtered or unexported fields
}
func NewTimeoutRWC ¶
func NewTimeoutRWC(conn io.ReadWriteCloser, readSize int, timeoutMs int64) *TimeoutRWC
func (*TimeoutRWC) Close ¶
func (m *TimeoutRWC) Close() (err error)
func (*TimeoutRWC) SetRWC ¶
func (m *TimeoutRWC) SetRWC(conn io.ReadWriteCloser)
func (*TimeoutRWC) Setup ¶
func (m *TimeoutRWC) Setup(conn io.ReadWriteCloser, readSize int, timeoutMs int64) *TimeoutRWC
Directories
¶
| Path | Synopsis |
|---|---|
|
* @Author: fuzhuang * @Date: 2023-12-11 09:23:21 * @LastEditTime: 2025-05-01 15:27:39 * @LastEditors: wangjun [email protected] * @Description: * @FilePath: \golib\serialer\test\test.go
|
* @Author: fuzhuang * @Date: 2023-12-11 09:23:21 * @LastEditTime: 2025-05-01 15:27:39 * @LastEditors: wangjun [email protected] * @Description: * @FilePath: \golib\serialer\test\test.go |
|
* @Author: fuzhuang * @Date: 2023-12-11 09:23:21 * @LastEditTime: 2024-11-20 09:12:19 * @LastEditors: wangjun [email protected] * @Description: * @FilePath: \golib\serialer\test\test.go
|
* @Author: fuzhuang * @Date: 2023-12-11 09:23:21 * @LastEditTime: 2024-11-20 09:12:19 * @LastEditors: wangjun [email protected] * @Description: * @FilePath: \golib\serialer\test\test.go |
Click to show internal directories.
Click to hide internal directories.