This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: ttydiag read and write to console
- From: "Venkateswara Rao L." <lvenkat at lvl7 dot com>
- To: "Venkateswara Rao L." <lvenkat at lvl7 dot com>, <ecos-discuss at ecos dot sourceware dot org>
- Date: Thu, 3 May 2007 10:04:17 +0530
- Subject: RE: [ECOS] ttydiag read and write to console
Hi some one please respond.
cyg_io_write() is working fine but cyg_io_read() is blocking, as
per the reference manual cyg_io_read() echoes but here it is not
echoing.
Please find the code below.
Warm Regards
L.Venkateswara Rao.
-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of
Venkateswara Rao L.
Sent: Wednesday, May 02, 2007 8:09 PM
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] ttydiag read and write to console
Hi all,
I want to work on ttydiag,
I am able to write to the terminal using "cyg_io_write"
But unable to read from the terminal with echo using "cyg_io_read"
Please find the code sample
---------------------------------------------------------
Char buff[] = "\nPlease enter some data: ";
retval = cyg_io_lookup("/dev/ttydiag", &handle);
if (retval != NOERR) {
printf("io lookup error: %d\n", retval);
return;
}
len = strlen(buff);
cyg_io_write(handle, buff, &len);
retval = cyg_io_read(handle,bufRead,&in_msglen);
if (retval != NOERR)
{
printf("Can't read data - DEVIO error: %d\n", retval);
while(1);/*Hang*/
return;
}
printf("Read %d bytes\n", in_msglen);
---------------------------------------------------------
I am able to see the output as shown
---------------------------------------------------------
Please enter some data:
---------------------------------------------------------
After that what ever I entering it is not echoing and hanged.
Please help me.
Warm Regards
L. Venkateswara Rao.
--
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