apps/examples/flowc: Small improvement to break line if more than 80 . were printed

This commit is contained in:
Alan Carvalho de Assis 2017-09-27 12:56:47 -06:00 committed by Gregory Nutt
parent 0d0d62fca0
commit 661a593939

View File

@ -143,6 +143,7 @@ int flowc_receiver(int argc, char **argv)
struct termios term; struct termios term;
#endif #endif
ssize_t nread; ssize_t nread;
int readcount = 0;
int ret; int ret;
int fd; int fd;
@ -197,6 +198,10 @@ int flowc_receiver(int argc, char **argv)
return 1; return 1;
} }
/* Increase the packet counter */
readcount++;
#if defined(CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY) && \ #if defined(CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY) && \
CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY > 0 CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY > 0
/* Delay to force flow control */ /* Delay to force flow control */
@ -205,6 +210,13 @@ int flowc_receiver(int argc, char **argv)
#endif #endif
#ifdef CONFIG_SYSLOG_INTBUFFER #ifdef CONFIG_SYSLOG_INTBUFFER
/* Move to next line if more than 80 chars */
if ((readcount % 80) == 0)
{
syslog(LOG_INFO, "\n");
}
/* Just to force a flush of syslog interrupt buffer. May also provide /* Just to force a flush of syslog interrupt buffer. May also provide
* a handy indication that the test is still running. * a handy indication that the test is still running.
*/ */