Menu

#137 Patch to add non-standard baudrates to Cygwin

v1.0 (example)
closed-fixed
None
5
2013-05-31
2012-12-23
No

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.

Discussion

  • Mark Blackburn

    Mark Blackburn - 2012-12-23

    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

     
  • Chris Liechti

    Chris Liechti - 2013-05-31

    OK, added for release 2.7

     
  • Chris Liechti

    Chris Liechti - 2013-05-31
    • status: open --> closed-fixed
    • assigned_to: Chris Liechti
    • Group: --> v1.0 (example)
     

Log in to post a comment.