diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-10 18:28:41 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-10 18:28:41 +0200 |
| commit | a65868d1d77b1929b855abd0c19bdc08bc9cee9d (patch) | |
| tree | 09486bed718fb096914780f33313fb82a0207c87 /Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | |
| parent | 82179e1b69b62b971a04af571979e7d10c60fd7a (diff) | |
| parent | ac9678197fc6142595089155d98442239a64e6d7 (diff) | |
| download | Tango-a65868d1d77b1929b855abd0c19bdc08bc9cee9d.tar.gz Tango-a65868d1d77b1929b855abd0c19bdc08bc9cee9d.zip | |
merge
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | 52 |
1 files changed, 3 insertions, 49 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 11fbf86c4..60873243c 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -48,7 +48,7 @@ FIL *UploadFileHandle = 0; //the system supports a single active file FIL *DownloadFileHandle = 0; //the system supports a single active file char FileHandleChar[5]; char ErrorMsg[100]; -#define MAX_CHUNK_LENGTH 2000 +#define MAX_CHUNK_LENGTH 4000 int32_t FileLength = 0; int32_t FileReceivedLength = 0; int32_t FileSentLength = 0; @@ -422,51 +422,10 @@ uint32_t DeleteRequestFunc(MessageContainer* requestContainer) DeleteResponse response = DELETE_RESPONSE__INIT; - DIR dir; FILINFO* fno = 0; //int NumOfFiles = 0; FRESULT Fresult = FR_OK; - /*Fresult |= f_opendir(&dir, g_cCwdBuf); - if(Fresult != FR_OK) - { - LOG_ERROR (Fresult,"f_write error"); - } - else - { - - fno = my_malloc(sizeof(FILINFO)); - memset (fno,0,sizeof(FILINFO)); - Fresult = f_stat(request->path,fno); - if (Fresult == FR_OK) - { - if (isDirectory(fno->fattrib)) - { - //============================ - Fresult = f_opendir(&dir, request->path); - if (Fresult == FR_OK) - { - Fresult = f_readdir(&dir, &fno); - if (Fresult == FR_OK) - { - if(fno->fname[0] ==0) - { - //no files - Fresult = f_unlink(request->path); - } - else - { - LOG_ERROR (fno,"Directory not empty"); - } - } - } - } - else - { - Fresult = f_unlink(request->path); - } - } - }*/ Fresult = f_unlink(request->path); responseContainer = createContainer(MESSAGE_TYPE__DeleteResponse, requestContainer->token, false, &response, &delete_response__pack, &delete_response__get_packed_size); @@ -509,9 +468,9 @@ uint32_t GetStorageInfoRequestFunc(MessageContainer* requestContainer) tot_sect = (fs->n_fatent - 2) * fs->csize; fre_sect = fre_clust * fs->csize; response.has_capacity = true; - response.capacity = tot_sect/2; + response.capacity = tot_sect/2*1024; response.has_freespace = true; - response.freespace = fre_sect/2; + response.freespace = fre_sect/2*1024; response.root = "/"; } @@ -588,16 +547,11 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) FilesInfo[i] = &Data[i]; Data[i].has_attribute = true; Data[i].attribute = fno[i]->fattrib; - Data[i].has_length = true; Data[i].name = fno[i]->fname; Data[i].has_length = true; Data[i].length = fno[i]->fsize; Data[i].lastmodifieddate = fno[i]->fdate; Data[i].lastmodifiedtime = fno[i]->ftime; - //strcpy(FullPath[i],request->path); - //strcat(FullPath[i],'\\'); - //strcat(FullPath[i],&fno[i]->fname); - //sprintf (FullPath[i], "%s/%s", request->path, &fno[i]->fname); if (i==0) usnprintf(&FullPath[i], 50, "%s", request->path); else |
