/[H7]/branches/linux-serial/SlipSerial.cpp
ViewVC logotype

Diff of /branches/linux-serial/SlipSerial.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 43 by torben, Sun Feb 4 20:11:41 2007 UTC revision 54 by torben, Mon Feb 5 10:10:18 2007 UTC
# Line 1  Line 1 
1  #include "StdAfx.h"  //#ifdef _MSC_VER
2  #include ".\slipserial.h"  #include "stdafx.h"
3    //#endif
4    
5    #include "SlipSerial.h"
6    
7  #include <iomanip>  #include <iomanip>
8    
# Line 16  enum SlipState{ Line 19  enum SlipState{
19  #define SLIP_ESCAPED_ESC 221  #define SLIP_ESCAPED_ESC 221
20    
21    
22  CSlipSerial::CSlipSerial(char* port, int bitrate)  CSlipSerial::CSlipSerial(char* port, Baudrate bitrate)
23  : CSerial(port,bitrate)  : CSerial(port,bitrate)
24  {  {
25  }  }
# Line 39  std::vector<unsigned char> CSlipSerial:: Line 42  std::vector<unsigned char> CSlipSerial::
42    
43          while ( /*bytesReady() >0 &&*/ state != SlipStopped)          while ( /*bytesReady() >0 &&*/ state != SlipStopped)
44          {          {
45                  unsigned char data = readByte();                  int c = readByte();
46                    if (c == -1)
47                    {
48                            Sleep(1);
49                            continue;
50                    }
51                    unsigned char data = (unsigned char) c;
52                  switch (state)                  switch (state)
53                  {                  {
54                          case SlipNormal:                          case SlipNormal:
# Line 105  void CSlipSerial::writeSlipByte(unsigned Line 114  void CSlipSerial::writeSlipByte(unsigned
114          }          }
115          else          else
116                  writeByte( out );                  writeByte( out );
 }  
117    }

Legend:
Removed from v.43  
changed lines
  Added in v.54

  ViewVC Help
Powered by ViewVC 1.1.20