diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-05-12 10:14:22 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-05-12 10:14:22 +0300 |
| commit | 9b05b634f385945d61548e8bfc75b57d78b1e3a5 (patch) | |
| tree | a79282ca7d5a34df90431f414ef5bce4ede10319 /Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | |
| parent | a478b5493345eb6a35cc7308c65fe3fa4023f142 (diff) | |
| parent | caa033747fa1703480a09b13230e8e4266e292d3 (diff) | |
| download | Tango-9b05b634f385945d61548e8bfc75b57d78b1e3a5.tar.gz Tango-9b05b634f385945d61548e8bfc75b57d78b1e3a5.zip | |
merge
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 1cf86c705..5a77a013d 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -6,6 +6,7 @@ */ #include "include.h" #include "Communication/CommunicationTask.h" +#include "Communication/connection.h" #include <DataDef.h> #include <Communication/PMR/IO/FileUploadRequest.pb-c.h> @@ -98,6 +99,8 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer) if (Fresult == FR_OK) { FileLength = request->length; + FileReceivedLength = 0; + REPORT_MSG (FileLength,"file upload request"); response.has_maxchunklength = true; response.maxchunklength = MAX_CHUNK_LENGTH; strcpy(FileHandleChar, "1234"); @@ -150,7 +153,8 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) // memcpy (&ReceivedFileHandle,request->uploadid,sizeof(ReceivedFileHandle)); //if (ReceivedFileHandle == FileHandle) //{ - Fresult = f_write(ReceivedFileHandle,request->buffer.data,request->buffer.len,&WrittenBytes ); + KeepAliveOneSecondCounter = 0; + Fresult = f_write(ReceivedFileHandle,request->buffer.data,request->buffer.len,&WrittenBytes ); if(Fresult != FR_OK) { LOG_ERROR (Fresult,"f_write error"); @@ -159,6 +163,7 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) else { FileReceivedLength += WrittenBytes; + //REPORT_MSG (FileReceivedLength,"file upload chunk"); if (FileReceivedLength == FileLength) { REPORT_MSG (FileReceivedLength,"file upload ended successfully"); @@ -188,7 +193,7 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) status = ERROR_CODE__FILE_NOT_FOUND; }*/ - responseContainer = createContainer(MESSAGE_TYPE__FileChunkUploadResponse, requestContainer->token, false, &response, &file_chunk_upload_response__pack, &file_chunk_upload_response__get_packed_size); + responseContainer = createContainer(MESSAGE_TYPE__FileChunkUploadResponse, requestContainer->token, FileDone, &response, &file_chunk_upload_response__pack, &file_chunk_upload_response__get_packed_size); if (Fresult!= OK) { responseContainer.error = getErrorCode(Fresult); |
