public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] polled serial
@ 2001-06-01  4:33 Andy Simpkins
  2001-06-01  4:42 ` Andrew Lunn
  2001-06-01  5:06 ` Jesper Skov
  0 siblings, 2 replies; 6+ messages in thread
From: Andy Simpkins @ 2001-06-01  4:33 UTC (permalink / raw)
  To: eCos Disuss

Hi there,

Assuming that I have understood things properly, cyg_io_read is a blocking
function, i.e. once called it will only return when characters have been
received from the serial port.   Is there another function available to
either return the amount of data currently held in the receive buffer (the
eCos serial buffer NOT that of the UART) or a non blocking read function
(i.e. returns NULL if there is nothing currently in the serial buffer)?

Kind regards

Andy

---
Transcomm UK Ltd.   DDI : +44 (0)23 80662155
Yeoman Park         Fax : +44 (0)23 80662120
Test Lane
Southampton         www.transcomm.uk.com
SO16 9JX


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

* Re: [ECOS] polled serial
  2001-06-01  4:33 [ECOS] polled serial Andy Simpkins
@ 2001-06-01  4:42 ` Andrew Lunn
  2001-06-01  7:01   ` Andy Simpkins
  2001-06-01  5:06 ` Jesper Skov
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2001-06-01  4:42 UTC (permalink / raw)
  To: Andy Simpkins; +Cc: eCos Disuss

On Fri, Jun 01, 2001 at 12:33:23PM +0100, Andy Simpkins wrote:
> Hi there,
> 
> Assuming that I have understood things properly, cyg_io_read is a blocking
> function, i.e. once called it will only return when characters have been
> received from the serial port.   Is there another function available to
> either return the amount of data currently held in the receive buffer 

Try this


{
  cyg_serial_buf_info_t bufinfo;
  cyg_uint32 len;
  
  len = sizeof(bufinfo);  
  cyg_io_get_config(port_handle, CYG_IO_GET_CONFIG_SERIAL_BUFFER_INFO, 
                    &bufinfo, &len); 
      
  return bufinfo.rx_count;
} 

        Andrew

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

* Re: [ECOS] polled serial
  2001-06-01  4:33 [ECOS] polled serial Andy Simpkins
  2001-06-01  4:42 ` Andrew Lunn
@ 2001-06-01  5:06 ` Jesper Skov
  2001-06-01  6:42   ` Andy Simpkins
  1 sibling, 1 reply; 6+ messages in thread
From: Jesper Skov @ 2001-06-01  5:06 UTC (permalink / raw)
  To: Andy.Simpkins; +Cc: eCos Disuss

>>>>> "Andy" == Andy Simpkins <Andy.Simpkins@TardisMobile.com> writes:

Andy> Hi there, Assuming that I have understood things properly,
Andy> cyg_io_read is a blocking function, i.e. once called it will
Andy> only return when characters have been received from the serial
Andy> port.  Is there another function available to either return the
Andy> amount of data currently held in the receive buffer (the eCos
Andy> serial buffer NOT that of the UART) or a non blocking read
Andy> function (i.e. returns NULL if there is nothing currently in the
Andy> serial buffer)?

Set the non-blocking property of the device. See the serial tests for
examples, or consult the documentation...

Jesper

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

