| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- // 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 nRequestLen, //请求数据总长度
- int nResponseLen, //响应数据总长度
- int nCmd, //命令
- int nCmdPos, //变量索引
- int nCmdLen, //变量长度
- int nParam, //参数
- char chMsg[80] ) = 0; //读到变量值
- virtual int WriteCommand(SETBASEPARAM SetBasePara, double dbData, 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_)
|