Here's a patch to add non-standard baudrates to Cygwin. It's working for 921600, so I think I got it right. At some point I'm going to check it with a scope to make sure the other baud rates are working.
--- pyserial/serial/serialposix.py (revision 455)
+++ pyserial/serial/serialposix.py (working copy)
@@ -101,7 +101,21 @@
def set_special_baudrate(port, baudrate):
raise ValueError("sorry don't know how to handle non standard baud rate on this platform")
- baudrate_constants = {}
+ # add baudrates not listed in Python's termios module but supported by Cygwin
+ # baudrate constants are from sys/termios.h in Cygwin
+ baudrate_constants = {
+ 128000: 0x01003,
+ 256000: 0x01005,
+ 500000: 0x01007,
+ 576000: 0x01008,
+ 921600: 0x01009,
+ 1000000: 0x0100a,
+ 1152000: 0x0100b,
+ 1500000: 0x0100c,
+ 2000000: 0x0100d,
+ 2500000: 0x0100e,
+ 3000000: 0x0100f
+ }
elif plat[:7] == 'openbsd': # OpenBSD
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't see patch file so I'm posting it here:
Index: pyserial/serial/serialposix.py
--- pyserial/serial/serialposix.py (revision 455)
+++ pyserial/serial/serialposix.py (working copy)
@@ -101,7 +101,21 @@
def set_special_baudrate(port, baudrate):
raise ValueError("sorry don't know how to handle non standard baud rate on this platform")
- baudrate_constants = {}
+ # add baudrates not listed in Python's termios module but supported by Cygwin
+ # baudrate constants are from sys/termios.h in Cygwin
+ baudrate_constants = {
+ 128000: 0x01003,
+ 256000: 0x01005,
+ 500000: 0x01007,
+ 576000: 0x01008,
+ 921600: 0x01009,
+ 1000000: 0x0100a,
+ 1152000: 0x0100b,
+ 1500000: 0x0100c,
+ 2000000: 0x0100d,
+ 2500000: 0x0100e,
+ 3000000: 0x0100f
+ }
elif plat[:7] == 'openbsd': # OpenBSD
OK, added for release 2.7