forked from platformio/platformio-core
Drop support for PySerial 2.7
This commit is contained in:
@ -24,6 +24,7 @@ PlatformIO 3.0
|
|||||||
(`issue #814 <https://github.com/platformio/platformio/issues/814>`_)
|
(`issue #814 <https://github.com/platformio/platformio/issues/814>`_)
|
||||||
* Fixed issue with ``PATH`` auto-configuring for upload tools
|
* Fixed issue with ``PATH`` auto-configuring for upload tools
|
||||||
* Fixed ``99-platformio-udev.rules`` checker for Linux OS
|
* Fixed ``99-platformio-udev.rules`` checker for Linux OS
|
||||||
|
* Stopped supporting PySerial 2.7
|
||||||
|
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -152,14 +152,17 @@ Set initial ``RTS`` line state, default ``0``
|
|||||||
|
|
||||||
Set initial ``DTR`` line state, default ``0``
|
Set initial ``DTR`` line state, default ``0``
|
||||||
|
|
||||||
|
.. option::
|
||||||
|
--echo
|
||||||
|
|
||||||
|
Enable local echo, default ``Off``
|
||||||
|
|
||||||
.. option::
|
.. option::
|
||||||
--encoding
|
--encoding
|
||||||
|
|
||||||
Set the encoding for the serial port (e.g. ``hexlify``, ``Latin1``, ``UTF-8``),
|
Set the encoding for the serial port (e.g. ``hexlify``, ``Latin1``, ``UTF-8``),
|
||||||
default ``UTF-8``.
|
default ``UTF-8``.
|
||||||
|
|
||||||
**NEW**: Available in Miniterm/PySerial 3.0
|
|
||||||
|
|
||||||
.. option::
|
.. option::
|
||||||
-f, --filter
|
-f, --filter
|
||||||
|
|
||||||
@ -173,8 +176,6 @@ Add text transformation. Available filters:
|
|||||||
* ``printable`` Show decimal code for all non-ASCII characters and replace
|
* ``printable`` Show decimal code for all non-ASCII characters and replace
|
||||||
most control codes
|
most control codes
|
||||||
|
|
||||||
**NEW**: Available in Miniterm/PySerial 3.0
|
|
||||||
|
|
||||||
.. option::
|
.. option::
|
||||||
--eol
|
--eol
|
||||||
|
|
||||||
@ -187,8 +188,6 @@ End of line mode (``CR``, ``LF`` or ``CRLF``), default ``CRLF``
|
|||||||
|
|
||||||
Do not apply any encodings/transformations
|
Do not apply any encodings/transformations
|
||||||
|
|
||||||
**NEW**: Available in Miniterm/PySerial 3.0
|
|
||||||
|
|
||||||
.. option::
|
.. option::
|
||||||
--exit-char
|
--exit-char
|
||||||
|
|
||||||
@ -209,40 +208,6 @@ default ``20`` (DEC)
|
|||||||
|
|
||||||
Diagnostics: suppress non-error messages, default ``Off``
|
Diagnostics: suppress non-error messages, default ``Off``
|
||||||
|
|
||||||
.. option::
|
|
||||||
--echo
|
|
||||||
|
|
||||||
Enable local echo, default ``Off``
|
|
||||||
|
|
||||||
.. option::
|
|
||||||
--cr
|
|
||||||
|
|
||||||
Do not send ``CR+LF``, send ``R`` only, default ``Off``
|
|
||||||
|
|
||||||
**REMOVED**: Is not available in Miniterm/PySerial 3.0
|
|
||||||
|
|
||||||
.. option::
|
|
||||||
--lf
|
|
||||||
|
|
||||||
Do not send ``CR+LF``, send ``LF`` only, default ``Off``
|
|
||||||
|
|
||||||
**REMOVED**: Is not available in Miniterm/PySerial 3.0
|
|
||||||
|
|
||||||
.. option::
|
|
||||||
-d, --debug
|
|
||||||
|
|
||||||
Debug received data (escape non-printable chars). ``--debug`` can be given
|
|
||||||
multiple times:
|
|
||||||
|
|
||||||
0. just print what is received
|
|
||||||
1. escape non-printable characters, do newlines as unusual
|
|
||||||
2. escape non-printable characters, newlines too
|
|
||||||
3. hex dump everything
|
|
||||||
|
|
||||||
**REMOVED**: Is not available in Miniterm/PySerial 3.0.
|
|
||||||
See :option:`platformio device monitor --encoding` and
|
|
||||||
:option:`platformio device monitor --filter` options.
|
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
|
@ -171,6 +171,11 @@ Set initial ``RTS`` line state, default ``0``
|
|||||||
|
|
||||||
Set initial ``DTR`` line state, default ``0``
|
Set initial ``DTR`` line state, default ``0``
|
||||||
|
|
||||||
|
.. option::
|
||||||
|
--echo
|
||||||
|
|
||||||
|
Enable local echo, default ``Off``
|
||||||
|
|
||||||
.. option::
|
.. option::
|
||||||
--encoding
|
--encoding
|
||||||
|
|
||||||
@ -220,11 +225,6 @@ default ``20`` (DEC)
|
|||||||
|
|
||||||
Diagnostics: suppress non-error messages, default ``Off``
|
Diagnostics: suppress non-error messages, default ``Off``
|
||||||
|
|
||||||
.. option::
|
|
||||||
--echo
|
|
||||||
|
|
||||||
Enable local echo, default ``Off``
|
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
|
@ -16,10 +16,8 @@ import json
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import click
|
import click
|
||||||
from serial import VERSION as PYSERIAL_VERSION
|
|
||||||
from serial.tools import miniterm
|
from serial.tools import miniterm
|
||||||
|
|
||||||
from platformio import app
|
|
||||||
from platformio.exception import MinitermException
|
from platformio.exception import MinitermException
|
||||||
from platformio.util import get_serialports
|
from platformio.util import get_serialports
|
||||||
|
|
||||||
@ -45,181 +43,87 @@ def device_list(json_output):
|
|||||||
click.echo("")
|
click.echo("")
|
||||||
|
|
||||||
|
|
||||||
if int(PYSERIAL_VERSION[0]) == 3:
|
@cli.command("monitor", short_help="Monitor device (Serial)")
|
||||||
|
@click.option("--port", "-p", help="Port, a number or a device name")
|
||||||
|
@click.option(
|
||||||
|
"--baud", "-b", type=int, default=9600, help="Set baud rate, default=9600")
|
||||||
|
@click.option(
|
||||||
|
"--parity",
|
||||||
|
default="N",
|
||||||
|
type=click.Choice(["N", "E", "O", "S", "M"]),
|
||||||
|
help="Set parity, default=N")
|
||||||
|
@click.option(
|
||||||
|
"--rtscts", is_flag=True, 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=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("--echo", is_flag=True, help="Enable local echo, default=Off")
|
||||||
|
@click.option(
|
||||||
|
"--encoding",
|
||||||
|
default="UTF-8",
|
||||||
|
help="Set the encoding for the serial port (e.g. hexlify, "
|
||||||
|
"Latin1, UTF-8), default: UTF-8")
|
||||||
|
@click.option("--filter", "-f", multiple=True, help="Add text transformation")
|
||||||
|
@click.option(
|
||||||
|
"--eol",
|
||||||
|
default="CRLF",
|
||||||
|
type=click.Choice(["CR", "LF", "CRLF"]),
|
||||||
|
help="End of line mode, default=CRLF")
|
||||||
|
@click.option(
|
||||||
|
"--raw", is_flag=True, help="Do not apply any encodings/transformations")
|
||||||
|
@click.option(
|
||||||
|
"--exit-char",
|
||||||
|
type=int,
|
||||||
|
default=3,
|
||||||
|
help="ASCII code of special character that is used to exit "
|
||||||
|
"the application, default=3 (Ctrl+C)")
|
||||||
|
@click.option(
|
||||||
|
"--menu-char",
|
||||||
|
type=int,
|
||||||
|
default=20,
|
||||||
|
help="ASCII code of special character that is used to "
|
||||||
|
"control miniterm (menu), default=20 (DEC)")
|
||||||
|
@click.option(
|
||||||
|
"--quiet",
|
||||||
|
is_flag=True,
|
||||||
|
help="Diagnostics: suppress non-error messages, default=Off")
|
||||||
|
def device_monitor(**kwargs):
|
||||||
|
if not kwargs['port']:
|
||||||
|
for item in get_serialports():
|
||||||
|
if "VID:PID" in item['hwid']:
|
||||||
|
kwargs['port'] = item['port']
|
||||||
|
break
|
||||||
|
|
||||||
@cli.command("monitor", short_help="Monitor device (Serial)")
|
sys.argv = ["monitor"]
|
||||||
@click.option("--port", "-p", help="Port, a number or a device name")
|
for k, v in kwargs.iteritems():
|
||||||
@click.option(
|
if k in ("port", "baud", "rts", "dtr"):
|
||||||
"--baud",
|
continue
|
||||||
"-b",
|
k = "--" + k.replace("_", "-")
|
||||||
type=int,
|
if isinstance(v, bool):
|
||||||
default=9600,
|
if v:
|
||||||
help="Set baud rate, default=9600")
|
sys.argv.append(k)
|
||||||
@click.option(
|
elif isinstance(v, tuple):
|
||||||
"--parity",
|
for i in v:
|
||||||
default="N",
|
sys.argv.extend([k, i])
|
||||||
type=click.Choice(["N", "E", "O", "S", "M"]),
|
else:
|
||||||
help="Set parity, default=N")
|
sys.argv.extend([k, str(v)])
|
||||||
@click.option(
|
|
||||||
"--rtscts",
|
|
||||||
is_flag=True,
|
|
||||||
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=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(
|
|
||||||
"--echo", is_flag=True, help="Enable local echo, default=Off")
|
|
||||||
@click.option(
|
|
||||||
"--encoding",
|
|
||||||
default="UTF-8",
|
|
||||||
help="Set the encoding for the serial port (e.g. hexlify, "
|
|
||||||
"Latin1, UTF-8), default: UTF-8")
|
|
||||||
@click.option(
|
|
||||||
"--filter", "-f", multiple=True, help="Add text transformation")
|
|
||||||
@click.option(
|
|
||||||
"--eol",
|
|
||||||
default="CRLF",
|
|
||||||
type=click.Choice(["CR", "LF", "CRLF"]),
|
|
||||||
help="End of line mode, default=CRLF")
|
|
||||||
@click.option(
|
|
||||||
"--raw",
|
|
||||||
is_flag=True,
|
|
||||||
help="Do not apply any encodings/transformations")
|
|
||||||
@click.option(
|
|
||||||
"--exit-char",
|
|
||||||
type=int,
|
|
||||||
default=3,
|
|
||||||
help="ASCII code of special character that is used to exit "
|
|
||||||
"the application, default=3 (Ctrl+C)")
|
|
||||||
@click.option(
|
|
||||||
"--menu-char",
|
|
||||||
type=int,
|
|
||||||
default=20,
|
|
||||||
help="ASCII code of special character that is used to "
|
|
||||||
"control miniterm (menu), default=20 (DEC)")
|
|
||||||
@click.option(
|
|
||||||
"--quiet",
|
|
||||||
is_flag=True,
|
|
||||||
help="Diagnostics: suppress non-error messages, default=Off")
|
|
||||||
def device_monitor(**kwargs):
|
|
||||||
if not kwargs['port']:
|
|
||||||
for item in get_serialports():
|
|
||||||
if "VID:PID" in item['hwid']:
|
|
||||||
kwargs['port'] = item['port']
|
|
||||||
break
|
|
||||||
|
|
||||||
sys.argv = ["monitor"]
|
try:
|
||||||
for k, v in kwargs.iteritems():
|
miniterm.main( # pylint: disable=E1123
|
||||||
if k in ("port", "baud", "rts", "dtr"):
|
default_port=kwargs['port'],
|
||||||
continue
|
default_baudrate=kwargs['baud'],
|
||||||
k = "--" + k.replace("_", "-")
|
default_rts=kwargs['rts'],
|
||||||
if isinstance(v, bool):
|
default_dtr=kwargs['dtr'])
|
||||||
if v:
|
except Exception as e: # pylint: disable=W0702
|
||||||
sys.argv.append(k)
|
raise MinitermException(e)
|
||||||
elif isinstance(v, tuple):
|
|
||||||
for i in v:
|
|
||||||
sys.argv.extend([k, i])
|
|
||||||
else:
|
|
||||||
sys.argv.extend([k, str(v)])
|
|
||||||
|
|
||||||
try:
|
|
||||||
miniterm.main( # pylint: disable=E1123
|
|
||||||
default_port=kwargs['port'],
|
|
||||||
default_baudrate=kwargs['baud'],
|
|
||||||
default_rts=kwargs['rts'],
|
|
||||||
default_dtr=kwargs['dtr'])
|
|
||||||
except Exception as e: # pylint: disable=W0702
|
|
||||||
raise MinitermException(e)
|
|
||||||
else:
|
|
||||||
|
|
||||||
@cli.command("monitor", short_help="Monitor device (Serial)")
|
|
||||||
@click.option("--port", "-p", help="Port, a number or a device name")
|
|
||||||
@click.option(
|
|
||||||
"--baud",
|
|
||||||
"-b",
|
|
||||||
type=int,
|
|
||||||
default=9600,
|
|
||||||
help="Set baud rate, default=9600")
|
|
||||||
@click.option(
|
|
||||||
"--parity",
|
|
||||||
default="N",
|
|
||||||
type=click.Choice(["N", "E", "O", "S", "M"]),
|
|
||||||
help="Set parity, default=N")
|
|
||||||
@click.option(
|
|
||||||
"--rtscts",
|
|
||||||
is_flag=True,
|
|
||||||
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=None,
|
|
||||||
type=click.Choice(["0", "1"]),
|
|
||||||
help="Set initial RTS line state, default=0")
|
|
||||||
@click.option(
|
|
||||||
"--dtr",
|
|
||||||
default=None,
|
|
||||||
type=click.Choice(["0", "1"]),
|
|
||||||
help="Set initial DTR line state, default=0")
|
|
||||||
@click.option(
|
|
||||||
"--echo", is_flag=True, help="Enable local echo, default=Off")
|
|
||||||
@click.option(
|
|
||||||
"--cr",
|
|
||||||
is_flag=True,
|
|
||||||
help="Do not send CR+LF, send CR only, default=Off")
|
|
||||||
@click.option(
|
|
||||||
"--lf",
|
|
||||||
is_flag=True,
|
|
||||||
help="Do not send CR+LF, send LF only, default=Off")
|
|
||||||
@click.option(
|
|
||||||
"--debug",
|
|
||||||
"-d",
|
|
||||||
count=True,
|
|
||||||
help="""Debug received data (escape non-printable chars)
|
|
||||||
# --debug can be given multiple times:
|
|
||||||
# 0: just print what is received
|
|
||||||
# 1: escape non-printable characters, do newlines as unusual
|
|
||||||
# 2: escape non-printable characters, newlines too
|
|
||||||
# 3: hex dump everything""")
|
|
||||||
@click.option(
|
|
||||||
"--exit-char",
|
|
||||||
type=int,
|
|
||||||
default=3,
|
|
||||||
help="ASCII code of special character that is used to exit "
|
|
||||||
"the application, default=3 (Ctrl+C)")
|
|
||||||
@click.option(
|
|
||||||
"--menu-char",
|
|
||||||
type=int,
|
|
||||||
default=20,
|
|
||||||
help="ASCII code of special character that is used to "
|
|
||||||
"control miniterm (menu), default=20 (DEC)")
|
|
||||||
@click.option(
|
|
||||||
"--quiet",
|
|
||||||
is_flag=True,
|
|
||||||
help="Diagnostics: suppress non-error messages, default=Off")
|
|
||||||
def device_monitor(**kwargs):
|
|
||||||
sys.argv = app.get_session_var("command_ctx").args[1:]
|
|
||||||
|
|
||||||
if not kwargs['port']:
|
|
||||||
for item in get_serialports():
|
|
||||||
if "VID:PID" in item['hwid']:
|
|
||||||
sys.argv += ["--port", item['port']]
|
|
||||||
break
|
|
||||||
|
|
||||||
try:
|
|
||||||
miniterm.main()
|
|
||||||
except Exception as e: # pylint: disable=W0702
|
|
||||||
raise MinitermException(e)
|
|
||||||
|
@ -20,7 +20,6 @@ from tempfile import mkdtemp
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
import click
|
import click
|
||||||
from serial import VERSION as PYSERIAL_VERSION
|
|
||||||
|
|
||||||
from platformio import exception, util
|
from platformio import exception, util
|
||||||
from platformio.commands.device import device_monitor as cmd_device_monitor
|
from platformio.commands.device import device_monitor as cmd_device_monitor
|
||||||
@ -85,151 +84,63 @@ def device_list(json_output):
|
|||||||
pioplus_call(sys.argv[1:])
|
pioplus_call(sys.argv[1:])
|
||||||
|
|
||||||
|
|
||||||
if int(PYSERIAL_VERSION[0]) == 3:
|
@remote_device.command("monitor", short_help="Monitor device (Serial)")
|
||||||
|
@click.option("--port", "-p", help="Port, a number or a device name")
|
||||||
@remote_device.command("monitor", short_help="Monitor device (Serial)")
|
@click.option(
|
||||||
@click.option("--port", "-p", help="Port, a number or a device name")
|
"--baud", "-b", type=int, default=9600, help="Set baud rate, default=9600")
|
||||||
@click.option(
|
@click.option(
|
||||||
"--baud",
|
"--parity",
|
||||||
"-b",
|
default="N",
|
||||||
type=int,
|
type=click.Choice(["N", "E", "O", "S", "M"]),
|
||||||
default=9600,
|
help="Set parity, default=N")
|
||||||
help="Set baud rate, default=9600")
|
@click.option(
|
||||||
@click.option(
|
"--rtscts", is_flag=True, help="Enable RTS/CTS flow control, default=Off")
|
||||||
"--parity",
|
@click.option(
|
||||||
default="N",
|
"--xonxoff",
|
||||||
type=click.Choice(["N", "E", "O", "S", "M"]),
|
is_flag=True,
|
||||||
help="Set parity, default=N")
|
help="Enable software flow control, default=Off")
|
||||||
@click.option(
|
@click.option(
|
||||||
"--rtscts",
|
"--rts",
|
||||||
is_flag=True,
|
default=None,
|
||||||
help="Enable RTS/CTS flow control, default=Off")
|
type=click.Choice(["0", "1"]),
|
||||||
@click.option(
|
help="Set initial RTS line state")
|
||||||
"--xonxoff",
|
@click.option(
|
||||||
is_flag=True,
|
"--dtr",
|
||||||
help="Enable software flow control, default=Off")
|
default=None,
|
||||||
@click.option(
|
type=click.Choice(["0", "1"]),
|
||||||
"--rts",
|
help="Set initial DTR line state")
|
||||||
default=None,
|
@click.option("--echo", is_flag=True, help="Enable local echo, default=Off")
|
||||||
type=click.Choice(["0", "1"]),
|
@click.option(
|
||||||
help="Set initial RTS line state")
|
"--encoding",
|
||||||
@click.option(
|
default="UTF-8",
|
||||||
"--dtr",
|
help="Set the encoding for the serial port (e.g. hexlify, "
|
||||||
default=None,
|
"Latin1, UTF-8), default: UTF-8")
|
||||||
type=click.Choice(["0", "1"]),
|
@click.option("--filter", "-f", multiple=True, help="Add text transformation")
|
||||||
help="Set initial DTR line state")
|
@click.option(
|
||||||
@click.option(
|
"--eol",
|
||||||
"--echo", is_flag=True, help="Enable local echo, default=Off")
|
default="CRLF",
|
||||||
@click.option(
|
type=click.Choice(["CR", "LF", "CRLF"]),
|
||||||
"--encoding",
|
help="End of line mode, default=CRLF")
|
||||||
default="UTF-8",
|
@click.option(
|
||||||
help="Set the encoding for the serial port (e.g. hexlify, "
|
"--raw", is_flag=True, help="Do not apply any encodings/transformations")
|
||||||
"Latin1, UTF-8), default: UTF-8")
|
@click.option(
|
||||||
@click.option(
|
"--exit-char",
|
||||||
"--filter", "-f", multiple=True, help="Add text transformation")
|
type=int,
|
||||||
@click.option(
|
default=3,
|
||||||
"--eol",
|
help="ASCII code of special character that is used to exit "
|
||||||
default="CRLF",
|
"the application, default=3 (Ctrl+C)")
|
||||||
type=click.Choice(["CR", "LF", "CRLF"]),
|
@click.option(
|
||||||
help="End of line mode, default=CRLF")
|
"--menu-char",
|
||||||
@click.option(
|
type=int,
|
||||||
"--raw",
|
default=20,
|
||||||
is_flag=True,
|
help="ASCII code of special character that is used to "
|
||||||
help="Do not apply any encodings/transformations")
|
"control miniterm (menu), default=20 (DEC)")
|
||||||
@click.option(
|
@click.option(
|
||||||
"--exit-char",
|
"--quiet",
|
||||||
type=int,
|
is_flag=True,
|
||||||
default=3,
|
help="Diagnostics: suppress non-error messages, default=Off")
|
||||||
help="ASCII code of special character that is used to exit "
|
@click.pass_context
|
||||||
"the application, default=3 (Ctrl+C)")
|
def device_monitor(ctx, **kwargs):
|
||||||
@click.option(
|
|
||||||
"--menu-char",
|
|
||||||
type=int,
|
|
||||||
default=20,
|
|
||||||
help="ASCII code of special character that is used to "
|
|
||||||
"control miniterm (menu), default=20 (DEC)")
|
|
||||||
@click.option(
|
|
||||||
"--quiet",
|
|
||||||
is_flag=True,
|
|
||||||
help="Diagnostics: suppress non-error messages, default=Off")
|
|
||||||
@click.pass_context
|
|
||||||
def device_monitor(ctx, **kwargs):
|
|
||||||
_device_monitor(ctx, **kwargs)
|
|
||||||
else:
|
|
||||||
|
|
||||||
@remote_device.command("monitor", short_help="Monitor device (Serial)")
|
|
||||||
@click.option("--port", "-p", help="Port, a number or a device name")
|
|
||||||
@click.option(
|
|
||||||
"--baud",
|
|
||||||
"-b",
|
|
||||||
type=int,
|
|
||||||
default=9600,
|
|
||||||
help="Set baud rate, default=9600")
|
|
||||||
@click.option(
|
|
||||||
"--parity",
|
|
||||||
default="N",
|
|
||||||
type=click.Choice(["N", "E", "O", "S", "M"]),
|
|
||||||
help="Set parity, default=N")
|
|
||||||
@click.option(
|
|
||||||
"--rtscts",
|
|
||||||
is_flag=True,
|
|
||||||
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=None,
|
|
||||||
type=click.Choice(["0", "1"]),
|
|
||||||
help="Set initial RTS line state, default=0")
|
|
||||||
@click.option(
|
|
||||||
"--dtr",
|
|
||||||
default=None,
|
|
||||||
type=click.Choice(["0", "1"]),
|
|
||||||
help="Set initial DTR line state, default=0")
|
|
||||||
@click.option(
|
|
||||||
"--echo", is_flag=True, help="Enable local echo, default=Off")
|
|
||||||
@click.option(
|
|
||||||
"--cr",
|
|
||||||
is_flag=True,
|
|
||||||
help="Do not send CR+LF, send CR only, default=Off")
|
|
||||||
@click.option(
|
|
||||||
"--lf",
|
|
||||||
is_flag=True,
|
|
||||||
help="Do not send CR+LF, send LF only, default=Off")
|
|
||||||
@click.option(
|
|
||||||
"--debug",
|
|
||||||
"-d",
|
|
||||||
count=True,
|
|
||||||
help="""Debug received data (escape non-printable chars)
|
|
||||||
# --debug can be given multiple times:
|
|
||||||
# 0: just print what is received
|
|
||||||
# 1: escape non-printable characters, do newlines as unusual
|
|
||||||
# 2: escape non-printable characters, newlines too
|
|
||||||
# 3: hex dump everything""")
|
|
||||||
@click.option(
|
|
||||||
"--exit-char",
|
|
||||||
type=int,
|
|
||||||
default=3,
|
|
||||||
help="ASCII code of special character that is used to exit "
|
|
||||||
"the application, default=3 (Ctrl+C)")
|
|
||||||
@click.option(
|
|
||||||
"--menu-char",
|
|
||||||
type=int,
|
|
||||||
default=20,
|
|
||||||
help="ASCII code of special character that is used to "
|
|
||||||
"control miniterm (menu), default=20 (DEC)")
|
|
||||||
@click.option(
|
|
||||||
"--quiet",
|
|
||||||
is_flag=True,
|
|
||||||
help="Diagnostics: suppress non-error messages, default=Off")
|
|
||||||
@click.pass_context
|
|
||||||
def device_monitor(ctx, **kwargs):
|
|
||||||
_device_monitor(ctx, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
def _device_monitor(ctx, **kwargs):
|
|
||||||
|
|
||||||
def _tx_target(sock_dir):
|
def _tx_target(sock_dir):
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user