From 96f7e84dde9cf67f56a5eea44fb5d800a6ceb0f6 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Wed, 8 Jan 2020 07:53:35 -0700 Subject: [PATCH] better serial recovery messages --- QnetITAP.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/QnetITAP.cpp b/QnetITAP.cpp index d41494a..36d3bd3 100644 --- a/QnetITAP.cpp +++ b/QnetITAP.cpp @@ -306,6 +306,9 @@ void CQnetITAP::Run(const char *cfgfile) break; case RT_PONG: if (! is_alive) { + auto count = queue.size(); + if (count) + printf("%u packets in queue.", (unsigned int)count); printf("Icom Radio is connected.\n"); is_alive = true; } @@ -366,17 +369,10 @@ void CQnetITAP::Run(const char *cfgfile) ackTimer.start(); acknowledged = false; } - }else { - static unsigned int last_count = 0; - auto count = queue.size(); - if (last_count != count) { - last_count = count; - printf("queue contains %u packets\n", last_count); - } } } else { // we are waiting on an acknowledgement if (ackTimer.time() >= 0.06) { - fprintf(stderr, "ERROR: packet sent to serial port not acknowledged\n"); + fprintf(stderr, "Serial port communication error, restarting...\n"); close(serfd); poll_counter = 0; pingtime = 0.1;