tcflush(fd,TCIFLUSH); /* Update the options and do it NOW */ if (tcsetattr(fd,TCSANOW,&options) != 0) { perror("SetupSerial 3"); return (false); } else { printf(" set serial success! "); }
fd = OpenDev(dev); if (fd>0) { printf(" Open Serial Port succes !\n"); set_speed(fd,9600); } else { printf("Can't Open Serial Port!\n"); exit(0); } if (set_Parity(fd,8,1,'N')== false) { printf("Set Parity Error\n"); exit(1); } printf("set paity success ! \n");