| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- /**
- * @content:HardwareI接口定义文件
- * @time:2016-9-7
- * @author:Mr_zhu
- * @version: V1.0
- * @describe:
- * 1#2016-9-7#V1.0#首次生成
- */
-
- #ifndef INCLUDE_IHARDWARE_H_
- #define INCLUDE_IHARDWARE_H_
-
- #include <map>
- #include <string>
-
- #include "../common/IUnknown.h"
- #include "../common/Type.h"
-
- struct CallBackHandleI;
-
- interface HardwareI:IUnknown{
- /**
- * 设置硬件参数
- */
- virtual HRESULT setParam(
- std::map<std::string,std::string>::iterator param,
- const int length
- ) = 0;
-
- /**
- * 打开硬件
- */
- virtual HRESULT openHW() = 0;
-
- /**
- * 初始化硬件
- */
- virtual HRESULT init() = 0;
-
- /**
- * 启动硬件
- */
- virtual HRESULT start() = 0;
-
- /**
- * 停止硬件
- */
- virtual HRESULT stop() = 0;
-
- /**
- * 挂起硬件
- */
- virtual HRESULT hang() = 0;
-
- /**
- * 恢复硬件
- */
- virtual HRESULT resume() = 0;
-
- /**
- * 硬件是否处于运行
- */
- virtual HRESULT isRun() = 0;
-
- /**
- * 硬件是否挂起
- */
- virtual HRESULT isHang() = 0;
-
- /**
- * 注册硬件回调接口
- */
- virtual HRESULT registerHandler(
- CallBackHandleI *pfunc
- ) = 0;
-
- /**
- * 同步写操作
- */
- virtual HRESULT syncRead(
- PBYTE preadbuf,
- const unsigned int length,
- int& len,
- const unsigned int timeout
- ) = 0;
-
- /**
- * 异步读操作
- */
- virtual HRESULT asyncRead(
- PBYTE preadbuf,
- const unsigned int length,
- int& len
- ) = 0;
-
- /**
- * 同步写操作
- */
- virtual HRESULT syncWrite(
- PBYTE pwritebuf,
- const unsigned int length,
- int& len,
- const unsigned int timeout
- ) = 0;
-
- /**
- * 异步写操作
- */
- virtual HRESULT asyncWrite(
- PBYTE pwritebuf,
- const unsigned int length,
- int& len
- ) = 0;
-
- /**
- * 释放硬件
- */
- virtual HRESULT realeseHW() = 0;
-
- virtual ~HardwareI(){}
- };
-
- #endif /* INCLUDE_IHARDWARE_H_ */
|