Versions in this module Expand all Collapse all v0 v0.0.3 Feb 6, 2026 v0.0.2 Nov 24, 2025 Changes in this version + const ExceptionAcknowledge + const ExceptionGatewayPathUnavailable + const ExceptionGatewayTargetDeviceFailedToRespond + const ExceptionIllegalDataAddress + const ExceptionIllegalDataValue + const ExceptionIllegalFunction + const ExceptionMemoryParityError + const ExceptionSlaveDeviceBusy + const ExceptionSlaveDeviceFailure + const FCReadCoils + const FCReadDiscreteInputs + const FCReadHoldingRegisters + const FCReadInputRegisters + const FCWriteMultipleCoils + const FCWriteMultipleRegisters + const FCWriteSingleCoil + const FCWriteSingleRegister + const ProtocolIDModbusTCP + func AppendCRC16(data []byte) []byte + func CalculateCRC16(data []byte) uint16 + func NewModbusError(code uint8) error + func VerifyCRC16(data []byte) bool + type ADU interface + Pack func() []byte + Unpack func([]byte) error + type Codec struct + func NewCodec(transportType string) *Codec + func (c *Codec) ReadADU(r io.Reader) (ADU, error) + type ModbusError struct + ExceptionCode uint8 + func (e *ModbusError) Error() string + type PDU struct + Data []byte + FunctionCode uint8 + type RTUADU struct + CRC uint16 + PDU PDU + UnitID uint8 + func (adu *RTUADU) Pack() []byte + func (adu *RTUADU) Unpack(data []byte) error + type TCPADU struct + Length uint16 + PDU PDU + ProtocolID uint16 + TransactionID uint16 + UnitID uint8 + func (adu *TCPADU) Pack() []byte + func (adu *TCPADU) Unpack(data []byte) error