This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_io_read
- From: "Marco SICHERI [CTS]" <m dot sicheri at ctsgroup dot it>
- To: "baljeet singh" <baljeet45 at yahoo dot com>
- Cc: "eCos Discus.List" <ecos-discuss at sources dot redhat dot com>, "eCos Dev.List" <ecos-devel at sources dot redhat dot com>
- Date: Tue, 15 Mar 2005 15:28:29 +0100
- Subject: Re: [ECOS] cyg_io_read
- Organization: CTS electronics
- References: <20050315033604.77080.qmail@web60809.mail.yahoo.com>
- Reply-to: "Marco SICHERI [CTS]" <m dot sicheri at ctsgroup dot it>
Hi Baljeet,
I do this...
Good work!
//
// -----
CPSUARTGetChar -----------------------------------------------------
//
BYTE CPSUARTGetChar(BYTE uartID, BYTE *charD)
{
BYTE rc = CPSRC_OK;
//
// Controllo uart valida e pronta
//
rc = _CTSUARTCheckUartReady(uartID);
if (rc == CPSRC_UART_NOTREADY)
{
//
// Aprire la uart
//
rc = _CTSUARTOpenUart(uartID);
}
//
// Porta pronta, controlliamo i dati!
//
if (rc == CPSRC_OK)
{
if (cyg_io_select(ctsUartHandle[uartID], CYG_FREAD, uartInfo) == false)
return (CPSRC_UART_NOTREADY);
else
{
cyg_uint32 dataToRead = 1;
if (cyg_io_read(ctsUartHandle[uartID], &charD[0], &dataToRead))
return (CPSRC_UART_NOTREADY);
}
}
return (rc);
}
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: "baljeet singh" <baljeet45@yahoo.com>
To: <ecos-discuss@sources.redhat.com>
Sent: Tuesday, March 15, 2005 4:36 AM
Subject: [ECOS] cyg_io_read
> All,
> one of the parameters in the cyg_io_read(..) is
> the number of bytes to read. Process blocks till
> specified number of bytes have been read. If the
> specified number of bytes is not received, the
> process stays blocked.
> Question: Is there a way to block the process for
> a specified amount of time such that the prcoess
> should return on either receiving the specified
> number of bytes or when the specified delay times
> out?
> Baljeet
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/
>
> --
> 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