From: Dave H. <dhy...@gm...> - 2011-04-08 13:41:20
|
Hi guys, On Fri, Apr 8, 2011 at 6:08 AM, Markus Svilans <msv...@ae...> wrote: > It sounds like you could use the open() system call to open a file > descriptor to the serial port device, and then use the poll() or > select() system calls in a loop to receive a notification when some data > is received. This is about as efficient and and fast a response as you > can get from a user space application. I have been doing it this way to > read data from all kinds of serial devices, and have had no problems > with the approach. Unless your needs are very special, I think you > should be able to get good results with the same approach. I normally launch a thread which is dedicated to reading the serial port. You can issue a read for multiple characters, but set it up so that the read will return when at least 1 character shows up. -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com |