tcpmodbus.c

Check for timeout when reading.  Added more error checking. Some
housekeeping to make it easier to follow the code, name changes and more
descriptive comments.

r3785 | ffr | 2012-11-05 12:20:41 +1100 (Mon, 05 Nov 2012) | 5 lines
This commit is contained in:
Ferdi Franceschini
2012-11-05 12:20:41 +11:00
committed by Douglas Clowes
parent e9f7c0547d
commit 828cccc2f3

View File

@ -304,6 +304,9 @@ int TCPMBReading(Ascon *a) {
}
if (allRead == 0 && aduLen >= (6 + RespLen)) {
/* all of response has been read */
/* FIXME If the Length field (ie RespLen) is wrong then we loop forever waiting for a response.
Can this be detected automatically (eg timeout) and reset?
*/
allRead = 1;
}
if (allRead) {