From 9fa64bf4da9136c3e69e83949d9c079fbfabc443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 23 Dec 2017 16:40:23 +0100 Subject: [PATCH] removed debug logging --- gex/TF_Integration.c | 4 ---- gex/gex_client.c | 4 ---- main.c | 26 ++++++++------------------ 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/gex/TF_Integration.c b/gex/TF_Integration.c index 1b348c9..84cc17b 100644 --- a/gex/TF_Integration.c +++ b/gex/TF_Integration.c @@ -15,13 +15,9 @@ void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, size_t len) GexClient *gc = tf->userdata; assert(gc->acm_fd != 0); - hexDump("TF_Write", buff, (uint32_t)len); - ssize_t rv = write(gc->acm_fd, buff, len); if (rv != (ssize_t)len) { fprintf(stderr, "ERROR %d in TF write: %s\n", errno, strerror(errno)); - } else { - fprintf(stderr, "Written %d bytes.\n", (int)rv); } } diff --git a/gex/gex_client.c b/gex/gex_client.c index 911657e..416d816 100644 --- a/gex/gex_client.c +++ b/gex/gex_client.c @@ -198,7 +198,6 @@ void GEX_Poll(GexClient *gex) } else { if (len == 0) { - fprintf(stderr,"No more data to read.\n"); if (gex->tf->state != 0) { if (cycle < MAX_RETRIES) { cycle++; @@ -211,9 +210,6 @@ void GEX_Poll(GexClient *gex) } } else { - fprintf(stderr, "rx %d bytes\n", (int) len); - hexDump("TF_Receive", pollbuffer, (uint32_t) len); - TF_Accept(gex->tf, pollbuffer, (size_t) len); } } diff --git a/main.c b/main.c index 7042721..52eaa53 100644 --- a/main.c +++ b/main.c @@ -49,6 +49,13 @@ int main(void) // the "PING" command GexMsg msg; +#if 1 + // Simple response + msg = GEX_Query0(test, 0); + assert(msg.type == MSG_SUCCESS); + fprintf(stderr, "Cmd \"PING\" OK\n"); +#endif + #if 1 // Test a echo command that returns back what was sent to it as useful payload const char *s = "I am \r\nreturning this otherwise good typing paper to you because someone " @@ -60,23 +67,6 @@ int main(void) #endif #if 1 - // Simple response - int failures = 0; - for(int i=0; i<20; i++) { - fprintf(stderr, "\nSending \"PING\" #%d\n", i); - msg = GEX_Query0(test, 0); - fprintf(stderr, "\"PING\" resp = %d\n", msg.type); - if (msg.type != 0) { - fprintf(stderr, "---------------------ERRR-------------------\n"); - if (msg.type == 2) fprintf(stderr, "%.*s\n", msg.len, msg.payload); - failures++; - } - //usleep(20000); - } - fprintf(stderr, "FAILURES = %d\n", failures); -#endif - -#if 0 // Read the communist manifesto via bulk transfer uint8_t buffr[10000]; GexBulk br = { @@ -91,7 +81,7 @@ int main(void) fprintf(stderr, "%.*s", actuallyRead, buffr); #endif - fprintf(stderr, "ALL done, ending.\n"); + fprintf(stderr, "\n\nALL done, ending.\n"); GEX_DeInit(gex); return 0; }