1.get log功能

This commit is contained in:
payton 2023-07-11 14:45:49 +08:00
parent 2dead38c0f
commit e0267aa496
2 changed files with 72 additions and 0 deletions

View File

@ -3596,6 +3596,51 @@ SINT32 sf_get_ftp_open_flag(void)
{ {
return FtpOpenOk; 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 #ifdef __cplusplus
#if __cplusplus #if __cplusplus
} }

View File

@ -2786,3 +2786,30 @@ UINT8 sf_set_send_video(UINT8 value)
CameraCmd.sendVideo = value; CameraCmd.sendVideo = value;
return CameraCmd.sendVideo; 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;
}