1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #pragma once
- // 下列 ifdef 块是创建使从 DLL 导出更简单的
- // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 BUSUNITCLIENT_EXPORTS
- // 符号编译的。在使用此 DLL 的
- // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
- // BUSUNITCLIENT_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
- // 符号视为是被导出的。
- #ifndef BUSUNITCLIENT_EXPORTS
- #ifdef _WIN64
- #ifdef _DEBUG
- #pragma comment(lib, "BusUnitClientX64D.lib")
- #else
- #pragma comment(lib, "BusUnitClientX64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "BusUnitClientD.lib")
- #else
- #pragma comment(lib, "BusUnitClient.lib")
- #endif
- #endif
- #endif
- #ifdef BUSUNITCLIENT_EXPORTS
- #define BUSUNITCLIENT_API __declspec(dllexport)
- #else
- #define BUSUNITCLIENT_API __declspec(dllimport)
- #endif
- #include "LogicClient.h"
- #include "BusUnitLogic.h"
- // 此类是从 BusUnitClient.dll 导出的
- class BUSUNITCLIENT_API BusUnitClient : public BusUnitLogic, public LogicClient
- {
- public:
- BusUnitClient(void);
- virtual ~BusUnitClient(void);
- // TODO: 在此添加您的方法。
- //内部实现设备的Open
- BusUnitClient& operator = (const BusUnitClient &tValue);
- virtual int Open(const char *pPath, int flags, DWORD timeout = INFINITE);
- virtual PACKET_CMD ReadCmd(ResDataObject &CmdObject);
- //get device resource
- virtual RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource);
- //ResourceCommand Request In and Response Out
- virtual RET_STATUS SYSTEM_CALL Request(ResDataObject PARAM_IN *pRequest, ResDataObject PARAM_OUT *pResponse);
- //notify to lower layer
- //notify&response from real logic device
- virtual RET_STATUS SYSTEM_CALL CmdToLogicDev(ResDataObject PARAM_IN *pCmd);
- //Data Access
- virtual int DATA_ACTION AddDeviceDescrpt(const char PARAM_IN *pDevPath, const char PARAM_IN *pMachineId, UINT64 ProcId, UINT64 Addr,bool forceAdd = false);
- virtual int DATA_ACTION DelDeviceDescrpt(const char PARAM_IN *pDevPath);
- virtual int DATA_ACTION ExitDriverProc();
- virtual int DATA_ACTION SetDeviceStatus(int PARAM_IN DevStatus);
- virtual int DATA_ACTION SetEthBusSwitch(int Switch);//设置网络EBUS开关
- virtual int DATA_ACTION SetEthBusRouterIp(const char PARAM_IN *pRouterIp);//设置网络EBUS的RouterIp
- bool GetDeviceUsage();
- virtual int DATA_ACTION ForTest(bool Flag);
- };
|