规范串口通讯
This commit is contained in:
@@ -13,7 +13,8 @@ import (
|
||||
|
||||
type Reader interface {
|
||||
io.Closer
|
||||
SetSlave(uint8)
|
||||
// SetSlave 设置读卡器的 UnitID
|
||||
SetSlave(byte)
|
||||
// WriteUnitId 写入读卡器的 UnitID
|
||||
WriteUnitId(uint16) error
|
||||
// Init 初始化读卡器配置
|
||||
|
||||
@@ -7,10 +7,15 @@ import (
|
||||
|
||||
type Relay interface {
|
||||
io.Closer
|
||||
SetSlave(slaveID byte)
|
||||
On(num int) error
|
||||
Off(num int) error
|
||||
// SetSlave 设置继电器的 UnitID
|
||||
SetSlave(byte)
|
||||
// On 打开继电器
|
||||
On(int) error
|
||||
// Off 关闭继电器
|
||||
Off(int) error
|
||||
// OnAll 打开所有继电器
|
||||
OnAll() error
|
||||
// OffAll 关闭所有继电器
|
||||
OffAll() error
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user