Documentation
¶
Index ¶
- type RTUClientHandler
- func (mb *RTUClientHandler) Decode(adu []byte) (pdu *ProtocolDataUnit, err error)
- func (mb *RTUClientHandler) Encode(pdu *ProtocolDataUnit) (adu []byte, err error)
- func (mb *RTUClientHandler) Received(handler func(data []byte))
- func (mb *RTUClientHandler) Send(aduRequest []byte) (aduResponse []byte, err error)
- func (mb *RTUClientHandler) Verify(aduRequest []byte, aduResponse []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RTUClientHandler ¶
type RTUClientHandler struct {
// contains filtered or unexported fields
}
RTUClientHandler implements Packager and Transporter interface.
func NewRTUClientHandler ¶
func NewRTUClientHandler(address string) *RTUClientHandler
NewRTUClientHandler allocates and initializes a RTUClientHandler.
func (*RTUClientHandler) Encode ¶
Encode encodes PDU in a RTU frame:
Slave Address : 1 byte Function : 1 byte Data : 0 up to 252 bytes CRC : 2 byte
Click to show internal directories.
Click to hide internal directories.