public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Serial I/O read
@ 2001-09-24 10:22 Greg Marsden
  2001-09-24 10:30 ` Grant Edwards
  2001-09-25 12:07 ` Jonathan Larmour
  0 siblings, 2 replies; 5+ messages in thread
From: Greg Marsden @ 2001-09-24 10:22 UTC (permalink / raw)
  To: ecos-discuss

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.

Thx - Greg
Wescam Inc. 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Serial I/O read
  2001-09-24 10:22 [ECOS] Serial I/O read Greg Marsden
@ 2001-09-24 10:30 ` Grant Edwards
  2001-09-25 12:07 ` Jonathan Larmour
  1 sibling, 0 replies; 5+ messages in thread
From: Grant Edwards @ 2001-09-24 10:30 UTC (permalink / raw)
  To: Greg Marsden; +Cc: ecos-discuss

On Mon, Sep 24, 2001 at 01:23:46PM -0400, 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.

I recently implimented this in my custom serial driver and
submitted a description of how to do it in the standard serial
driver (it's only a few lines of code):

http://sources.redhat.com/ml/ecos-discuss/2001-08/msg00521.html

I don't know if anybody has implimented it yet or not.

> 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.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Serial I/O read
  2001-09-24 10:22 [ECOS] Serial I/O read Greg Marsden
  2001-09-24 10:30 ` Grant Edwards
@ 2001-09-25 12:07 ` Jonathan Larmour
  1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Larmour @ 2001-09-25 12:07 UTC (permalink / raw)
  To: Greg Marsden; +Cc: ecos-discuss

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
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Serial I/O read
  2001-09-26  2:00 harri.siirtola
@ 2001-09-26  7:44 ` Grant Edwards
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Edwards @ 2001-09-26  7:44 UTC (permalink / raw)
  To: harri.siirtola; +Cc: Jonathan Larmour, Greg Marsden, ecos-discuss

On Wed, Sep 26, 2001 at 11:59:43AM +0300, harri.siirtola@vtt.fi wrote:
> 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.

Adding the semi-blocking read mode to the "generic" part of the
serial driver should be really trivial: change one line of code
in serial.c and add a two lines to an include file somewhere.
If I could run the current CVS snapshot, I'd go ahead and do
it.  But, updating to the current CVS snapshot isn't at the top
of my list yet.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Serial I/O read
@ 2001-09-26  2:00 harri.siirtola
  2001-09-26  7:44 ` Grant Edwards
  0 siblings, 1 reply; 5+ messages in thread
From: harri.siirtola @ 2001-09-26  2:00 UTC (permalink / raw)
  To: Jonathan Larmour, Greg Marsden; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-09-26  7:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-24 10:22 [ECOS] Serial I/O read Greg Marsden
2001-09-24 10:30 ` Grant Edwards
2001-09-25 12:07 ` Jonathan Larmour
2001-09-26  2:00 harri.siirtola
2001-09-26  7:44 ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).