#include #include #include #include #include #include #include //#include "config.h" static int speed_arr[] = { B921600, B460800, B230400, B115200, B57600, B38400, B19200, B9600, B4800, B2400, B1200, B300, }; static int name_arr[] = { 921600, 460800, 230400, 115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200, 300, }; int open_dev(char *Dev) { int fd = open(Dev, O_RDWR /*| O_NONBLOCK*/); //| O_NOCTTY | O_NDELAY //int fd = open(Dev, O_RDWR | O_NONBLOCK); //| O_NOCTTY | O_NDELAY //int fd = open(Dev, O_RDWR | O_NOCTTY | O_NDELAY/*| O_NONBLOCK*/); //| O_NOCTTY | O_NDELAY return fd; } void close_dev(int fd) { close(fd); } void set_Speed(int fd, int speed) { int i; struct termios options; tcgetattr(fd, &options); for(i= 0; i