[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

com port DTR and RTS



I tested the following code on both host red hat 7.3 and axis dev board with different results. I need to keep DTR and RTS pins positive to control a dallas DS9097 for a 1-wire network on Com1. The host keeps both pins positive, but the axis board only controls RTS pin. The DTR doesn't change. Do i need to control DTR from Port B??
 
  if ((fd = open("ttyS0", O_RDWR)) < 0) {
    printf("Couldn't open Com1\n");
    exit(1);
  }
 
  tcgetattr(fd, &tio);          /* get the termio information */
  tio.c_cflag &= ~HUPCL;        /* clear the HUPCL bit */
  tcsetattr(fd, TCSANOW, &tio); /* set the termio information */
 
  ioctl(fd, TIOCMGET, &status); /* get the serial port status */
 
  status |= TIOCM_DTR;
  status |= TIOCM_RTS;
 
  ioctl(fd, TIOCMSET, &status); /* set the serial port status */
 
  close(fd);                    /* close the device file */
I currently have Axis Developer Board LX release 2.0.0 and Linux 2.4.5 on a cris
 
Murray