* RE: [ECOS] polled serial
  2001-06-01  5:06 ` Jesper Skov
@ 2001-06-01  6:42   ` Andy Simpkins
  2001-06-01  6:51     ` Jesper Skov
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Simpkins @ 2001-06-01  6:42 UTC (permalink / raw)
  To: jskov; +Cc: eCos Disuss

Jesper,
Looking in both the documentation and the serial tests I am afraid I can not
find any
reference to the non-blocking property.

The tests I am looking at are serial1.c through serial5.c, tty1.c & tty2.c
in packages\io\serial\v1_3_1\tests
The documentation I searched was 'eCos 1.3.1 Documentation'

Can please point me to where I should be looking?

Andy

> -----Original Message-----
> From: jskov@thinktwice.zoftcorp.adsl.dk
> [ mailto:jskov@thinktwice.zoftcorp.adsl.dk]On Behalf Of Jesper Skov
> Sent: 01 June 2001 13:06
> To: Andy.Simpkins@TardisMobile.com
> Cc: eCos Disuss
> Subject: Re: [ECOS] polled serial
>
>
> >>>>> "Andy" == Andy Simpkins <Andy.Simpkins@TardisMobile.com> writes:
>
> Andy> Hi there, Assuming that I have understood things properly,
> Andy> cyg_io_read is a blocking function, i.e. once called it will
> Andy> only return when characters have been received from the serial
> Andy> port.  Is there another function available to either return the
> Andy> amount of data currently held in the receive buffer (the eCos
> Andy> serial buffer NOT that of the UART) or a non blocking read
> Andy> function (i.e. returns NULL if there is nothing currently in the
> Andy> serial buffer)?
>
> Set the non-blocking property of the device. See the serial tests for
> examples, or consult the documentation...
>
> Jesper
>


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

* RE: [ECOS] polled serial
  2001-06-01  6:42   ` Andy Simpkins
@ 2001-06-01  6:51     ` Jesper Skov
  0 siblings, 0 replies; 6+ messages in thread
From: Jesper Skov @ 2001-06-01  6:51 UTC (permalink / raw)
  To: Andy.Simpkins; +Cc: jskov, eCos Disuss

>>>>> "Andy" == Andy Simpkins <Andy.Simpkins@TardisMobile.com> writes:

Andy> Jesper, Looking in both the documentation and the serial tests I
Andy> am afraid I can not find any reference to the non-blocking
Andy> property.

Andy> The tests I am looking at are serial1.c through serial5.c,
Andy> tty1.c & tty2.c in packages\io\serial\v1_3_1\tests The
Andy> documentation I searched was 'eCos 1.3.1 Documentation'

Andy> Can please point me to where I should be looking?

Ah, sorry. This is a feature only available in the CVS sources (and
online documentation).

Jesper

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

* RE: [ECOS] polled serial
  2001-06-01  4:42 ` Andrew Lunn
@ 2001-06-01  7:01   ` Andy Simpkins
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Simpkins @ 2001-06-01  7:01 UTC (permalink / raw)
  To: andrew.lunn; +Cc: eCos Disuss

Hi there Andrew
ummm, looks like I am using a greatly outdated version of eCOS,
cyg_serial_info_t is not found anywhere on my machine!

NT 4, cygwin, eCos 1.3.1
Custom Hardware, ARM7TDMI Core

Andy

> -----Original Message-----
> From: Andrew Lunn [ mailto:andrew.lunn@ascom.ch ]
> Sent: 01 June 2001 12:43
> To: Andy Simpkins
> Cc: eCos Disuss
> Subject: Re: [ECOS] polled serial
>
>
> On Fri, Jun 01, 2001 at 12:33:23PM +0100, Andy Simpkins wrote:
> > Hi there,
> >
> > Assuming that I have understood things properly, cyg_io_read is
> a blocking
> > function, i.e. once called it will only return when characters have been
> > received from the serial port.   Is there another function available to
> > either return the amount of data currently held in the receive buffer
>
> Try this
>
>
> {
>   cyg_serial_buf_info_t bufinfo;
>   cyg_uint32 len;
>
>   len = sizeof(bufinfo);
>   cyg_io_get_config(port_handle, CYG_IO_GET_CONFIG_SERIAL_BUFFER_INFO,
>                     &bufinfo, &len);
>
>   return bufinfo.rx_count;
> }
>
>         Andrew
>


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

end of thread, other threads:[~2001-06-01  7:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-01  4:33 [ECOS] polled serial Andy Simpkins
2001-06-01  4:42 ` Andrew Lunn
2001-06-01  7:01   ` Andy Simpkins
2001-06-01  5:06 ` Jesper Skov
2001-06-01  6:42   ` Andy Simpkins
2001-06-01  6:51     ` Jesper Skov

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