Documentation ¶
Index ¶
- Constants
- func BytesToFloat32s(endianness Endianness, wordOrder WordOrder, in []byte) (out []float32)
- func BytesToFloat64s(endianness Endianness, wordOrder WordOrder, in []byte) (out []float64)
- func BytesToUint16(endianness Endianness, in []byte) (out uint16)
- func BytesToUint16s(endianness Endianness, in []byte) (out []uint16)
- func BytesToUint32s(endianness Endianness, wordOrder WordOrder, in []byte) (out []uint32)
- func BytesToUint64s(endianness Endianness, wordOrder WordOrder, in []byte) (out []uint64)
- func DecodeBools(quantity uint16, in []byte) (out []bool)
- func EncodeBools(in []bool) (out []byte)
- func Float32ToBytes(endianness Endianness, wordOrder WordOrder, in float32) (out []byte)
- func Float64ToBytes(endianness Endianness, wordOrder WordOrder, in float64) (out []byte)
- func Uint16ToBytes(endianness Endianness, in uint16) (out []byte)
- func Uint16sToBytes(endianness Endianness, in []uint16) (out []byte)
- func Uint32ToBytes(endianness Endianness, wordOrder WordOrder, in uint32) (out []byte)
- func Uint64ToBytes(endianness Endianness, wordOrder WordOrder, in uint64) (out []byte)
- type Endianness
- type Plugin
- type Value
- type WordOrder
Constants ¶
View Source
const ( Coil primaryTable = "COIL" // 线圈 DiscreteInput primaryTable = "DISCRETE_INPUT" // 离散输入 InputRegister primaryTable = "INPUT_REGISTER" // 离散寄存器 HoldingRegister primaryTable = "HOLDING_REGISTER" // 保持寄存器 )
View Source
const ( // endianness of 16-bit registers LITTLE_ENDIAN Endianness = true BIG_ENDIAN Endianness = false // word order of 32-bit registers LOW_WORD_FIRST WordOrder = true HIGH_WORD_FIRST WordOrder = false )
Variables ¶
This section is empty.
Functions ¶
func BytesToFloat32s ¶
func BytesToFloat32s(endianness Endianness, wordOrder WordOrder, in []byte) (out []float32)
func BytesToFloat64s ¶
func BytesToFloat64s(endianness Endianness, wordOrder WordOrder, in []byte) (out []float64)
func BytesToUint16 ¶
func BytesToUint16(endianness Endianness, in []byte) (out uint16)
func BytesToUint16s ¶
func BytesToUint16s(endianness Endianness, in []byte) (out []uint16)
func BytesToUint32s ¶
func BytesToUint32s(endianness Endianness, wordOrder WordOrder, in []byte) (out []uint32)
func BytesToUint64s ¶
func BytesToUint64s(endianness Endianness, wordOrder WordOrder, in []byte) (out []uint64)
func DecodeBools ¶
func EncodeBools ¶
func Float32ToBytes ¶
func Float32ToBytes(endianness Endianness, wordOrder WordOrder, in float32) (out []byte)
func Float64ToBytes ¶
func Float64ToBytes(endianness Endianness, wordOrder WordOrder, in float64) (out []byte)
func Uint16ToBytes ¶
func Uint16ToBytes(endianness Endianness, in uint16) (out []byte)
func Uint16sToBytes ¶
func Uint16sToBytes(endianness Endianness, in []uint16) (out []byte)
func Uint32ToBytes ¶
func Uint32ToBytes(endianness Endianness, wordOrder WordOrder, in uint32) (out []byte)
func Uint64ToBytes ¶
func Uint64ToBytes(endianness Endianness, wordOrder WordOrder, in uint64) (out []byte)
Types ¶
type Endianness ¶
type Endianness bool
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin 驱动插件
func (*Plugin) Initialize ¶
func (p *Plugin) Initialize(logger *zap.Logger, c config.Config, handler plugin.OnReceiveHandler, ls *lua.LState) (err error)
Initialize 插件初始化
func (*Plugin) ProtocolAdapter ¶
func (p *Plugin) ProtocolAdapter() plugin.ProtocolAdapter
ProtocolAdapter 适配器
Click to show internal directories.
Click to hide internal directories.