| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- // CommAsyn.h: interface for the CCommAsyn class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_COMMASYN_H__DAIKIN__INCLUDED_)
- #define AFX_COMMASYN_H__DAIKIN__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #define STATUS_NORMAL 0
- #define STATUS_FAULT 1
- #define STATUS_NOUSE 2
- #define STATUS_TYPEERROR 3
- #define COMM_CORRECT 0
- #define COMM_ERROR 1
- #define MAX_DATA_NUM128 128
- #define MAX_YXNO 2048
- #define MAX_YCNO 2048
- class CProtocol;
- class CCommAsyn
- {
- public:
- CProtocol* m_pProtocol;
- virtual int Write(BYTE * pBuf, int len) =0;
- virtual int Read(BYTE * pBuf, int len) =0;
- 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); //保留未用
- virtual int WriteCommand(
- int nCommPort, //端口
- int nAddr, //地址
- int nVer, //版本号
- int nCid1, //控制标识码
- int nCid2, //命令信息
- WORD wLenId, //INFO字节长度
- int nCmdType, //命令类型
- int nSetValue); //设定值
- virtual int WriteCommand(
- int nCommPort, //端口
- int nAddr, //地址
- int nSetType, //设定类型
- int nSetIndex, //设定值索引,只针对特殊变量(例如:空调制冷、制热温度)
- int nSetValue); //设定值
- virtual BOOL InitParam(PPORTPARAM pPortParam);
- virtual BOOL CloseComm();
- CCommAsyn();
- virtual ~CCommAsyn();
- };
- #endif // !defined(AFX_COMMASYN_H__8351010D_0DD3_4F8C_8F3B_959BA59019E7__INCLUDED_)
|