NewModelDPC.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #define NEWMODELDPC_API
  2. #define NEWMODELDPC_C_API extern "C"
  3. #include "ModuleDriver.h"
  4. #include "VirtualDevice.h"
  5. #include "CCOS.Dev.IODevice.hpp"
  6. #include <vector>
  7. #include <memory>
  8. #include <string>
  9. #include <cstdint>
  10. NEWMODELDPC_C_API DriverDPC* GetDriverDPC();
  11. NEWMODELDPC_C_API void ReleaseDriverDPC(DriverDPC *p);
  12. namespace nsDEV = CCOS::Dev;
  13. typedef int (*ImageProcessAPI)(int , std::string& , char* , char*, DWORD , LogicDevice* , LogicDevice* );
  14. class NewModelDevice;
  15. class NEWMODELDPC_API NewModelDPC : public ModuleDriver
  16. {
  17. friend class NewModelDevice;
  18. std::string *m_pWorkpath;
  19. int m_nServerIdx; //同SDK 的索引
  20. std::unique_ptr <nsDEV::IODriver> m_NewDevManager; //IODriver对象
  21. void* m_Module;
  22. bool InitDeviceMgr(const char *pDriverpath);
  23. bool LoadVirtualDevice(const char* pDevicePath, bool isImgDevice = false, bool bAddToList = true, std::string devPath="", std::string devSrvPath="");
  24. //图像处理设备x个,消息处理设备x个
  25. std::vector<VirtualDevice*> m_arrImgeProcessDevices;
  26. std::vector<ImageProcessAPI> m_arrImgeFunc;
  27. std::vector<VirtualDevice*> m_arrMessageProcessDevices;
  28. LogicDevice* m_MainHostDevice;
  29. void* m_hImgeDeviceHandle;
  30. void* m_hMessageDeviceHandle;
  31. ResDataObject m_resHardwareInfo;
  32. int ImageRrocess(int Type, std::string& imageHead, ResDataObject& resContext, char* pFrameBuff, DWORD FrameSize, NewModelDevice* pDeviceFrom);
  33. int NotifyMessageProcess(ResDataObject& resNotify, NewModelDevice* pDeviceFrom);
  34. public:
  35. NewModelDPC(void);
  36. virtual ~NewModelDPC(void) override;
  37. virtual bool DriverEntry(ResDataObject &Configuration) override;
  38. virtual bool GetDeviceType(GUID &DevType) override;
  39. //virtual void SubscribeSelf() override;
  40. virtual bool SetDriverWorkPath(const char *pWorkPath) override;
  41. RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject *pDeviceResource);
  42. virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo) override;
  43. virtual bool SYSTEM_CALL Device_Probe(ResDataObject& PARAM_OUT HardwareInfo) override;
  44. virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath) override;
  45. virtual bool Connect() override;
  46. virtual bool SYSTEM_CALL GetConnectionStatus() override;
  47. virtual void DisConnect() override;
  48. virtual bool SYSTEM_CALL OnHeartBeat() override;
  49. virtual PVOID LoadLogicDevices() override;
  50. virtual void UnloadLogicDevices() override;
  51. virtual RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT* pDeviceConfig) override;
  52. virtual RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN* DeviceConfig) override;
  53. RET_STATUS OnAction(const char* pszActionName, const char* pszParams, ResDataObject& resResponse);
  54. DWORD SYSTEM_CALL OnNotify(std::vector<std::shared_ptr<LinuxEvent>> evtList, DWORD count);
  55. };