瀏覽代碼

Z991239-6212 #comment DeviceControl实体代码删除

80374374 4 月之前
父節點
當前提交
6c5adbc668

+ 0 - 2
Module/CMakeLists.txt

@@ -163,7 +163,6 @@ add_subdirectory(mod_ScannerSet)
 add_subdirectory(mod_HSPScanner)
 add_subdirectory(mod_ContactlessCard)
 add_subdirectory(mod_gpio)
-add_subdirectory(mod_DeviceControl)
 #zhaohu
 add_subdirectory(mod_facetracking)
 #zhaohu
@@ -224,7 +223,6 @@ add_subdirectory(mod_ScannerSet)
 add_subdirectory(mod_HSPScanner)
 add_subdirectory(mod_ContactlessCard)
 add_subdirectory(mod_gpio)
-add_subdirectory(mod_DeviceControl)
 add_subdirectory(mod_facetracking)
 add_subdirectory(mod_initiativetransfer)
 add_subdirectory(mod_interactioncontext)

+ 0 - 29
Module/mod_DeviceControl/CMakeLists.txt

@@ -1,29 +0,0 @@
-define_module("DeviceControl")
-
-file(GLOB ${MODULE_PREFIX}_SRCS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
-    "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
-    "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
-
-set(MOD_VERSION_STRING "0.0.1-dev1")
-add_module_libraries(${MODULE_PREFIX} ${MODULE_NAME} ${MOD_VERSION_STRING})
-
-target_include_directories(${MODULE_NAME} PRIVATE
-	${DevHeadPath}
-    ${MODULE_BASE_DIR}/mod_gpio
-    ${OTHER_LIB_BASE_DIR}/libRestfulFunc
-)
-
-set(${MODULE_PREFIX}_LIBS ${MODULE_BASE_LIBS})
-if(MSVC)
-    list(APPEND ${MODULE_PREFIX}_LIBS Iphlpapi ws2_32)
-else()
-    list(APPEND ${MODULE_PREFIX}_LIBS RestfulFunc)
-endif(MSVC)
-target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})  
-
-target_include_directories(${MODULE_NAME} PRIVATE 
-${CMAKE_CURRENT_SOURCE_DIR}
-${MODULE_BASE_DIR}/mod_CenterSetting
-)
-
-deploy_module(${MODULE_PREFIX} ${MODULE_NAME})

+ 0 - 209
Module/mod_DeviceControl/DeviceControl.xml

@@ -1,209 +0,0 @@
-<?xml version="1.0" encoding="gb2312" ?>
-<entity name="DeviceControl">
-  
-	<class name="DeviceControlService" overlap="true" exclusive="false">
-		<twoway name="USB" overlap="true">
-			<req>
-				<param name="open" type="bool" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</req>
-			<res>
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</res>			
-		</twoway>
-		<twoway name="GetUkeyID" overlap="true">
-			<req>
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</req>
-			<res>
-				<param name="UkeyID" type="string" />
-				<param name="UkeyIDLen" type="int" />				
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</res>			
-		</twoway>
-		<twoway name="InitToken" overlap="true">
-			<req>
-				<param name="CertType" type="string" />
-				<param name="OldSuperPwd" type="string" />
-				<param name="UserName" type="string" />
-				<param name="UserIDType" type="string" />
-				<param name="UserIDNo" type="string" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</req>
-			<res>
-				<param name="TokenSn" type="string" />
-				<param name="PKCS10" type="string" />
-				<param name="Msg" type="string" />
-				<param name="TokenType" type="int" />
-				<param name="TokenSnLen" type="int" />
-				<param name="PKCS10Len" type="int" />
-				<param name="MsgLen" type="int" />	
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</res>			
-		</twoway>
-		<twoway name="QueryUSBStatus" overlap="true">
-			<req>
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</req>
-			<res>
-				<param name="flag" type="int" />			
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</res>			
-		</twoway>								
-		<twoway name="QueryHardwareInfo" overlap="true">
-			<req>
-			</req>
-			<res>
-				<param name="machineType" type="string" />
-				<param name="terminalNo" type="string" />
-				<param name="site" type="string" />
-				<param name="termLimit" type="string" />
-				<param name="termVersion" type="string" />
-				<param name="ip" type="array_string" />
-				<param name="mac" type="array_string" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</res>			
-		</twoway>
-		<twoway name="ReadCenterConfigStr" overlap="true">
-			<req>
-				<param name="entityName" type="string" />
-				<param name="key" type="string" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</req>
-			<res>
-				<param name="value" type="string" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</res>			
-		</twoway>
-		<twoway name="ReadConfigValue" overlap="true">
-			<req>
-				<!--0:Custom, 1:Config_Hardware,2:Config_Software, 3:Config_Run, 4:Config_Shell, 5:Config_Root, 6:Config_CenterSetting, 7:Config_Cache-->
-				<param name="configType" type="int" />
-				<param name="section" type="string" />
-				<!-- true: write; false: read -->
-				<param name="option" type="bool" />
-				<param name="key" type="string" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />				
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</req>
-			<res>
-				<param name="value" type="string" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />		
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
-			</res>			
-		</twoway>
-    <twoway name="TestConnectivity" overlap="true">
-      <req>
-        <!--1: ping;2:socket connect;3: telnet,4: http-->
-        <param name="protocol" type="int" />
-        <param name="ip" type="string" />
-        <param name="port" type="int" />
-        <param name="reserved1" type="int" />
-        <param name="reserved2" type="string" />
-      </req>
-      <res>
-        <param name="result" type="int" />
-        <param name="additionalMsg" type="string" />
-      </res>
-    </twoway>
-    <twoway name="GetVendorFileList" overlap="true">
-      <req>
-        <!--过滤信息是否从root.ini里借鉴,如果是则忽略掉后面的参数过滤-->
-        <param name="root" type="bool" />
-        <param name="adapter" type="string" />
-        <param name="vendor" type="string" />
-        <param name="version" type="string" />
-        <param name="batch" type="string" />
-      </req>
-      <res>
-        <param name="result" type="int" />
-        <param name="msg" type="string" />
-        <param name="filenames" type="array_string"/>
-        <!--0x1:exist; 0x2: root current config-->
-        <param name="status" type="array_int"/>
-        <param name="port" type="array_int"/>
-        <param name="baudrate" type="array_int" />
-        <param name="param1" type="array_string"/>
-        <param name="param2" type="array_string"/>
-
-      </res>
-    </twoway>
-    <twoway name="TestAdapterFileAvailable" overlap="true">
-      <req>
-        <!--默认在Dep下面,所以这里仅是文件名,根据文件名判断适配类型-->
-        <param name="filename" type="string" />
-        <param name="type" type="int" />
-        <param name="options" type="int" />
-        <param name="port" type="int"/>
-        <param name="baudrate" type="int" />
-        <param name="param1" type="int"/>
-        <param name="param2" type="int" />
-        <param name="param3" type="string" />
-        <param name="param4" type="string" />
-        <param name="param5" type="array_int" />
-        <param name="param6" type="array_string" />
-      </req>
-      <res>
-        <!--0x1: not exists; 0x2: load failed; 0x3: open failed-->
-        <param name="status" type="uint" />
-        <param name="msg" type="string" />
-        <param name="reserved1" type="array_int" />
-        <param name="reserved2" type="array_string"/>
-        <param name="reserved3" type="array_string"/>
-      </res>
-    </twoway>
-    <twoway name="GetDevInfo" overlap="true" method_id="65535">
-			<req>
-			</req>
-			<res>
-				<param name="type" type="string" />
-				<param name="model" type="string" />
-				<param name="version" type="string" />
-				<param name="state" type="int" />
-			</res>			
-		</twoway>													
-	</class>
-
-  <message name="AdapterTestResult">
-    <param name="result" type="int"/>
-    <param name="adapterInfo" type="string" />
-    <param name="errMsg" type="string" />
-  </message>
-</entity>

+ 0 - 224
Module/mod_DeviceControl/DeviceControlFSM.cpp

