Protocol.h 945 B

123456789101112131415161718192021222324252627282930313233
  1. // Protocol.h: interface for the CProtocol class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_PROTOCOL_H__B54C8930_9411_4B11_B750_261140346F76__INCLUDED_)
  5. #define AFX_PROTOCOL_H__B54C8930_9411_4B11_B750_261140346F76__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CCommAsyn;
  10. class CProtocol
  11. {
  12. public:
  13. virtual BOOL InitParam(PPORTPARAM pPortParam,CCommAsyn*pComm);
  14. virtual int WorkMain(SETBASEPARAM SetBasePara, int nDataLen, int iCmdPos, int iCmdLen, char chMsg[10]) =0;
  15. virtual int WriteCommand(char DataBuffer[80], char ResDataBuffer[2]) = 0;
  16. CProtocol();
  17. virtual ~CProtocol();
  18. protected:
  19. CCommAsyn* m_pComm;
  20. int WriteMessage(BYTE* pBuf, int len);
  21. int ReadMessage(BYTE *pBuf, int len);
  22. public:
  23. RESPONSE_STRUCT m_structResponse;
  24. REQUESTWRPARAM m_RequestWrParam;
  25. };
  26. #endif // !defined(AFX_PROTOCOL_H__B54C8930_9411_4B11_B750_261140346F76__INCLUDED_)