|
@@ -5,6 +5,7 @@
|
|
|
#include "publicFunExport.h"
|
|
|
//#pragma comment(lib, "libpublicFun.lib")
|
|
|
#include "tokenDefine.h"
|
|
|
+#include <thread>
|
|
|
#include <SpIni.h>
|
|
|
|
|
|
void VtmLoaderServerSession::Handle_SetTerminalNo(SpReqAnsContext<VtmLoaderService_SetTerminalNo_Req, VtmLoaderService_SetTerminalNo_Ans>::Pointer ctx)
|
|
@@ -133,6 +134,44 @@ void CVtmLoaderEntity::EntityLostProc(CSimpleStringA entityName)
|
|
|
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
+
|
|
|
+ void CVtmLoaderEntity::DealWithOldEvent(SpReqAnsContext<VtmLoaderService_DealWithOldEvent_Req, VtmLoaderService_DealWithOldEvent_Ans>::Pointer ctx)
|
|
|
+ {
|
|
|
+ /*
|
|
|
+ DealWithOldEvent_Event* pEvt = new DealWithOldEvent_Event();
|
|
|
+ pEvt->ctx = ctx;
|
|
|
+ m_FSM.PostEventFIFO(pEvt);
|
|
|
+ */
|
|
|
+ static SpReqAnsContext<VtmLoaderService_DealWithOldEvent_Req, VtmLoaderService_DealWithOldEvent_Ans>::Pointer s_ctx;
|
|
|
+ s_ctx = ctx;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ auto dealOldEventThread = [&] {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("DealWithOldEvent called eventId, %d", s_ctx->Req.eventId);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("DealWithOldEvent called reqStrRev1, %s", s_ctx->Req.reqStrRev1);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("DealWithOldEvent called reqStrRev2, %s", s_ctx->Req.reqStrRev2);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("DealWithOldEvent called reqIntRev1, %d", s_ctx->Req.reqIntRev1);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("DealWithOldEvent called reqIntRev2, %d", s_ctx->Req.reqIntRev2);
|
|
|
+ ErrorCodeEnum eErr = ErrorCodeEnum::Error_Succeed;
|
|
|
+ switch (s_ctx->Req.eventId)
|
|
|
+ {
|
|
|
+ case EVENT_CONSOLE_REQ_SHUTDOWN_SHELL:
|
|
|
+ LogWarn(Severity_Low, Error_Unexpect, 0x50100215, CSimpleStringA::Format("%x, reason:%s", EVENT_CONSOLE_REQ_SHUTDOWN_SHELL, s_ctx->Req.reqStrRev1.GetData()));
|
|
|
+ GetFunction()->GetPrivilegeFunction()->Reboot(RebootTrigger_DeadForever , RebootWayEnum::RebootWay_Framework);
|
|
|
+ break;
|
|
|
+ case LOG_EVT_IEBROWSER_RESET_SITE_RESTART:
|
|
|
+ GetFunction()->GetPrivilegeFunction()->Reboot(RebootTrigger_ManualLocal, RebootWayEnum::RebootWay_Framework);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ s_ctx->Answer(eErr);
|
|
|
+ };
|
|
|
+
|
|
|
+ std::thread(dealOldEventThread).detach();
|
|
|
+ }
|
|
|
+
|
|
|
SP_BEGIN_ENTITY_MAP()
|
|
|
SP_ENTITY(CVtmLoaderEntity)
|
|
|
SP_END_ENTITY_MAP()
|