|
@@ -10,12 +10,12 @@ static CIRControl g_IRControl;
|
|
|
// 定义 DLL 的导出函数和变量。
|
|
|
int nIRControl = 100;
|
|
|
|
|
|
-DWORD IsAppRunning(LPCTSTR lpszAppDir)
|
|
|
+IRCONTROL_API DWORD IsAppRunning(LPCTSTR lpszAppDir)
|
|
|
{
|
|
|
return CIRControl::IsAppRunning(lpszAppDir);
|
|
|
}
|
|
|
|
|
|
-bool StartIRApp(LPCTSTR lpszAppDir, LPCTSTR lpSignalXml, DWORD dwPort)
|
|
|
+IRCONTROL_API bool StartIRApp(LPCTSTR lpszAppDir, LPCTSTR lpSignalXml, DWORD dwPort)
|
|
|
{
|
|
|
if (!CIRControl::StartApp(lpszAppDir, lpSignalXml, dwPort))
|
|
|
return false;
|
|
@@ -23,18 +23,18 @@ bool StartIRApp(LPCTSTR lpszAppDir, LPCTSTR lpSignalXml, DWORD dwPort)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-bool CloseApp()
|
|
|
+IRCONTROL_API bool CloseApp()
|
|
|
{
|
|
|
return CIRControl::CloseApp();
|
|
|
}
|
|
|
|
|
|
-bool Connect(LPCTSTR lpServer, int port)
|
|
|
+IRCONTROL_API bool Connect(LPCTSTR lpServer, int port)
|
|
|
{
|
|
|
// 创建连接;
|
|
|
if (!g_IRControl.InitSocket())
|
|
|
{
|
|
|
Global::WriteTextLog(_T("创建TCP连接失败"));
|
|
|
- g_IRControl.CloseApp();
|
|
|
+ //g_IRControl.CloseApp();
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -45,14 +45,19 @@ bool Connect(LPCTSTR lpServer, int port)
|
|
|
if (!g_IRControl.Connect(lpServer, port))
|
|
|
{
|
|
|
Global::WriteTextLog(_T("连接服务器失败"));
|
|
|
- g_IRControl.CloseApp();
|
|
|
+ //g_IRControl.CloseApp();
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-LPCTSTR getDeviceNames()
|
|
|
+IRCONTROL_API void DisConnect()
|
|
|
+{
|
|
|
+ g_IRControl.DisConnect();
|
|
|
+}
|
|
|
+
|
|
|
+IRCONTROL_API LPCTSTR getDeviceNames()
|
|
|
{
|
|
|
static std::string devices;
|
|
|
std::vector<std::string> vtDevices;
|
|
@@ -70,7 +75,7 @@ LPCTSTR getDeviceNames()
|
|
|
return _T("");
|
|
|
}
|
|
|
|
|
|
-LPCTSTR getSignalsName()
|
|
|
+IRCONTROL_API LPCTSTR getSignalsName()
|
|
|
{
|
|
|
static std::string signals;
|
|
|
signals = g_IRControl.getSignalsName();
|
|
@@ -78,7 +83,7 @@ LPCTSTR getSignalsName()
|
|
|
return signals.c_str();
|
|
|
}
|
|
|
|
|
|
-bool loadSignalDataSet(LPCTSTR lpDatasetXml)
|
|
|
+IRCONTROL_API bool loadSignalDataSet(LPCTSTR lpDatasetXml)
|
|
|
{
|
|
|
if (!lpDatasetXml || lpDatasetXml[0] == '\0')
|
|
|
return false;
|
|
@@ -86,7 +91,7 @@ bool loadSignalDataSet(LPCTSTR lpDatasetXml)
|
|
|
return g_IRControl.loadSignalDataSet(lpDatasetXml);
|
|
|
}
|
|
|
|
|
|
-bool sendSignal(LPCTSTR lpSignal, int send_times, int sleep_time)
|
|
|
+IRCONTROL_API bool sendSignal(LPCTSTR lpSignal, int send_times, int sleep_time)
|
|
|
{
|
|
|
if (!lpSignal || lpSignal[0] == '\0')
|
|
|
return false;
|
|
@@ -94,7 +99,7 @@ bool sendSignal(LPCTSTR lpSignal, int send_times, int sleep_time)
|
|
|
return g_IRControl.sendSignal(lpSignal, send_times, sleep_time);
|
|
|
}
|
|
|
|
|
|
-bool sendSignals(LPCTSTR lpSignals, int sleep_time)
|
|
|
+IRCONTROL_API bool sendSignals(LPCTSTR lpSignals, int sleep_time)
|
|
|
{
|
|
|
if (!lpSignals || lpSignals[0] == '\0')
|
|
|
return false;
|
|
@@ -116,7 +121,7 @@ bool sendSignals(LPCTSTR lpSignals, int sleep_time)
|
|
|
return g_IRControl.sendSignals(vtSignals, sleep_time);
|
|
|
}
|
|
|
|
|
|
-bool sendRepeatsSignal(LPCTSTR lpSignal, int repeat_time)
|
|
|
+IRCONTROL_API bool sendRepeatsSignal(LPCTSTR lpSignal, int repeat_time)
|
|
|
{
|
|
|
if (!lpSignal || lpSignal[0] == '\0')
|
|
|
return false;
|