Pārlūkot izejas kodu

Z991239-5462 #comment fea: change bcm position,support vtmloader、guiconsole、chromium

chenliangyu 1 gadu atpakaļ
vecāks
revīzija
2fbad51c25

+ 1 - 0
Framework/spbase/sp_bcm.h

@@ -53,6 +53,7 @@ DECLARE_REF_COUNT(sp_bcm_listener, sp_bcm_listener_t)
 
 // daemon
 SPBASE_API int sp_bcm_daemon_create(sp_svc_t *svc, sp_bcm_daemon_t **p_daemon);
+SPBASE_API int sp_bcm_deamon_refresh(sp_bcm_daemon_t* daemon);
 SPBASE_API void sp_bcm_daemon_destroy(sp_bcm_daemon_t *daemon);
 SPBASE_API array_header_t *sp_bcm_daemon_get_receiver(sp_bcm_daemon_t *daemon, int entity_id);
 SPBASE_API void sp_bcm_daemon_free_receiver_array(array_header_t *arr_receiver);

+ 1 - 1
Framework/spbase/sp_iom.c

@@ -214,7 +214,7 @@ static void on_msg(bus_endpt_t *endpt, int msg, int nparam, param_size_t params[
 			bus_endpt_send_info(endpt, epid, pkt_type, pkt);
 			iobuffer_dec_ref(pkt);
 		}
-		WLog_DBG(TAG, "<== on_msg send_info end, pkt type: 0x%08X, %d, %d, %d, %d", pkt_type, this_svc_id, epid, svc_id, pkt_id);
+		WLog_DBG(TAG, "<== on_msg send_info end, pkt type: 0x%08X, this_svc_id:%d, epid:%d, svc_id:%d, pkt_id:%d", pkt_type, this_svc_id, epid, svc_id, pkt_id);
 	} else if (msg == IOM_T_GET_STATE) {
 		int epid = params[0];
 		int *state = (int*)params[1];

+ 5 - 1
Framework/spbase/sp_ses.c

@@ -795,7 +795,7 @@ static void uac_process_redirect(sp_ses_uac_t *uac, int epid, int svc_id, int co
 				uac->remote_epid = ent->mod->cfg->idx;
 				uac->remote_svc_id = ent->cfg->idx;
 				sp_svc_post(uac->mgr->svc, uac->remote_epid, uac->remote_svc_id, SP_PKT_SES|SES_CMD_CONN, conn_id, p_pkt);
-				DbgWithLinkForC(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM, "svc_post, epid:%d, svc_id:%d", uac->remote_epid, uac->remote_svc_id);
+				//DbgWithLinkForC(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM, "svc_post, epid:%d, svc_id:%d", uac->remote_epid, uac->remote_svc_id);
 			}
 		}
 	}
