From 41cc2ac8fda5c4c793a57215fa7d7cc0d763e8a8 Mon Sep 17 00:00:00 2001 From: ucart <ucart_groundstation@iastate.edu> Date: Sat, 1 Apr 2017 00:49:25 -0500 Subject: [PATCH] added prints so we know when we are in the middle of logging --- groundStation/src/backend/backend.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/groundStation/src/backend/backend.c b/groundStation/src/backend/backend.c index 633d3c850..632be4563 100644 --- a/groundStation/src/backend/backend.c +++ b/groundStation/src/backend/backend.c @@ -764,6 +764,7 @@ static void client_recv(int fd) { static void quad_recv() { static unsigned char respBuf[CMD_MAX_LENGTH]; static size_t respBufLen; + static int receiving_logs; struct metadata m; uint8_t data[CMD_MAX_LENGTH]; @@ -836,7 +837,13 @@ static void quad_recv() { quadlog_file = fopen(log_file, "a"); quadlog_file_open = 1; } - //printf("(Quad) : Log found\n"); + if (!receiving_logs) { + printf("(Quad) : Log found\n"); + receiving_logs = 1; + } else { + printf("."); + fflush(0); + } fwrite((char *) data, sizeof(char), m.data_len, quadlog_file); break; case RESPPARAM_ID: @@ -851,7 +858,8 @@ static void quad_recv() { fclose(quadlog_file); quadlog_file_open = 0; } - printf("(Quad) : Log End found\n"); + printf("\n(Quad) : Log End found\n"); + receiving_logs = 0; break; default: printf("(Backend): message type %d ignored from quad\n", m.msg_type); @@ -953,7 +961,7 @@ void findTimeDiff(int respID) { char * create_log_name(char * buffer, size_t max) { static const char * prefix = "logs"; static size_t num_logs = 0; - static const char * format_string = "%Y-%m-%e_%-l:%M"; + static const char * format_string = "%F_%-l:%M"; time_t curr_time; char c_time_string[256]; -- GitLab