12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #pragma once
- // 下列 ifdef 块是创建使从 DLL 导出更简单的
- // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 DIOSCTRLBOX_EXPORTS
- // 符号编译的。在使用此 DLL 的
- // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
- // DIOSCTRLBOX_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
- // 符号视为是被导出的。
- #ifndef DIOSCTRLBOX_EXPORTS
- #ifdef _WIN64
- #ifdef _DEBUG
- #pragma comment(lib, "DiosCtrlBoxSTDSX64D.lib")
- #else
- #pragma comment(lib, "DiosCtrlBoxSTDSX64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "DiosCtrlBoxSTDSD.lib")
- #else
- #pragma comment(lib, "DiosCtrlBoxSTDS.lib")
- #endif
- #endif
- #endif
- #ifdef DIOSCTRLBOX_EXPORTS
- #define DIOSCTRLBOX_API __declspec(dllexport)
- #define DIOSCTRLBOX_C_API extern "C" __declspec(dllexport)
- #else
- #define DIOSCTRLBOX_API __declspec(dllimport)
- #define DIOSCTRLBOX_C_API extern "C" __declspec(dllimport)
- #endif
- #include "DPC.h"
- #include "Generator_Model_Def.h"
- #include "DiosLogicDeviceStructure.h"
- #pragma pack(push, 1)
- class DIOSCTRLBOX_API DiosCtrlBoxDPC : public LogicDriver
- {
- public:
- DiosCtrlBoxDPC(void);
- virtual ~DiosCtrlBoxDPC(void);
- virtual bool DriverEntry(ResDataObject &Configuration);
- virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo);
- virtual RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource);
- virtual bool SetDriverWorkPath(const char *pWorkPath);
- virtual PVOID SYSTEM_CALL LoadDriver();//无根节点
- virtual void SYSTEM_CALL UnloadDriver();
- //actions
- virtual bool Connect();
- virtual void DisConnect();
- virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath);
- //逻辑设备树的加载和卸载
- virtual PVOID SYSTEM_CALL LoadLogicDevices();
- virtual void SYSTEM_CALL UnloadLogicDevices();
- virtual bool Device_Probe(ResDataObject &HardwareInfo);
- virtual DWORD SYSTEM_CALL OnNotify(HANDLE evtList[], DWORD count);
- virtual RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig) override;
- virtual RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig)override;
- private:
- void InstallLoggers(const std::string &workpath);
- void IntallPinDefineFile(const std::string &workpath);
- private:
- ResDataObject m_resources;
- void *m_dpcHandler;
- void *m_handleComm;
- void *m_handleDispatcher;
- };
- DIOSCTRLBOX_C_API DriverDPC* GetDriverDPC();
- DIOSCTRLBOX_C_API void ReleaseDriverDPC(DriverDPC *p);
|