I have a thread, that reads serial device (/dev/ttyUSB0), and writes data to stdout :
void io_thread_func () { int serial_port = open(settings.port, O_RD