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:
- 1:e35ceaa8c758
- Parent:
- 0:62be54b8975d
- Child:
- 2:53de07fd9705
--- a/ModBus/porttcp.cpp Tue Mar 13 09:11:49 2012 +0000
+++ b/ModBus/porttcp.cpp Tue Mar 13 13:12:21 2012 +0000
@@ -213,16 +213,9 @@
return FALSE;
}
- /* Though this part is verbose, it doesn't work when data is recieved directly into aucTCPBuf. */
- while (len = pConnectedSock->recv(&buf[total], MB_TCP_BUF_SIZE-total) ) {
- total+=len;
- }
-
- if(total>0){
- memcpy((char *)&aucTCPBuf[usTCPBufPos],buf,total);
- usTCPBufPos+=total;
- usTCPFrameBytesLeft-=total;
- prvMBTCPGetFrame();
+ while (len = pConnectedSock->recv((char *)&aucTCPBuf[usTCPBufPos], MB_TCP_BUF_SIZE-usTCPBufPos) ) {
+ usTCPBufPos+=len;
+ usTCPFrameBytesLeft-=len;
}
/* If we have received the MBAP header we can analyze it and calculate