From e0267aa496e099a07cd82bc1fc092fa0f72363b0 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 11 Jul 2023 14:45:49 +0800 Subject: [PATCH] =?UTF-8?q?1.get=20log=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/4gMng/sf_ftp.c | 45 +++++++++++++++++++ .../source/sf_app/code/source/4gMng/sf_sms.c | 27 +++++++++++ 2 files changed, 72 insertions(+) diff --git a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c index 36a5bfa28..00ed105ad 100644 --- a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c @@ -3596,6 +3596,51 @@ SINT32 sf_get_ftp_open_flag(void) { return FtpOpenOk; } + +SINT32 sf_log_send_ftp(void) +{ + SINT32 ret = SF_SUCCESS; + //UINT8 CamNameStr[20] = { 0 }; + UINT8 uploadFname[64] = { 0 }; + UINT8 customStr[64] = { 0 }; + UINT8 filePath[64] = { 0 }; + UINT8 timeout = 60; + UIMenuStoreInfo *pPara = sf_app_ui_para_get(); + + printf("%s:%d start\n", __FUNCTION__, __LINE__); + sf_set_send_log(0); + if(sf_file_IsExsit(LOG_AT_FILE_PATH) == SF_TRUE) + { + printf("%s:%d err create dailyreport file\n", __FUNCTION__, __LINE__); + return SF_FAILURE; + } + + sprintf((char *)filePath, "UFS:/%s", SF_LOG_TXT); + + printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath); + + sf_custom_str_get(customStr); + sprintf((char *)uploadFname, "%s-%s-log.txt",pPara->ModuleImei, customStr); + + ret = sf_quectel_upload_file_to_module((UINT8 *)LOG_AT_FILE_PATH, (UINT8 *)SF_LOG_TXT); + + if(SF_SUCCESS != ret) + { + printf("%s:%d upload err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); + } + else + { + ret = sf_ftp_send(uploadFname, filePath, timeout); + + if(SF_SUCCESS != ret) + { + printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); + } + } + + printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret); + return ret; +} #ifdef __cplusplus #if __cplusplus } diff --git a/code/application/source/sf_app/code/source/4gMng/sf_sms.c b/code/application/source/sf_app/code/source/4gMng/sf_sms.c index 51241ab67..095a57e0b 100644 --- a/code/application/source/sf_app/code/source/4gMng/sf_sms.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_sms.c @@ -2785,4 +2785,31 @@ UINT8 sf_set_send_video(UINT8 value) { CameraCmd.sendVideo = value; return CameraCmd.sendVideo; +} + +/************************************************* + Function: sf get send log + Description: get log flag + Input: N/A + Output: N/A + Return: 0:SUCCESS, errcode:FAIL + Others: N/A +*************************************************/ +UINT8 sf_get_send_log(void) +{ + return CameraCmd.getLog; +} + +/************************************************* + Function: sf set send log + Description: set log flag + Input: N/A + Output: N/A + Return: 0:SUCCESS, errcode:FAIL + Others: N/A +*************************************************/ +UINT8 sf_set_send_log(UINT8 value) +{ + CameraCmd.getLog = value; + return CameraCmd.getLog; } \ No newline at end of file