DiosCtrlBoxCArm.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #pragma once
  2. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  3. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 DIOSCTRLBOX_EXPORTS
  4. // 符号编译的。在使用此 DLL 的
  5. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  6. // DIOSCTRLBOX_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  7. // 符号视为是被导出的。
  8. #ifndef DIOSCTRLBOX_EXPORTS
  9. #ifdef _WIN64
  10. #ifdef _DEBUG
  11. #pragma comment(lib, "DiosCtrlBoxCArmX64D.lib")
  12. #else
  13. #pragma comment(lib, "DiosCtrlBoxCArmX64.lib")
  14. #endif
  15. #else
  16. #ifdef _DEBUG
  17. #pragma comment(lib, "DiosCtrlBoxCArmD.lib")
  18. #else
  19. #pragma comment(lib, "DiosCtrlBoxCArm.lib")
  20. #endif
  21. #endif
  22. #endif
  23. #ifdef DIOSCTRLBOX_EXPORTS
  24. #define DIOSCTRLBOX_API __declspec(dllexport)
  25. #define DIOSCTRLBOX_C_API extern "C" __declspec(dllexport)
  26. #else
  27. #define DIOSCTRLBOX_API __declspec(dllimport)
  28. #define DIOSCTRLBOX_C_API extern "C" __declspec(dllimport)
  29. #endif
  30. #include "DPC.h"
  31. #include "Generator_Model_Def.h"
  32. #include "DiosLogicDeviceStructure.h"
  33. #pragma pack(push, 1)
  34. class DIOSCTRLBOX_API DiosCtrlBoxDPC : public LogicDriver
  35. {
  36. public:
  37. DiosCtrlBoxDPC(void);
  38. virtual ~DiosCtrlBoxDPC(void);
  39. virtual bool DriverEntry(ResDataObject &Configuration);
  40. virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo);
  41. virtual RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource);
  42. virtual bool SetDriverWorkPath(const char *pWorkPath);
  43. virtual PVOID SYSTEM_CALL LoadDriver();//无根节点
  44. virtual void SYSTEM_CALL UnloadDriver();
  45. //actions
  46. virtual bool Connect();
  47. virtual void DisConnect();
  48. virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath);
  49. //逻辑设备树的加载和卸载
  50. virtual PVOID SYSTEM_CALL LoadLogicDevices();
  51. virtual void SYSTEM_CALL UnloadLogicDevices();
  52. virtual bool Device_Probe(ResDataObject &HardwareInfo);
  53. virtual DWORD SYSTEM_CALL OnNotify(HANDLE evtList[], DWORD count);
  54. virtual RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig) override;
  55. virtual RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig)override;
  56. private:
  57. void InstallLoggers(const std::string &workpath);
  58. void IntallPinDefineFile(const std::string &workpath);
  59. private:
  60. ResDataObject m_resources;
  61. void *m_dpcHandler;
  62. void *m_handleComm;
  63. void *m_handleDispatcher;
  64. };
  65. DIOSCTRLBOX_C_API DriverDPC* GetDriverDPC();
  66. DIOSCTRLBOX_C_API void ReleaseDriverDPC(DriverDPC *p);