

Reported one is only an excerpt of my code. Btw, waiting or usleep() is something I need to avoid.

Just for a try, I've created a waiting loop until data is avaliable, but my code never exit the loop. I've tried using select() but nothing happens.

I've also tried avoiding the O_NONBLOCK flag on reading, but then I only block until forever. Int USB = open( "/dev/ttyUSB0", O_RDWR| O_NONBLOCK | O_NDELAY ) #include // POSIX terminal control definitions #include // UNIX standard function definitions Here's my code: #include // standard input / output functions Both commands and response are ASCII characters.Įverything works fine using GtkTerm but, when I switch to C programming, I encounter problems. I need to send those commands and read device's response. I'm working on Linux (Ubuntu).īasically, I am connected to a device which is listening for incoming commands. I'm trying to send/receive data over an USB Port using FTDI, so I need to handle serial communication using C/C++.
