Advantech RSB-4210 Evaluation Kit User Manual Page 77

  • Download
  • Add to my manuals
  • Print
  • Page
    / 104
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 76
69 RSB-4210 User Manual
Chapter 3 Software Functionality
tcgetattr(fd, &options);
options.c_cflag &= ~CSTOPB;
options.c_cflag &= ~CSIZE;
options.c_cflag |= PARENB;
options.c_cflag &= ~PARODD;
options.c_cflag |= CS8;
options.c_cflag &= ~CRTSCTS;
options.c_lflag &= ~(ICANON | IEXTEN | ISIG | ECHO);
options.c_oflag &= ~OPOST;
options.c_iflag &= ~(ICRNL | INPCK | ISTRIP | IXON |
BRKINT );
options.c_cc[VMIN] = 1;
options.c_cc[VTIME] = 0;
options.c_cflag |= (CLOCAL | CREAD);
for(i = 2; i < argc; i++) {
if (!strcmp(argv[i], "-S")) {
options.c_cflag |= CSTOPB;
continue;
}
if (!strcmp(argv[i], "-O")) {
options.c_cflag |= PARODD;
options.c_cflag &= ~PARENB;
continue;
}
if (!strcmp(argv[i], "-E")) {
options.c_cflag &= ~PARODD;
options.c_cflag |= PARENB;
continue;
}
if (!strcmp(argv[i], "-HW")) {
options.c_cflag |= CRTSCTS;
continue;
}
if (!strcmp(argv[i], "-B")) {
i++;
baudrate = atoi(argv[i]);
if(!baudrate_map(baudrate))
baudrate = DEFAULT_RATE;
continue;
}
}
if(baudrate) {
cfsetispeed(&options, baudrate_map(baudrate));
Page view 76
1 2 ... 72 73 74 75 76 77 78 79 80 81 82 ... 103 104

Comments to this Manuals

No comments