@@ -1,224 +0,0 @@
-#include "stdafx.h"
-#include "DeviceControlFSM.h"
-#include "EventCode.h"
-#include "fileutil.h"
-#include "toolkit.h"
-#include "osutil.h"
-#include "CommEntityUtil.hpp"
-
-
-ErrorCodeEnum CDeviceControlFSM::OnInit()
-{
-    LOG_FUNCTION();
-    return Error_Succeed;
-}
-
-
-ErrorCodeEnum CDeviceControlFSM::RestartSogouServices()
-{
-    LOG_FUNCTION();
-
-    ErrorCodeEnum result(Error_Succeed);
-
-    CSimpleStringA shellScriptPath;
-    GetEntityBase()->GetFunction()->GetPath("Base", shellScriptPath);
-    shellScriptPath += SPLIT_SLASH_STR;
-    shellScriptPath += "res" SPLIT_SLASH_STR "RunScript" SPLIT_SLASH_STR;
-
-    std::string startup_service(shellScriptPath.GetData());
-    startup_service += "startup_sogouservice.sh";
-    std::string shutdown_service(shellScriptPath.GetData());
-    shutdown_service += "shutdown_sogouservice.sh";
-
-    std::string shutdown_service_without_monitor(shellScriptPath.GetData());
-    shutdown_service_without_monitor += "shutdown_sogouservice_without_monitor.sh";
-
-    const BOOL s1 = ExistsFileA(startup_service.c_str());
-    const BOOL s2 = ExistsFileA(shutdown_service.c_str());
-    const BOOL s3 = ExistsFileA(shutdown_service_without_monitor.c_str());
-
-    if (s3) {
-        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("to shutdown sogou service except monitor...");
-        char* relate_processes[3] = { "sogouImeWebSrv", "sogouImeService", "sogoumonitor.sh" };
-        int count = 4;
-        alive_process_info old_processes[4];
-        memset(old_processes, 0, sizeof(old_processes));
-        osutil_detect_unique_app(relate_processes, array_size(relate_processes), &count, old_processes);
-
-        int sogouImeWebSrv_PID(0), sogouImeServicePID(0);
-
-        bool monitor_exist(false), other_exists(false);
-
-        /** ��Ϊ�ӿ���ʱ��ȡ���������е����ݣ�ֻ����ʱ���˽ӿ���Ϊ�ɹ� [Gifur@2022110]*/
-        monitor_exist = true;
-
-        for (int i = 0; i < count; ++i) {
-            if (strcmp(old_processes[i].name, relate_processes[2]) == 0) {
-                monitor_exist = true;
-            } else {
-                other_exists = true;
-            }
-            if (strcmp(old_processes[i].name, relate_processes[0]) == 0) {
-                sogouImeWebSrv_PID = old_processes[i].pid;
-            } else if (strcmp(old_processes[i].name, relate_processes[1]) == 0) {
-                sogouImeServicePID = old_processes[i].pid;
-            }
-        }
-
-        if (!monitor_exist) {
-            return Error_InvalidState;
-        } else if(!other_exists){
-            return Error_NotExist;
-        } else {
-
-            std::string succStr, errStr;
-            std::string runStr("bash ");
-            runStr += shutdown_service_without_monitor;
-            if (!SP::Module::Util::ShellExecute(runStr, succStr, errStr)) {
-                LogWarn(Severity_Middle, Error_Unexpect, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_FAILED,
-                        CSimpleStringA::Format("%s: %s, %s", shutdown_service_without_monitor.c_str(), succStr.c_str(), errStr.c_str()));
-                return Error_Unexpect;
-            } else {
-                DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("execute {%s} suc: %s", shutdown_service_without_monitor.c_str(), succStr.c_str());
-
-                /**�ȴ���������˳� */
-                Sleep(300);
-
-                /** Sogou�ļ໤����ÿ��5s�����ѹ������Ƿ���ڣ�����������Ϊʲô���Լ��������Ϊ�ѹ������������ͨ�û�Ȩ���� [Gifur@20211230]*/
-                const DWORD defaultInterval = 3000;
-                const int maxtIntervalTimes(3);
-                int intervalTimes(0);
-
-                char* relate_processes2[2] = { "sogouImeWebSrv", "sogouImeService" };
-                
-                bool succ_flag(false);
-                int sogouImeWebSrv_newPID(0), sogouImeService_newPID(0);
-
-                int count2 = 3;
-                alive_process_info new_processes[3];
-                memset(new_processes, 0, sizeof(new_processes));
-                osutil_detect_unique_app(relate_processes2, array_size(relate_processes2), &count2, new_processes);
-
-                do {
-
-                    if (count2 == 2/*normal process count*/) {
-                        int exit_flag(0);
-                        for (int i = 0; i < count2; ++i) {
-                            if (strcmp(new_processes[i].name, relate_processes2[0]) == 0 && sogouImeWebSrv_PID != new_processes[i].pid) {
-                                sogouImeWebSrv_newPID = new_processes[i].pid;
-                                exit_flag += 1;
-                            } else if (strcmp(new_processes[i].name, relate_processes2[1]) == 0 && sogouImeServicePID != new_processes[i].pid) {
-                                exit_flag += 1;
-                                sogouImeService_newPID = new_processes[i].pid;
-                            }
-                        }
-
-                        if (exit_flag == 2) {
-                            succ_flag = true;
-                            break;
-                        }
-                    }
-
-                    if (++intervalTimes >= maxtIntervalTimes) {
-                        break;
-                    }
-
-                    Sleep(defaultInterval);
-                    count2 = 3;
-                    memset(new_processes, 0, sizeof(new_processes));
-                    osutil_detect_unique_app(relate_processes2, array_size(relate_processes2), &count2, new_processes);
-
-                } while (true);
-
-                if (succ_flag) {
-                    LogWarn(Severity_Middle, Error_Debug, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_SUCC,
-                            CSimpleStringA::Format("auto restart sogou services succ: WebSrv pid: %u, Service pid: %u", sogouImeWebSrv_newPID, sogouImeService_newPID));
-                    result = Error_Succeed;
-                } else {
-                    LogWarn(Severity_Middle, Error_TimeOut, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_TIMEOUT, "wait sogou auto restart timeout");
-                    result = Error_TimeOut;
-                }
-            }
-        }
-    }
-
-    else if (s1 && s2) {
-
-        do {
-            std::string succStr, errStr;
-            std::string runStr("bash ");
-            runStr += shutdown_service;
-            if (!SP::Module::Util::ShellExecute(runStr, succStr, errStr)) {
-                LogWarn(Severity_Middle, Error_Unexpect, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_FAILED,
-                        CSimpleStringA::Format("%s: %s, %s", shutdown_service.c_str(), succStr.c_str(), errStr.c_str()));
-                return Error_Unexpect;
-            } else {
-                DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("execute {%s} suc: %s", shutdown_service.c_str(), succStr.c_str());
-            }
-        } while (false);
-
-        Sleep(3000);
-
-        do {
-            char app[MAX_PATH] = { '\0' };
-            tk_process_t* process = NULL;
-            tk_process_option_t option;
-            option.exit_cb = NULL;
-            option.file = NULL;
-            option.flags = 0;
-
-            sprintf(app, "bash %s", startup_service.c_str());
-            option.params = app;
-
-            const int res = process_spawn(&option, &process);
-            if (0 == res) {
-                FREE(process);
-                DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("execute {%s} suc", startup_service.c_str());
-            } else {
-                LogWarn(Severity_Middle, Error_Unexpect, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_FAILED,
-                        CSimpleStringA::Format("%s: %d", startup_service.c_str(), res));
-                return Error_Unexpect;
-            }
-
-        } while (false);
-
-        LogWarn(Severity_Middle, Error_Unexpect, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_SUCC, "sogou restart succ.");
-
-    } else {
-
-        LogWarn(Severity_Middle, Error_NotExist, LOG_DEVICECONTROL_SOGOU_SCRIPTS_NOT_EXISTS,
-                CSimpleStringA::Format("%s=%d, %s=%d", startup_service.c_str(), s1, shutdown_service.c_str(), s2));
-        result = Error_NotExist;
-    }
-
-    return result;
-}
-
-ErrorCodeEnum CDeviceControlFSM::OnExit()
-{
-    return Error_Succeed;
-}
-
-unsigned int CDeviceControlFSM::s0_on_event(FSMEvent* pEvt)
-{
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s0 event %d,%d", pEvt->iEvt, pEvt->param1);
-    return 0;
-}
-
-unsigned int CDeviceControlFSM::s1_on_event(FSMEvent* pEvt)
-{
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s1 %d,%d", pEvt->iEvt, pEvt->param1);
-    return 0;
-}
-
-unsigned int CDeviceControlFSM::s3_on_event(FSMEvent* pEvt)
-{
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s3 %d,%d", pEvt->iEvt, pEvt->param1);
-    return 0;
-}
-
-unsigned int CDeviceControlFSM::s4_on_event(FSMEvent* pEvt)
-{
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s4 %d,%d", pEvt->iEvt, pEvt->param1);
-    return 0;
-}

+ 0 - 100
Module/mod_DeviceControl/DeviceControlFSM.h

@@ -1,100 +0,0 @@
-#ifndef _DEVICE_CONTROL_FSM_H
-#define _DEVICE_CONTROL_FSM_H
-
-#pragma once
-
-#include "stdafx.h"
-#include "SpFSM.h"
-
-#include "DeviceControl_def_g.h"
-#include "DeviceControl_server_g.h"
-#include "DeviceControlClass.h"
-#include "DevFSMCommBase.hpp"
-
-#include "Interface.h"
-
-using namespace DeviceControl;
-
-enum EvtType
-{
-	USER_EVT_TEST = EVT_USER+1,
-	USER_EVT_QUIT,
-	USER_EVT_USB,
-	USER_EVT_USB_FINISHED,
-	USER_EVT_GET_UKEYID,
-	USER_EVT_GET_UKEYID_FINISHED,
-	USER_EVT_INIT_TOKEN,
-	USER_EVT_INIT_TOKEN_FINISHED,
-	USER_EVT_QUERY_USB,
-	USER_EVT_QUERY_USB_FINISHED,
-	USER_EVT_WORKING_OP,
-
-};
-
-class CDeviceControlFSM : public CCommDevFSM<CDeviceControlFSM, DeviceControlClass>
-{
-public:
-	enum {s0,s1,s2,s3,s4};
-
-	BEGIN_FSM_STATE(CDeviceControlFSM)
-		FSM_STATE_ENTRY(s0,"Idle",s0_on_entry,s0_on_exit,s0_on_event)
-		FSM_STATE_ENTRY(s1,"USB",s1_on_entry,s1_on_exit,s1_on_event)
-		FSM_STATE_ENTRY(s2,"Failed",s2_on_entry,s2_on_exit,s2_on_event)
-		FSM_STATE_ENTRY(s3,"GetUkeyID",s3_on_entry,s3_on_exit,s3_on_event)
-		FSM_STATE_ENTRY(s4,"InitToken",s4_on_entry,s4_on_exit,s4_on_event)
-		END_FSM_STATE()
-
-		BEGIN_FSM_RULE(CDeviceControlFSM, s0)
-		FSM_RULE_ENTRY(s0, FSM_STATE_EXIT, USER_EVT_QUIT, 0)
-		FSM_RULE_ENTRY(s0, s1, USER_EVT_USB, 0)
-		FSM_RULE_ENTRY(s0, s1, USER_EVT_QUERY_USB, 0)
-		FSM_RULE_ENTRY(s0, s3, USER_EVT_GET_UKEYID, 0)
-		FSM_RULE_ENTRY(s0, s4, USER_EVT_INIT_TOKEN, 0)
-		FSM_RULE_ENTRY(s1, s0, USER_EVT_USB_FINISHED, 0)
-		FSM_RULE_ENTRY(s1, s2, USER_EVT_USB_FINISHED, 1)
-		FSM_RULE_ENTRY(s1, s0, USER_EVT_QUERY_USB_FINISHED, 0)
-		FSM_RULE_ENTRY(s1, s2, USER_EVT_QUERY_USB_FINISHED, 1)
-		FSM_RULE_ENTRY(s3, s0, USER_EVT_GET_UKEYID_FINISHED, 0)
-		FSM_RULE_ENTRY(s3, s0, USER_EVT_GET_UKEYID_FINISHED, 1)
-		FSM_RULE_ENTRY(s4, s0, USER_EVT_INIT_TOKEN_FINISHED, 0)
-		FSM_RULE_ENTRY(s4, s0, USER_EVT_INIT_TOKEN_FINISHED, 1)
-		END_FSM_RULE()
-
-		CDeviceControlFSM():m_testResult(Error_Succeed){};
-	virtual ~CDeviceControlFSM() {};
-
-	virtual ErrorCodeEnum OnInit();
-	virtual ErrorCodeEnum OnExit();
-
-	virtual void s0_on_entry() {}
-	virtual void s0_on_exit() {}
-	virtual unsigned int s0_on_event(FSMEvent* e);
-
-	virtual void s1_on_entry() {}
-	virtual void s1_on_exit() {}
-	virtual unsigned int s1_on_event(FSMEvent* e);
-
-	virtual void s2_on_entry() {}
-	virtual void s2_on_exit() {}
-	virtual unsigned int s2_on_event(FSMEvent* e) { return 0; }
-
-	virtual void s3_on_entry() {}
-	virtual void s3_on_exit() {}
-	virtual unsigned int s3_on_event(FSMEvent* e);
-
-	virtual void s4_on_entry() {}
-	virtual void s4_on_exit() {}
-	virtual unsigned int s4_on_event(FSMEvent* e);
-
-	void SelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext)
-	{
-		pTransactionContext->SendAnswer(Error_Succeed);
-	}
-	ErrorCodeEnum RestartSogouServices();
-	
-private:
-	ErrorCodeEnum m_testResult;
-	CSimpleStringA m_csMachineType;
-};
-
-#endif //_DEVICE_CONTROL_FSM_H

