This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]