From 4da4b1e7c77629bf5ab83c5d1caff4ecb6c9c452 Mon Sep 17 00:00:00 2001
From: MicroCART <ucart@localhost.localdomain>
Date: Fri, 24 Mar 2017 20:25:48 -0500
Subject: [PATCH] finished log end command testing

---
 groundStation/src/backend/backend.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/groundStation/src/backend/backend.c b/groundStation/src/backend/backend.c
index 068544d2e..f025c009d 100644
--- a/groundStation/src/backend/backend.c
+++ b/groundStation/src/backend/backend.c
@@ -751,13 +751,13 @@ static void quad_recv() {
 		return;
 	}
 	respBufLen += respLen;
-
+/*
 	printf("packetFromQuad = '");
 	for(int i = 0; i < (int)respBufLen; ++i) {
 		printf(" %.2x ", respBuf[i]);
 	}
 	printf("'\n");
-
+*/
 	while(respBufLen){
 		datalen = DecodePacket(&m, data, CMD_MAX_LENGTH, respBuf, respBufLen);
 		if (datalen == -1) {
@@ -802,7 +802,8 @@ static void quad_recv() {
 					create_log_name(log_file, 256);
 					printf("New log file created: '%s'\n", log_file);
 					quadlog_file = fopen(log_file, "a");
-				}
+					quadlog_file_open = 1;
+				}	
 				/* something like this */
 				printf("(Quad) : Log found\n");
 				fwrite((char *) data, sizeof(char), m.data_len, quadlog_file);
@@ -820,6 +821,7 @@ static void quad_recv() {
 					fclose(quadlog_file);
 					quadlog_file_open = 0;	
 				}
+				printf("(Quad) : Log End found\n");
 				break;
 			default:
 				printf("(Backend): message type %d ignored from quad\n", m.msg_type);
@@ -926,4 +928,4 @@ char * create_log_name(char * buffer, size_t max) {
 	}
 	
 	return buffer;
-}
\ No newline at end of file
+}
-- 
GitLab