From 2345eb3bb7703806b23c35e2300375cbc0bbc36b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 5 Dec 2015 23:30:42 +0200 Subject: [PATCH] Fix incorrect behaviour of "platformio serialports monitor" in pair with @PySerial 3.0 --- HISTORY.rst | 2 ++ platformio/commands/serialports.py | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 06c18d5e..b8b78b8a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -14,6 +14,8 @@ PlatformIO 2.0 * Removed prompt with "auto-uploading" from `platformio init `__ command and added ``--enable-auto-uploading`` option (`issue #352 `_) +* Fixed incorrect behaviour of `platformio serialports monitor `__ + in pair with PySerial 3.0 2.4.1 (2015-12-01) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/commands/serialports.py b/platformio/commands/serialports.py index 6c6e58ff..46d56f48 100644 --- a/platformio/commands/serialports.py +++ b/platformio/commands/serialports.py @@ -57,10 +57,10 @@ if int(PYSERIAL_VERSION[0]) == 3: help="Enable RTS/CTS flow control, default=Off") @click.option("--xonxoff", is_flag=True, help="Enable software flow control, default=Off") - @click.option("--rts", default="0", type=click.Choice(["0", "1"]), - help="Set initial RTS line state, default=0") - @click.option("--dtr", default="0", type=click.Choice(["0", "1"]), - help="Set initial DTR line state, default=0") + @click.option("--rts", default=None, type=click.Choice(["0", "1"]), + help="Set initial RTS line state") + @click.option("--dtr", default=None, type=click.Choice(["0", "1"]), + help="Set initial DTR line state") @click.option("--encoding", default="UTF-8", help="Set the encoding for the serial port (e.g. hexlify, " "Latin1, UTF-8), default: UTF-8") @@ -101,6 +101,7 @@ if int(PYSERIAL_VERSION[0]) == 3: sys.argv.extend([k, str(v)]) try: + print kwargs miniterm.main( # pylint: disable=E1123 default_port=kwargs['port'], default_baudrate=kwargs['baud'],