public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] io_read
       [not found]   ` <011601c4ad4b$573e9c50$110110ac@Msicheri>
@ 2004-10-18  9:20     ` Sicheri Marco
  2004-10-18  9:36       ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Sicheri Marco @ 2004-10-18  9:20 UTC (permalink / raw)
  To: eCos Dev.List, eCos Discus.List

Hi,
I resolve my problem, I read the source. Thanks!
This is my code:
if (cyg_io_select(ctsUartHandle[uartID], CYG_FREAD, uartInfo) == false)
    return (CPSRC_UART_NOTREADY);
else
{
    uartBufLen = 1;
    err = cyg_io_read(ctsUartHandle[uartID], &uartChar, &uartBufLen);
    ...
}
Thank all for yours answer.

But:
I can use the read() or the cyg_io_read()...
Which do you recommend to use? read() or cyg_io_read()? Or are they alike
right?
Thanks and good work!

Ossequi,  (Best Regards/Obrigado)
Marco SICHERI
CTS electronics  - R&D Department
phone: +39 0125 235637, +39 0125 235630
e-mail: m.sicheri@ctsgroup.it
http://www.ctsgroup.it


----- Original Message ----- 
From: "Sicheri Marco" <m.sicheri@ctsgroup.it>
To: "eCos Discus.List" <ecos-discuss@sources.redhat.com>
Sent: Friday, October 08, 2004 5:27 PM
Subject: Re: [ECOS] io_read


> Thanks Andrew, I had think to use the cyg_io_select (like uclinux) but I
> don't found the cyg_io_select() doc. man cyg_io_select don't do....:o(
> Please, (you are the angel) can you have the doc of this function? ^_*
> If i don't read you email today: Good weekend!!
>
> Ossequi,  (Best Regards/Obrigado)
> Marco SICHERI
> CTS electronics  - R&D Department
> phone: +39 0125 235637, +39 0125 235630
> e-mail: m.sicheri@ctsgroup.it
> http://www.ctsgroup.it
>
>
> ----- Original Message ----- 
> From: "Andrew Lunn" <andrew@lunn.ch>
> To: "Sicheri Marco" <m.sicheri@ctsgroup.it>
> Cc: "eCos Discus.List" <ecos-discuss@sources.redhat.com>
> Sent: Friday, October 08, 2004 5:19 PM
> Subject: Re: [ECOS] io_read
>
>
> > On Fri, Oct 08, 2004 at 05:08:43PM +0200, Sicheri Marco wrote:
> > > Hi All,
> > >
> > > the cyg_io_read function don't return until it don't 'read' a data.
> > > How can I return after timeout? Or, How can I know if a data is in my
> io?
> >
> > You can use cyg_io_select() to see if there is anything availabe on
> > the handle.
> >
> >         Andrew
> >
> > -- 
> > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] io_read
  2004-10-18  9:20     ` [ECOS] io_read Sicheri Marco
@ 2004-10-18  9:36       ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2004-10-18  9:36 UTC (permalink / raw)
  To: Sicheri Marco; +Cc: eCos Dev.List

On Mon, Oct 18, 2004 at 11:22:30AM +0200, Sicheri Marco wrote:
> Hi,
> I resolve my problem, I read the source. Thanks!
> This is my code:
> if (cyg_io_select(ctsUartHandle[uartID], CYG_FREAD, uartInfo) == false)
>     return (CPSRC_UART_NOTREADY);
> else
> {
>     uartBufLen = 1;
>     err = cyg_io_read(ctsUartHandle[uartID], &uartChar, &uartBufLen);
>     ...
> }
> Thank all for yours answer.
> 
> But:
> I can use the read() or the cyg_io_read()...
> Which do you recommend to use? read() or cyg_io_read()? Or are they alike
> right?

The advantage of using read() and select() etc is that they are
POSIX. So if you need to port to code some some other RTOS it should
be much easier.

        Andrew

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

end of thread, other threads:[~2004-10-18  9:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <010901c4ad48$b4ca3da0$110110ac@Msicheri>
     [not found] ` <20041008151913.GI28515@lunn.ch>
     [not found]   ` <011601c4ad4b$573e9c50$110110ac@Msicheri>
2004-10-18  9:20     ` [ECOS] io_read Sicheri Marco
2004-10-18  9:36       ` Andrew Lunn

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