1.启动和发送log优化

This commit is contained in:
payton 2024-02-01 13:57:49 +08:00
parent 35993f061f
commit 043722c714
2 changed files with 29 additions and 41 deletions

View File

@ -231,7 +231,7 @@ SINT32 sf_ftp_config(UINT8 ssl, UINT8 GprsMode, int timeout)
// printf("ftp_manager_init password = %s\n", config.password);
ftp_manager_init(config);
printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret);
// printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret);
if(SF_SUCCESS != ret){
sf_sys_status_led_set(SF_LED_SYS_STATE_SEND_FAIL);
}
@ -940,7 +940,7 @@ SINT32 sf_pic_send_ftp(void)
// piccount = 1;
// }
// }
MLOGI("netGeneration:%dG,tempPicSize=%d,piccount=%d,filecnt=%d\n", sf_get_net_generation(), tempPicSize, piccount, pThumbFileCfg->filecnt);
// MLOGI("netGeneration:%dG,tempPicSize=%d,piccount=%d,filecnt=%d\n", sf_get_net_generation(), tempPicSize, piccount, pThumbFileCfg->filecnt);
//printf("[%s:%d]piccount=%d\n", __FUNCTION__, __LINE__, piccount);
@ -1017,7 +1017,7 @@ SINT32 sf_pic_send_ftp(void)
}
else
{
printf("%s:%d err up file ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ftpFileName[pic], filePath[pic]);
MLOGE("%s:%d ret:[0x%08X] err up file ftpFileName:%s filePath:%s\n", ret, __FUNCTION__, __LINE__, ftpFileName[pic], filePath[pic]);
}
}
// sendEndTime = clock();
@ -1029,7 +1029,7 @@ SINT32 sf_pic_send_ftp(void)
//pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
//pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
MLOGD(" end ret:[0x%08X] \n", ret);
// MLOGD(" end ret:[0x%08X] \n", ret);
return ret;
}
double sf_sys_ms_time_get(clock_t end_time)
@ -1086,7 +1086,7 @@ SINT32 sf_video_send_ftp(void)
snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, sf_app_get_battery(), csqlevel, CamNameStr); /* DCF 8.3 naming rule */
printf("netGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", sf_get_net_generation(), tempPicSize, piccount, pic);
// printf("netGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", sf_get_net_generation(), tempPicSize, piccount, pic);
/*sf_get_send_video_fname(videoDirKey, videoFname);
sprintf((char *)ftpFileName, "%s%s", cameraID, videoFname);
@ -1098,16 +1098,16 @@ SINT32 sf_video_send_ftp(void)
sprintf((char *)ftpFileName, "%s%s", cameraID, pThumbFileCfg->stfileattr[fileIndex].thumbfileName);
sprintf((char *)filePath, "%s", pThumbFileCfg->stfileattr[fileIndex].thumbfilePath);
printf("%s:%d ftpFileName:%s filePath:%s videoDir:%s\n", __FUNCTION__, __LINE__, ftpFileName, filePath, videoDir);
// printf("%s:%d ftpFileName:%s filePath:%s videoDir:%s\n", __FUNCTION__, __LINE__, ftpFileName, filePath, videoDir);
//ret = sf_simcom_upload_file_to_module(videoDir,ftpFileName);
ret = SF_SUCCESS;
// ret = SF_SUCCESS;
if(SF_SUCCESS != ret)
{
printf("%s:%d upload err ret: [0x%08X] ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ret, ftpFileName, filePath);
}
else
// if(SF_SUCCESS != ret)
// {
// printf("%s:%d upload err ret: [0x%08X] ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ret, ftpFileName, filePath);
// }
// else
{
SF_SEND_RE:
ret = sf_ftp_send(ftpFileName, filePath, timeout);
@ -1126,8 +1126,6 @@ SINT32 sf_video_send_ftp(void)
sf_log_error_code(logStr);
}
}
MLOGD(" end ret:[0x%08X]\n", ret);
return ret;
}
@ -1348,7 +1346,6 @@ SINT32 sf_check_ftp_send(UINT8 mode)
SINT32 sf_send_file_to_ftp(UINT8 mode)
{
SINT32 ret1 = SF_SUCCESS; //0:success; else:fail;
SINT32 ret2 = SF_SUCCESS; //0:success; else:fail;
UINT8 ssl = 0;
UINT8 gprsMode = 0;
int timeout = 60000;
@ -1359,7 +1356,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode)
ssl = ((2 == puiPara->FtpSwitch) ? 1 : 0);
gprsMode = 0;//puiPara->GprsMode;
printf("[%s:%d] ssl:%d,GprsMode:%d\n", __FUNCTION__, __LINE__, ssl, gprsMode);
// printf("[%s:%d] ssl:%d,GprsMode:%d\n", __FUNCTION__, __LINE__, ssl, gprsMode);
if(mode == 1 ) //send Original+video
{
@ -1403,7 +1400,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode)
}
}
printf("[%s:%d]netGeneration=%d\n", __FUNCTION__, __LINE__, sf_get_net_generation());
// printf("[%s:%d]netGeneration=%d\n", __FUNCTION__, __LINE__, sf_get_net_generation());
if(((puiPara->CamMode == SF_CAM_MODE_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_VIDEO2)) && (puiPara->SendVideoSwitch == 1) && (sf_get_net_generation() == 4)) //video
{
@ -1445,25 +1442,16 @@ SINT32 sf_send_file_to_ftp(UINT8 mode)
}
}
if(ret1 != SF_FTP_ERROR_TERM)
{
//ret2 = sf_ftp_stop(ssl, gprsMode);
}
#if SF_TEST_ERROR_CODE
sf_set_code_err_flag(0);
#endif
//printf("[%s:%d]ret1:[0x%08X],ret2:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret1, ret2);
MLOGD(" end ret1:[0x%08X],ret2:[0x%08X]\n", ret1, ret2);
if(ret1 != SF_SUCCESS)
{
MLOGD(" end ret1:[0x%08X]\n", ret1);
return ret1;
}
else
{
FtpOpenOk = SUCCESS;
return ret2;
return ret1;
}
}

View File

@ -160,23 +160,23 @@ int main(int argc, char *argv[])
if((!isUsb) && (SF_MCU_STARTUP_NORMAL != startup) && (SF_MCU_STARTUP_OFF != startup)/*&& (0 == isUpdate)*/)
{
printf("[sf_app]battery thread start\n");
// printf("[sf_app]battery thread start\n");
sf_app_battery_start();
#if SF_IQ_TEST != ENABLE
if(SF_MCU_STARTUP_ONKEY == startup)
{
if(puiPara->WifiSwitch)
{
sf_set_wifi_en(1);
}
if(puiPara->BluSwitch)
{
sf_set_bt_en(1);
}
}
// if(SF_MCU_STARTUP_ONKEY == startup)
// {
// if(puiPara->WifiSwitch)
// {
// sf_set_wifi_en(1);
// }
// if(puiPara->BluSwitch)
// {
// sf_set_bt_en(1);
// }
// }
if((0 == isMcuUpdate) && (0 == isUpdate) && (puiPara->GprsSwitch))
{
sf_4G_usb_init();
// sf_4G_usb_init();
app_RegisterNet_start();
}
#endif