Hi Mike,
On Tue, Dec 3, 2013 at 11:39 AM, Mikester <[email protected]> wrote: > > Dave I appreciate the info. > > Unfortunately still no joy. I used > > int qsb = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NONBLOCK); > fcntl(qsb, F_SETFL, fcntl(qsb, F_GETFL ) & ~O_NONBLOCK); > > fcntl after my open() but the only result is that the process hangs indefinately and there is no output. If I run then kill "screen" before executing the code change works albeit much slower. > > Did I put the call in the wrong location? That looks right. I suspect that there is something wrong in other parts of your program. If you ask to read and there is no data available, then the read will hang until data is available. Can you post your complete source code? What type of device are you trying to connect to on the serial port? There are really only 4 ways to read data from the serial port: 1 - Using non-blocking (which means that read will return errno == EAGAIN when no data is available 2 - Use multiple threads (and noon-blocking reads). The tthread that reads from the serial port will hang, but the other threads will run. 3 - Use select to determine when data is available and then read 4 - Use a single thread and blocking reads - which will cause your program to hang. -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
