For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > January 2007 > Problem with serial port









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem with serial port
alok

2007-01-15, 8:05 am

Hi

I have to access a device through serial port . that device sends some
messages per second that needs to be received . I am that what
should be better option either to wait in select system call or
checking input buffer through ioctl (..FIONREAD) periodically at some
100ms ? can any body have any idea regarding this ?

Edwin van den Oetelaar

2007-01-15, 8:05 am

alok wrote:
> Hi
>
> I have to access a device through serial port . that device sends some
> messages per second that needs to be received . I am that what
> should be better option either to wait in select system call or
> checking input buffer through ioctl (..FIONREAD) periodically at some
> 100ms ? can any body have any idea regarding this ?
>

I use select(2) no need to anything to see if data is available. (no busy waiting)
works for me.
Good luck,
Edwin
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com