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.
Diff: Receiver.cpp
- Revision:
- 8:7c56fb1ed8c0
- Parent:
- 7:332766fb3114
- Child:
- 9:8f479f7c1b54
--- a/Receiver.cpp Tue Oct 24 07:04:28 2017 +0000 +++ b/Receiver.cpp Wed Oct 25 04:17:42 2017 +0000 @@ -14,7 +14,10 @@ char Receiver::getNext() { - dataReady.wait(); + if(dataReady.wait(2)==0) + { + return BitData::timeout; + } char val = data[currentData]; currentData++; if(currentData==size) @@ -136,8 +139,9 @@ //data for(int i = 0; i < length; i++) { - if(!getByte(byte)) - return false; + if(!getByte(byte)){ + return false; + } message.push_back(byte); frame.push_back(byte); }