TCLCommand.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  2. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 TCLCOMMAND_EXPORTS
  3. // 符号编译的。在使用此 DLL 的
  4. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  5. // TCLCOMMAND_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  6. // 符号视为是被导出的。
  7. #ifdef TCLCOMMAND_EXPORTS
  8. #define TCLCOMMAND_API __declspec(dllexport)
  9. #else
  10. #define TCLCOMMAND_API __declspec(dllimport)
  11. #endif
  12. #ifdef EXPORTS_CLASS
  13. //class TCLCommand;
  14. #include "CommandParam.h"
  15. // 此类是从 TCLCommand.dll 导出的
  16. class TCLCOMMAND_API CTCLCommand {
  17. public:
  18. CTCLCommand(void);
  19. // TODO: 在此添加您的方法。
  20. bool Open(int nPort, DWORD dwBaudrate, BYTE ByteSize, BYTE Parity, BYTE StopBits);
  21. void Close();
  22. bool IsOpen();
  23. void SetExternalCMDParams(LPCTSTR lpFileName);
  24. bool GetCommandParams(std::string name, CommandParam& cmdPara);
  25. void PackingCommand(CommandParam& cmdPara, LPVOID data = NULL, const int& dataLen = 0);
  26. bool SendCommand(std::string name, CommandParam& cmdPara, LPVOID data = NULL, int dataLen = 0);
  27. };
  28. extern TCLCOMMAND_API int nTCLCommand;
  29. TCLCOMMAND_API int fnTCLCommand(void);
  30. #else
  31. // 打开串口;
  32. TCLCOMMAND_API bool Open(int nPort, DWORD dwBaudrate, BYTE ByteSize, BYTE Parity, BYTE StopBits);
  33. // 关闭串口;
  34. TCLCOMMAND_API void Close();
  35. // 串口是否打开;
  36. TCLCOMMAND_API bool IsOpen();
  37. TCLCOMMAND_API void SetExternalCMDParams(LPCTSTR lpFileName);
  38. // 指令接口;
  39. TCLCOMMAND_API bool EnterFactory();
  40. TCLCOMMAND_API bool LeaveFactory();
  41. TCLCOMMAND_API bool GetProjectId(int &pid);
  42. TCLCOMMAND_API bool GetSoftVersion(std::string &strValue);
  43. TCLCOMMAND_API bool GetDeviceId(std::string &strValue);
  44. TCLCOMMAND_API bool GetClientType(std::string &strValue);
  45. TCLCOMMAND_API bool GetMAC(std::string &strValue);
  46. TCLCOMMAND_API bool GetHDCPKey(std::string &strValue);
  47. TCLCOMMAND_API bool GetHDCPKey22(std::string &strValue);
  48. TCLCOMMAND_API bool GetWidi(std::string &strValue);
  49. TCLCOMMAND_API bool GetNetflixESN(std::string &strValue);
  50. TCLCOMMAND_API bool GetWidevine(std::string &strValue);
  51. TCLCOMMAND_API bool GetCiKey(std::string &strValue);
  52. TCLCOMMAND_API bool GetOSDLanguage(std::string &strValue);
  53. TCLCOMMAND_API bool GetShopLanguage(std::string &strValue);
  54. TCLCOMMAND_API bool GetChannel(std::string &strValueTCLCOMMAND_API );
  55. TCLCOMMAND_API bool SetProjectId(int pid);
  56. TCLCOMMAND_API bool SetProjectId(LPCTSTR lpPid);
  57. TCLCOMMAND_API bool SetProjectId(const byte* pBuffer, const int& nLen);
  58. TCLCOMMAND_API bool SetDeviceId(LPCTSTR lpDeviceId);
  59. TCLCOMMAND_API bool SetDeviceId(const byte* pBuffer, const int &nLen);
  60. TCLCOMMAND_API bool SetMAC(LPCTSTR lpMac);
  61. TCLCOMMAND_API bool SetMAC(const byte* pBuffer, const int& nLen);
  62. TCLCOMMAND_API bool SetHDCPKey(LPCTSTR lpHDCP, bool bHasSpace = FALSE);
  63. TCLCOMMAND_API bool SetHDCPKey(const byte* pBuffer, const int& nLen);
  64. TCLCOMMAND_API bool SetHDCPKey22(LPCTSTR lpHDCP22, bool bHasSpace = FALSE);
  65. TCLCOMMAND_API bool SetHDCPKey22(const byte* pBuffer, const int& nLen);
  66. TCLCOMMAND_API bool SetNetflixESN(LPCTSTR lpESN, bool bHasSpace = FALSE);
  67. TCLCOMMAND_API bool SetNetflixESN(const byte* pBuffer, const int& nLen);
  68. TCLCOMMAND_API bool SetWidi(LPCTSTR lpWidi, bool bHasSpace = FALSE);
  69. TCLCOMMAND_API bool SetWidi(const byte* pBuffer, const int& nLen);
  70. TCLCOMMAND_API bool SetWidevine(LPCTSTR lpWidevine, bool bHasSpace = FALSE);
  71. TCLCOMMAND_API bool SetWidevine(const byte* pBuffer, const int& nLen);
  72. TCLCOMMAND_API bool SetCiKey(LPCTSTR lpCiKey, bool bHasSpace = FALSE);
  73. TCLCOMMAND_API bool SetCiKey(const byte* pBuffer, const int& nLen);
  74. TCLCOMMAND_API bool SetOSDLanguage(LPCTSTR lan, bool bHasSpace = TRUE);
  75. TCLCOMMAND_API bool SetOSDLanguage(const byte* pBuffer, const int& nLen);
  76. TCLCOMMAND_API bool SetShopLanguage(LPCTSTR lan, bool bHasSpace = TRUE);
  77. TCLCOMMAND_API bool SetShopLanguage(const byte* pBuffer, const int& nLen);
  78. TCLCOMMAND_API bool SetChannel(LPCTSTR channel, bool bHasSpace = TRUE);
  79. TCLCOMMAND_API bool SetChannel(const byte* pBuffer, const int& nLen);
  80. TCLCOMMAND_API bool SetWBNormal(LPCTSTR data);
  81. TCLCOMMAND_API bool SetWBNormal(const byte* pBuffer, const int& nLen);
  82. TCLCOMMAND_API bool SetWBCool(LPCTSTR data);
  83. TCLCOMMAND_API bool SetWBCool(const byte* pBuffer, const int& nLen);
  84. TCLCOMMAND_API bool SetWBWarm(LPCTSTR data);
  85. TCLCOMMAND_API bool SetWBWarm(const byte* pBuffer, const int& nLenTCLCOMMAND_API );
  86. TCLCOMMAND_API bool CheckDeviceId();
  87. TCLCOMMAND_API bool CheckMAC();
  88. TCLCOMMAND_API bool CheckHDCP();
  89. TCLCOMMAND_API bool CheckHDCP22();
  90. TCLCOMMAND_API bool CheckNetflixESN();
  91. TCLCOMMAND_API bool CheckWidi();
  92. TCLCOMMAND_API bool CheckWidevine();
  93. TCLCOMMAND_API bool CheckCikeyTCLCOMMAND_API ();
  94. TCLCOMMAND_API bool StarWarmUpMode();
  95. TCLCOMMAND_API bool StopWarmUpModeTCLCOMMAND_API ();
  96. // 工厂菜单显示与隐藏;
  97. TCLCOMMAND_API bool ShowFactoryMenu();
  98. TCLCOMMAND_API bool HideFactoryMenu();
  99. // 工厂信息内容显示与隐藏;
  100. TCLCOMMAND_API bool ShowFactoryInformation();
  101. TCLCOMMAND_API bool HideFactoryInformation();
  102. // 老化模式的开与关、老化时间读取;
  103. TCLCOMMAND_API bool EnterAgingModel();
  104. TCLCOMMAND_API bool LeaveAgingModel();
  105. TCLCOMMAND_API bool ReadAgingTime(int &min);
  106. // 红绿蓝增益;
  107. TCLCOMMAND_API bool SetRedGainRegister(int value);
  108. TCLCOMMAND_API bool SetGreenGainRegister(int value);
  109. TCLCOMMAND_API bool SetBlueGainRegister(int value);
  110. // 红绿蓝偏移;
  111. TCLCOMMAND_API bool SetRedOffsetRegister(int value);
  112. TCLCOMMAND_API bool SetGreenOffsetRegister(int value);
  113. TCLCOMMAND_API bool SetBlueOffsetRegister(int value);
  114. #endif