This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Non-blocking mode read from serial port
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: Ali Rodgo <alirodgo at web dot de>
- Cc: NickGarnett <nickg at ecoscentric dot com>,ecos-discuss at sources dot redhat dot com
- Date: Tue, 24 Feb 2004 18:36:00 +0000
- Subject: Re: [ECOS] Non-blocking mode read from serial port
- References: <200402241213.i1OCDoQ13433@mailgate5.cinetic.de>
Ali Rodgo wrote:
Hello, what i have to do is to read one byte from the serial port send
it to the screen and repeat the process.Without VMIN=1 in the programm
the read() function doesn't block itself and go to the next step even
though no data was read.
That should really never happen. Unless you marked the socket as
non-blocking - but if you want to wait until a byte is read, then it
shouldn't be non-blocking.
With the VMIN=1 the read() function block
itself each three data and these are always the same, 0 or 128.I don't
really know why.The code is quite simple but doesn't work:
VMIN=1 won't work yet, sorry. But there are easy to use alternatives.
Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
Visit us in booth 2527 at the Embedded Systems Conference 2004 <<<<<
March 30 - April 1, San Francisco http://www.esconline.com/electronicaUSA/
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss