Ensure that port reads do not block indefinitely if a user enters an incorrect timeout value (<100) on Linux or Mac.
This commit is contained in:
parent
5d9b261ee4
commit
c943df001f
|
@ -657,6 +657,8 @@ public final class SerialPort
|
|||
readTimeout = newReadTimeout;
|
||||
writeTimeout = newWriteTimeout;
|
||||
}
|
||||
else if ((newReadTimeout > 0) && (newReadTimeout <= 100))
|
||||
readTimeout = 100;
|
||||
else
|
||||
readTimeout = Math.round((float)newReadTimeout / 100.0f) * 100;
|
||||
|
||||
|
|
Loading…
Reference in New Issue