+ 0 - 619
Module/mod_DeviceControl/DeviceControl_client_g.h

@@ -1,619 +0,0 @@
-
-#ifndef __DEVICECONTROL_CLIENT_G_H
-#define __DEVICECONTROL_CLIENT_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "DeviceControl_def_g.h"
-
-namespace DeviceControl {
-class DeviceControlService_ClientBase : public CClientSessionBase {
-public:
-	explicit DeviceControlService_ClientBase(CEntityBase *pEntity) : m_pEntityBase(pEntity), m_bSysManaged(false) {}
-
-	DeviceControlService_ClientBase* operator () (const linkContext &curLink) 
-	{
-		m_context = curLink;
-		return this;
-	}
-
-protected:
-	virtual ~DeviceControlService_ClientBase()
-	{
-		/// override by user
-	}
-public:
-
-	void OnConnectSucceed()
-	{
-		bSessionClosed = false;
-	}
-	void OnClose(ErrorCodeEnum)
-	{
-		bSessionClosed = true;
-	}
-	bool QuerySessionClosed()
-	{
-		return bSessionClosed;
-	}
-	ErrorCodeEnum Connect(CSmartPointer<IAsynWaitSp> &spAsyncWait)
-	{
-		CSmartPointer<IEntityFunction> pFunc = m_pEntityBase->GetFunction();
-		ErrorCodeEnum Error = pFunc->ConnectRemoteEntity(this, "DeviceControl", "DeviceControlService", spAsyncWait);
-		if (Error == Error_Succeed) {
-			m_bSysManaged = true;
-			bSessionClosed = false;
-		}
-		return Error;
-	}
-	ErrorCodeEnum Connect()
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Connect(spAsyncWait);
-		if (Error == Error_Succeed) {
-			Error = spAsyncWait->WaitAnswer();
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum USB(DeviceControlService_USB_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_USB, DeviceControlService_MethodSignature_USB, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum USB(DeviceControlService_USB_Req &Req, DeviceControlService_USB_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = USB(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum USB(DeviceControlService_USB_Req &Req, DeviceControlService_USB_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = USB(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum USB(DeviceControlService_USB_Req &Req, DeviceControlService_USB_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = USB(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum GetUkeyID(DeviceControlService_GetUkeyID_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_GetUkeyID, DeviceControlService_MethodSignature_GetUkeyID, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum GetUkeyID(DeviceControlService_GetUkeyID_Req &Req, DeviceControlService_GetUkeyID_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetUkeyID(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetUkeyID(DeviceControlService_GetUkeyID_Req &Req, DeviceControlService_GetUkeyID_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetUkeyID(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetUkeyID(DeviceControlService_GetUkeyID_Req &Req, DeviceControlService_GetUkeyID_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetUkeyID(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum InitToken(DeviceControlService_InitToken_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_InitToken, DeviceControlService_MethodSignature_InitToken, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum InitToken(DeviceControlService_InitToken_Req &Req, DeviceControlService_InitToken_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = InitToken(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum InitToken(DeviceControlService_InitToken_Req &Req, DeviceControlService_InitToken_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = InitToken(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum InitToken(DeviceControlService_InitToken_Req &Req, DeviceControlService_InitToken_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = InitToken(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum QueryUSBStatus(DeviceControlService_QueryUSBStatus_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_QueryUSBStatus, DeviceControlService_MethodSignature_QueryUSBStatus, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum QueryUSBStatus(DeviceControlService_QueryUSBStatus_Req &Req, DeviceControlService_QueryUSBStatus_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryUSBStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryUSBStatus(DeviceControlService_QueryUSBStatus_Req &Req, DeviceControlService_QueryUSBStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryUSBStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryUSBStatus(DeviceControlService_QueryUSBStatus_Req &Req, DeviceControlService_QueryUSBStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryUSBStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum QueryHardwareInfo(DeviceControlService_QueryHardwareInfo_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_QueryHardwareInfo, DeviceControlService_MethodSignature_QueryHardwareInfo, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum QueryHardwareInfo(DeviceControlService_QueryHardwareInfo_Req &Req, DeviceControlService_QueryHardwareInfo_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryHardwareInfo(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryHardwareInfo(DeviceControlService_QueryHardwareInfo_Req &Req, DeviceControlService_QueryHardwareInfo_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryHardwareInfo(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryHardwareInfo(DeviceControlService_QueryHardwareInfo_Req &Req, DeviceControlService_QueryHardwareInfo_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryHardwareInfo(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum ReadCenterConfigStr(DeviceControlService_ReadCenterConfigStr_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_ReadCenterConfigStr, DeviceControlService_MethodSignature_ReadCenterConfigStr, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum ReadCenterConfigStr(DeviceControlService_ReadCenterConfigStr_Req &Req, DeviceControlService_ReadCenterConfigStr_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadCenterConfigStr(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum ReadCenterConfigStr(DeviceControlService_ReadCenterConfigStr_Req &Req, DeviceControlService_ReadCenterConfigStr_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadCenterConfigStr(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum ReadCenterConfigStr(DeviceControlService_ReadCenterConfigStr_Req &Req, DeviceControlService_ReadCenterConfigStr_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadCenterConfigStr(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum ReadConfigValue(DeviceControlService_ReadConfigValue_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_ReadConfigValue, DeviceControlService_MethodSignature_ReadConfigValue, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum ReadConfigValue(DeviceControlService_ReadConfigValue_Req &Req, DeviceControlService_ReadConfigValue_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadConfigValue(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum ReadConfigValue(DeviceControlService_ReadConfigValue_Req &Req, DeviceControlService_ReadConfigValue_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadConfigValue(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum ReadConfigValue(DeviceControlService_ReadConfigValue_Req &Req, DeviceControlService_ReadConfigValue_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = ReadConfigValue(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum TestConnectivity(DeviceControlService_TestConnectivity_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_TestConnectivity, DeviceControlService_MethodSignature_TestConnectivity, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum TestConnectivity(DeviceControlService_TestConnectivity_Req &Req, DeviceControlService_TestConnectivity_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = TestConnectivity(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum TestConnectivity(DeviceControlService_TestConnectivity_Req &Req, DeviceControlService_TestConnectivity_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = TestConnectivity(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum TestConnectivity(DeviceControlService_TestConnectivity_Req &Req, DeviceControlService_TestConnectivity_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = TestConnectivity(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum GetVendorFileList(DeviceControlService_GetVendorFileList_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_GetVendorFileList, DeviceControlService_MethodSignature_GetVendorFileList, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum GetVendorFileList(DeviceControlService_GetVendorFileList_Req &Req, DeviceControlService_GetVendorFileList_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetVendorFileList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetVendorFileList(DeviceControlService_GetVendorFileList_Req &Req, DeviceControlService_GetVendorFileList_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetVendorFileList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetVendorFileList(DeviceControlService_GetVendorFileList_Req &Req, DeviceControlService_GetVendorFileList_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetVendorFileList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum TestAdapterFileAvailable(DeviceControlService_TestAdapterFileAvailable_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_TestAdapterFileAvailable, DeviceControlService_MethodSignature_TestAdapterFileAvailable, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum TestAdapterFileAvailable(DeviceControlService_TestAdapterFileAvailable_Req &Req, DeviceControlService_TestAdapterFileAvailable_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = TestAdapterFileAvailable(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum TestAdapterFileAvailable(DeviceControlService_TestAdapterFileAvailable_Req &Req, DeviceControlService_TestAdapterFileAvailable_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = TestAdapterFileAvailable(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum TestAdapterFileAvailable(DeviceControlService_TestAdapterFileAvailable_Req &Req, DeviceControlService_TestAdapterFileAvailable_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = TestAdapterFileAvailable(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum GetDevInfo(DeviceControlService_GetDevInfo_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(DeviceControlService_Method_GetDevInfo, DeviceControlService_MethodSignature_GetDevInfo, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum GetDevInfo(DeviceControlService_GetDevInfo_Req &Req, DeviceControlService_GetDevInfo_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetDevInfo(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetDevInfo(DeviceControlService_GetDevInfo_Req &Req, DeviceControlService_GetDevInfo_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetDevInfo(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetDevInfo(DeviceControlService_GetDevInfo_Req &Req, DeviceControlService_GetDevInfo_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetDevInfo(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-
-	bool SafeDelete()
-	{
-		if (!m_bSysManaged) {
-			delete this;
-		}
-		return m_bSysManaged;
-	}
-
-protected:
-	bool m_bSysManaged;
-	CEntityBase *m_pEntityBase;
-	linkContext m_context;
-	bool bSessionClosed;
-};
-
-///////////////////////////
-
-} // namespace DeviceControl
-#endif // __DEVICECONTROL_CLIENT_G_H

+ 0 - 397
Module/mod_DeviceControl/DeviceControl_def_g.h

@@ -1,397 +0,0 @@
-#ifndef __DEVICECONTROL_DEF_G_H
-#define __DEVICECONTROL_DEF_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "SpHelper.h"
-
-namespace DeviceControl {
-//
-// const goes here
-//
-
-#define DeviceControlService_Method_USB 0
-#define DeviceControlService_Method_GetUkeyID 1
-#define DeviceControlService_Method_InitToken 2
-#define DeviceControlService_Method_QueryUSBStatus 3
-#define DeviceControlService_Method_QueryHardwareInfo 4
-#define DeviceControlService_Method_ReadCenterConfigStr 5
-#define DeviceControlService_Method_ReadConfigValue 6
-#define DeviceControlService_Method_TestConnectivity 7
-#define DeviceControlService_Method_GetVendorFileList 8
-#define DeviceControlService_Method_TestAdapterFileAvailable 9
-#define DeviceControlService_Method_GetDevInfo 65535
-
-#define DeviceControlService_MethodSignature_USB 109707598
-#define DeviceControlService_MethodSignature_GetUkeyID -339019147
-#define DeviceControlService_MethodSignature_InitToken 2087976810
-#define DeviceControlService_MethodSignature_QueryUSBStatus -1166010722
-#define DeviceControlService_MethodSignature_QueryHardwareInfo 1706767096
-#define DeviceControlService_MethodSignature_ReadCenterConfigStr -673154017
-#define DeviceControlService_MethodSignature_ReadConfigValue 730234720
-#define DeviceControlService_MethodSignature_TestConnectivity -42627632
-#define DeviceControlService_MethodSignature_GetVendorFileList 1902033390
-#define DeviceControlService_MethodSignature_TestAdapterFileAvailable 1059104594
-#define DeviceControlService_MethodSignature_GetDevInfo 296205965
-
-#define DeviceControlService_LogCode_USB "QLR040221400"
-#define DeviceControlService_LogCode_GetUkeyID "QLR040221401"
-#define DeviceControlService_LogCode_InitToken "QLR040221402"
-#define DeviceControlService_LogCode_QueryUSBStatus "QLR040221403"
-#define DeviceControlService_LogCode_QueryHardwareInfo "QLR040221404"
-#define DeviceControlService_LogCode_ReadCenterConfigStr "QLR040221405"
-#define DeviceControlService_LogCode_ReadConfigValue "QLR040221406"
-#define DeviceControlService_LogCode_TestConnectivity "QLR040221407"
-#define DeviceControlService_LogCode_GetVendorFileList "QLR040221408"
-#define DeviceControlService_LogCode_TestAdapterFileAvailable "QLR040221409"
-#define DeviceControlService_LogCode_GetDevInfo "QLR040221499"
-
-struct DeviceControlService_USB_Req
-{
-	bool open;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & open & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_USB_Ans
-{
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_GetUkeyID_Req
-{
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_GetUkeyID_Ans
-{
-	CSimpleStringA UkeyID;
-	int UkeyIDLen;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & UkeyID & UkeyIDLen & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_InitToken_Req
-{
-	CSimpleStringA CertType;
-	CSimpleStringA OldSuperPwd;
-	CSimpleStringA UserName;
-	CSimpleStringA UserIDType;
-	CSimpleStringA UserIDNo;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & CertType & OldSuperPwd & UserName & UserIDType & UserIDNo & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_InitToken_Ans
-{
-	CSimpleStringA TokenSn;
-	CSimpleStringA PKCS10;
-	CSimpleStringA Msg;
-	int TokenType;
-	int TokenSnLen;
-	int PKCS10Len;
-	int MsgLen;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & TokenSn & PKCS10 & Msg & TokenType & TokenSnLen & PKCS10Len & MsgLen & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_QueryUSBStatus_Req
-{
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_QueryUSBStatus_Ans
-{
-	int flag;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & flag & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_QueryHardwareInfo_Req
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct DeviceControlService_QueryHardwareInfo_Ans
-{
-	CSimpleStringA machineType;
-	CSimpleStringA terminalNo;
-	CSimpleStringA site;
-	CSimpleStringA termLimit;
-	CSimpleStringA termVersion;
-	CAutoArray<CSimpleStringA> ip;
-	CAutoArray<CSimpleStringA> mac;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & machineType & terminalNo & site & termLimit & termVersion & ip & mac & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_ReadCenterConfigStr_Req
-{
-	CSimpleStringA entityName;
-	CSimpleStringA key;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & entityName & key & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_ReadCenterConfigStr_Ans
-{
-	CSimpleStringA value;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & value & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_ReadConfigValue_Req
-{
-	int configType;
-	CSimpleStringA section;
-	bool option;
-	CSimpleStringA key;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & configType & section & option & key & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_ReadConfigValue_Ans
-{
-	CSimpleStringA value;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & value & reserved1 & reserved2 & reserved3 & reserved4;
-	}
-
-};
-
-struct DeviceControlService_TestConnectivity_Req
-{
-	int protocol;
-	CSimpleStringA ip;
-	int port;
-	int reserved1;
-	CSimpleStringA reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & protocol & ip & port & reserved1 & reserved2;
-	}
-
-};
-
-struct DeviceControlService_TestConnectivity_Ans
-{
-	int result;
-	CSimpleStringA additionalMsg;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & result & additionalMsg;
-	}
-
-};
-
-struct DeviceControlService_GetVendorFileList_Req
-{
-	bool root;
-	CSimpleStringA adapter;
-	CSimpleStringA vendor;
-	CSimpleStringA version;
-	CSimpleStringA batch;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & root & adapter & vendor & version & batch;
-	}
-
-};
-
-struct DeviceControlService_GetVendorFileList_Ans
-{
-	int result;
-	CSimpleStringA msg;
-	CAutoArray<CSimpleStringA> filenames;
-	CAutoArray<int> status;
-	CAutoArray<int> port;
-	CAutoArray<int> baudrate;
-	CAutoArray<CSimpleStringA> param1;
-	CAutoArray<CSimpleStringA> param2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & result & msg & filenames & status & port & baudrate & param1 & param2;
-	}
-
-};
-
-struct DeviceControlService_TestAdapterFileAvailable_Req
-{
-	CSimpleStringA filename;
-	int type;
-	int options;
-	int port;
-	int baudrate;
-	int param1;
-	int param2;
-	CSimpleStringA param3;
-	CSimpleStringA param4;
-	CAutoArray<int> param5;
-	CAutoArray<CSimpleStringA> param6;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & filename & type & options & port & baudrate & param1 & param2 & param3 & param4 & param5 & param6;
-	}
-
-};
-
-struct DeviceControlService_TestAdapterFileAvailable_Ans
-{
-	unsigned int status;
-	CSimpleStringA msg;
-	CAutoArray<int> reserved1;
-	CAutoArray<CSimpleStringA> reserved2;
-	CAutoArray<CSimpleStringA> reserved3;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & status & msg & reserved1 & reserved2 & reserved3;
-	}
-
-};
-
-struct DeviceControlService_GetDevInfo_Req
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct DeviceControlService_GetDevInfo_Ans
-{
-	CSimpleStringA type;
-	CSimpleStringA model;
-	CSimpleStringA version;
-	int state;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & type & model & version & state;
-	}
-
-};
-
-
-///////////////////////////
-
-} // namespace DeviceControl
-
-#endif // __DEVICECONTROL_DEF_G_H

+ 0 - 32
Module/mod_DeviceControl/DeviceControl_msg_g.h

@@ -1,32 +0,0 @@
-
-#ifndef __DEVICECONTROL_MSG_G_H
-#define __DEVICECONTROL_MSG_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "SpHelper.h"
-
-namespace DeviceControl {
-#define eMsg_AdapterTestResult 0
-
-#define eMsgSig_AdapterTestResult -208286610
-
-struct AdapterTestResult
-{
-	int result;
-	CSimpleStringA adapterInfo;
-	CSimpleStringA errMsg;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & result & adapterInfo & errMsg;
-	}
-
-};
-
-///////////////////////////
-
-} // namespace DeviceControl
-#endif // __DEVICECONTROL_MSG_G_H

+ 0 - 380
Module/mod_DeviceControl/DeviceControl_server_g.h

@@ -1,380 +0,0 @@
-
-#ifndef __DEVICECONTROL_SERVER_G_H
-#define __DEVICECONTROL_SERVER_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "DeviceControl_def_g.h"
-
-namespace DeviceControl {
-class DeviceControlService_ServerSessionBase : public CServerSessionBase
-{
-public:
-	DeviceControlService_ServerSessionBase()
-	{
-		/// override by user
-	}
-
-	virtual ~DeviceControlService_ServerSessionBase()
-	{
-		/// override by user
-	}
-
-	virtual bool IsExclusive() { return false; }
-
-	virtual bool IsSessionOverlap() { return true; }
-
-	virtual ErrorCodeEnum GetMessageAttr(DWORD dwMessageID, DWORD dwSignature, bool &bOverlap)
-	{
-		ErrorCodeEnum Error = Error_Succeed;
-		switch (dwMessageID) {
-		case DeviceControlService_Method_USB:
-			if (dwSignature == DeviceControlService_MethodSignature_USB) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_GetUkeyID:
-			if (dwSignature == DeviceControlService_MethodSignature_GetUkeyID) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_InitToken:
-			if (dwSignature == DeviceControlService_MethodSignature_InitToken) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_QueryUSBStatus:
-			if (dwSignature == DeviceControlService_MethodSignature_QueryUSBStatus) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_QueryHardwareInfo:
-			if (dwSignature == DeviceControlService_MethodSignature_QueryHardwareInfo) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_ReadCenterConfigStr:
-			if (dwSignature == DeviceControlService_MethodSignature_ReadCenterConfigStr) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_ReadConfigValue:
-			if (dwSignature == DeviceControlService_MethodSignature_ReadConfigValue) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_TestConnectivity:
-			if (dwSignature == DeviceControlService_MethodSignature_TestConnectivity) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_GetVendorFileList:
-			if (dwSignature == DeviceControlService_MethodSignature_GetVendorFileList) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_TestAdapterFileAvailable:
-			if (dwSignature == DeviceControlService_MethodSignature_TestAdapterFileAvailable) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_GetDevInfo:
-			if (dwSignature == DeviceControlService_MethodSignature_GetDevInfo) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		default:
-			Error = Error_MethodNotFound;
-			break;
-		}
-		return Error;
-	}
-
-	int CheckMessageSignature(DWORD dwMessageID, DWORD dwSignature)
-	{
-		ErrorCodeEnum Error = Error_Succeed;
-		switch (dwMessageID) {
-		case DeviceControlService_Method_USB:
-			if (dwSignature != DeviceControlService_MethodSignature_USB) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_GetUkeyID:
-			if (dwSignature != DeviceControlService_MethodSignature_GetUkeyID) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_InitToken:
-			if (dwSignature != DeviceControlService_MethodSignature_InitToken) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_QueryUSBStatus:
-			if (dwSignature != DeviceControlService_MethodSignature_QueryUSBStatus) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_QueryHardwareInfo:
-			if (dwSignature != DeviceControlService_MethodSignature_QueryHardwareInfo) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_ReadCenterConfigStr:
-			if (dwSignature != DeviceControlService_MethodSignature_ReadCenterConfigStr) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_ReadConfigValue:
-			if (dwSignature != DeviceControlService_MethodSignature_ReadConfigValue) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_TestConnectivity:
-			if (dwSignature != DeviceControlService_MethodSignature_TestConnectivity) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_GetVendorFileList:
-			if (dwSignature != DeviceControlService_MethodSignature_GetVendorFileList) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_TestAdapterFileAvailable:
-			if (dwSignature != DeviceControlService_MethodSignature_TestAdapterFileAvailable) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case DeviceControlService_Method_GetDevInfo:
-			if (dwSignature != DeviceControlService_MethodSignature_GetDevInfo) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		default:
-			Error = Error_MethodNotFound;
-			break;
-		}
-		return Error;
-	}
-
-	virtual void Handle_USB(SpReqAnsContext<DeviceControlService_USB_Req, DeviceControlService_USB_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_GetUkeyID(SpReqAnsContext<DeviceControlService_GetUkeyID_Req, DeviceControlService_GetUkeyID_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_InitToken(SpReqAnsContext<DeviceControlService_InitToken_Req, DeviceControlService_InitToken_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_QueryUSBStatus(SpReqAnsContext<DeviceControlService_QueryUSBStatus_Req, DeviceControlService_QueryUSBStatus_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_QueryHardwareInfo(SpReqAnsContext<DeviceControlService_QueryHardwareInfo_Req, DeviceControlService_QueryHardwareInfo_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_ReadCenterConfigStr(SpReqAnsContext<DeviceControlService_ReadCenterConfigStr_Req, DeviceControlService_ReadCenterConfigStr_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_ReadConfigValue(SpReqAnsContext<DeviceControlService_ReadConfigValue_Req, DeviceControlService_ReadConfigValue_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_TestConnectivity(SpReqAnsContext<DeviceControlService_TestConnectivity_Req, DeviceControlService_TestConnectivity_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_GetVendorFileList(SpReqAnsContext<DeviceControlService_GetVendorFileList_Req, DeviceControlService_GetVendorFileList_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_TestAdapterFileAvailable(SpReqAnsContext<DeviceControlService_TestAdapterFileAvailable_Req, DeviceControlService_TestAdapterFileAvailable_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_GetDevInfo(SpReqAnsContext<DeviceControlService_GetDevInfo_Req, DeviceControlService_GetDevInfo_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
-	{
-		CAutoBuffer Buf;
-		DWORD dwMessageID;
-		DWORD dwMessageSignature;
-		ErrorCodeEnum Error = pTransactionContext->GetReceiveBuffer(dwMessageID, dwMessageSignature, Buf);
-		if (Error == Error_Succeed) {
-#ifdef DEBUG
-			assert(CheckMessageSignature(dwMessageID, dwMessageSignature) == Error_Succeed);
-#else
-			if (CheckMessageSignature(dwMessageID, dwMessageSignature) != Error_Succeed) {
-				pTransactionContext->SendAnswer(Error_MethodSignatureFailed);
-				return;
-			}
-#endif
-			switch (dwMessageID) {
-				case DeviceControlService_Method_USB:
-					{
-						SpReqAnsContext<DeviceControlService_USB_Req,DeviceControlService_USB_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_USB_Req,DeviceControlService_USB_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_USB(ctx);
-					}
-					break;
-				case DeviceControlService_Method_GetUkeyID:
-					{
-						SpReqAnsContext<DeviceControlService_GetUkeyID_Req,DeviceControlService_GetUkeyID_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_GetUkeyID_Req,DeviceControlService_GetUkeyID_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_GetUkeyID(ctx);
-					}
-					break;
-				case DeviceControlService_Method_InitToken:
-					{
-						SpReqAnsContext<DeviceControlService_InitToken_Req,DeviceControlService_InitToken_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_InitToken_Req,DeviceControlService_InitToken_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_InitToken(ctx);
-					}
-					break;
-				case DeviceControlService_Method_QueryUSBStatus:
-					{
-						SpReqAnsContext<DeviceControlService_QueryUSBStatus_Req,DeviceControlService_QueryUSBStatus_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_QueryUSBStatus_Req,DeviceControlService_QueryUSBStatus_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_QueryUSBStatus(ctx);
-					}
-					break;
-				case DeviceControlService_Method_QueryHardwareInfo:
-					{
-						SpReqAnsContext<DeviceControlService_QueryHardwareInfo_Req,DeviceControlService_QueryHardwareInfo_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_QueryHardwareInfo_Req,DeviceControlService_QueryHardwareInfo_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_QueryHardwareInfo(ctx);
-					}
-					break;
-				case DeviceControlService_Method_ReadCenterConfigStr:
-					{
-						SpReqAnsContext<DeviceControlService_ReadCenterConfigStr_Req,DeviceControlService_ReadCenterConfigStr_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_ReadCenterConfigStr_Req,DeviceControlService_ReadCenterConfigStr_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_ReadCenterConfigStr(ctx);
-					}
-					break;
-				case DeviceControlService_Method_ReadConfigValue:
-					{
-						SpReqAnsContext<DeviceControlService_ReadConfigValue_Req,DeviceControlService_ReadConfigValue_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_ReadConfigValue_Req,DeviceControlService_ReadConfigValue_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_ReadConfigValue(ctx);
-					}
-					break;
-				case DeviceControlService_Method_TestConnectivity:
-					{
-						SpReqAnsContext<DeviceControlService_TestConnectivity_Req,DeviceControlService_TestConnectivity_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_TestConnectivity_Req,DeviceControlService_TestConnectivity_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_TestConnectivity(ctx);
-					}
-					break;
-				case DeviceControlService_Method_GetVendorFileList:
-					{
-						SpReqAnsContext<DeviceControlService_GetVendorFileList_Req,DeviceControlService_GetVendorFileList_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_GetVendorFileList_Req,DeviceControlService_GetVendorFileList_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_GetVendorFileList(ctx);
-					}
-					break;
-				case DeviceControlService_Method_TestAdapterFileAvailable:
-					{
-						SpReqAnsContext<DeviceControlService_TestAdapterFileAvailable_Req,DeviceControlService_TestAdapterFileAvailable_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_TestAdapterFileAvailable_Req,DeviceControlService_TestAdapterFileAvailable_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_TestAdapterFileAvailable(ctx);
-					}
-					break;
-				case DeviceControlService_Method_GetDevInfo:
-					{
-						SpReqAnsContext<DeviceControlService_GetDevInfo_Req,DeviceControlService_GetDevInfo_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<DeviceControlService_GetDevInfo_Req,DeviceControlService_GetDevInfo_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_GetDevInfo(ctx);
-					}
-					break;
-				default:
-					assert(0);
-					break;
-			}
-			
-		} else {
-			pTransactionContext->SendAnswer(Error);
-		}
-	}
-
-};
-
-
-///////////////////////////
-
-} // namespace DeviceControl
-#endif // __DEVICECONTROL_SERVER_G_H

+ 0 - 161
Module/mod_DeviceControl/Interface.h

@@ -1,161 +0,0 @@
-//---------------------------------------------------------------------------
-
-#ifndef InterfaceH
-#define InterfaceH
-//---------------------------------------------------------------------------
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#define TOKEN_TYPE_MW21   0x21     //"类型21"
-#define TOKEN_TYPE_GD31   0x31     //"类型31"
-#define TOKEN_TYPE_GD33   0x33     //"类型33"
-#define TOKEN_TYPE_MW23   0x23     //"类型23"
-#define TOKEN_TYPE_GD35   0x35     //"类型35"
-
-
-//错误
-#define OK_FORMAT_COMPLETE   0
-#define ERR_ALREADY_PROCESSING  -1
-#define ERR_PARAM_EMPTY      -2
-#define ERR_BUFFER_TOO_SMALL -3
-#define ERR_NAME_TOO_LONG    -4
-#define ERR_MULTI_TOKENS     -5
-#define ERR_FIND_TOKEN       -6
-#define ERR_CONNECT_TOKEN    -7
-#define ERR_VERIFY_SUPER_PWD -8
-#define ERR_VERIFY_USER_PWD  -9
-#define ERR_BLANK_TOKEN      -10
-#define ERR_READ_SN          -11
-#define ERR_MW21DRV_NOTEXIST -12
-#define ERR_GD31DRV_NOTEXIST -13
-#define ERR_SET_USER_PWD     -14
-
-//以下错误发生,会重新尝试格式化key
-#define ERR_FORMAT_TOKEN     -20
-#define ERR_CREATE_CONTAINER -21
-#define ERR_GENERATE_RSAKEY  -22
-#define ERR_EXPORT_PUBKEY    -23
-#define ERR_GENERATE_CERTREQ -24
-#define ERR_REQ_SINGATURE    -25
-
-#define ERR_CREATE_V0        -26
-#define ERR_CREATE_P0        -27
-#define ERR_CREATE_P2        -28
-
-#define ERR_WRITE_V0         -29
-#define ERR_WRITE_P0         -30
-#define ERR_WRITE_P2         -31
-
-#define ERR_READ_V0          -32
-#define ERR_READ_P0          -33
-#define ERR_READ_P2          -34
-
-#define ERR_VERIFY_V0        -35
-#define ERR_VERIFY_P0        -36
-#define ERR_VERIFY_P2        -37
-
-#define ERR_WRITE_BACK       -38
-
-#define ERR_UNKNOWN_EXCEPTION -39
-
-
-#define ERR_STR_ALREADY_PROCESSING  "有其他的格式化操作正在进行。"
-#define ERR_STR_PARAM_EMPTY      "输入变量为空。"
-#define ERR_STR_BUFFER_TOO_SMALL "输出缓冲太小。"
-#define ERR_STR_NAME_TOO_LONG    "申请人姓名太长。"
-#define ERR_STR_MULTI_TOKENS     "电脑上有多个USBKEY。"
-#define ERR_STR_FIND_TOKEN       "搜索USBKEY失败。请确认是否插好。"
-#define ERR_STR_CONNECT_TOKEN    "连接USBKEY出错。请插拔后再试。"
-#define ERR_STR_VERIFY_SUPER_PWD "验证USBKEY超级口令失败。"
-#define ERR_STR_VERIFY_USER_PWD  "验证USBKEY用户口令失败。"
-#define ERR_STR_SET_USER_PWD     "修改用户口令失败。"
-#define ERR_STR_BLANK_TOKEN      "清空USBKEY失败。"
-#define ERR_STR_READ_SN          "读取USBKEY序列号失败。请更换设备。"
-#define ERR_STR_MW21DRV_NOTEXIST "21型驱动尚未安装。请安装驱动。"
-#define ERR_STR_GD31DRV_NOTEXIST "31型驱动尚未安装。请安装驱动。"
-#define ERR_STR_FORMAT_TOKEN     "格式化失败。请插拔后再试或者更换设备。"
-#define ERR_STR_CREATE_CONTAINER "创建容器失败。请更换设备。"
-#define ERR_STR_GENERATE_RSAKEY  "生成密钥对失败。请更换设备。"
-#define ERR_STR_EXPORT_PUBKEY    "导出公钥失败。请更换设备。"
-#define ERR_STR_GENERATE_CERTREQ "生成证书请求失败。请更换设备。"
-#define ERR_STR_REQ_SINGATURE    "证书请求的签名验证失败。请更换设备。"
-#define ERR_STR_CREATE_V0        "创建文件v0失败。请更换设备。"
-#define ERR_STR_CREATE_P0        "创建文件p0失败。请更换设备。"
-#define ERR_STR_CREATE_P2        "创建文件p2失败。请更换设备。"
-#define ERR_STR_WRITE_V0         "写入文件v0失败。请更换设备。"
-#define ERR_STR_WRITE_P0         "写入文件p0失败。请更换设备。"
-#define ERR_STR_WRITE_P2         "写入文件p2失败。请更换设备。"
-#define ERR_STR_READ_V0          "读取文件v0失败。请更换设备。"
-#define ERR_STR_READ_P0          "读取文件p0失败。请更换设备。"
-#define ERR_STR_READ_P2          "读取文件p2失败。请更换设备。"
-#define ERR_STR_VERIFY_V0        "校验文件v0失败。请更换设备。"
-#define ERR_STR_VERIFY_P0        "校验文件p0失败。请更换设备。"
-#define ERR_STR_VERIFY_P2        "校验文件p2失败。请更换设备。"
-#define ERR_STR_WRITE_BACK       "回写标志失败"
-#define ERR_STR_UNKNOWN_EXCEPTION "发生未知异常"
-
-
-/*
-证书系统:
-"身份证"        A
-"护照"          B
-"军人证"        C
-"户口簿"        D
-"居住证"        E
-"监护人证件"    F
-"武警身份证"    G
-"通行证"        H
-"暂住证"        I
-"其他"          Z
-
-主机:
-居民身份证      P01
-学生证          P02
-临时居民身份证  P03
-军人证          P04
-武警身份证      P08
-居民户口簿      P16
-通行证          P18
-回乡证          P19
-护照            P31
-*/
-
-__declspec(dllexport)
-int __stdcall CalcCheckValue(char* pszTokenNum , int nTokenNum);
-
-
-#define CERTTYPE_RSA1024  6
-#define CERTTYPE_RSA2048  7
-#define CERTTYPE_SM2_256  8
-
-__declspec(dllexport)
-int __stdcall InitToken(char* pszCertType,
-						int& nTokenType,  //char* pszTokenType, int& nTokenType,
-                        char* pszOldSuperPwd,
-                        char* pszUserName,
-                        char* pszUserIDType,
-                        char* pszUserIDNo,
-                        char* pszTokenSn, int& nTokenSn,   //至少16字节
-                        char* pszPKCS10,  int& nPKCS10,    //建议大小1024字节
-                        char* pszMsg,     int& nMsg          //建议至少100字节
-);
-
-
-__declspec(dllexport)
-int __stdcall EndInitToken();
-
-// add by wr 20151019
-__declspec(dllexport)
-int __stdcall GetUKeyID(char *pUKeyID, int &nUKeyID);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif

+ 0 - 477
Module/mod_DeviceControl/mod_DeviceControl.cpp

@@ -1,477 +0,0 @@
-// mod_DeviceControl.cpp : Defines the exported functions for the DLL application.
-//
-
-#include "stdafx.h"
-#include "mod_DeviceControl.h"
-#include "DeviceControl_msg_g.h"
-#include "toolkit.h"
-#include "CommEntityUtil.hpp"
-#include <string>
-#include <map>
-#include "array.h"
-#include "fileutil.h"
-#include <vector>
-#include <iostream>
-#include <memory>
-
-#include "EventCode.h"
-
-#if defined(RVC_OS_WIN)
-#include<windows.h>
-#else
-#include <regex.h>
-#include <sys/utsname.h>
-#include "RestfulFunc.h"
-
-#define NOT_SUPPOT_X11
-#ifndef NOT_SUPPOT_X11
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#endif //NOT_SUPPOT_X11
-#endif //RVC_OS_WIN
-
-#define DeviceControl_MouseMove  0x21400301	//鼠标移动
-
-void CDeviceControlServerSession::Handle_USB(SpReqAnsContext<DeviceControlService_USB_Req, DeviceControlService_USB_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-    DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_USB).setAPI(__FUNCTION__)(__FUNCTION__);
-    m_pEntity->USB(ctx);
-}
-void CDeviceControlServerSession::Handle_GetUkeyID(SpReqAnsContext<DeviceControlService_GetUkeyID_Req, DeviceControlService_GetUkeyID_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_GetUkeyID).setAPI(__FUNCTION__)(__FUNCTION__);
-    m_pEntity->GetUkeyID(ctx);
-}
-void CDeviceControlServerSession::Handle_InitToken(SpReqAnsContext<DeviceControlService_InitToken_Req, DeviceControlService_InitToken_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_InitToken).setAPI(__FUNCTION__)(__FUNCTION__);
-    m_pEntity->InitToken(ctx);
-}
-void CDeviceControlServerSession::Handle_QueryUSBStatus(SpReqAnsContext<DeviceControlService_QueryUSBStatus_Req, DeviceControlService_QueryUSBStatus_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_QueryUSBStatus).setAPI(__FUNCTION__)(__FUNCTION__);
-
-    m_pEntity->QueryUSBStatus(ctx);
-}
-/** 无交易量  [Gifur@20241210]*/
-void CDeviceControlServerSession::Handle_QueryHardwareInfo(SpReqAnsContext<DeviceControlService_QueryHardwareInfo_Req, DeviceControlService_QueryHardwareInfo_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_QueryHardwareInfo).setAPI(__FUNCTION__)(__FUNCTION__);
-
-    m_pEntity->QueryHardwareInfo(ctx);
-}
-void CDeviceControlServerSession::Handle_ReadCenterConfigStr(SpReqAnsContext<DeviceControlService_ReadCenterConfigStr_Req, DeviceControlService_ReadCenterConfigStr_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_ReadCenterConfigStr).setAPI(__FUNCTION__)(__FUNCTION__);
-
-    m_pEntity->ReadCenterConfigStr(ctx);
-}
-
-void CDeviceControlServerSession::Handle_ReadConfigValue(SpReqAnsContext<DeviceControlService_ReadConfigValue_Req, DeviceControlService_ReadConfigValue_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_ReadConfigValue).setAPI(__FUNCTION__)(__FUNCTION__);
-
-    m_pEntity->ReadConfigValue(ctx);
-}
-
-void CDeviceControlServerSession::Handle_GetDevInfo(SpReqAnsContext<DeviceControlService_GetDevInfo_Req, DeviceControlService_GetDevInfo_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_GetDevInfo).setAPI(__FUNCTION__)(__FUNCTION__);
-
-    m_pEntity->GetDevInfo(ctx);
-}
-
-void CDeviceControlServerSession::Handle_TestConnectivity(SpReqAnsContext<DeviceControlService_TestConnectivity_Req, DeviceControlService_TestConnectivity_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_TestConnectivity).setAPI(__FUNCTION__)(__FUNCTION__);
-
-    m_pEntity->TestConnectivity(ctx);
-}
-
-void CDeviceControlServerSession::Handle_GetVendorFileList(SpReqAnsContext<DeviceControlService_GetVendorFileList_Req, DeviceControlService_GetVendorFileList_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_GetVendorFileList).setAPI(__FUNCTION__)(__FUNCTION__);
-
-    m_pEntity->GetVendorFileList(ctx);
-}
-
-void CDeviceControlServerSession::Handle_TestAdapterFileAvailable(SpReqAnsContext<DeviceControlService_TestAdapterFileAvailable_Req, DeviceControlService_TestAdapterFileAvailable_Ans>::Pointer ctx)
-{
-    DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(DeviceControlService_LogCode_TestAdapterFileAvailable).setAPI(__FUNCTION__)(__FUNCTION__);
-
-    m_pEntity->TestAdapterFileAvailable(ctx);
-}
-
-void CDeviceControlEntity::QueryHardwareInfo(SpReqAnsContext<DeviceControlService_QueryHardwareInfo_Req, DeviceControlService_QueryHardwareInfo_Ans>::Pointer ctx)
-{
-    CSystemStaticInfo info;
-    GetFunction()->GetSystemStaticInfo(info);
-	CAutoArray<SP::Module::Net::NetworkAdapterItem> netList;
-	SP::Module::Net::GetINETMacAddresses(netList);
-
-	CAutoArray<CSimpleStringA> ipAddrs, macAddrs;
-	for (int i = 0; i < netList.GetCount(); i++) {
-		CSimpleStringA tmpip = netList[i].ip.c_str();
-		CSimpleStringA tmpmac = netList[i].mac.c_str();
-		ipAddrs.Append(&tmpip, 0, 1);
-		macAddrs.Append(&tmpmac, 0, 1);
-	}
-    //获取操作系统版本信息
-#if defined(_MSC_VER)
-        //获取windows系统版本
-    DWORD dwMajorVer, dwMinorVer, dwBuildNumber;
-    BOOL bRet = FALSE;
-    HMODULE hModNtdll = NULL;
-    if (hModNtdll = ::LoadLibraryW(L"ntdll.dll")) {
-        typedef void (WINAPI* pfRTLGETNTVERSIONNUMBERS)(DWORD*, DWORD*, DWORD*);
-        pfRTLGETNTVERSIONNUMBERS pfRtlGetNtVersionNumbers;
-        pfRtlGetNtVersionNumbers = (pfRTLGETNTVERSIONNUMBERS)::GetProcAddress(hModNtdll, "RtlGetNtVersionNumbers");
-        if (pfRtlGetNtVersionNumbers) {
-            pfRtlGetNtVersionNumbers(&dwMajorVer, &dwMinorVer, &dwBuildNumber);
-            dwBuildNumber &= 0x0ffff;
-            bRet = TRUE;
-        }
-
-        ::FreeLibrary(hModNtdll);
-        hModNtdll = NULL;
-    }
-
-    char buffer[1024];
-    sprintf(buffer, "%d.%d.%d", dwMajorVer, dwMinorVer, dwBuildNumber);
-    CSimpleStringA sysVer = (string("Windows ver[") + string(buffer) + "]").c_str();
-#else
-    utsname sysInfo;
-    uname(&sysInfo);
-    CSimpleStringA sysVer("UOS ");
-    sysVer.Append(sysInfo.release);
-#endif //_MSC_VER
-
-    if (ctx != NULL) {
-        ctx->Ans.ip = ipAddrs;
-        ctx->Ans.mac = macAddrs;
-        ctx->Ans.machineType = info.strMachineType;
-        ctx->Ans.site = info.strSite;
-        ctx->Ans.terminalNo = info.strTerminalID;
-        ctx->Ans.termLimit = "";
-        ctx->Ans.termVersion = info.InstallVersion.ToString();
-#ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/
-        ctx->Ans.reserved1 = 1;
-#elif defined(DEVOPS_ON_UAT)/*DevOps流水线编译,UAT环境*/
-        ctx->Ans.reserved1 = 2;
-#elif defined(DEVOPS_ON_PRD)/*DevOps流水线编译,PRD环境*/
-        ctx->Ans.reserved1 = 3;
-#elif defined(DEVOPS_ON_DEV)/*DevOps流水线编译,Dev环境*/
-        ctx->Ans.reserved1 = 0;
-#else/*本地编译等非DevOps环境编译的版本*/
-        ctx->Ans.reserved1 = 0;
-#endif	
-        ctx->Ans.reserved3 = sysVer;
-        ctx->Ans.reserved4 = "";
-
-        ctx->Answer(Error_Succeed);
-    }
-}
-
-
-bool get_current_cursorPos(int& x, int& y)
-{
-#if (defined _WIN32 || defined _WIN64)
-    POINT p;
-    if (GetCursorPos(&p)) {
-        x = p.x;
-        y = p.y;
-        return true;
-    }
-
-#else
-
-#ifndef NOT_SUPPOT_X11
-    std::shared_ptr<Display> display(XOpenDisplay(NULL), [](Display* p) {
-        XCloseDisplay(p);
-});
-    XEvent event;
-    if (XQueryPointer(display.get(), XDefaultRootWindow(display), &event.xbutton.root, &event.xbutton.window, &event.xbutton.x_root, &event.xbutton.y_root,
-                      &event.xbutton.x, &event.xbutton.y, &event.xbutton.state)) {
-        x = event.xbutton.x_root;
-        y = event.xbutton.y_root;
-        return true;
-    }
-#endif // !NOT_SUPPOT_X11
-
-#endif
-
-    return false;
-}
-
-
-DWORD cursorPosUpdate(void* param)
-{
-    int curX = 0, curY = 0;
-    while (true) {
-        int tmpX = 0, tmpY = 0;
-        get_current_cursorPos(tmpX, tmpY);
-        if (tmpX != curX || tmpY != curY) {
-            LogEvent(Severity_Low, DeviceControl_MouseMove,
-                     CSimpleString::Format("cursor move from (%d, %d) to (%d, %d)", curX, curY, tmpX, tmpY));
-            curX = tmpX;
-            curY = tmpY;
-        }
-        Sleep(20000);
-    }
-    return 0;
-}
-
-void CDeviceControlEntity::ReadCenterConfigStr(SpReqAnsContext<DeviceControlService_ReadCenterConfigStr_Req, DeviceControlService_ReadCenterConfigStr_Ans>::Pointer ctx)
-{
-    auto ret = __ReadCenterConfigStr(ctx->Req.key, ctx->Req.entityName);
-    ctx->Ans.value = ret.second;
-    ctx->Ans.reserved1 = ctx->Ans.reserved2 = 0;
-    DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s: ReadCenterConfigStr key:%s, entityName:%s: %s",
-        SpStrError(ret.first),
-        ctx->Req.key.GetData(), ctx->Req.entityName.GetData(), ctx->Ans.value.GetData());
-    ctx->Answer(ret.first);
-}
-
-void CDeviceControlEntity::ReadConfigValue(SpReqAnsContext<DeviceControlService_ReadConfigValue_Req, DeviceControlService_ReadConfigValue_Ans>::Pointer ctx)
-{
-    if (ctx->Req.configType < 0 || ctx->Req.configType > Config_Cache + 1) {
-        ctx->Answer(Error_Param);
-        return;
-    }
-
-    if (ctx->Req.configType == 0) {
-
-        if (ctx->Req.section.Compare("SougouInput") == 0) {
-
-            if (ctx->Req.key.Compare("Snapshot") == 0) {
-                CSimpleStringA shellScriptPath;
-                GetFunction()->GetPath("Base", shellScriptPath);
-                shellScriptPath += SPLIT_SLASH_STR;
-                shellScriptPath += "res" SPLIT_SLASH_STR "RunScript" SPLIT_SLASH_STR;
-                std::string fetch_scripts(shellScriptPath.GetData());
-                fetch_scripts += "sogouime-info-cmb.sh";
-                if (!ExistsFileA(fetch_scripts.c_str())) {
-                    ctx->Answer(Error_NotExist);
-                    return;
-                } else {
-
-                    do {
-                        char app[MAX_PATH] = { '\0' };
-                        tk_process_t* process = NULL;
-                        tk_process_option_t option;
-                        option.exit_cb = NULL;
-                        option.file = NULL;
-                        option.flags = 0;
-
-                        sprintf(app, "bash %s", fetch_scripts.c_str());
-                        option.params = app;
-                        const int res = process_spawn(&option, &process);
-                        if (0 == res) {
-                            FREE(process);
-                            LogWarn(Severity_Middle, Error_Debug, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_SUCC,
-                                    CSimpleStringA::Format("%s", fetch_scripts.c_str()));
-                        } else {
-                            LogWarn(Severity_Middle, Error_Unexpect, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_FAILED,
-                                    CSimpleStringA::Format("%s: %d", fetch_scripts.c_str(), res));
-                            ctx->Answer(Error_NotExist);
-                            return;
-                        }
-
-                    } while (false);
-
-                    Sleep(5000);
-
-                    do {
-
-                        std::string succStr, errStr;
-                        SYSTEMTIME curTime = CSmallDateTime::GetNow().ToSystemTime();
-                        CSimpleStringA logFileName = CSimpleStringA::Format("/opt/rvc/dbg/sogouinfo/%04d%02d%02d.log", curTime.wYear, curTime.wMonth, curTime.wDay);
-                        std::string runStr("cat ");
-                        if (ExistsFileA(logFileName)) {
-                            runStr += logFileName.GetData();
-                            if (SP::Module::Util::ShellExecute(runStr, succStr, errStr)) {
-                                DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("execute {%s} suc: %s", runStr.c_str(), succStr.c_str());
-                                ctx->Ans.reserved3 = succStr.c_str();
-                            }
-                        }
-                    } while (false);
-
-                    ctx->Answer(Error_Succeed);
-                    return;
-                }
-            
-            } else if (ctx->Req.key.Compare("SogouRestart") == 0) {
-                ctx->Answer(m_fsm.RestartSogouServices());
-                return;
-            }
-            else {
-                ctx->Answer(Error_NotImpl);
-                return;
-            }
-        } else {
-            ctx->Answer(Error_NotImpl);
-            return;
-        }
-    }
-
-    ConfigTypeEnum type = static_cast<ConfigTypeEnum>(ctx->Req.configType - 1);
-    CSmartPointer<IConfigInfo> spConfig;
-    ErrorCodeEnum err = GetFunction()->OpenConfig(type, spConfig);
-    if (err == Error_Succeed) {
-
-        CSimpleStringA str(true);
-        CSimpleStringA section(ctx->Req.section);
-        CSimpleStringA key(ctx->Req.key);
-#ifndef DEVOPS_ON_PRD
-        /** 被逼的,方便测试环境验证,并且在只读的情况下 [Gifur@2022127]*/
-        if (ctx->Req.reserved1 == 1 && !ctx->Req.option) {
-#ifdef DEVOPS_ON_ST
-            section.Append("_ST");
-#else defined(DEVOPS_ON_UAT)
-            section.Append("_UAT");
-#endif // DEVOPS_ON_ST
-        }
-#endif
-        err = spConfig->ReadConfigValue(section, key, str);
-        if (err == Error_Succeed) ctx->Ans.value = str;
-
-        if (ctx->Req.option && ctx->Req.reserved3.Compare(str) != 0) {
-            DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("save value: %s", ctx->Req.reserved3.GetData());
-            err = spConfig->WriteConfigValue(section, key, ctx->Req.reserved3);
-        } else if (ctx->Req.option) {
-            DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("stored value is the same as the coming one: %s", str.GetData());
-        }
-    }
-    ctx->Answer(err);
-    return;
-}
-
-void CDeviceControlEntity::TestConnectivity(SpReqAnsContext<DeviceControlService_TestConnectivity_Req, DeviceControlService_TestConnectivity_Ans>::Pointer ctx)
-{
-    DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%d: %s:%d", ctx->Req.protocol, ctx->Req.ip.GetData(), ctx->Req.port);
-
-#if defined(_MSC_VER)
-    ctx->Answer(Error_NotImpl);
-#else
-	ErrorCodeEnum result(Error_NotInit);
-
-	if (ctx->Req.protocol == 0) {
-		result = Error_Param;
-	} else if (ctx->Req.protocol == 1) { //Ping
-		if (ctx->Req.ip.IsNullOrEmpty()) {
-			result = Error_Param;
-		} else {
-			const int res = PingTest(std::string(ctx->Req.ip));
-			if (res == 0) {
-				ctx->Ans.result = 0;
-				ctx->Ans.additionalMsg.Clear();
-			} else {
-				ctx->Ans.result = -1;
-				ctx->Ans.additionalMsg = CSimpleStringA::Format("Ping %s failed: %d", ctx->Req.ip.GetData(), res);
-			}
-			result = Error_Succeed;
-		}
-	} else if (ctx->Req.protocol == 2) { //Normal socket connect Test
-		if (ctx->Req.ip.IsNullOrEmpty() || ctx->Req.port <= 0) {
-			result = Error_Param;
-		} else {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Test socket connect available: %s:%d", ctx->Req.ip.GetData(), ctx->Req.port);
-			std::string errMsg("");
-			const int ret = SocketConnectTest(ctx->Req.ip.GetData(), ctx->Req.port, errMsg);
-			ctx->Ans.result = ret;
-			ctx->Ans.additionalMsg = errMsg.c_str();
-			result = Error_Succeed;
-		}
-	} else if (ctx->Req.protocol == 4) { //Http Test
-		if (ctx->Req.ip.IsNullOrEmpty()) {
-			result = Error_Param;
-		} else {
-			std::string msg;
-			const int res = HttpProbe(std::string(ctx->Req.ip), msg);
-			ctx->Ans.result = res;
-			ctx->Ans.additionalMsg = msg.c_str();
-			result = Error_Succeed;
-		}
-	} else {
-		result = Error_NotSupport;
-	}
-	ctx->Answer(result);
-#endif //_MSC_VER
-
-}
-
-void CDeviceControlEntity::GetVendorFileList(SpReqAnsContext<DeviceControlService_GetVendorFileList_Req, DeviceControlService_GetVendorFileList_Ans>::Pointer ctx)
-{
-	ctx->Answer(Error_NotSupport);
-}
-
-void CDeviceControlEntity::TestAdapterFileAvailable(
-    SpReqAnsContext<DeviceControlService_TestAdapterFileAvailable_Req, DeviceControlService_TestAdapterFileAvailable_Ans>::Pointer ctx)
-{
-    ctx->Answer(Error_NotSupport);
-    return;
-}
-
-std::pair<ErrorCodeEnum, CSimpleStringA> CDeviceControlEntity::__ReadCenterConfigStr(CSimpleStringA key, CSimpleStringA entityName = "")
-{
-    CSimpleStringA str = "";
-    CSmartPointer<IConfigInfo> spCerConfig;
-    ErrorCodeEnum err = GetFunction()->OpenConfig(Config_CenterSetting, spCerConfig);
-    if (err != Error_Succeed)
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("OpenConfig failed: %s", SpStrError(err));
-    else
-        err = spCerConfig->ReadConfigValue(
-            entityName == CSimpleStringA("") ? "IEBrowser" : (const char*)entityName.GetData()
-            , (const char*)key.GetData(), str);
-
-    if (str.IsNullOrEmpty() && key.Compare("CenterConfigUrl") == 0 && entityName.Compare("CenterSetting") == 0) {
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Try to read CenterSettings download url from shell.ini again");
-        CSmartPointer<IConfigInfo> pConfigShell;
-        GetFunction()->OpenConfig(Config_Shell, pConfigShell);
-        CSimpleStringA section("CenterSettingsDownloadUrl");
-        pConfigShell->ReadConfigValue(section, "LAN", str);
-        if (Error_Succeed != err && !str.IsNullOrEmpty()) {
-            err = Error_Succeed;
-        }
-    }
-
-    return std::make_pair(err, str);
-}
-
-void CDeviceControlEntity::BroadcastAdapterTestResult(const CSimpleStringA& adapterName, ErrorCodeEnum result, const CSimpleStringA& strErrMsg)
-{
-    DeviceControl::AdapterTestResult evt;
-    evt.result = result;
-    evt.adapterInfo = adapterName;
-    evt.errMsg = strErrMsg;
-    SpSendBroadcast(GetFunction(), SP_MSG_OF(AdapterTestResult), SP_MSG_SIG_OF(AdapterTestResult), evt);
-}
-
-void CDeviceControlEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs, CSmartPointer<ITransactionContext> pTransactionContext)
-{
-    LOG_FUNCTION();
-    ErrorCodeEnum rt = m_fsm.Init(this);
-    ///**TODO(Gifur@9/28/2023): UOS 下需要监控鼠标移动状态吗? */
-#if defined(_MSC_VER)
-    CloseHandle(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&cursorPosUpdate, NULL, 0, NULL));
-#endif //_MSC_VER
-    pTransactionContext->SendAnswer(rt);
-}
-
-SP_BEGIN_ENTITY_MAP()
-SP_ENTITY(CDeviceControlEntity)
-SP_END_ENTITY_MAP()
-
-
-

+ 0 - 143
Module/mod_DeviceControl/mod_DeviceControl.h

@@ -1,143 +0,0 @@
-#ifndef _MOD_DEVICECONTROL_H
-#define _MOD_DEVICECONTROL_H
-
-#pragma once
-
-#include "modVer.h"
-
-#include "DeviceControlFSM.h"
-#include "DevEntityCommBase.hpp"
-
-// to get mac address
-#include <string>
-#include <vector>
-
-#ifdef RVC_OS_WIN
-#include <Winsock2.h>
-#include <WS2tcpip.h>
-#include <Iphlpapi.h>
-#include "IHttpFunc.h"
-#else
-#include "SpTest.h"
-
-#endif // RVC_OS_WIN
-
-#pragma warning( disable : 4996 )
-
-#define MACSESION 6
-
-using namespace DeviceControl;
-
-class CDeviceControlEntity;
-
-class CDeviceControlServerSession : public DeviceControlService_ServerSessionBase
-{
-public:
-    CDeviceControlServerSession(CDeviceControlEntity* pEntity) :m_pEntity(pEntity) {}
-    virtual ~CDeviceControlServerSession() {}
-    virtual void Handle_USB(SpReqAnsContext<DeviceControlService_USB_Req, DeviceControlService_USB_Ans>::Pointer ctx);
-    virtual void Handle_GetUkeyID(SpReqAnsContext<DeviceControlService_GetUkeyID_Req, DeviceControlService_GetUkeyID_Ans>::Pointer ctx);
-    virtual void Handle_InitToken(SpReqAnsContext<DeviceControlService_InitToken_Req, DeviceControlService_InitToken_Ans>::Pointer ctx);
-    virtual void Handle_QueryUSBStatus(SpReqAnsContext<DeviceControlService_QueryUSBStatus_Req, DeviceControlService_QueryUSBStatus_Ans>::Pointer ctx);
-    virtual void Handle_QueryHardwareInfo(SpReqAnsContext<DeviceControlService_QueryHardwareInfo_Req, DeviceControlService_QueryHardwareInfo_Ans>::Pointer ctx);
-    virtual void Handle_ReadCenterConfigStr(SpReqAnsContext<DeviceControlService_ReadCenterConfigStr_Req, DeviceControlService_ReadCenterConfigStr_Ans>::Pointer ctx);
-    virtual void Handle_ReadConfigValue(SpReqAnsContext<DeviceControlService_ReadConfigValue_Req, DeviceControlService_ReadConfigValue_Ans>::Pointer ctx);
-    virtual void Handle_GetDevInfo(SpReqAnsContext<DeviceControlService_GetDevInfo_Req, DeviceControlService_GetDevInfo_Ans>::Pointer ctx);
-    virtual void Handle_TestConnectivity(SpReqAnsContext<DeviceControlService_TestConnectivity_Req, DeviceControlService_TestConnectivity_Ans>::Pointer ctx);
-    virtual void Handle_GetVendorFileList(SpReqAnsContext<DeviceControlService_GetVendorFileList_Req, DeviceControlService_GetVendorFileList_Ans>::Pointer ctx);
-    virtual void Handle_TestAdapterFileAvailable(SpReqAnsContext<DeviceControlService_TestAdapterFileAvailable_Req, DeviceControlService_TestAdapterFileAvailable_Ans>::Pointer ctx);
-
-private:
-    CDeviceControlEntity* m_pEntity;
-};
-
-class CDeviceControlEntity : public CDevAdptEntityBase
-{
-public:
-    CDeviceControlEntity(){}
-    virtual ~CDeviceControlEntity()
-    {
-
-    }
-    virtual const char* GetEntityName() const { return "DeviceControl"; }
-
-    const char* GetEntityVersion() const { return MODULE_VERSION_FULL; }
-
-#if defined(RVC_OS_LINUX)
-	ON_ENTITYT_TEST()
-#endif //RVC_OS_LINUX
-
-	virtual void OnPreStart(CAutoArray<CSimpleStringA> strArgs, CSmartPointer<ITransactionContext> pTransactionContext);
-
-    virtual void OnPrePause(CSmartPointer<ITransactionContext> pTransactionContext)
-    {
-        pTransactionContext->SendAnswer(Error_Succeed);
-    }
-    virtual void OnPreContinue(CSmartPointer<ITransactionContext> pTransactionContext)
-    {
-        pTransactionContext->SendAnswer(Error_Succeed);
-    }
-
-    virtual void OnPreClose(EntityCloseCauseEnum eCloseCause, CSmartPointer<ITransactionContext> pTransactionContext)
-    {
-        m_fsm.OnExit();
-        pTransactionContext->SendAnswer(Error_Succeed);
-    }
-
-    virtual CServerSessionBase* OnNewSession(const char*, const char*)
-    {
-        return new CDeviceControlServerSession(this);
-    }
-
-    void USB(SpReqAnsContext<DeviceControlService_USB_Req, DeviceControlService_USB_Ans>::Pointer ctx)
-    {
-        ctx->Answer(Error_NotSupport);
-    }
-
-    void GetUkeyID(SpReqAnsContext<DeviceControlService_GetUkeyID_Req, DeviceControlService_GetUkeyID_Ans>::Pointer ctx)
-    {
-        ctx->Answer(Error_NotSupport);
-    }
-
-    void InitToken(SpReqAnsContext<DeviceControlService_InitToken_Req, DeviceControlService_InitToken_Ans>::Pointer ctx)
-    {
-        ctx->Answer(Error_NotSupport);
-    }
-
-    void QueryUSBStatus(SpReqAnsContext<DeviceControlService_QueryUSBStatus_Req, DeviceControlService_QueryUSBStatus_Ans>::Pointer ctx)
-    {
-        ctx->Answer(Error_NotSupport);
-    }
-
-    void QueryHardwareInfo(SpReqAnsContext<DeviceControlService_QueryHardwareInfo_Req, DeviceControlService_QueryHardwareInfo_Ans>::Pointer ctx);
-    void ReadCenterConfigStr(SpReqAnsContext<DeviceControlService_ReadCenterConfigStr_Req, DeviceControlService_ReadCenterConfigStr_Ans>::Pointer ctx);
-
-    void ReadConfigValue(SpReqAnsContext<DeviceControlService_ReadConfigValue_Req, DeviceControlService_ReadConfigValue_Ans>::Pointer ctx);
-
-    void GetDevInfo(SpReqAnsContext<DeviceControlService_GetDevInfo_Req, DeviceControlService_GetDevInfo_Ans>::Pointer ctx)
-    {
-        ctx->Answer(Error_NotImpl);
-    }
-
-    void TestConnectivity(SpReqAnsContext<DeviceControlService_TestConnectivity_Req, DeviceControlService_TestConnectivity_Ans>::Pointer ctx);
-
-    void GetVendorFileList(SpReqAnsContext<DeviceControlService_GetVendorFileList_Req, DeviceControlService_GetVendorFileList_Ans>::Pointer ctx);
-    void TestAdapterFileAvailable(SpReqAnsContext<DeviceControlService_TestAdapterFileAvailable_Req, DeviceControlService_TestAdapterFileAvailable_Ans>::Pointer ctx);
-
-    void OnSelfTest(EntityTestEnum eTestType, CSmartPointer<ITransactionContext> pTransactionContext)
-    {
-        m_fsm.SelfTest(eTestType, pTransactionContext);
-    }
-
-    virtual bool IsService()const { return true; }
-
-    virtual bool IsMultiThread()const { return true; }
-
-private:
-    std::pair<ErrorCodeEnum, CSimpleStringA> __ReadCenterConfigStr(CSimpleStringA key, CSimpleStringA entityName);
-    void BroadcastAdapterTestResult(const CSimpleStringA& adapterName, ErrorCodeEnum result, const CSimpleStringA& strErrMsg);
-private:
-    CDeviceControlFSM m_fsm;
-};
-
-#endif //_MOD_DEVICECONTROL_H

+ 0 - 13
Module/mod_DeviceControl/test/testGetIpMacAddress.cpp

@@ -1,13 +0,0 @@
-#ifndef TEST_MOD_DEVICECONTROL_IPMAC
-#define TEST_MOD_DEVICECONTROL_IPMAC
-
-#include "mod_DeviceControl.h"
-
-TEST_CASE_ENTITY_CONTEXT(CDeviceControlEntity, DeviceControlService, QueryHardwareInfo, "QueryHardwareInfo", "Description or TAG")
-{
-    ANSWER_CHECK(Ans.ip.GetCount() > 0);
-    ANSWER_CHECK(Ans.mac.GetCount() > 0);
-}
-
-#endif
-