Unix Programming - com1 getch() problem

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > December 2006 > com1 getch() problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author com1 getch() problem
one2001boy@yahoo.com

2006-12-19, 1:31 am

Hello,

I use 'getch' to read the input from stdin, it seems not to work via
serial port using null-modem cable, is 'getch' not compatibal with the
serial port( com1) or some special settings needs to be set?

thanks
Thomas Dickey

2006-12-19, 7:32 am

one2001boy@yahoo.com <one2001boy@yahoo.com> wrote:
> Hello,


> I use 'getch' to read the input from stdin, it seems not to work via
> serial port using null-modem cable, is 'getch' not compatibal with the
> serial port( com1) or some special settings needs to be set?


You probably intended getchar().
getch() is used for screen-oriented applications.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
one2001boy@yahoo.com

2006-12-20, 7:24 am

Thomas Dickey wrote:


>
>
>
>
>
> You probably intended getchar().
> getch() is used for screen-oriented applications.
>

thanks so much for your help.

I realized the problem is more related to ioctl() function.
I tried to write my own terminal for com1,
/sbin/agetty is used as a terminal service and ioctl() functions
returns correctly, but the col and row size is zero.

did I miss something? thanks.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com