* fhandler_serial.cc (fhandler_serial::tcsetattr): Add support for
baud rates up to 3000000 baud. Add missing 128K and 256K cases. (fhandler_serial::tcgetattr): Ditto. * include/sys/termios.h: Add baud rate definitions from B460800 up to B3000000.
This commit is contained in:
parent
f5b9595fd7
commit
f82f801cd2
|
@ -1,3 +1,11 @@
|
||||||
|
2007-02-05 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_serial.cc (fhandler_serial::tcsetattr): Add support for
|
||||||
|
baud rates up to 3000000 baud. Add missing 128K and 256K cases.
|
||||||
|
(fhandler_serial::tcgetattr): Ditto.
|
||||||
|
* include/sys/termios.h: Add baud rate definitions from B460800 up to
|
||||||
|
B3000000.
|
||||||
|
|
||||||
2007-02-02 Corinna Vinschen <corinna@vinschen.de>
|
2007-02-02 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* syscalls.cc (unlink_nt): Add missing assignment in case NtClose fails.
|
* syscalls.cc (unlink_nt): Add missing assignment in case NtClose fails.
|
||||||
|
|
|
@ -635,9 +635,45 @@ fhandler_serial::tcsetattr (int action, const struct termios *t)
|
||||||
case B115200:
|
case B115200:
|
||||||
state.BaudRate = CBR_115200;
|
state.BaudRate = CBR_115200;
|
||||||
break;
|
break;
|
||||||
|
case B128000:
|
||||||
|
state.BaudRate = CBR_128000;
|
||||||
|
break;
|
||||||
case B230400:
|
case B230400:
|
||||||
state.BaudRate = 230400 /* CBR_230400 - not defined */;
|
state.BaudRate = 230400 /* CBR_230400 - not defined */;
|
||||||
break;
|
break;
|
||||||
|
case B256000:
|
||||||
|
state.BaudRate = CBR_256000;
|
||||||
|
break;
|
||||||
|
case B460800:
|
||||||
|
state.BaudRate = 460800 /* CBR_460800 - not defined */;
|
||||||
|
break;
|
||||||
|
case B500000:
|
||||||
|
state.BaudRate = 500000 /* CBR_500000 - not defined */;
|
||||||
|
break;
|
||||||
|
case B576000:
|
||||||
|
state.BaudRate = 576000 /* CBR_576000 - not defined */;
|
||||||
|
break;
|
||||||
|
case B921600:
|
||||||
|
state.BaudRate = 921600 /* CBR_921600 - not defined */;
|
||||||
|
break;
|
||||||
|
case B1000000:
|
||||||
|
state.BaudRate = 1000000 /* CBR_1000000 - not defined */;
|
||||||
|
break;
|
||||||
|
case B1152000:
|
||||||
|
state.BaudRate = 1152000 /* CBR_1152000 - not defined */;
|
||||||
|
break;
|
||||||
|
case B1500000:
|
||||||
|
state.BaudRate = 1500000 /* CBR_1500000 - not defined */;
|
||||||
|
break;
|
||||||
|
case B2000000:
|
||||||
|
state.BaudRate = 2000000 /* CBR_2000000 - not defined */;
|
||||||
|
break;
|
||||||
|
case B2500000:
|
||||||
|
state.BaudRate = 2500000 /* CBR_2500000 - not defined */;
|
||||||
|
break;
|
||||||
|
case B3000000:
|
||||||
|
state.BaudRate = 3000000 /* CBR_3000000 - not defined */;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* Unsupported baud rate! */
|
/* Unsupported baud rate! */
|
||||||
termios_printf ("Invalid t->c_ospeed %d", t->c_ospeed);
|
termios_printf ("Invalid t->c_ospeed %d", t->c_ospeed);
|
||||||
|
@ -942,9 +978,45 @@ fhandler_serial::tcgetattr (struct termios *t)
|
||||||
case CBR_115200:
|
case CBR_115200:
|
||||||
t->c_ospeed = t->c_ispeed = B115200;
|
t->c_ospeed = t->c_ispeed = B115200;
|
||||||
break;
|
break;
|
||||||
|
case CBR_128000:
|
||||||
|
t->c_ospeed = t->c_ispeed = B128000;
|
||||||
|
break;
|
||||||
case 230400: /* CBR_230400 - not defined */
|
case 230400: /* CBR_230400 - not defined */
|
||||||
t->c_ospeed = t->c_ispeed = B230400;
|
t->c_ospeed = t->c_ispeed = B230400;
|
||||||
break;
|
break;
|
||||||
|
case CBR_256000:
|
||||||
|
t->c_ospeed = t->c_ispeed = B256000;
|
||||||
|
break;
|
||||||
|
case 460800: /* CBR_460000 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B460800;
|
||||||
|
break;
|
||||||
|
case 500000: /* CBR_500000 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B500000;
|
||||||
|
break;
|
||||||
|
case 576000: /* CBR_576000 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B576000;
|
||||||
|
break;
|
||||||
|
case 921600: /* CBR_921600 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B921600;
|
||||||
|
break;
|
||||||
|
case 1000000: /* CBR_1000000 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B1000000;
|
||||||
|
break;
|
||||||
|
case 1152000: /* CBR_1152000 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B1152000;
|
||||||
|
break;
|
||||||
|
case 1500000: /* CBR_1500000 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B1500000;
|
||||||
|
break;
|
||||||
|
case 2000000: /* CBR_2000000 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B2000000;
|
||||||
|
break;
|
||||||
|
case 2500000: /* CBR_2500000 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B2500000;
|
||||||
|
break;
|
||||||
|
case 3000000: /* CBR_3000000 - not defined */
|
||||||
|
t->c_ospeed = t->c_ispeed = B3000000;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* Unsupported baud rate! */
|
/* Unsupported baud rate! */
|
||||||
termios_printf ("Invalid baud rate %d", state.BaudRate);
|
termios_printf ("Invalid baud rate %d", state.BaudRate);
|
||||||
|
|
|
@ -177,12 +177,25 @@ POSIX commands */
|
||||||
#define PARODD 0x00200
|
#define PARODD 0x00200
|
||||||
#define HUPCL 0x00400
|
#define HUPCL 0x00400
|
||||||
#define CLOCAL 0x00800
|
#define CLOCAL 0x00800
|
||||||
|
|
||||||
|
/* Extended baud rates above 37K. */
|
||||||
#define CBAUDEX 0x0100f
|
#define CBAUDEX 0x0100f
|
||||||
#define B57600 0x01001
|
#define B57600 0x01001
|
||||||
#define B115200 0x01002
|
#define B115200 0x01002
|
||||||
#define B128000 0x01003
|
#define B128000 0x01003
|
||||||
#define B230400 0x01004
|
#define B230400 0x01004
|
||||||
#define B256000 0x01005
|
#define B256000 0x01005
|
||||||
|
#define B460800 0x01006
|
||||||
|
#define B500000 0x01007
|
||||||
|
#define B576000 0x01008
|
||||||
|
#define B921600 0x01009
|
||||||
|
#define B1000000 0x0100a
|
||||||
|
#define B1152000 0x0100b
|
||||||
|
#define B1500000 0x0100c
|
||||||
|
#define B2000000 0x0100d
|
||||||
|
#define B2500000 0x0100e
|
||||||
|
#define B3000000 0x0100f
|
||||||
|
|
||||||
#define CRTSXOFF 0x04000
|
#define CRTSXOFF 0x04000
|
||||||
#define CRTSCTS 0x08000
|
#define CRTSCTS 0x08000
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue