CommRS232.h 845 B

123456789101112131415161718192021222324252627282930313233
  1. // CommRS232.h: interface for the CCommRS232 class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_COMMRS232_H__B7D595F0_425B_45C2_91E3_816604795E01__INCLUDED_)
  5. #define AFX_COMMRS232_H__B7D595F0_425B_45C2_91E3_816604795E01__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "CommAsyn.h"
  10. class CCommRS232 : public CCommAsyn
  11. {
  12. public:
  13. virtual int Write(BYTE * pBuf, int len);
  14. virtual int Read(BYTE * pBuf, int len);
  15. virtual BOOL InitParam(PPORTPARAM pPortParam);
  16. virtual int ClearBuffer();
  17. CCommRS232();
  18. virtual ~CCommRS232();
  19. private:
  20. BOOL m_bOpen;
  21. int m_nPort;
  22. HANDLE m_hCom;
  23. // DWORD inQue, outQue;
  24. BOOL CloseComm();
  25. BOOL InitComm(PPORTPARAM pPortParam);
  26. protected:
  27. };
  28. #endif // !defined(AFX_COMMRS232_H__B7D595F0_425B_45C2_91E3_816604795E01__INCLUDED_)