apps/examples/flowc: Add a delay between received packets in order to force input flow control.

This commit is contained in:
Gregory Nutt 2017-09-26 10:30:14 -06:00
parent adcce43685
commit 778ff478e6
2 changed files with 10 additions and 0 deletions

View File

@ -102,6 +102,10 @@ config EXAMPLES_FLOWC_RECEIVER_BUFSIZE
int "Receiver buffer size" int "Receiver buffer size"
default 64 default 64
config EXAMPLES_FLOWC_RECEIVER_DELAY
int "Receiver read delay (msec)"
default 100
config EXAMPLES_FLOWC_RECEVER_DEVNAME config EXAMPLES_FLOWC_RECEVER_DEVNAME
string "Default TTY device for receiver" string "Default TTY device for receiver"
default "/dev/ttyACM0" default "/dev/ttyACM0"

View File

@ -191,6 +191,12 @@ int flowc_receiver(int argc, char **argv)
close(fd); close(fd);
return 1; return 1;
} }
#ifdef CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY
/* Delay to force flow control */
usleep(1000 * CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY);
#endif
} }
close(fd); close(fd);