// Protocol.h: interface for the CProtocol class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_PROTOCOL_H__DAIKIN__INCLUDED_) #define AFX_PROTOCOL_H__DAIKIN__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 nAddr, //地址 int nVer, //版本号 int nCid1, //控制标识码 int nCid2, //命令信息 WORD wLenId, //INFO字节长度 int nCmdID, //命令ID int nDataLen, //请求数据长度 int nCmdPos, //变量索引 int nCmdLen, //变量长度 char chMsg[80], //读到的变量值 char *byDataFlag) = 0; //保留未用 =0; virtual int WriteCommand( int nCommPort, //端口 int nAddr, //地址 int nVer, //版本号 int nCid1, //控制标识码 int nCid2, //命令信息 WORD wLenId, //INFO字节长度 int nCmdType, //命令类型 int nSetValue) = 0; //设定值 virtual int WriteCommand( int nCommPort, //端口 int nAddr, //地址 int nSetType, //设定类型 int nSetIndex, //设定值索引,只针对特殊变量(例如:空调制冷、制热温度) int nSetValue) = 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_)