A library for talking to Multi-Tech's Cellular SocketModem Devices.
Dependents: M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more
Revision 129:3aa470877c59, committed 2014-01-02
- Comitter:
- jengbrecht
- Date:
- Thu Jan 02 20:59:09 2014 +0000
- Parent:
- 128:cd154c0253d9
- Child:
- 130:5a8af68a46ec
- Child:
- 133:da0a2a7b5aa1
- Commit message:
- Updated MTSSerial handle read call to look more like MTSSerialFlowControl
Changed in this revision
io/MTSSerial.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/io/MTSSerial.cpp Thu Jan 02 20:19:46 2014 +0000 +++ b/io/MTSSerial.cpp Thu Jan 02 20:59:09 2014 +0000 @@ -27,11 +27,12 @@ void MTSSerial::handleRead() { - while (serial.readable() && rxBuffer.remaining()) { - rxBuffer.write(serial.getc()); - } - if (!rxBuffer.remaining() && serial.readable()) { - printf("[WARNING] Receieve buffer full, possible data loss.\r\n"); + while (serial.readable()) { + char byte = serial.getc(); + if(rxBuffer.write(byte) != 1) { + printf("[ERROR] Serial Rx Byte Dropped [%c][0x%02X]\r\n", byte, byte); + return; + } } }