This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Re: [ECOS] io_read
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Sicheri Marco <m dot sicheri at ctsgroup dot it>
- Cc: "eCos Dev.List" <ecos-devel at sources dot redhat dot com>
- Date: Mon, 18 Oct 2004 11:36:07 +0200
- Subject: Re: [ECOS] io_read
- References: <010901c4ad48$b4ca3da0$110110ac@Msicheri> <20041008151913.GI28515@lunn.ch> <011601c4ad4b$573e9c50$110110ac@Msicheri> <002f01c4b4f3$fdfdae50$110110ac@Msicheri>
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