12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #define NEWMODELDPC_API
- #define NEWMODELDPC_C_API extern "C"
- #include "ModuleDriver.h"
- #include "VirtualDevice.h"
- #include "CCOS.Dev.IODevice.hpp"
- #include <vector>
- #include <memory>
- #include <string>
- #include <cstdint>
- NEWMODELDPC_C_API DriverDPC* GetDriverDPC();
- NEWMODELDPC_C_API void ReleaseDriverDPC(DriverDPC *p);
- namespace nsDEV = CCOS::Dev;
- typedef int (*ImageProcessAPI)(int , std::string& , char* , char*, DWORD , LogicDevice* , LogicDevice* );
- class NewModelDevice;
- class NEWMODELDPC_API NewModelDPC : public ModuleDriver
- {
- friend class NewModelDevice;
- std::string *m_pWorkpath;
- int m_nServerIdx; //同SDK 的索引
- std::unique_ptr <nsDEV::IODriver> m_NewDevManager; //IODriver对象
- void* m_Module;
- bool InitDeviceMgr(const char *pDriverpath);
- bool LoadVirtualDevice(const char* pDevicePath, bool isImgDevice = false, bool bAddToList = true, std::string devPath="", std::string devSrvPath="");
- //图像处理设备x个,消息处理设备x个
- std::vector<VirtualDevice*> m_arrImgeProcessDevices;
- std::vector<ImageProcessAPI> m_arrImgeFunc;
- std::vector<VirtualDevice*> m_arrMessageProcessDevices;
- LogicDevice* m_MainHostDevice;
- void* m_hImgeDeviceHandle;
- void* m_hMessageDeviceHandle;
- ResDataObject m_resHardwareInfo;
- int ImageRrocess(int Type, std::string& imageHead, ResDataObject& resContext, char* pFrameBuff, DWORD FrameSize, NewModelDevice* pDeviceFrom);
- int NotifyMessageProcess(ResDataObject& resNotify, NewModelDevice* pDeviceFrom);
- public:
- NewModelDPC(void);
- virtual ~NewModelDPC(void) override;
- virtual bool DriverEntry(ResDataObject &Configuration) override;
- virtual bool GetDeviceType(GUID &DevType) override;
- //virtual void SubscribeSelf() override;
- virtual bool SetDriverWorkPath(const char *pWorkPath) override;
- RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject *pDeviceResource);
- virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo) override;
- virtual bool SYSTEM_CALL Device_Probe(ResDataObject& PARAM_OUT HardwareInfo) override;
- virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath) override;
- virtual bool Connect() override;
- virtual bool SYSTEM_CALL GetConnectionStatus() override;
- virtual void DisConnect() override;
- virtual bool SYSTEM_CALL OnHeartBeat() override;
- virtual PVOID LoadLogicDevices() override;
- virtual void UnloadLogicDevices() override;
- virtual RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT* pDeviceConfig) override;
- virtual RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN* DeviceConfig) override;
- RET_STATUS OnAction(const char* pszActionName, const char* pszParams, ResDataObject& resResponse);
- DWORD SYSTEM_CALL OnNotify(std::vector<std::shared_ptr<LinuxEvent>> evtList, DWORD count);
- };
|