From 7816a6a659f0434770edf47d15d0ee24add3b04f Mon Sep 17 00:00:00 2001 From: cliechti Date: Fri, 31 May 2013 01:27:25 +0000 Subject: [Bug pyserial:137] Patch to add non-standard baudrates to Cygwin git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@459 f19166aa-fa4f-0410-85c2-fa1106f25c8a --- CHANGES.txt | 1 + serial/serialposix.py | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 143ac23..dee6da0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -452,6 +452,7 @@ Bugfixes (posix): - [Patch 3462364] Fix: NameError: global name 'base' is not defined - list_ports and device() for BSD updated (Anders Langworthy) - [Bug 3518380] python3.2 -m serial.tools.list_ports error +- [Bug pyserial:137] Patch to add non-standard baudrates to Cygwin Bugfixes (win32): diff --git a/serial/serialposix.py b/serial/serialposix.py index 6f7bb47..1b7fe86 100644 --- a/serial/serialposix.py +++ b/serial/serialposix.py @@ -101,7 +101,19 @@ elif plat == 'cygwin': # cygwin/win32 (confirmed) def set_special_baudrate(port, baudrate): raise ValueError("sorry don't know how to handle non standard baud rate on this platform") - baudrate_constants = {} + 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 -- cgit v1.2.1