From 7fb932b8941549219b7a1300428243d5ec0c0de6 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Sun, 15 Mar 2020 22:40:40 -0500 Subject: [PATCH] Remove debug from serial.c --- src/serial.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/serial.c b/src/serial.c index 0688f6bb8..f553b7c86 100644 --- a/src/serial.c +++ b/src/serial.c @@ -592,32 +592,31 @@ int HAMLIB_API serial_flush(hamlib_port_t *p) { rig_debug(RIG_DEBUG_VERBOSE, "%s MDB called\n", __func__); -// if (p->fd == uh_ptt_fd || p->fd == uh_radio_fd) -// { - unsigned char buf[32]; - /* - * Catch microHam case: - * if fd corresponds to a microHam device drain the line - * (which is a socket) by reading until it is empty. - */ - int n; - - rig_debug(RIG_DEBUG_TRACE, "%s: flushing: ", __func__); - - while ((n = read(p->fd, buf, 32)) > 0) + if (p->fd == uh_ptt_fd || p->fd == uh_radio_fd) { - int i; + unsigned char buf[32]; + /* + * Catch microHam case: + * if fd corresponds to a microHam device drain the line + * (which is a socket) by reading until it is empty. + */ + int n; - for (i = 0; i < n; ++i) { printf("0x%02x(%c) ", buf[i], isprint(buf[i]) ? buf[i] : '~'); } + rig_debug(RIG_DEBUG_TRACE, "%s: flushing: ", __func__); - /* do nothing */ + while ((n = read(p->fd, buf, 32)) > 0) + { + //int i; + + //for (i = 0; i < n; ++i) { printf("0x%02x(%c) ", buf[i], isprint(buf[i]) ? buf[i] : '~'); } + + /* do nothing */ + } + + + return RIG_OK; } - printf("DONE\n"); - - return RIG_OK; -// } - rig_debug(RIG_DEBUG_VERBOSE, "%s: tcflush\n", __func__); tcflush(p->fd, TCIFLUSH); return RIG_OK;