aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-05-16 11:58:10 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-05-16 11:58:10 +0300
commit30fcfa4100a9d00e887c6e17e32e427b05296ce7 (patch)
tree0810375ae9424acca748b6538e7d1cf706dbb3a4 /Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
parent62b3546679aab27fc35b0955608c24ad37619258 (diff)
parent4fdb3d2406b16a95e15fe24d6f562e666b3258af (diff)
downloadTango-30fcfa4100a9d00e887c6e17e32e427b05296ce7.tar.gz
Tango-30fcfa4100a9d00e887c6e17e32e427b05296ce7.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c9
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);