#pragma once #define CONTAINERDPC_API #define CONTAINERDPC_C_API extern "C" #include "LogicDriver.h" //#include "CCOS.Dev.IODevice.hpp" #include "DriverDefine.h" #include "common_api.h" CONTAINERDPC_C_API DriverDPC* GetDriverDPC(); CONTAINERDPC_C_API void ReleaseDriverDPC(DriverDPC *p); /// /// 记录日志到平台 /// /// /// /// CONTAINERDPC_C_API void DeviceLog(int LogLevel, string Context); /// /// 系统事件日志记录 /// /// /// /// /// /// CONTAINERDPC_C_API void CCOSSystemLog(int cmd, string Code, string Context, string SenderId = ""); /// /// 属性通知 /// /// /// /// /// CONTAINERDPC_C_API void CCOSNotifyCallBackEntry(int cmdType, string keyType, string Context); /// /// 图像数据回调通知 /// /// /// /// /// /// /// /// CONTAINERDPC_C_API void RawDataNotifyCallBackEntry(int cmdType, string keyType, string Context, string Head, char* pRawData, int DataLength); /// /// 设置图像缓冲区的大小 /// /// /// /// /// /// /// CONTAINERDPC_C_API void NotifyCallBackSetBlockSize(string QueName, DWORD BlockSize, DWORD FulBlockCount, DWORD PrevBlockSize, DWORD PrevBlockCount); //namespace nsDEV = CCOS::Dev; class CONTAINERDPC_API ContainerDPC : public LogicDriver { std::string *m_pWorkpath; //std::unique_ptr m_NewDevManager; //IODriver对象 std::vector m_DriverFunctions; CCOS_DRIVER_OBJ m_ContainerManager; CCOS_DEVICE_OBJ m_ContainerDeviceManager; void* m_Module; bool InitDeviceMgr(const char *pDriverpath); public: ContainerDPC(void); virtual ~ContainerDPC(void); virtual bool DriverEntry(ResDataObject &Configuration); virtual bool GetDeviceType(GUID &DevType); //virtual void SubscribeSelf() override; virtual bool SetDriverWorkPath(const char *pWorkPath); RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject *pDeviceResource); virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo); virtual bool SYSTEM_CALL Device_Probe(ResDataObject& PARAM_OUT HardwareInfo); virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath); virtual bool Connect(); virtual bool SYSTEM_CALL GetConnectionStatus(); virtual void DisConnect(); virtual bool SYSTEM_CALL OnHeartBeat(); virtual PVOID LoadLogicDevices(); virtual void UnloadLogicDevices(); virtual RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT* pDeviceConfig); virtual RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN* DeviceConfig); protected: bool CheckDriver(); ResDataObject m_Config; //配置项 std::string m_strConfigFilePath; //配置文件路径 };