Parent Directory | Revision Log | Patch
revision 61 by torben, Mon Feb 5 10:10:18 2007 UTC | revision 62 by torben, Tue Feb 6 14:01:26 2007 UTC | |
---|---|---|
# | Line 2 | Line 2 |
2 | #include "stdafx.h" | #include "stdafx.h" |
3 | //#endif | //#endif |
4 | ||
5 | #include <stdexcept> | |
6 | ||
7 | #include "SlipSerial.h" | #include "SlipSerial.h" |
8 | ||
9 | #include <iomanip> | #include <iomanip> |
10 | #include <iostream> | |
11 | enum SlipState{ | enum SlipState{ |
12 | SlipNormal, | SlipNormal, |
13 | SlipEscaped, | SlipEscaped, |
# | Line 40 std::vector<unsigned char> CSlipSerial:: | Line 42 std::vector<unsigned char> CSlipSerial:: |
42 | ||
43 | int state = SlipNormal; | int state = SlipNormal; |
44 | ||
45 | int now; | |
46 | int start = time(0); | |
47 | ||
48 | while ( /*bytesReady() >0 &&*/ state != SlipStopped) | while ( /*bytesReady() >0 &&*/ state != SlipStopped) |
49 | { | { |
50 | now = time(0); | |
51 | if ( (now - start)>3) | |
52 | throw timeout_error("readFrame() timed out"); | |
53 | ||
54 | int c = readByte(); | int c = readByte(); |
55 | if (c == -1) | if (c == -1) |
56 | { | { |
|
ViewVC Help | |
Powered by ViewVC 1.1.20 |