Closed mhjohans closed 6 years ago
It should be possible to create a new ReadInputDiscretesRequest spanning the last possible address (65535).
java.lang.IllegalArgumentException at com.ghgande.j2mod.modbus.msg.ReadInputDiscretesRequest.setBitCount(ReadInputDiscretesRequest.java:151)
The SetBitCount() method does this comparison: count + reference >= 65536. It should be changed to: count + reference > 65536.
Added fix to snapshot
Expected Behavior
It should be possible to create a new ReadInputDiscretesRequest spanning the last possible address (65535).
Actual Behavior
java.lang.IllegalArgumentException at com.ghgande.j2mod.modbus.msg.ReadInputDiscretesRequest.setBitCount(ReadInputDiscretesRequest.java:151)
The SetBitCount() method does this comparison: count + reference >= 65536. It should be changed to: count + reference > 65536.
Steps to Reproduce the Problem