From be47a3f3bb511709ed41728cf1311323d7823e85 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Tue, 12 Feb 2019 19:31:23 -0700 Subject: [PATCH] have a look at the extra bytes. --- QnetModem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/QnetModem.cpp b/QnetModem.cpp index 5a60f18..9a8891e 100644 --- a/QnetModem.cpp +++ b/QnetModem.cpp @@ -408,6 +408,8 @@ MODEM_RESPONSE CQnetModem::GetModemData(unsigned char *buf, unsigned int size) offset += ret; } + if (LOG_DEBUG && junk_count) + fprintf(stderr, "Extra bytes: "); while (junk_count) { unsigned char junk[8]; ret = read(serfd, junk, (junk_count > 8U) ? 8U : junk_count); @@ -416,8 +418,12 @@ MODEM_RESPONSE CQnetModem::GetModemData(unsigned char *buf, unsigned int size) return ERROR_RESPONSE; } else if (ret == 0) { printf("READ junk RETURNED A ZERO!\n"); - } else + } else { junk_count -= (unsigned int)ret; + if (LOG_DEBUG) + for (int i=0; i