CommAsyn.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // CommAsyn.h: interface for the CCommAsyn class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_COMMASYN_H__8351010D_0DD3_4F8C_8F3B_959BA59019E7__INCLUDED_)
  5. #define AFX_COMMASYN_H__8351010D_0DD3_4F8C_8F3B_959BA59019E7__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #define STATUS_NORMAL 0
  10. #define STATUS_FAULT 1
  11. #define STATUS_NOUSE 2
  12. #define STATUS_TYPEERROR 3
  13. #define COMM_CORRECT 0
  14. #define COMM_ERROR 1
  15. #define MAX_DATA_NUM128 128
  16. #define MAX_YXNO 2048
  17. #define MAX_YCNO 2048
  18. class CProtocol;
  19. class CCommAsyn
  20. {
  21. public:
  22. CProtocol* m_pProtocol;
  23. virtual int Write(BYTE * pBuf, int len) =0;
  24. virtual int Read(BYTE * pBuf, int len) =0;
  25. virtual int WorkMain(SETBASEPARAM SetBasePara, int nDataLen, int iCmdPos, int iCmdLen, char chMsg[10]);
  26. virtual int WriteCommand(char DataBuffer[80], char ResDataBuffer[2]);
  27. virtual BOOL InitParam(PPORTPARAM pPortParam);
  28. virtual BOOL CloseComm();
  29. CCommAsyn();
  30. virtual ~CCommAsyn();
  31. };
  32. #endif // !defined(AFX_COMMASYN_H__8351010D_0DD3_4F8C_8F3B_959BA59019E7__INCLUDED_)