|
@@ -0,0 +1,1281 @@
|
|
|
+// TCLCommand.cpp : 定义 DLL 应用程序的导出函数。
|
|
|
+//
|
|
|
+
|
|
|
+#include "stdafx.h"
|
|
|
+#include "TCLCommand.h"
|
|
|
+#include "Command.h"
|
|
|
+#include "resource.h"
|
|
|
+#ifdef __MAKE_PYD__
|
|
|
+#include "Python.h"
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifdef _DEBUG
|
|
|
+#define new DEBUG_NEW
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+// 唯一的应用程序对象
|
|
|
+
|
|
|
+CWinApp theApp;
|
|
|
+TCLCommand g_TCLCommand;
|
|
|
+
|
|
|
+// 宏函数;
|
|
|
+#define OPEN_CHECK if (!g_TCLCommand.IsOpen()) return false
|
|
|
+
|
|
|
+#define GET_CMDS(cmdName) CommandParam cmdpara;\
|
|
|
+if ( !g_TCLCommand.GetCommandParams(cmdName, cmdpara) )return false;\
|
|
|
+g_TCLCommand.PackingCommand(cmdpara);
|
|
|
+
|
|
|
+#define SET_CMDS(cmdName, data, len) CommandParam cmdpara;\
|
|
|
+if ( !g_TCLCommand.GetCommandParams(cmdName, cmdpara) )return false;\
|
|
|
+g_TCLCommand.PackingCommand(cmdpara, data, len);
|
|
|
+
|
|
|
+using namespace std;
|
|
|
+
|
|
|
+#ifdef __CONSOLE__
|
|
|
+int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
|
|
|
+{
|
|
|
+ int nRetCode = 0;
|
|
|
+
|
|
|
+ // 初始化 MFC 并在失败时显示错误
|
|
|
+ if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
|
|
|
+ {
|
|
|
+ // TODO: 更改错误代码以符合您的需要
|
|
|
+ _tprintf(_T("错误: MFC 初始化失败\n"));
|
|
|
+ nRetCode = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // TODO: 在此处为应用程序的行为编写代码。
|
|
|
+ if ( Open(21, 115200, 8, 0, 1) )
|
|
|
+ {
|
|
|
+ EnterFactory();
|
|
|
+
|
|
|
+ int pid;
|
|
|
+ GetProjectId(pid);
|
|
|
+
|
|
|
+ std::string value;
|
|
|
+ GetSoftVersion(value);
|
|
|
+ GetDeviceId(value);
|
|
|
+ GetClientType(value);
|
|
|
+ GetMAC(value);
|
|
|
+ GetHDCPKey(value);
|
|
|
+
|
|
|
+ GetHDCPKey22(value);
|
|
|
+ GetWidi(value);
|
|
|
+ GetNetflixESN(value);
|
|
|
+ GetWidevine(value);
|
|
|
+ GetCiKey(value);
|
|
|
+ GetOSDLanguage(value);
|
|
|
+ GetShopLanguage(value);
|
|
|
+ GetChannel(value);
|
|
|
+
|
|
|
+ LeaveFactory();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return nRetCode;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifdef EXPORTS_CLASS
|
|
|
+CTCLCommand::CTCLCommand()
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+bool CTCLCommand::Open(int nPort, DWORD dwBaudrate, BYTE ByteSize, BYTE Parity, BYTE StopBits)
|
|
|
+{
|
|
|
+ TCHAR szSet[MAX_PATH] = {0};
|
|
|
+ _stprintf_s(szSet, _T("baud=%ld parity=%s data=%d stop=%d"), dwBaudrate, Parity == 0 ? "N" : "O", ByteSize, StopBits);
|
|
|
+ g_TCLCommand.SetInternalCMDParams(BIN_CMD);
|
|
|
+ return g_TCLCommand.Open(nPort, szSet);
|
|
|
+}
|
|
|
+
|
|
|
+void CTCLCommand::Close()
|
|
|
+{
|
|
|
+ g_TCLCommand.Close();
|
|
|
+}
|
|
|
+
|
|
|
+bool CTCLCommand::IsOpen()
|
|
|
+{
|
|
|
+ return g_TCLCommand.IsOpen();
|
|
|
+}
|
|
|
+
|
|
|
+void CTCLCommand::SetExternalCMDParams(LPCTSTR lpFileName)
|
|
|
+{
|
|
|
+ g_TCLCommand.SetExternalCMDParams(lpFileName);
|
|
|
+}
|
|
|
+
|
|
|
+bool CTCLCommand::GetCommandParams(std::string name, CommandParam& cmdPara)
|
|
|
+{
|
|
|
+ return g_TCLCommand.GetCommandParams(name, cmdPara);
|
|
|
+}
|
|
|
+
|
|
|
+void CTCLCommand::PackingCommand(CommandParam& cmdPara, std::string data, const int& dataLen)
|
|
|
+{
|
|
|
+ g_TCLCommand.PackingCommand(cmdPara, data, dataLen);
|
|
|
+}
|
|
|
+
|
|
|
+bool CTCLCommand::SendCommand(CommandParam& cmdPara)
|
|
|
+{
|
|
|
+ return g_TCLCommand.SendCommand(cmdPara);
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+bool Open(int nPort, DWORD dwBaudrate, BYTE ByteSize, BYTE Parity, BYTE StopBits)
|
|
|
+{
|
|
|
+ TCHAR szSet[MAX_PATH] = {0};
|
|
|
+ _stprintf_s(szSet, _T("baud=%ld parity=%s data=%d stop=%d"), dwBaudrate, Parity == 0 ? "N" : "O", ByteSize, StopBits);
|
|
|
+ g_TCLCommand.SetInternalCMDParams(BIN_CMD);
|
|
|
+ return g_TCLCommand.Open(nPort, szSet);
|
|
|
+}
|
|
|
+
|
|
|
+void Close()
|
|
|
+{
|
|
|
+ g_TCLCommand.Close();
|
|
|
+}
|
|
|
+
|
|
|
+bool IsOpen()
|
|
|
+{
|
|
|
+ return g_TCLCommand.IsOpen();
|
|
|
+}
|
|
|
+
|
|
|
+void SetExternalCMDParams(LPCTSTR lpFileName)
|
|
|
+{
|
|
|
+ g_TCLCommand.SetExternalCMDParams(lpFileName);
|
|
|
+}
|
|
|
+
|
|
|
+bool EnterFactory()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ return g_TCLCommand.SendCommand(cmdpara);
|
|
|
+}
|
|
|
+
|
|
|
+bool LeaveFactory()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ return g_TCLCommand.SendCommand(cmdpara);
|
|
|
+}
|
|
|
+
|
|
|
+bool GetProjectId(int& pid)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ if (cmdpara._rtnData.size() == 2)
|
|
|
+ pid = (byte)cmdpara._rtnData[0] << 8 | (byte)cmdpara._rtnData[1];
|
|
|
+ else
|
|
|
+ pid = (byte)cmdpara._rtnData[0];
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetSoftVersion(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetDeviceId(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetClientType(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetMAC(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetHDCPKey(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetHDCPKey22(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetWidi(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetNetflixESN(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetWidevine(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetCiKey(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetOSDLanguage(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetShopLanguage(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool GetChannel(std::string& strValue)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ GET_CMDS(__FUNCTION__);
|
|
|
+ if (g_TCLCommand.SendCommand(cmdpara))
|
|
|
+ {
|
|
|
+ strValue = cmdpara._rtnData;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetProjectId(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetDeviceId(LPCTSTR lpDeviceId)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetDeviceId(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetMAC(LPCTSTR lpMac)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetMAC(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetHDCPKey(LPCTSTR lpHDCP, bool bHasSpace)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetHDCPKey(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetHDCPKey22(LPCTSTR lpHDCP22, bool bHasSpace)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetHDCPKey22(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetNetflixESN(LPCTSTR lpESN, bool bHasSpace)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetNetflixESN(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWidi(LPCTSTR lpWidi, bool bHasSpace)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWidi(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWidevine(LPCTSTR lpWidevine, bool bHasSpace)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWidevine(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetCiKey(LPCTSTR lpCiKey, bool bHasSpace)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetCiKey(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetOSDLanguage(LPCTSTR lan, bool bHasSpace)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetOSDLanguage(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetShopLanguage(LPCTSTR lan, bool bHasSpace)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetShopLanguage(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetChannel(LPCTSTR channel, bool bHasSpace)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetChannel(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWBNormal(LPCTSTR data)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWBNormal(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWBCool(LPCTSTR data)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWBCool(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWBWarm(LPCTSTR data)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetWBWarm(const byte* pBuffer, const int& nLen)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool CheckDeviceId()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool CheckMAC()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool CheckHDCP()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool CheckHDCP22()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool CheckNetflixESN()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool CheckWidi()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool CheckWidevine()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool CheckCikey()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool StarWarmUpMode()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool StopWarmUpMode()
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetProjectId(int pid)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+bool SetProjectId(LPCTSTR lpPid)
|
|
|
+{
|
|
|
+ OPEN_CHECK;
|
|
|
+ return false;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifdef __MAKE_PYD__
|
|
|
+static PyObject* Open(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int nPort;
|
|
|
+ int Baudrate;
|
|
|
+ int ByteSize, Parity, StopBits;
|
|
|
+ if (!PyArg_ParseTuple(args, "iiiii", &nPort, &Baudrate, &ByteSize, &Parity, &StopBits ))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.OpenComm(nPort, Baudrate));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* Close(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_objSiacp.CloseComm();
|
|
|
+ return Py_None;
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* IsOpen(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.IsOpen());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* EnterFactory(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_EnterFactory());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* LeaveFactory(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_LeaveFactory());
|
|
|
+}
|
|
|
+
|
|
|
+//////////////////////////////////////////////////////////////////////////
|
|
|
+// 读取;
|
|
|
+static PyObject* GetProjectId(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int pid = -1;
|
|
|
+ g_objSiacp.SCBC_GetProjectId(pid);
|
|
|
+ // 获取失败返回-1;
|
|
|
+ return Py_BuildValue("i", pid);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetSoftVersion(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetSoftVersion(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetDeviceId(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetDeviceId(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetClientType(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetClientType(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetMAC(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetMAC(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetHDCPKey(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetHDCPKey(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetHDCPKey22(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetHDCPKey22(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetWidi(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetWidi(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetNetflixESN(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetNetflixESN(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetWidevine(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetWidevine(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetCiKey(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetCiKey(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetOSDLanguage(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetOSDLanguage(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetShopLanguage(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetShopLanguage(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* GetChannel(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ g_strData.clear();
|
|
|
+ g_objSiacp.SCBC_GetChannel(g_strData);
|
|
|
+ // 获取失败返回"";
|
|
|
+ return Py_BuildValue("s", g_strData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+//////////////////////////////////////////////////////////////////////////
|
|
|
+// 设置;
|
|
|
+static PyObject* SetProjectId(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int pid = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "i", &pid))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetProjectId(pid));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetDeviceId(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszdata= 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszdata))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetDeviceId(pszdata));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetDeviceIdBF(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszfile = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszfile))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ // 打开文件;
|
|
|
+ std::string data;
|
|
|
+ if ( ReadKeyFile(pszfile, data) )
|
|
|
+ {
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetDeviceId((BYTE*)data.c_str(), data.size()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Py_BuildValue("b", false);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetMAC(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszdata))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetMAC(pszdata));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetMACBF(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszfile = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszfile))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ // 打开文件;
|
|
|
+ std::string data;
|
|
|
+ if ( ReadKeyFile(pszfile, data) )
|
|
|
+ {
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetMAC((BYTE*)data.c_str(), data.size()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Py_BuildValue("b", false);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetHDCPKey(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ BOOL bHasSpace;
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "sb", &pszdata, &bHasSpace))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetHDCPKey(pszdata, bHasSpace));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetHDCPKeyBF(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszfile = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszfile))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ // 打开文件;
|
|
|
+ std::string data;
|
|
|
+ if ( ReadKeyFile(pszfile, data) )
|
|
|
+ {
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetHDCPKey((BYTE*)data.c_str(), data.size()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Py_BuildValue("b", false);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetHDCPKey22(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ BOOL bHasSpace;
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "sb", &pszdata, &bHasSpace))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetHDCPKey22(pszdata, bHasSpace));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetHDCPKey22BF(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszfile = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszfile))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ // 打开文件;
|
|
|
+ std::string data;
|
|
|
+ if ( ReadKeyFile(pszfile, data) )
|
|
|
+ {
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetHDCPKey22((BYTE*)data.c_str(), data.size()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Py_BuildValue("b", false);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetNetflixESN(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ BOOL bHasSpace;
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "sb", &pszdata, &bHasSpace))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetNetflixESN(pszdata, bHasSpace));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetNetflixESNBF(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszfile = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszfile))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ // 打开文件;
|
|
|
+ std::string data;
|
|
|
+ if ( ReadKeyFile(pszfile, data) )
|
|
|
+ {
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetNetflixESN((BYTE*)data.c_str(), data.size()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Py_BuildValue("b", false);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetWidi(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ BOOL bHasSpace;
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "sb", &pszdata, &bHasSpace))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetWidi(pszdata, bHasSpace));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetWidiBF(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszfile = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszfile))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ // 打开文件;
|
|
|
+ std::string data;
|
|
|
+ if ( ReadKeyFile(pszfile, data) )
|
|
|
+ {
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetWidi((BYTE*)data.c_str(), data.size()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Py_BuildValue("b", false);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetWidevine(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ BOOL bHasSpace;
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "sb", &pszdata, &bHasSpace))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetWidevine(pszdata, bHasSpace));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetWidevineBF(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszfile = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszfile))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ // 打开文件;
|
|
|
+ std::string data;
|
|
|
+ if ( ReadKeyFile(pszfile, data) )
|
|
|
+ {
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetWidevine((BYTE*)data.c_str(), data.size()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Py_BuildValue("b", false);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetCiKey(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ BOOL bHasSpace;
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "sb", &pszdata, &bHasSpace))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetCiKey(pszdata, bHasSpace));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetCiKeyBF(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszfile = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszfile))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ // 打开文件;
|
|
|
+ std::string data;
|
|
|
+ if ( ReadKeyFile(pszfile, data) )
|
|
|
+ {
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetCiKey((BYTE*)data.c_str(), data.size()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Py_BuildValue("b", false);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetOSDLanguage(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ BOOL bHasSpace;
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "sb", &pszdata, &bHasSpace))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetOSDLanguage(pszdata, bHasSpace));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetShopLanguage(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ BOOL bHasSpace;
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "sb", &pszdata, &bHasSpace))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetShopLanguage(pszdata, bHasSpace));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetChannel(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int value = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "i", &value))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetChannel(value));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetWBNormal(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszdata))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetWBNormal(pszdata));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetWBCool(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszdata))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetWBCool(pszdata));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetWBWarm(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszdata = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "s", &pszdata))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetWBWarm(pszdata));
|
|
|
+}
|
|
|
+//////////////////////////////////////////////////////////////////////////
|
|
|
+// 校验;
|
|
|
+static PyObject* CheckDeviceId(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_CheckDeviceId());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* CheckMAC(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_CheckMAC());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* CheckHDCP(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_CheckHDCP());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* CheckHDCP22(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_CheckHDCP22());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* CheckNetflixESN(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_CheckNetflixESN());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* CheckWidi(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_CheckWidi());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* CheckWidevine(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_CheckWidevine());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* CheckCikey(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_CheckCikey());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* StarWarmUpMode(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_StarWarmUpMode());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* StopWarmUpMode(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_StopWarmUpMode());
|
|
|
+}
|
|
|
+
|
|
|
+//
|
|
|
+static PyObject* ShowFactoryMenu(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_ShowFactoryMenu());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* HideFactoryMenu(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_HideFactoryMenu());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* ShowFactoryInformation(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_ShowFactoryInformation());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* HideFactoryInformation(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_HideFactoryInformation());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* EnterAgingModel(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_EnterAgingModel());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* LeaveAgingModel(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_LeaveAgingModel());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* ReadAgingTime(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int min = 0;
|
|
|
+ if ( !g_objSiacp.SCBC_ReadAgingTime(min) )
|
|
|
+ return Py_BuildValue("i", -1);
|
|
|
+ return Py_BuildValue("i", min);
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetRedGainRegister(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int value = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "i", &value))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetRedGainRegister(value));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetGreenGainRegister(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int value = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "i", &value))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetGreenGainRegister(value));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetBlueGainRegister(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int value = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "i", &value))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetBlueGainRegister(value));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetRedOffsetRegister(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int value = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "i", &value))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetRedOffsetRegister(value));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetGreenOffsetRegister(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int value = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "i", &value))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetGreenOffsetRegister(value));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* SetBlueOffsetRegister(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int value = 0;
|
|
|
+ if (!PyArg_ParseTuple(args, "i", &value))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return Py_BuildValue("b", (bool)g_objSiacp.SCBC_SetBlueOffsetRegister(value));
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* HTTPLogin(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ int rememberMe = 0;
|
|
|
+ const char* pszhost = NULL;
|
|
|
+ const char* pszUserName = NULL;
|
|
|
+ const char* pszPassword = NULL;
|
|
|
+
|
|
|
+ if (!PyArg_ParseTuple(args, "sssb", &pszhost, &pszUserName, &pszPassword, &rememberMe))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ HTTP_Login(pszhost, pszUserName, pszPassword, rememberMe);
|
|
|
+
|
|
|
+ return Py_BuildValue("s", g_httpData.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static PyObject* HTTPGetUserId(PyObject* self, PyObject* args)
|
|
|
+{
|
|
|
+ const char* pszhost = NULL;
|
|
|
+ const char* pszToken = NULL;
|
|
|
+ const char* pszClientType = NULL;
|
|
|
+ const char* pszDeviceId = NULL;
|
|
|
+ const char* pszMAC = NULL;
|
|
|
+ if (!PyArg_ParseTuple(args, "sssss", &pszhost, &pszToken, &pszClientType, &pszDeviceId, &pszMAC))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ int userId = HTTP_GetUserId(pszhost, pszToken, pszClientType, pszDeviceId, pszMAC);
|
|
|
+
|
|
|
+ return Py_BuildValue("i", userId);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// 描述方法,暴露给python的函数;
|
|
|
+static PyMethodDef ScbcCopyKey_Methods[] = {
|
|
|
+ {"Open",Open,METH_VARARGS,"打开串口"},
|
|
|
+ {"Close", Close, METH_VARARGS, "关闭串口"},
|
|
|
+ {"IsOpen", IsOpen, METH_VARARGS, "串口是否打开"},
|
|
|
+ {"EnterFactory", EnterFactory, METH_VARARGS, "进入工厂模式"},
|
|
|
+ {"LeaveFactory", LeaveFactory, METH_VARARGS, "离开工厂模式"},
|
|
|
+ //////////////////////////////////////////////////////////////////////////
|
|
|
+ // 读取;
|
|
|
+ {"GetProjectId", GetProjectId, METH_VARARGS, "获取pid"},
|
|
|
+ {"GetSoftVersion", GetSoftVersion, METH_VARARGS, "获取版本号"},
|
|
|
+ {"GetDeviceId", GetDeviceId, METH_VARARGS, "获取DeviceID"},
|
|
|
+ {"GetClientType", GetClientType, METH_VARARGS, "获取ClientType"},
|
|
|
+ {"GetMAC", GetMAC, METH_VARARGS, "获取MAC"},
|
|
|
+ {"GetHDCPKey", GetHDCPKey, METH_VARARGS, "获取HDCP"},
|
|
|
+ {"GetHDCPKey22", GetHDCPKey22, METH_VARARGS, "获取HDCP22"},
|
|
|
+ {"GetWidi", GetWidi, METH_VARARGS, "获取WIDI"},
|
|
|
+ {"GetNetflixESN", GetNetflixESN, METH_VARARGS, "获取ESN"},
|
|
|
+ {"GetWidevine", GetWidevine, METH_VARARGS, "获取WIDEVINE"},
|
|
|
+ {"GetCiKey", GetCiKey, METH_VARARGS, "获取CIKEY"},
|
|
|
+ {"GetOSDLanguage", GetOSDLanguage, METH_VARARGS, "获取OSDLAN"},
|
|
|
+ {"GetShopLanguage", GetShopLanguage, METH_VARARGS, "获取SHOPLAN"},
|
|
|
+ {"GetChannel", GetChannel, METH_VARARGS, "获取频道号"},
|
|
|
+ //////////////////////////////////////////////////////////////////////////
|
|
|
+ // 设置;
|
|
|
+ {"SetProjectId", SetProjectId, METH_VARARGS, "设置pid"},
|
|
|
+ {"SetDeviceId", SetDeviceId, METH_VARARGS, "设置DeviceId"},
|
|
|
+ {"SetDeviceIdBF", SetDeviceIdBF, METH_VARARGS, "设置DeviceId"},
|
|
|
+ {"SetMAC", SetMAC, METH_VARARGS, "设置MAC"},
|
|
|
+ {"SetMACBF", SetMACBF, METH_VARARGS, "设置MAC"},
|
|
|
+ {"SetHDCPKey", SetHDCPKey, METH_VARARGS, "设置HDCP"},
|
|
|
+ {"SetHDCPKeyBF", SetHDCPKeyBF, METH_VARARGS, "设置HDCP"},
|
|
|
+ {"SetHDCPKey22", SetHDCPKey22, METH_VARARGS, "设置HDCP22"},
|
|
|
+ {"SetHDCPKey22BF", SetHDCPKey22BF, METH_VARARGS, "设置HDCP22"},
|
|
|
+ {"SetWidi", SetWidi, METH_VARARGS, "设置WIDI"},
|
|
|
+ {"SetWidiBF", SetWidiBF, METH_VARARGS, "设置WIDI"},
|
|
|
+ {"SetNetflixESN", SetNetflixESN, METH_VARARGS, "设置ESN"},
|
|
|
+ {"SetNetflixESNBF", SetNetflixESNBF, METH_VARARGS, "设置ESN"},
|
|
|
+ {"SetWidevine", SetWidevine, METH_VARARGS, "设置WIDEVINE"},
|
|
|
+ {"SetWidevineBF", SetWidevineBF, METH_VARARGS, "设置WIDEVINE"},
|
|
|
+ {"SetCiKey", SetCiKey, METH_VARARGS, "设置CIKEY"},
|
|
|
+ {"SetCiKeyBF", SetCiKeyBF, METH_VARARGS, "设置CIKEY"},
|
|
|
+ {"SetOSDLanguage", SetOSDLanguage, METH_VARARGS, "设置OSDLAN"},
|
|
|
+ {"SetShopLanguage", SetShopLanguage, METH_VARARGS, "设置SHOPLAN"},
|
|
|
+ {"SetChannel", SetChannel, METH_VARARGS, "设置频道号"},
|
|
|
+
|
|
|
+ {"SetWBNormal", SetWBNormal, METH_VARARGS, "设置OSDLAN"},
|
|
|
+ {"SetWBCool", SetWBCool, METH_VARARGS, "设置SHOPLAN"},
|
|
|
+ {"SetWBWarm", SetWBWarm, METH_VARARGS, "设置频道号"},
|
|
|
+ //////////////////////////////////////////////////////////////////////////
|
|
|
+ // 校验;
|
|
|
+ {"CheckDeviceId", CheckDeviceId, METH_VARARGS, "检验pid"},
|
|
|
+ {"CheckMAC", CheckMAC, METH_VARARGS, "检验MAC"},
|
|
|
+ {"CheckHDCP", CheckHDCP, METH_VARARGS, "检验HDCP"},
|
|
|
+ {"CheckHDCP22", CheckHDCP22, METH_VARARGS, "检验HDCP22"},
|
|
|
+ {"CheckWidi", CheckWidi, METH_VARARGS, "检验WIDI"},
|
|
|
+ {"CheckNetflixESN", CheckNetflixESN, METH_VARARGS, "检验ESN"},
|
|
|
+ {"CheckWidevine", CheckWidevine, METH_VARARGS, "检验WIDEVINE"},
|
|
|
+ {"CheckCikey", CheckCikey, METH_VARARGS, "检验CIKEY"},
|
|
|
+ {"StarWarmUpMode", StarWarmUpMode, METH_VARARGS, "检验OSDLAN"},
|
|
|
+ {"StopWarmUpMode", StopWarmUpMode, METH_VARARGS, "检验SHOPLAN"},
|
|
|
+ // others;
|
|
|
+ {"ShowFactoryMenu", ShowFactoryMenu, METH_VARARGS, "显示工厂菜单"},
|
|
|
+ {"HideFactoryMenu", HideFactoryMenu, METH_VARARGS, "隐藏工厂菜单"},
|
|
|
+ {"ShowFactoryInformation", ShowFactoryInformation, METH_VARARGS, "工厂信息内容显示"},
|
|
|
+ {"HideFactoryInformation", HideFactoryInformation, METH_VARARGS, "工厂信息内容隐藏"},
|
|
|
+ {"EnterAgingModel", EnterAgingModel, METH_VARARGS, "老化模式开"},
|
|
|
+ {"LeaveAgingModel", LeaveAgingModel, METH_VARARGS, "老化模式关"},
|
|
|
+ {"ReadAgingTime", ReadAgingTime, METH_VARARGS, "老化时间读取"},
|
|
|
+ {"SetRedGainRegister", SetRedGainRegister, METH_VARARGS, "红增益"},
|
|
|
+ {"SetGreenGainRegister", SetGreenGainRegister, METH_VARARGS, "绿增益"},
|
|
|
+ {"SetBlueGainRegister", SetBlueGainRegister, METH_VARARGS, "蓝增益"},
|
|
|
+ {"SetRedOffsetRegister", SetRedOffsetRegister, METH_VARARGS, "红偏移"},
|
|
|
+ {"SetGreenOffsetRegister", SetGreenOffsetRegister, METH_VARARGS, "绿偏移"},
|
|
|
+ {"SetBlueOffsetRegister", SetBlueOffsetRegister, METH_VARARGS, "蓝偏移"},
|
|
|
+ // HTTP
|
|
|
+ {"HTTPLogin", HTTPLogin, METH_VARARGS, "登录服务器"},
|
|
|
+ {"HTTPGetUserId", HTTPGetUserId, METH_VARARGS, "获取UserId"},
|
|
|
+ {NULL,NULL}
|
|
|
+};
|
|
|
+
|
|
|
+// 初始模块;//格式:init<模块名称>
|
|
|
+PyMODINIT_FUNC initScbcCopyKey()
|
|
|
+{
|
|
|
+ // 初始化pyd函数列表;
|
|
|
+ PyObject* m, * d;
|
|
|
+ m = Py_InitModule("ScbcCopyKey", ScbcCopyKey_Methods);
|
|
|
+ d = PyModule_GetDict(m);
|
|
|
+}
|
|
|
+#endif
|