Repository navigation
Compatibility notes
2.2.0 contains API and behavior changes. Review these before upgrading from 2.1.x.
API changes
WriteSingleRegisterRequest.value()andWriteSingleRegisterResponse.value()returnbyte[]instead ofint. This breaks source and binary compatibility for callers ofvalue()and record patterns. The(int, int)constructors remain.ReadWriteModbusServices.writeSingleRegisternow declaresModbusResponseException. (#169)ModbusClientConfiggainedbroadcastTurnaroundDelayandresponseValidatorcomponents. The 2.1.x four-argument constructor no longer exists; useModbusClientConfig.create(...)or the builder. (#181, #196)SerialPortTransportConfiggained apartialFrameTimeoutcomponent, which changes its canonical constructor. UseSerialPortTransportConfig.create(...)or the builder. (#209)
Behavior changes
- Built-in requests reject out-of-range addresses, quantities, and values with
IllegalArgumentExceptionbefore encoding. Value arrays must be exactly the required length (WriteMultipleCoilsRequestpreviously accepted a longer buffer), and unused bits in the last coil byte must be zero. (#193) - Typed client calls validate responses against their requests. Malformed responses fail with
ModbusMalformedResponseException. (#196, #201) - Pending client requests fail with
ModbusConnectionLostExceptionwhen the connection is lost, instead of waiting for their timeout. Sends on a disconnected transport fail withModbusNotConnectedException. (#202, #208) - Blocking client calls throw
ModbusExecutionExceptionwith the exceptions above as the cause. A lost connection previously surfaced asModbusTimeoutException. (#201, #202, #208) - The RTU client keeps one request on the wire at a time. Serial client writes run on the configured executor, which must run tasks on its own threads. (#171, #175)
- After
disconnect(),SerialPortClientTransport.getSerialPort()returns a newSerialPort. Settings applied directly to the previous instance must be reapplied after reconnecting. (#171) - RTU client broadcasts go through the request queue. (#181)
- RTU and RTU-over-TCP servers treat unit ID 0 as a broadcast. They ignore read requests to unit 0, and they deliver write requests to the unit IDs returned by
ModbusServices.getBroadcastUnitIds(ModbusRtuRequestContext)(default: unit 0) without sending a response. A customModbusRtuServerTransportmust accept anullresponse frame fromFrameReceiver.receive. (#195) ModbusClientConfigrejects a negativerequestTimeoutor one longer thanLong.MAX_VALUEnanoseconds. The RTU client schedules timeouts in nanoseconds, so customTimeoutSchedulerimplementations must honor the time unit. (#207)- Server transports discard partial request frames after
partialFrameTimeout. The serial default follows the Modbus end-of-frame delay for the baud rate. USB serial adapters with latency timers may need a longer value. (#209) stop()on Modbus TCP and RTU-over-TCP servers returns only after the listening socket is released. (#213)
What's Changed
- Update Maven dependencies (2026-08-10) by @kevinherron in #163
- Add a user documentation foundation by @kevinherron in #162
- Update Maven dependencies (2026-08-17) by @kevinherron in #164
- Update Maven dependencies (2026-08-31) by @kevinherron in #165
- Update Maven dependencies (2026-09-07) by @kevinherron in #166
- Update Maven dependencies (2026-09-14) by @kevinherron in #167
- Fix RTU server parsing of write requests with 128+ data bytes by @kevinherron in #168
- Don't block the caller on stalled RTU serial writes by @kevinherron in #171
- Send RTU client requests one at a time by @kevinherron in #175
- Read the RTU exception code after the function code by @kevinherron in #180
- Bound the RTU broadcast wait with the request timeout by @129duckflew in #182
- Send RTU broadcasts through the request queue by @kevinherron in #181
- Fix flaky read/write register serializer test by @kevinherron in #184
- Maven dependency updates 2026-10-05 by @kevinherron in #185
- Maven dependency updates 2026-10-12 by @kevinherron in #186
- Fix Maven publishing on updated GitHub runners by @kevinherron in #187
- Validate built-in requests before outbound encoding by @kevinherron in #193
- Validate typed client responses against their requests by @kevinherron in #196
- Decode certificate roles with strict DER and UTF-8 by @kevinherron in #194
- Support RTU server broadcasts without responses by @kevinherron in #195
- Allow applications to customize Netty TLS contexts by @kevinherron in #197
- Generalize FC 06 register values to bytes by @kevinherron in #169
- Use a dedicated exception for malformed responses by @kevinherron in #201
- Fail pending requests when the connection is lost by @kevinherron in #202
- Report never-sent RTU timeouts and exclude turnaround holds from queued timeouts by @kevinherron in #207
- Report serial connection loss and fail not-connected sends with a typed exception by @kevinherron in #208
- Discard stale partial request frames in server transports by @kevinherron in #209
- Compute the RTU exception response CRC over the whole PDU by @kevinherron in #210
- Maven dependency updates 2026-10-19 by @kevinherron in #211
- Wait for server listening socket release on unbind by @kevinherron in #213
- Update netty-channel-fsm to 1.0.3 by @kevinherron in #214
- Maven dependency updates 2026-10-26 by @kevinherron in #215
- Maven dependency updates 2026-11-02 by @kevinherron in #216
New Contributors
- @129duckflew made their first contribution in #182
Full Changelog: v2.1.6...v2.2.0