IRControl.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  2. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 IRCONTROL_EXPORTS
  3. // 符号编译的。在使用此 DLL 的
  4. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  5. // IRCONTROL_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  6. // 符号视为是被导出的。
  7. #ifdef IRCONTROL_EXPORTS
  8. #define IRCONTROL_API __declspec(dllexport)
  9. #else
  10. #define IRCONTROL_API __declspec(dllimport)
  11. #endif
  12. #ifndef __MAKE_PYD__ // 是否使用PYD;
  13. extern "C" IRCONTROL_API int nIRControl;
  14. //////////////////////////////////////////////////////////////////////////
  15. // 程序是否在运行;
  16. extern "C" IRCONTROL_API DWORD IsAppRunning(LPCTSTR lpszAppDir);
  17. // 启动红老鼠服务进程;
  18. extern "C" IRCONTROL_API bool StartIRApp(LPCTSTR lpszAppDir, LPCTSTR lpSignalXml, DWORD dwPort);
  19. // 关闭红老鼠;
  20. extern "C" IRCONTROL_API bool CloseApp();
  21. //////////////////////////////////////////////////////////////////////////
  22. extern "C" IRCONTROL_API bool Connect(LPCTSTR lpServer, int port);
  23. extern "C" IRCONTROL_API void DisConnect();
  24. // 返回设备列表,以逗号隔开;
  25. extern "C" IRCONTROL_API LPCTSTR getDeviceNames();
  26. // 获取信号数据集信号,以\n分隔;
  27. extern "C" IRCONTROL_API LPCTSTR getSignalsName();
  28. // 加载xml文件;
  29. extern "C" IRCONTROL_API bool loadSignalDataSet(LPCTSTR lpDatasetXml);
  30. // 发送单个信号;
  31. extern "C" IRCONTROL_API bool sendSignal(LPCTSTR lpSignal, int send_times, int sleep_time);
  32. // 发送多个信号,以逗号分隔;
  33. extern "C" IRCONTROL_API bool sendSignals(LPCTSTR lpSignals, int sleep_time);
  34. // 发送重复信号;
  35. extern "C" IRCONTROL_API bool sendRepeatsSignal(LPCTSTR lpSignal, int repeat_time);
  36. #endif