Own fork of MbedSmartRest
Dependents: MbedSmartRestMain MbedSmartRestMain
Fork of MbedSmartRest by
Diff: MbedDataSink.cpp
- Revision:
- 14:56478403e340
- Parent:
- 0:099f76422485
- Child:
- 17:b3a4b4bdfc59
diff -r aba98ad2ac1b -r 56478403e340 MbedDataSink.cpp --- a/MbedDataSink.cpp Sat Nov 15 12:21:41 2014 +0100 +++ b/MbedDataSink.cpp Mon Feb 16 09:15:55 2015 +0000 @@ -32,6 +32,7 @@ #include <string.h> #include "mbed.h" +size_t packetSize = 0; MbedDataSink::MbedDataSink(TCPSocketConnection& sock) : _len(0), _sock(sock) { @@ -49,6 +50,7 @@ } _buf[_len++] = c; + ++packetSize; return 1; } @@ -71,7 +73,7 @@ _len += len; sent += len; } - + packetSize += length; return length; } @@ -84,7 +86,7 @@ { char str[24]; - snprintf(str, 24, "%lu", number); + packetSize += snprintf(str, 24, "%lu", number); return write(str); }