An stty question

An stty question

Post by Laurence Lindstro » Mon, 10 Mar 1997 04:00:00



[ Stty_q 1K ]

Hi Experts:

   The following relates to X86/2.5/du 3.  

   I can't get stty to work form me.  What am I doing wrong?  

   I enter:
$ stty parenb -parodd 2400 cs7 cstopb crtscts < /dev/tty00

   I believe this should enable parity, set it to even, 2400 BPS,
7 bit data, 2 stop bits, RTS/CTS handshake.  Yes, I know this a weird
way to set a port.  I'm just testing my ability to talk to any
configuration.  

   I then test the serial port:
$ stty -a < /dev/tty00                                    
speed 9600 baud;
rows = 0; columns = 0; ypixels = 0; xpixels = 0;
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^|; erase = ^?; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff -parext
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt e*-defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
$

   It loooks like nothing I set made an impression.  

   I can tcsetattr from my application to set any of these options just
fine.  But I want to set BPS, parity, and other serial port values from
the comand line.  Then call the application, which will set a few
additional port values, but not those I want to set from the command line.  

   I can set the port from the application when I'm in user.  I've tried
stty as a user and root.  No luck in either case.  

   Suggestions?  

                                                                    Thanks
                                                                    Larryl

 
 
 

An stty question

Post by Casper H.S. Dik - Network Security Engine » Thu, 13 Mar 1997 04:00:00



>   I enter:
>$ stty parenb -parodd 2400 cs7 cstopb crtscts < /dev/tty00
>   I believe this should enable parity, set it to even, 2400 BPS,
>7 bit data, 2 stop bits, RTS/CTS handshake.  Yes, I know this a weird
>way to set a port.  I'm just testing my ability to talk to any
>configuration.  

As soon as the port is closed, the port is reset to defaults.

You'd need to keep the port open for the stty to stick.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

An stty question

Post by Mario Klebsch DG1 » Tue, 18 Mar 1997 04:00:00




>>   I enter:
>>$ stty parenb -parodd 2400 cs7 cstopb crtscts < /dev/tty00
>As soon as the port is closed, the port is reset to defaults.
>You'd need to keep the port open for the stty to stick.

A simple way to keep the port open is to do

        sleep 10000000 >/dev/tty00 &

Of course, you have to kill the sleep process, when you are finished. :-)

73, Mario
--

Institut fuer Robotik und Prozessinformatik der TU Braunschweig
Hamburger Strasse 267, 38114 Braunschweig, Germany

 
 
 

1. Another stty question.

Monday, I posted a question relating to the following:  

I'm trying to use stty to set the values of a terminal that I then
want to open with an application I've written.  

   I "stty blablabla < /dev/tty00" and when I then look at it with
"stty -a < /dev/tty00", it's values are as they were before my first
stty.  

   Several people have told me that this is the way it's supposed
to work.  As I now understand it, the stty opens the port and sets
it's values, but closes the port, undoing the changes, when it
exits.  

   I've looked at the man page for stty, and I just don't get it.  

   Is there a way to set a port's values, then open that port in
an app while preserving those values, and set additional values
with tcsetattr?  

   I've been contracted to do a small project.  I would like the
user to change the com port values without setting entries for
tcsetattr, and then recompiling.  My client wants this program to
be portable between Solaris to DOS, and I want to minimize the
volume of code in conditional compile clauses.  

                                                          Thanks
                                                          Larry

2. does anyone have c code for making a ramdisk?

3. Stty Question

4. Login manager does not display login screen

5. stty question

6. SNMP Monitor

7. .gz suffix

8. Another stty question....

9. stty questions

10. Stty questions for serial port modem

11. Newbie stty question