Protocol.h 967 B

1234567891011121314151617181920212223242526272829303132333435363738
  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( int nCommPort,
  15. int nAddr,
  16. char szCmd[32],
  17. char chSendMsg[32],
  18. int nDataLen,
  19. char chMsg[UPS_KE_HUA_MAX_MSG]) =0;
  20. virtual int WriteCommand(char DataBuffer[80], int nDataLen) = 0;
  21. CProtocol();
  22. virtual ~CProtocol();
  23. protected:
  24. CCommAsyn* m_pComm;
  25. int WriteMessage(BYTE* pBuf, int len);
  26. int ReadMessage(BYTE *pBuf, int len);
  27. public:
  28. RESPONSE_STRUCT m_structResponse;
  29. };
  30. #endif // !defined(AFX_PROTOCOL_H__B54C8930_9411_4B11_B750_261140346F76__INCLUDED_)