Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetNetIf mbed
Diff: ModBus/porttcp.cpp
- Revision:
- 2:53de07fd9705
- Parent:
- 1:e35ceaa8c758
--- a/ModBus/porttcp.cpp Tue Mar 13 13:12:21 2012 +0000
+++ b/ModBus/porttcp.cpp Tue Mar 13 13:16:24 2012 +0000
@@ -199,10 +199,6 @@
BOOL bOkay = TRUE;
USHORT usLength;
int iRes;
- int i;
- int total=0;
- int len;
- char buf[MB_TCP_BUF_SIZE];
/* Make sure that we can safely process the next read request. If there
* is an overflow drop the client.
*/
@@ -213,9 +209,9 @@
return FALSE;
}
- while (len = pConnectedSock->recv((char *)&aucTCPBuf[usTCPBufPos], MB_TCP_BUF_SIZE-usTCPBufPos) ) {
- usTCPBufPos+=len;
- usTCPFrameBytesLeft-=len;
+ while (iRes = pConnectedSock->recv((char *)&aucTCPBuf[usTCPBufPos], MB_TCP_BUF_SIZE-usTCPBufPos) ) {
+ usTCPBufPos+=iRes;
+ usTCPFrameBytesLeft-=iRes;
}
/* If we have received the MBAP header we can analyze it and calculate