#ifndef __SERIAL_Device_H__ /* (C) 2003 XDA Developers itsme@xs4all.nl * * $Header$ */ #include "CircularBuffer.h" class SerialDevice { public: SerialDevice(); ~SerialDevice(); bool open(const std::string& devicename); void close(); bool ReceiveData(ByteVector& buf, int timeout); bool SendData(const ByteVector& buf); bool SendData(const std::string& buf); bool WriteCommand(const std::string& cmd, std::string& reply); private: HANDLE m_hPort; HANDLE m_hThread; DWORD m_nThreadId; CircularBuffer m_rcv; static DWORD MainThreadProc(SerialDevice *port); DWORD PortThreadProc(); void handleRXCharEvent(); bool UpdateCommParams(); }; #define __SERIAL_Device_H__ #endif