From 30f69b08529e347c0b9d6b46e74af50c56fc814a Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Tue, 13 Oct 2015 09:35:25 +0200 Subject: [PATCH] Revert "tunslip6: make printing of sensible strings from mote more reliable" This reverts commit 6608b62b01953b8a263ffda65802c1bc9052c06c. --- tools/tunslip6.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/tools/tunslip6.c b/tools/tunslip6.c index 4f3ff7e3e..b7a66ad3d 100644 --- a/tools/tunslip6.c +++ b/tools/tunslip6.c @@ -238,21 +238,13 @@ serial_to_tun(FILE *inslip, int outfd) slip_send(slipfd, SLIP_END); } #define DEBUG_LINE_MARKER '\r' - if(uip.inbuf[0] == DEBUG_LINE_MARKER || - is_sensible_string(uip.inbuf, inbufptr)) { - unsigned char *out = uip.inbuf; - unsigned int len = inbufptr; - if(uip.inbuf[0] == DEBUG_LINE_MARKER) { - out++; - len--; - } - fprintf(stderr, "\n***"); - fwrite(out, len, 1, stderr); - fprintf(stderr, "***\n"); - } else { - fprintf(stderr, - "serial_to_tun: drop packet len=%d\n", inbufptr); - } + } else if(uip.inbuf[0] == DEBUG_LINE_MARKER) { + fwrite(uip.inbuf + 1, inbufptr - 1, 1, stdout); + } else if(is_sensible_string(uip.inbuf, inbufptr)) { + if(verbose==1) { /* strings already echoed below for verbose>1 */ + if (timestamp) stamptime(); + fwrite(uip.inbuf, inbufptr, 1, stdout); + } } else { if(verbose>2) { if (timestamp) stamptime();