All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Alot of breaking changes. Biggest things:
- Introduced
Field
struct to be used instead ofmodbus.BField
.BField
and fluent interface is deprecated. When adding fields in bulk and dynamically the struct (more idiomatic) approach is more ergonomic than fluent API. - Added implementation of Poller in
poller
package. For example usage see cmd/modbus-poller/main.go
Breaking changes to following structs/methods/functions
- struct field
modbus.Field.RegisterAddress
was renamed toAddress
- struct
modbus.RegisterRequest
was renamed toBuilderRequest
- method
BuilderRequest.ExtractFields()
signature changed - removed type
packet.LooksLikeType
and related consts- const
packet.DataTooShort
- const
packet.IsNotTPCPacket
- const
packet.LooksLikeTCPPacket
- const
packet.UnsupportedFunctionCode
- const
- error
modbus.ErrClientNotConnected
: changed fromClientError
to*ClientError
- error
modbus.ErrPacketTooLong
: changed fromClientError
to*ClientError
- Added FC1/FC2 support to builder. You can register coils with
b.Coild(address)
to be requested and extracted. Builder has now following methods for splitting:ReadCoilsTCP
combines fields into TCP Read Coils (FC1) requestsReadCoilsRTU
combines fields into RTU Read Coils (FC1) requestsReadDiscreteInputsTCP
combines fields into TCP Read Discrete Inputs (FC2) requestsReadDiscreteInputsRTU
combines fields into RTU Read Discrete Inputs (FC2) requests
- Added support for FC17 (0x11) Read Server ID.
- Added
packet.LooksLikeModbusTCP()
to check if given bytes are possibly TCP packet or start of packet. - Added
Parse*Request*
for every function type to help implement Modbus servers. - Added
Server
package to implement your own modbus server
- First implementations