/[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 54 by torben, Mon Feb 5 10:10:18 2007 UTC revision 76 by torben, Wed Jun 4 13:06:09 2008 UTC
# Line 9  Line 9 
9  #include <vector>  #include <vector>
10  #include <string>  #include <string>
11  #include <stdexcept>  #include <stdexcept>
 typedef std::vector<unsigned char> UCVector;  
12    
13  #ifndef _MSC_VER //  #ifndef _MSC_VER //
14  inline void Sleep(int x) { usleep(x*1000);}  inline void Sleep(int x) { usleep(x*1000);}
# Line 58  public: //public methods Line 57  public: //public methods
57          int readByte();          int readByte();
58          void writeByte(unsigned char out);          void writeByte(unsigned char out);
59    
60            void writeBytes(unsigned char* buf, unsigned int len);
61            int readBytes(unsigned char* buf, unsigned int maxLen);
62    
63  #ifdef _MSC_VER  #ifdef _MSC_VER
64          COMSTAT getComstat() const;          COMSTAT getComstat() const;
65  #endif  #endif
# Line 68  public: //public methods Line 70  public: //public methods
70    
71          bool isOpen() { return mIsopen; }          bool isOpen() { return mIsopen; }
72    
         //void writeBytes(UCVector out);  
         //UCVector readBytes(int maxcount);  
73  protected:  protected:
74                    
75          void printByte(char* description, unsigned char byte);          void printByte(char* description, unsigned char byte);
76          int convertBaudrate(Baudrate rate);          int convertBaudrate(Baudrate rate);
77    
78  #ifdef _MSC_VER  #ifdef _MSC_VER
79          void openWindows();          void openWindows();
80            int readBytesWindows(unsigned char*buf, unsigned int maxLen);
81            void writeBytesWindows(unsigned char* buf, unsigned int len);
82  #else  #else
83          void openLinux();          void openLinux();
84            int readBytesLinux(unsigned char* buf, unsigned int maxLen);
85            void writeBytesLinux(unsigned char* buf, unsigned int len);
86  #endif  #endif
87  };  };

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

  ViewVC Help
Powered by ViewVC 1.1.20