Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!news.gmi.edu!zombie.ncsc.mil!news.mathworks.com!newsfeed.internetmci.com!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!wariat.org!news.nask.org.pl!cergowa!jarekb From: jarekb@pap.waw.pl (Jaroslaw Bazydlo) Newsgroups: comp.unix.bsd.freebsd.misc Subject: Some kind of trouble with reading /dev/cuaa? Date: 1 Feb 1996 12:43:45 GMT Organization: Research and Academic Computer Network Lines: 57 Message-ID: <4eqci1$n66@bilbo.nask.org.pl> NNTP-Posting-Host: cergowa.pap.waw.pl X-Newsreader: TIN [version 1.2 PL2] I've posted this letter to freebsd-question@freebsd.org but till today I did not get any answer. So I hope that some of you will be able to help me. I'm writing an application that read serial ports and write the text stream to disk file. I wrote simple C code that is freading /dev/cuaa0. After compiling I had no problems with reading data from serial port. (In a fact I had to use rc.serial to configure my port to 1200 baud. A Few days I go I replaced a direct connection with a modem line and it stopped working ;-(. What I have to do first is to set 1200 8N1 parameters of my port. This is my script (a modified part of rc.serial): green:~/src/papreceiver-0.01 {19} more set.modem #!/bin/sh for i in $* do comcontrol /dev/ttyd$i dtrwait 100 drainwait 180 stty </dev/ttyid$i crtscts -parenb cs8 -cstopb -clocal 1200 stty </dev/ttyld$i crtscts stty </dev/cuaia$i crtscts -parenb cs8 -cstopb -clocal 1200 stty </dev/cuala$i crtscts done Thhose are the parameters of /dev/cuaa0 after calling my script. green:~/src/papreceiver-0.01 {24} ./set.modem 0 green:~/src/papreceiver-0.01 {25} stty -a -f /dev/cuaa0 speed 1200 baud; 0 rows; 0 columns; lflags: -icanon -isig -iexten -echo -echoe -echok -echoke -echonl -echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo -extproc iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany -imaxbel -ignbrk -brkint -inpck -ignpar -parmrk oflags: -opost -onlcr -oxtabs cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb crtscts -dsrflow -dtrflow -mdmbuf cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>; eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; status = <undef>; stop = ^S; susp = ^Z; time = 0; werase = ^W; green:~/src/papreceiver-0.01 {26} For my it should work as 8N1. I tested modem line under MS-DOS and there is no problem with hardware. Please think it over and let me know. Greets Jaras -- _ ____ ____ | | __ _| _ \ __ _/ ___| POLISH PRESS AGENCY - Warsaw _ | |/ _` | |_) / _` \___ \ email: ............... jarekb@pap.waw.pl | |_| | Jaroslaw Bazydlo __) | irc: McJARAS ...... on: #Polska #Gandalf \___/ \__,_|_| \_\__,_|____/. home-page: http://www.pap.waw.pl/~jarekb