1.修复dp发送
This commit is contained in:
parent
24a64a859d
commit
c5caa537e5
|
@ -1173,12 +1173,6 @@ SINT32 sf_ftp_dailyreport_send(void)
|
||||||
|
|
||||||
ret = SF_SUCCESS;//sf_quectel_upload_file_to_module((UINT8 *)SF_DAILYREPORT_FILENAME, (UINT8 *)SF_DAILYREPORT_TXT);
|
ret = SF_SUCCESS;//sf_quectel_upload_file_to_module((UINT8 *)SF_DAILYREPORT_FILENAME, (UINT8 *)SF_DAILYREPORT_TXT);
|
||||||
|
|
||||||
char *err_code_path = sf_root_path_strcat(SF_ERROR_CODE);
|
|
||||||
if(err_code_path == NULL)
|
|
||||||
{
|
|
||||||
free(err_code_path);
|
|
||||||
return SF_FAILURE;
|
|
||||||
}
|
|
||||||
if(SF_SUCCESS != ret)
|
if(SF_SUCCESS != ret)
|
||||||
{
|
{
|
||||||
printf("%s:%d upload err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath);
|
printf("%s:%d upload err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath);
|
||||||
|
@ -1225,12 +1219,24 @@ SINT32 sf_ftp_dailyreport_send(void)
|
||||||
pSifarPara->videoSendFailCount = 0;
|
pSifarPara->videoSendFailCount = 0;
|
||||||
pSifarPara->videoSendSucessCount = 0;
|
pSifarPara->videoSendSucessCount = 0;
|
||||||
pSifarPara->SendlowPowerWarnCnt = 0;
|
pSifarPara->SendlowPowerWarnCnt = 0;
|
||||||
sf_file_remove(err_code_path);
|
|
||||||
|
memset(filePath, '\0', sizeof(filePath));
|
||||||
|
snprintf((char *)filePath, sizeof(filePath), "/mnt/sd/%s", SF_ERROR_CODE);
|
||||||
|
if(sf_file_IsExsit((char *)filePath) == SF_TRUE)
|
||||||
|
{
|
||||||
|
sf_file_remove((char *)filePath);
|
||||||
|
}
|
||||||
|
memset(filePath, '\0', sizeof(filePath));
|
||||||
|
snprintf((char *)filePath, sizeof(filePath), "/mnt/sd2/%s", SF_ERROR_CODE);
|
||||||
|
if(sf_file_IsExsit((char *)filePath) == SF_TRUE)
|
||||||
|
{
|
||||||
|
sf_file_remove((char *)filePath);
|
||||||
|
}
|
||||||
|
system("sync");
|
||||||
}
|
}
|
||||||
sf_dailyReport_set();
|
sf_dailyReport_set();
|
||||||
}
|
}
|
||||||
MLOGD(" end ret:[0x%08X]\n", ret);
|
MLOGD(" end ret:[0x%08X]\n", ret);
|
||||||
free(err_code_path);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -941,6 +941,8 @@ UINT32 sf_create_dailyreport_file(void)
|
||||||
SINT16 fTemper = 0, cTemper = 0;
|
SINT16 fTemper = 0, cTemper = 0;
|
||||||
char imageSize = 0;
|
char imageSize = 0;
|
||||||
char videoSize = 0;
|
char videoSize = 0;
|
||||||
|
UINT8 filePath[64] = { 0 };
|
||||||
|
|
||||||
/*Avoid New Card*/
|
/*Avoid New Card*/
|
||||||
|
|
||||||
if(SF_CAMID_ON == pPara->CamNameSwitch)
|
if(SF_CAMID_ON == pPara->CamNameSwitch)
|
||||||
|
@ -1285,18 +1287,14 @@ UINT32 sf_create_dailyreport_file(void)
|
||||||
//printf("szTmpsize=%d\n",szTmpsize);
|
//printf("szTmpsize=%d\n",szTmpsize);
|
||||||
write(fd, szTmp2, szTmpsize);
|
write(fd, szTmp2, szTmpsize);
|
||||||
|
|
||||||
char *err_code_path = sf_root_path_strcat(SF_ERROR_CODE);
|
memset(filePath, '\0', sizeof(filePath));
|
||||||
if(err_code_path == NULL)
|
snprintf((char *)filePath, sizeof(filePath), "/mnt/sd/%s", SF_ERROR_CODE);
|
||||||
{
|
if(sf_file_IsExsit((char *)filePath) == SF_TRUE)
|
||||||
free(err_code_path);
|
{
|
||||||
return SF_FAILURE;
|
size = sf_get_file_size(filePath);
|
||||||
}
|
fd1 = open((char *)filePath, O_RDONLY, S_IRUSR | S_IWUSR);
|
||||||
if(sf_file_IsExsit(err_code_path) == SF_TRUE){
|
|
||||||
size = sf_get_file_size((UINT8 *)err_code_path);
|
|
||||||
fd1 = open(err_code_path, O_RDONLY, S_IRUSR | S_IWUSR);
|
|
||||||
if(fd1)
|
if(fd1)
|
||||||
{
|
{
|
||||||
free(err_code_path);
|
|
||||||
//size = sp5kFsFileSizeGet(fd1);
|
//size = sp5kFsFileSizeGet(fd1);
|
||||||
buf = malloc(size);
|
buf = malloc(size);
|
||||||
|
|
||||||
|
@ -1310,6 +1308,33 @@ UINT32 sf_create_dailyreport_file(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
close(fd1);
|
close(fd1);
|
||||||
|
fd1 = 0;
|
||||||
|
buf = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(filePath, '\0', sizeof(filePath));
|
||||||
|
snprintf((char *)filePath, sizeof(filePath), "/mnt/sd2/%s", SF_ERROR_CODE);
|
||||||
|
if(sf_file_IsExsit((char *)filePath) == SF_TRUE)
|
||||||
|
{
|
||||||
|
size = sf_get_file_size(filePath);
|
||||||
|
fd1 = open((char *)filePath, O_RDONLY, S_IRUSR | S_IWUSR);
|
||||||
|
if(fd1)
|
||||||
|
{
|
||||||
|
//size = sp5kFsFileSizeGet(fd1);
|
||||||
|
buf = malloc(size);
|
||||||
|
|
||||||
|
if (buf)
|
||||||
|
{
|
||||||
|
read(fd1, buf, size-1);
|
||||||
|
printf("error code size=%d\n",size);
|
||||||
|
write(fd, buf, size-1);
|
||||||
|
write(fd, (UINT8 *)"\r\n", SF_STRLEN("\r\n"));
|
||||||
|
free(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fd1);
|
||||||
|
fd1 = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user