1.调整发送log

This commit is contained in:
payton 2023-07-11 16:46:19 +08:00
parent 4032c1c135
commit c28e5f1602

View File

@ -470,7 +470,7 @@ SINT32 sf_ftp_config(UINT8 ssl, UINT8 GprsMode, UINT8 timeout)
sf_hal_ttyusb2_read(gsmPara, 200); sf_hal_ttyusb2_read(gsmPara, 200);
printf("eFtpLocation=%d,time=%d\n", eFtpLocation, time); printf("eFtpLocation=%d,time=%d\n", eFtpLocation, time);
if(gsmPara[0] != '\0') if((gsmPara[0] != '\0') && (FTP_SIM_EXIT != eFtpLocation) && (FTP_SIM_CCHSTART != eFtpLocation) && (FTP_SIM_QSSLCFG0 != eFtpLocation))
{ {
SLOGI("gsmPara:%s", gsmPara); SLOGI("gsmPara:%s", gsmPara);
} }
@ -3600,21 +3600,29 @@ SINT32 sf_get_ftp_open_flag(void)
SINT32 sf_log_send_ftp(void) SINT32 sf_log_send_ftp(void)
{ {
SINT32 ret = SF_SUCCESS; SINT32 ret = SF_SUCCESS;
//UINT8 CamNameStr[20] = { 0 }; SINT32 ret2 = SF_SUCCESS; //0:success; else:fail;
UINT8 uploadFname[64] = { 0 }; UINT8 uploadFname[64] = { 0 };
UINT8 customStr[64] = { 0 }; UINT8 customStr[64] = { 0 };
UINT8 filePath[64] = { 0 }; UINT8 filePath[64] = { 0 };
UINT8 timeout = 60; UINT8 timeout = 100;
UIMenuStoreInfo *pPara = sf_app_ui_para_get(); UIMenuStoreInfo *pPara = sf_app_ui_para_get();
UINT8 ssl = 0;
UINT8 gprsMode = 0;
ssl = ((2 == pPara->FtpSwitch) ? 1 : 0);
gprsMode = 0;//puiPara->GprsMode;
printf("%s:%d start\n", __FUNCTION__, __LINE__); printf("%s:%d start\n", __FUNCTION__, __LINE__);
sf_set_send_log(0); sf_set_send_log(0);
if(sf_file_IsExsit(LOG_AT_FILE_PATH) == SF_TRUE) if(sf_file_IsExsit(LOG_AT_FILE_PATH) != SF_TRUE)
{ {
printf("%s:%d err create dailyreport file\n", __FUNCTION__, __LINE__); printf("%s:%d err file\n", __FUNCTION__, __LINE__);
return SF_FAILURE; return SF_FAILURE;
} }
ret = sf_ftp_config(ssl, gprsMode, timeout);
if(SF_SUCCESS == ret)
{
sprintf((char *)filePath, "UFS:/%s", SF_LOG_TXT); sprintf((char *)filePath, "UFS:/%s", SF_LOG_TXT);
printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath); printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath);
@ -3637,9 +3645,25 @@ SINT32 sf_log_send_ftp(void)
printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath);
} }
} }
}
if(ret != SF_FTP_ERROR_TERM)
{
ret2 = sf_ftp_stop(ssl, gprsMode);
}
printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret); #if SF_TEST_ERROR_CODE
sf_set_code_err_flag(0);
#endif
printf("[%s:%d]ret:[0x%08X],ret2:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret, ret2);
if(ret != SF_SUCCESS)
{
return ret; return ret;
}
else
{
return ret2;
}
} }
#ifdef __cplusplus #ifdef __cplusplus
#if __cplusplus #if __cplusplus