// Protocol.h: interface for the CProtocol class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_PROTOCOL_H__B54C8930_9411_4B11_B750_261140346F76__INCLUDED_) #define AFX_PROTOCOL_H__B54C8930_9411_4B11_B750_261140346F76__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CCommAsyn; class CProtocol { public: virtual BOOL InitParam(PPORTPARAM pPortParam,CCommAsyn*pComm); virtual int WorkMain( int nCommPort, int nAddr, char szCmd[32], char chSendMsg[32], int nDataLen, char chMsg[UPS_KE_HUA_MAX_MSG]) =0; virtual int WriteCommand(char DataBuffer[80], int nDataLen) = 0; CProtocol(); virtual ~CProtocol(); protected: CCommAsyn* m_pComm; int WriteMessage(BYTE* pBuf, int len); int ReadMessage(BYTE *pBuf, int len); public: RESPONSE_STRUCT m_structResponse; }; #endif // !defined(AFX_PROTOCOL_H__B54C8930_9411_4B11_B750_261140346F76__INCLUDED_)