This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
ttydiag read and write to console
- From: "Venkateswara Rao L." <lvenkat at lvl7 dot com>
- To: <ecos-discuss at ecos dot sourceware dot org>
- Date: Wed, 2 May 2007 20:08:32 +0530
- 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