[ECOS] Serial I/O read

harri.siirtola@vtt.fi harri.siirtola@vtt.fi
Wed Sep 26 02:00:00 GMT 2001


At 20:07 25.9.2001 +0100, Jonathan Larmour wrote:
>Greg Marsden wrote:
>> 
>> Is there a way that I can request a read of a block of
>> characters from a serial port and have the read function
>> return when it has between 1 and blockLen characters.
>> 
>> Most Unix and Win32 api's support this mode, Ecos seems to wait
>> until a full buffer is available or it returns immediately with
>> no characters in non blocking mode.
>
>The only way to get that type of behaviour with eCos at present is to use
>the file I/O package and select() followed by a non-blocking read().
>
>Jifl

Another way is to establish an rx semaphore and posting it in the serial
DSR. A receiver thread (or function) counting this semaphore (and reading
the rx reg) can stop on any char count received.

	Harri



More information about the Ecos-discuss mailing list