how to set onyx2 tty4(rs-422 mode) baud rate

New Message Reply Date view Thread view Subject view Author view

From: lei lixing (llxsimul++at++263.net)
Date: 03/16/2002 16:53:21


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)


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Mar 16 2002 - 17:01:23 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.