From: lei lixing (llxsimul++at++263.net)
Date: 03/16/2002 09:02:58
IHRvIDM4NDAwPw==?=
X-Priority: 3
X-Originating-IP: [61.135.29.159]
X-Mailer: Coremail2.0 Copyright Tebie Ltd., 2001
Hello to everybody,
Is anyone aware of a method how to set onyx2 tty4 (in RS-422 mode,as tty4d4)
baud rate to 38400?
The segment code I use for tty4 is:
//////////////////////////////////////////////////////////////////////
int ttyfile ;
char path[20] = "/dev/tty4d4" ;
struct termios arg ;
int rval ;
extern int errno ;
/* open tty4d4 */
ttyfile = open ( path , O_RDWR , O_NONBLOCK ) ;
printf ( "open ttyfile : %d\n" , ttyfile ) ;
if ( ttyfile < 0 )
{
perror ( " ttyfile open error " ) ;
exit ( -1 ) ;
}
/* get tty attribute */
tcgetattr ( ttyfile , &arg ) ;
/* set tty to 38400 baud 8 bits no parity one stop bits */
arg.c_cflag = B38400 | CS8 | CREAD | HUPCL | CLOCAL ;
arg.c_iflag = IGNBRK ;
arg.c_lflag = 0 ;
rval=tcsetattr ( ttyfile , TCSANOW , &arg ) ;
//////////////////////////////////////////////////////////////////////////////////
Make this source file is success,But when i try to run , the result displays the baud rate still is 9600 in oscillograph!!
Has anyone experienced a similar problem?
Are I doing something wrong?
Any suggestions?
Thank you in advance for any answers.
LEI Li-xing
__________________________________________
邮件到了吗?手机告诉你(http://mail.263.net/mmail/index.html)
点击下载95963上网直通车(http://www.263.net/0ji/StarDialer.exe)
我拿什么来诱惑你(http://95963.263.net/)
化妆品三折,香水半价(http://shopping.263.net/class004.htm)
This archive was generated by hypermail 2b29 : Sat Mar 16 2002 - 09:04:12 PST