@@ -1094,6 +1094,7 @@ int sp_ses_uac_send_info(sp_ses_uac_t *uac, int method_id, int method_sig, iobuf
 		iobuffer_write_head(*info_pkt, IOBUF_T_I4, &method_sig, 0);
 		iobuffer_write_head(*info_pkt, IOBUF_T_I4, &method_id, 0);
 		rc = sp_svc_post(uac->mgr->svc, uac->remote_epid, uac->remote_svc_id, SP_PKT_SES|SES_CMD_INFO, uac->conn_id, info_pkt);
+		WLog_INFO(TAG, "sp_ses_uac_send_info from %d", uac->remote_epid);
 	} else {
 		DbgWithLinkForC(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM, "send info failed, uac is not in connected state!");
 		rc = Error_IO;
@@ -1201,6 +1202,7 @@ static void tsx_uac_process_ans(sp_tsx_uac_t *tsx, int end, iobuffer_t **ans_pkt
 	} else {
 		DbgWithLinkForC(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM, "tsx uac current state cannot recv ack!");
 		sp_svc_post(tsx->uac->mgr->svc, tsx->uac->remote_epid, tsx->uac->remote_svc_id, SP_PKT_SES|SES_CMD_ERRC, tsx->uac->conn_id, NULL);
+		WLog_INFO(TAG, "tsx_uac_process_ans remote_epid:%d, remote_svc_id:%d", tsx->uac->remote_epid, tsx->uac->remote_svc_id);
 	}
 	if (trigger)
 		tsx_uac_trigger(tsx, 0, end, ans_pkt);
@@ -1336,6 +1338,7 @@ int sp_tsx_uac_async_req(sp_tsx_uac_t *tsx, int timeout, iobuffer_t **req_pkt)
 		iobuffer_write_head(*req_pkt, IOBUF_T_I4, &tsx->tsx_id, 0);
 		sp_tsx_uac_inc_ref(tsx); // @1
 		rc = sp_svc_post(uac->mgr->svc, uac->remote_epid, uac->remote_svc_id, SP_PKT_SES|SES_CMD_REQ, uac->conn_id, req_pkt);
+		WLog_INFO(TAG, "sp_tsx_uac_async_req remote_epid:%d, remote_svc_id:%d, method_sig:%d, method_id:%d", uac->remote_epid, uac->remote_svc_id, tsx->method_sig, tsx->method_id);
 		if (rc == 0) {
 			if (timeout >= 0) {
 				tsx->op_timer = MALLOC_T(timer_entry);
@@ -1608,6 +1611,7 @@ static void uas_process_req_reply_error(sp_ses_uas_t *uas, int tsx_id, int err)
 
 	iobuffer_write_head(ans_pkt, IOBUF_T_I4, &tsx_id, 0);
 	sp_svc_post(uas->mgr->svc, uas->remote_epid, uas->remote_svc_id, SP_PKT_SES|SES_CMD_ANS, uas->conn_id, &ans_pkt);
+	WLog_INFO(TAG, "uas_process_req_reply_error remote_epid:%d, remote_svc_id:%d", uas->remote_epid, uas->remote_svc_id);
 	if (ans_pkt)
 		iobuffer_dec_ref(ans_pkt);
 }

+ 4 - 3
Framework/spshell/app.cpp

@@ -514,7 +514,6 @@ int app_init(const sp_cfg_start_args_t* args, std::function<void(const char* msg
 #endif //_MSC_VER
 	}
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("log daemon create ok!");
-
 	RenameLightPacks(env->cfg->root_ini->ref_addata_path);
 
 	/** for update terminal state event*/
@@ -529,7 +528,7 @@ int app_init(const sp_cfg_start_args_t* args, std::function<void(const char* msg
 		return rc;
 #endif //_MSC_VER
 	}
-	/*
+	
 	popup("初始化 VAR DEAMON 模块... ...", false);
 	rc = sp_var_daemon_create(g_app.svc, &g_app.var_daemon);	// add workitem daemon_on_pkt and daemon_on_sys
 	if (rc != 0) {
@@ -556,7 +555,9 @@ int app_init(const sp_cfg_start_args_t* args, std::function<void(const char* msg
 	}
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("bcm daemon create ok!");
 	sp_mod_mgr_bind_bcm_daemon(env->mod_mgr, g_app.bcm_daemon);
-	*/
+	
+
+
 	popup("初始化 RPC SERVER 模块... ...", false);
 	callback.on_info = &on_info;
 	callback.on_req = &on_req;

+ 4 - 2
Framework/spshell/svc.cpp

@@ -830,8 +830,9 @@ iobuffer_t* on_try_update_cfg(sp_rpc_server_t* server, int epid, int svc_id, int
 	iobuffer_t* ans_pkt = iobuffer_create(-1, -1);
 	auto ret = sp_TryUpdateCfg();
 	int rc = Error_Succeed;
-
+	
 	sp_mod_mgr_init(sp_get_env()->mod_mgr);
+	/*
 	//add workitem daemon_on_pkt and daemon_on_sys
 	if (0 != (rc = sp_var_daemon_create(get_app_instance()->svc, &get_app_instance()->var_daemon)))
 		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("var daemon create failed!");
@@ -844,7 +845,8 @@ iobuffer_t* on_try_update_cfg(sp_rpc_server_t* server, int epid, int svc_id, int
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("bcm daemon create ok!");
 
 	sp_mod_mgr_bind_bcm_daemon(sp_get_env()->mod_mgr, get_app_instance()->bcm_daemon);
-
+	*/
+	sp_bcm_deamon_refresh(get_app_instance()->bcm_daemon);
 	auto env = sp_get_env();
 	if (!env)
 	{

+ 7 - 3
Framework/winpr/libwinpr/utils/wlog/wlog.c

@@ -81,15 +81,18 @@ static void WLog_Uninit_(void) __attribute__((destructor));
 #include <tchar.h>
 char* get_process_name() {
 	// 拼接前缀、进程名和后缀
-	char full_path[MAX_PATH], date_str[MAX_PATH];
+	char date_str[MAX_PATH];
+	char* full_path = malloc(MAX_PATH);
+	
 	time_t now = time(NULL);
 	struct tm* local_time = localtime(&now);
+	memset(full_path, 0, MAX_PATH);
 	snprintf(date_str, sizeof(date_str), "%04d%02d%02d", local_time->tm_year + 1900, local_time->tm_mon + 1, local_time->tm_mday);
 
 	if (strlen(g_logRoot) == 0)
 		return NULL;
 
-	snprintf(full_path, sizeof(full_path), "%s\\wlog_%s.log", g_logRoot, date_str);
+	snprintf(full_path, MAX_PATH, "%s\\wlog_%s.log", g_logRoot, date_str);
 	//MessageBox(NULL, full_path, NULL, 0);
 	// 检查文件是否存在
 	FILE* fp = fopen(full_path, "r");
@@ -154,9 +157,10 @@ void WLog_WriteLogFile(int type, const char* fmt, ...)
 			return;
 		}
 	}
-
+	
 	if (pFile)
 	{
+		//MessageBox(NULL, path, NULL, 0);
 		fprintf(pFile, "[%s] [%s] ", time_str, _type[type]);
 		va_list args;
 		va_start(args, fmt);

+ 1 - 1
Module/mod_chromium/CModTools.cpp

@@ -290,7 +290,7 @@ namespace Chromium {
         CSimpleString dstCmd = generateBrowserCMDForEverything(errPageUrl.GetData(), 2).c_str();
 #endif //RVC_OS_WIN
 
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("GenerateErrPage type=%s, dstPage=%s", errType._to_string(), dstCmd.GetData());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("GenerateErrPage dstPage=%s", dstCmd.GetData());
 
 		return std::make_pair(true, (const char*)dstCmd.GetData());
 	}

+ 1 - 2
Module/mod_guiconsole/mod_guiconsole.cpp

@@ -36,7 +36,6 @@ void CGUIConsoleEntity::OnLog(const CAutoArray<CUUID>& SubIDs, const CUUID nLogI
 	if (pszMessage != NULL && strlen(pszMessage) > 2)
 	{
 		CSimpleStringA str = pszMessage;
-
 		LogInfo msg;
 		msg.sysError = dwSysError;
 		msg.userCode = dwUserCode;
@@ -45,7 +44,7 @@ void CGUIConsoleEntity::OnLog(const CAutoArray<CUUID>& SubIDs, const CUUID nLogI
 		msg.LogType = LogTypeEnumToString(eLogType).c_str();
 		msg.message = str;
 
-
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("OnLog %x from entity %s, msg : %s", dwUserCode, NULL == pszEntityName ? "" : pszEntityName, NULL == pszMessage ? "" : pszMessage);
 		SpSendBroadcast(GetFunction(), eMsg_LogInfo, eMsgSig_LogInfo, msg);
 	}
 }