/[H7]/branches/linux-serial/Serial.h
ViewVC logotype

Diff of /branches/linux-serial/Serial.h

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

revision 44 by torben, Sun Feb 4 21:22:44 2007 UTC revision 48 by torben, Mon Feb 5 01:10:50 2007 UTC
# Line 7  Line 7 
7  #pragma once  #pragma once
8    
9  #include <vector>  #include <vector>
10    #include <string>
11    #include <stdexcept>
12  typedef std::vector<unsigned char> UCVector;  typedef std::vector<unsigned char> UCVector;
13    
14  #ifndef _WINDOWS //  #ifndef _WINDOWS //
15  inline void Sleep(int x) { usleep(x*1000);}  inline void Sleep(int x) { usleep(x*1000);}
16    #include <termios.h>
17  #endif  #endif
18    
19    
# Line 21  class CSerial Line 24  class CSerial
24          DCB mDcbRestore;          DCB mDcbRestore;
25  #else  #else
26          int mFiledescriptor;          int mFiledescriptor;
27            termios mOldtio;
28  #endif  #endif
29                    
30          char* mPortstr;          char* mPortstr;
31          int mBitrate;          int mBitrate;
32          bool mIsopen;          bool mIsopen;
33    
         //void printByte(char* description, unsigned char byte);  
34  public:  public:
35          CSerial();          CSerial();
36          CSerial(char* port, int bitrate);          CSerial(char* port, int bitrate);
37          ~CSerial(void);          virtual ~CSerial(void);
38    
39          void close();          void close();
40          void open(char* port, int bitrate);          void open(char* port, int bitrate);
41    
42          unsigned char readByte();          int readByte();
43          void writeByte(unsigned char out);          void writeByte(unsigned char out);
44    
45  #ifdef _WINDOWS  #ifdef _WINDOWS
# Line 53  public: Line 56  public:
56          //UCVector readBytes(int maxcount);          //UCVector readBytes(int maxcount);
57  protected:  protected:
58                    
59            void printByte(char* description, unsigned char byte);
60  #ifdef _WINDOWS  #ifdef _WINDOWS
61          void openWindows();          void openWindows();
62  #else  #else

Legend:
Removed from v.44  
changed lines
  Added in v.48

  ViewVC Help
Powered by ViewVC 1.1.20