You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why value is casted to short?
Short is signed in java, and with such castings this method returns false for values above 32767.
Is there any reason? I am not sure if I can fix this by removing that cast.
The text was updated successfully, but these errors were encountered:
It looks like this was put in to fix a different reported bug where someone was trying to use this method for values between Short.MIN and Short.MAX instead of 0 to Modbus.MAX_REGISTER_VALUE. It definitely doesn't work to cast to short, and then check range between 0 and 65535.
jlibmodbus/src/com/intelligt/modbus/jlibmodbus/Modbus.java
Line 293 in 38fcf02
Why
value
is casted to short?Short is signed in java, and with such castings this method returns false for values above 32767.
Is there any reason? I am not sure if I can fix this by removing that cast.
The text was updated successfully, but these errors were encountered: