1.修复发送文件名记录
This commit is contained in:
parent
45303b42cc
commit
efe77088b9
|
@ -2157,6 +2157,9 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
|
|
||||||
//return ;
|
//return ;
|
||||||
UINT8 fileIndex = 0;
|
UINT8 fileIndex = 0;
|
||||||
|
INT32 ret_fs = 0;
|
||||||
|
FST_FILE_STATUS FileStat;
|
||||||
|
|
||||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
|
|
||||||
if (pThumbFileCfg != NULL) {
|
if (pThumbFileCfg != NULL) {
|
||||||
|
@ -2183,6 +2186,7 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO);
|
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO);
|
||||||
if((access(sendListName, F_OK) == 0) && (0 == flag))
|
if((access(sendListName, F_OK) == 0) && (0 == flag))
|
||||||
{
|
{
|
||||||
|
printf("%s:%d DeleteFile:%s\r\n", __FUNCTION__, __LINE__, sendListName);
|
||||||
if (FileSys_DeleteFile(sendListName) != FST_STA_OK) {
|
if (FileSys_DeleteFile(sendListName) != FST_STA_OK) {
|
||||||
DBG_IND("Ignore deleting file.\r\n");
|
DBG_IND("Ignore deleting file.\r\n");
|
||||||
}
|
}
|
||||||
|
@ -2201,17 +2205,26 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
else {
|
else {
|
||||||
fd = open(sendListName, O_APPEND | O_WRONLY | O_CREAT);
|
fd = open(sendListName, O_APPEND | O_WRONLY | O_CREAT);
|
||||||
}*/
|
}*/
|
||||||
fs = FileSys_OpenFile(sendListName, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
|
fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
||||||
if(/*fd*/fs)
|
if(/*fd*/fs)
|
||||||
{
|
{
|
||||||
|
FileSys_StatFile(fs, &FileStat);
|
||||||
|
printf("%s:%d qFileStat:%llu\n", __FUNCTION__, __LINE__, FileStat.uiFileSize);
|
||||||
|
|
||||||
|
|
||||||
|
ret_fs = FileSys_SeekFile(fs, 0, FST_SEEK_END);
|
||||||
|
if (ret_fs != FST_STA_OK) {
|
||||||
|
printf("%s:%d seek file failed\r\n", __FUNCTION__, __LINE__);
|
||||||
|
}
|
||||||
for(fileIndex = 0; fileIndex < pThumbFileCfg->filecnt; fileIndex++)
|
for(fileIndex = 0; fileIndex < pThumbFileCfg->filecnt; fileIndex++)
|
||||||
{
|
{
|
||||||
if((0 == fileIndex) || ((1 == puiPara->SendMulti))){
|
if((0 == fileIndex) || ((1 == puiPara->SendMulti))){
|
||||||
sf_add_file_name_to_send_list(pThumbFileCfg->stfileattr[fileIndex].thumbfileName, fs);
|
sf_add_file_name_to_send_list(pThumbFileCfg->stfileattr[fileIndex].thumbfileName, fs);
|
||||||
printf("%s:%d thumbfileSize:%ld thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,pThumbFileCfg->stfileattr[fileIndex].thumbfileSize,pThumbFileCfg->stfileattr[fileIndex].thumbfileName,pThumbFileCfg->stfileattr[fileIndex].thumbfilePath);
|
printf("%s:%d thumbfileSize:%ld thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,pThumbFileCfg->stfileattr[fileIndex].thumbfileSize,pThumbFileCfg->stfileattr[fileIndex].thumbfileName,pThumbFileCfg->stfileattr[fileIndex].thumbfilePath);
|
||||||
}
|
|
||||||
}
|
|
||||||
FileSys_FlushFile(fs);
|
FileSys_FlushFile(fs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FileSys_CloseFile(fs);
|
FileSys_CloseFile(fs);
|
||||||
//close(fd);
|
//close(fd);
|
||||||
}
|
}
|
||||||
|
@ -2222,9 +2235,13 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
char str1[6] = { 0 };
|
char str1[6] = { 0 };
|
||||||
char str2[6] = { 0 };
|
char str2[6] = { 0 };
|
||||||
printf("fileName:%s\n",SF_BATTERY_TEST_FILE);
|
printf("fileName:%s\n",SF_BATTERY_TEST_FILE);
|
||||||
fs = FileSys_OpenFile(SF_BATTERY_TEST_FILE, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
|
fs = FileSys_OpenFile(SF_BATTERY_TEST_FILE, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
||||||
if(fs)
|
if(fs)
|
||||||
{
|
{
|
||||||
|
ret_fs = FileSys_SeekFile(fs, 0, FST_SEEK_END);
|
||||||
|
if (ret_fs != FST_STA_OK) {
|
||||||
|
printf("%s:%d seek file failed\r\n", __FUNCTION__, __LINE__);
|
||||||
|
}
|
||||||
for(fileIndex = 0; fileIndex < pThumbFileCfg->filecnt; fileIndex++)
|
for(fileIndex = 0; fileIndex < pThumbFileCfg->filecnt; fileIndex++)
|
||||||
{
|
{
|
||||||
if((0 == fileIndex) || ((1 == puiPara->SendMulti))){
|
if((0 == fileIndex) || ((1 == puiPara->SendMulti))){
|
||||||
|
@ -2234,9 +2251,10 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
snprintf((char *)str2, sizeof(str2), "%s", str1);
|
snprintf((char *)str2, sizeof(str2), "%s", str1);
|
||||||
printf("%s:%d thumbfileName:%s str2:%s\n", __FUNCTION__, __LINE__, pThumbFileCfg->stfileattr[fileIndex].thumbfileName, str2);
|
printf("%s:%d thumbfileName:%s str2:%s\n", __FUNCTION__, __LINE__, pThumbFileCfg->stfileattr[fileIndex].thumbfileName, str2);
|
||||||
sf_BatteryInfoSave(str2,fs);
|
sf_BatteryInfoSave(str2,fs);
|
||||||
}
|
|
||||||
}
|
|
||||||
FileSys_FlushFile(fs);
|
FileSys_FlushFile(fs);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
FileSys_CloseFile(fs);
|
FileSys_CloseFile(fs);
|
||||||
//close(fd);
|
//close(fd);
|
||||||
}
|
}
|
||||||
|
@ -2248,9 +2266,13 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
char str4[6] = { 0 };
|
char str4[6] = { 0 };
|
||||||
|
|
||||||
printf("fileName:%s\n",SF_HW_TEST_FILE);
|
printf("fileName:%s\n",SF_HW_TEST_FILE);
|
||||||
fs = FileSys_OpenFile(SF_HW_TEST_FILE, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
|
fs = FileSys_OpenFile(SF_HW_TEST_FILE, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
||||||
if(fs)
|
if(fs)
|
||||||
{
|
{
|
||||||
|
ret_fs = FileSys_SeekFile(fs, 0, FST_SEEK_END);
|
||||||
|
if (ret_fs != FST_STA_OK) {
|
||||||
|
printf("%s:%d seek file failed\r\n", __FUNCTION__, __LINE__);
|
||||||
|
}
|
||||||
for(fileIndex = 0; fileIndex < pThumbFileCfg->filecnt; fileIndex++)
|
for(fileIndex = 0; fileIndex < pThumbFileCfg->filecnt; fileIndex++)
|
||||||
{
|
{
|
||||||
if((0 == fileIndex) || ((1 == puiPara->SendMulti))){
|
if((0 == fileIndex) || ((1 == puiPara->SendMulti))){
|
||||||
|
@ -2260,9 +2282,10 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
snprintf((char *)str4, sizeof(str4), "%s", str3);
|
snprintf((char *)str4, sizeof(str4), "%s", str3);
|
||||||
printf("%s:%d thumbfileName:%s str2:%s\n", __FUNCTION__, __LINE__, pThumbFileCfg->stfileattr[fileIndex].thumbfileName, str4);
|
printf("%s:%d thumbfileName:%s str2:%s\n", __FUNCTION__, __LINE__, pThumbFileCfg->stfileattr[fileIndex].thumbfileName, str4);
|
||||||
sf_hw_info_save(str4,fs);
|
sf_hw_info_save(str4,fs);
|
||||||
}
|
|
||||||
}
|
|
||||||
FileSys_FlushFile(fs);
|
FileSys_FlushFile(fs);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
FileSys_CloseFile(fs);
|
FileSys_CloseFile(fs);
|
||||||
//close(fd);
|
//close(fd);
|
||||||
}
|
}
|
||||||
|
@ -2288,6 +2311,7 @@ void sf_add_file_name_to_send_list(char *sendfname, FST_FILE fd)
|
||||||
UINT32 size = 0;
|
UINT32 size = 0;
|
||||||
INT32 ret_fs = 0;
|
INT32 ret_fs = 0;
|
||||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
|
FST_FILE_STATUS FileStat;
|
||||||
|
|
||||||
if (sendfname == NULL) {
|
if (sendfname == NULL) {
|
||||||
printf("%s:%d sendfname err\n", __FUNCTION__, __LINE__);
|
printf("%s:%d sendfname err\n", __FUNCTION__, __LINE__);
|
||||||
|
@ -2304,18 +2328,21 @@ void sf_add_file_name_to_send_list(char *sendfname, FST_FILE fd)
|
||||||
{
|
{
|
||||||
//fstat(fd, &st);
|
//fstat(fd, &st);
|
||||||
//lseek(fd, 0, SEEK_END);
|
//lseek(fd, 0, SEEK_END);
|
||||||
ret_fs = FileSys_SeekFile((FST_FILE)fd, 0, FST_SEEK_END);
|
/*ret_fs = FileSys_SeekFile(fd, 0, FST_SEEK_END);
|
||||||
if (ret_fs != FST_STA_OK) {
|
if (ret_fs != FST_STA_OK) {
|
||||||
printf("%s:%d seek file failed\r\n", __FUNCTION__, __LINE__);
|
printf("%s:%d seek file failed\r\n", __FUNCTION__, __LINE__);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
snprintf(buff, sizeof(buff), "%d%s\r\n", puiPara->CamMode, sendfname);
|
snprintf(buff, sizeof(buff), "%d%s\r\n", puiPara->CamMode, sendfname);
|
||||||
size = SF_SEND_LIST_ITEM_LENGTH;
|
size = SF_SEND_LIST_ITEM_LENGTH;
|
||||||
ret_fs = FileSys_WriteFile((FST_FILE)fd, (UINT8*)buff, &size, 0, NULL);
|
ret_fs = FileSys_WriteFile(fd, (UINT8*)buff, &size, 0, NULL);
|
||||||
if (ret_fs != FST_STA_OK) {
|
if (ret_fs != FST_STA_OK) {
|
||||||
printf("%s:%d FileSys_WriteFile failed\r\n", __FUNCTION__, __LINE__);
|
printf("%s:%d FileSys_WriteFile failed\r\n", __FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileSys_StatFile(fd, &FileStat);
|
||||||
|
printf("%s:%d FileStat:%llu\n", __FUNCTION__, __LINE__, FileStat.uiFileSize);
|
||||||
|
|
||||||
//write(fd, buff, SF_SEND_LIST_ITEM_LENGTH);
|
//write(fd, buff, SF_SEND_LIST_ITEM_LENGTH);
|
||||||
|
|
||||||
//printf("Add Success st_size:%ld\n", st.st_size);
|
//printf("Add Success st_size:%ld\n", st.st_size);
|
||||||
|
@ -2473,10 +2500,7 @@ void sf_hw_info_save(char *name,FST_FILE fd)
|
||||||
write(fd, tmpBuf, strlen(tmpBuf));
|
write(fd, tmpBuf, strlen(tmpBuf));
|
||||||
close(fd);*/
|
close(fd);*/
|
||||||
//printf("Add Success st_size:%ld\n", st.st_size);
|
//printf("Add Success st_size:%ld\n", st.st_size);
|
||||||
ret_fs = FileSys_SeekFile(fd, 0, FST_SEEK_END);
|
|
||||||
if (ret_fs != FST_STA_OK) {
|
|
||||||
printf("%s:%d seek file failed\r\n", __FUNCTION__, __LINE__);
|
|
||||||
}
|
|
||||||
size = strlen(tmpBuf);
|
size = strlen(tmpBuf);
|
||||||
ret_fs = FileSys_WriteFile(fd, (UINT8*)tmpBuf, &size, 0, NULL);
|
ret_fs = FileSys_WriteFile(fd, (UINT8*)tmpBuf, &size, 0, NULL);
|
||||||
if (ret_fs != FST_STA_OK) {
|
if (ret_fs != FST_STA_OK) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user