Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: C++ | Size: 0.61 KB | Hits: 78 | Expires: Never
Copy text to clipboard
  1. #ifdef WIN32
  2. #ifndef WIN32UARTLINE_H
  3. #define WIN32UARTLINE_H
  4.  
  5. #include "ioline.h"
  6. #include <windows.h>
  7. #include <QString>
  8.  
  9. class Win32UartLine : public IOLine
  10. {
  11. public:
  12.         Win32UartLine(const QString& devname);
  13.         virtual ~Win32UartLine();
  14.  
  15.         bool open();
  16.         bool close();
  17.  
  18.         bool setBaudRate(int br);
  19.         bool setTimeout(int to);
  20.  
  21.         virtual size_t read(int toread, uint8_t* buf);
  22.         virtual size_t write(int towrite, uint8_t* buf);
  23.  
  24.         virtual void purge();
  25.  
  26.         virtual bool setSpeed(int speed);
  27.  
  28. private:
  29.         QString m_devName;
  30.         int m_readTimeout;
  31.         HANDLE m_handle;
  32. };
  33.  
  34. #endif // WIN32UARTLINE_H
  35. #endif // WIN32