I'm using C (gcc) and ncurses, to make a program that will be monitoring data coming from the serial port. The program has a big while
, where it reads the data coming from the port and at the same time, it prints that info in the screen...
But the problem is here:
How can it read input from my keyboard, (since getch()
freezes the program until it gets an input) and at the same time read info coming from the port?
Maybe I have to use another way (not the big while
), so ideas are welcome!
make getch a non-blocking call using nodelay option.
nodelay(stdscr,TRUE);
More info can be found at http://www.gsp.com/cgi-bin/man.cgi?topic=nodelay
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With