This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Non-blocking mode read from serial port


"Ali Rodgo" <alirodgo@web.de> writes:

> Thanks a lot, but all of that means that i should use VTIME=0 and
> VMIN=0 to work propertly or should i change something (the bug
> explained below) in the termiostty.c in order to use VMIN >0?If that
> doesn't work how could i read only one byte to one byte from the
> serial port?
>

I'm not sure what you are trying to do. If you want to read a single
byte, then read a single byte: read(fd,buf,1). If you want the read to
block while you do it, that is the default. If you want to also wait
for a timeout then do a select(), then read the byte. If you don't
want to block then set the O_NONBLOCK flag, select() will still block
but the read()s won't. Ignore the VTIME/VMIN stuff entirely.


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]