diff --git a/pyserial-master.zip b/pyserial-master.zip deleted file mode 100644 index 1074a78..0000000 Binary files a/pyserial-master.zip and /dev/null differ diff --git a/pyserial-master/pyserial-master/.gitignore b/pyserial-master/pyserial-master/.gitignore deleted file mode 100644 index fdbfde0..0000000 --- a/pyserial-master/pyserial-master/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -**/__pycache__ -*.pyc -*.pyo -documentation/_build -build -dist -*.egg-info - -/MANIFEST - -.idea -venv -xxx* diff --git a/pyserial-master/pyserial-master/.travis.yml b/pyserial-master/pyserial-master/.travis.yml deleted file mode 100644 index ff48704..0000000 --- a/pyserial-master/pyserial-master/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright Roger Meier -# SPDX-License-Identifier: BSD-3-Clause - -language: python - -python: - - 2.7 - - 3.4 - - 3.5 - - 3.6 - - pypy - - pypy3 - -script: - - python setup.py install - - python test/run_all_tests.py loop:// diff --git a/pyserial-master/pyserial-master/CHANGES.rst b/pyserial-master/pyserial-master/CHANGES.rst deleted file mode 100644 index ab5a1d5..0000000 --- a/pyserial-master/pyserial-master/CHANGES.rst +++ /dev/null @@ -1,825 +0,0 @@ -======================== - pySerial Release Notes -======================== - -Version 1.0 13 Feb 2002 ---------------------------- -- First public release. -- Split from the pybsl application (see http://mspgcc.sourceforge.net) - -New Features: - -- Added Jython support - - -Version 1.1 14 Feb 2002 ---------------------------- -Bugfixes: - -- Win32, when not specifying a timeout -- Typos in the Docs - -New Features: - -- added ``serialutil`` which provides a base class for the ``Serial`` - objects. - -- ``readline``, ``readlines``, ``writelines`` and ``flush`` are now supported - see README.txt for deatils. - - -Version 1.11 14 Feb 2002 ---------------------------- -Same as 1.1 but added missing files. - - -Version 1.12 18 Feb 2002 ---------------------------- -Removed unneeded constants to fix RH7.x problems. - - -Version 1.13 09 Apr 2002 ---------------------------- -Added alternate way for enabling rtscts (CNEW_RTSCTS is tried too) -If port opening fails, a ``SerialException`` is raised on all platforms - - -Version 1.14 29 May 2002 ---------------------------- -Added examples to archive -Added non-blocking mode for ``timeout=0`` (tnx Mat Martineau) - -Bugfixes: - -- win32 does now return the remaining characters on timeout - - -Version 1.15 04 Jun 2002 ---------------------------- -Bugfixes (win32): - -- removed debug messages -- compatibility to win9x improved - - -Version 1.16 02 Jul 2002 ---------------------------- -Added implementation of RI and corrected RTS/CTS on Win32 - - -Version 1.17 03 Jul 2002 ---------------------------- -Silly mix of two versions in win32 code corrected - - -Version 1.18 06 Dec 2002 ---------------------------- -Bugfixes (general): - -- remove the mapping of flush to the destructive flushOutput as - this is not the expected behaviour. -- readline: EOL character for lines can be chosen idea by - John Florian. - -Bugfixes (posix): - -- cygwin port numbering fixed -- test each and every constant for it's existence in termios module, - use default if not existent (fix for Bug item #640214) -- wrong exception on nonexistent ports with /dev file. bug report - by Louis Cordier - -Bugfixes (win32): - -- RTS/CTS handling as suggested in Bug #635072 -- bugfix of timeouts brought up by Markus Hoffrogge - - -Version 1.19 19 Mar 2003 ---------------------------- -Bugfixes (posix): - -- removed ``dgux`` entry which actually had a wrong comment and is - probably not in use anywhere. - -Bugfixes (win32): - -- added ``int()`` conversion, [Bug 702120] -- remove code to set control lines in close method of win32 - version. [Bug 669625] - - -Version 1.20 28 Aug 2003 ---------------------------- -- Added ``serial.device()`` for all platforms - -Bugfixes (win32): - -- don't recreate overlapped structures and events on each - read/write. -- don't set unneeded event masks. -- don't use DOS device names for ports > 9. -- remove send timeout (it's not used in the linux impl. anyway). - - -Version 1.21 30 Sep 2003 ---------------------------- -Bugfixes (win32): - -- name for COM10 was not built correctly, found by Norm Davis. - -Bugfixes (examples): - -- small change in ``miniterm.py`` that should mage it run on cygwin, - [Bug 809904] submitted by Rolf Campbell. - - -Version 2.0b1 1 Oct 2003 ---------------------------- -Transition to the Python 2.0 series: - -- New implementation only supports Python 2.2+, backwards compatibility - should be maintained almost everywhere. - The OS handles (like the ``hComPort`` or ``fd`` attribute) were prefixed - with an underscore. The different names stay, as anyone that uses one of - these has to write platform specific code anyway. -- Common base class ``serialutil.SerialBase`` for all implementations. -- ``PARITY_NONE``, ``PARITY_EVEN``, ``PARITY_ODD`` constants changed and all - these constants moved to ``serialutil.py`` (still available as - ``serial.PARITY_NONE`` etc. and they should be used that way) -- Added ``serial.PARITY_NAMES`` (implemented in ``serialutil.PARITY_NAMES``). - This dictionary can be used to convert parity constants to meaningful - strings. -- Each Serial class and instance has a list of supported values: - ``BAUDRATES``, ``BYTESIZES``, ``PARITIES``, ``STOPBITS``Ggg - (i.e. ``serial.Serial.BAUDRATES or s = serial.Serial; s.BAUDRATES``) - these values can be used to fill in value sin GUI dialogs etc. -- Creating a ``Serial()`` object without port spec returns an unconfigured, - closed port. Useful if a GUI dialog should take a port and configure - it. -- New methods for ``serial.Serial`` instances: ``open()``, ``isOpen()`` -- A port can be opened and closed as many times as desired. -- Instances of ``serial.Serial`` have ``baudrate``, ``bytesize``, ``timeout`` - etc. attributes implemented as properties, all can be set while the port is - opened. It will then be reconfigured. -- Improved ``__doc__``'s. -- New ``test_advanced.py`` for the property setting/getting testing. -- Small bugfix on posix with get* methods (return value should be true a - boolean). -- added a ``__repr__`` that returns a meaningful string will all the serial - setting, easy for debugging. -- The serialposix module does not throw an exception on unsupported - platforms, the message is still printed. The idea that it may still - work even if the platform itself s not known, it simply tries to do - the posix stuff anyway (It's likely that opening ports by number - fails, but by name it should work). - - -Version 2.0b2 4 Oct 2003 ---------------------------- -- Added serial port configuration dialog for wxPython to the examples. -- Added terminal application for wxPython with wxGlade design file - to the examples. -- Jython support is currently broken as Jython does not have a Python 2.2 - compatible release out yet - - -Version 2.0 6 Nov 2003 ---------------------------- -- Fixes ``setup.py`` for older distutils - - -Version 2.1 28 Jul 2004 ---------------------------- -Bugfixes: - -- Fix XON/XOFF values [Bug 975250] - -Bugfixes (posix): - -- ``fd == 0`` fix from Vsevolod Lobko -- netbsd fixes from Erik Lindgren -- Dynamically lookup baudrates and some cleanups - -Bugfixes (examples): - -- CRLF handling of ``miniterm.py`` should be more consistent on Win32 - and others. Added LF only command line option -- Multithreading fixes to ``wxTerminal.py`` (helps with wxGTK) -- Small change for wxPython 2.5 in ``wxSerialConfigDialog.py`` [Bug 994856] - -New Features: - -- Implement write timeouts (``writeTimeout`` parameter) - - -Version 2.2 31 Jul 2005 ---------------------------- -Bugfixes: - -- [Bug 1014227]: property broken -- [Bug 1105687]: ``serial_tcp_example.py``: ``--localport`` option -- [Bug 1106313]: device (port) strings cannot be unicode - -Bugfixes (posix): - -- [Patch 1043436] Fix for [Bug 1043420] (OSError: EAGAIN) -- [Patch 1102700] ``fileno()`` added -- ensure disabled PARMRK - -Bugfixes (win32): - -- [Patch 983106]: keep RTS/CTS state on port setting changes - -New Features: - -- ``dsrdtr`` setting to enable/disable DSR/DTR flow control independently - from the ``rtscts`` setting. (Currently Win32 only, ignored on other - platforms) - - -Version 2.3 19 Jun 2008 ---------------------------- -New Features: - -- iterator interface. ``for line in Serial(...): ...`` is now possible - Suggested by Bernhard Bender -- ``sendBreak()`` accepts a ``duration`` argument. Default duration increased. -- win32 handles \\.\COMx format automatically for com ports of higher number - (COM10 is internally translated to \\.\COM10 etc.) -- miniterm.py has a new feature to send a file (upload) and configurable - special characters for exit and upload. Refactored internals to class based - structure (upload and class refactoring by Colin D Bennett) - -Bugfixes: - -- [Bug 1451535] TCP/serial redirect example "--help" -- update VERSION variable -- update wxSerialConfigDialog.py and wxTerminal.py compatibility with - wxPython 2.8 (Peleg) -- Check for string in write function. Using unicode causes errors, this - helps catching errors early (Tom Lynn) - -Bugfixes (posix): - -- [Bug 1554183] setRTS/setDTR reference to non existing local "on" -- [Bug 1513653] file descriptor not closed when exception is thrown -- FreeBSD now uses cuadX instead of cuaaX (Patrick Phalen) - -Bugfixes (win32): - -- [Bug 1520357] Handle leak -- [Bug 1679013] Ignore exception raised by SetCommTimeout() in close(). -- [Bug 1938118] process hang forever under XP - - -Version 2.4 6 Jul 2008 ---------------------------- -New Features: - -- [Patch 1616790] pyserial: Add inter-character timeout feature -- [Patch 1924805] add a setBreak function -- Add mark/space parity -- Add .NET/Mono backend (IronPython) - -Bugfixes (posix): - -- [Bug 1783159] Arbitrary baud rates (Linux/Posix) - -Bugfixes (win32): - -- [Patch 1561423] Add mark/space parity, Win32 -- [Bug 2000771] serial port CANNOT be specified by number on windows -- examples/scanwin32.py does no longer return \\.\ names -- fix \\.\ handling for some cases - -Bugfixes (jython): - - - The Jython backend tries javax.comm and gnu.io (Seo Sanghyeon) - - -Version 2.5-rc1 2009-07-30 ---------------------------- -New Features: - -- Python 3.x support (through 2to3) -- compatible with Python io library (Python 2.6+) -- Support for Win32 is now written on the top of ctypes (bundled with - Python 2.5+) instead of pywin32 (patch by Giovanni Bajo). -- 1.5 stop bits (STOPBITS_ONE_POINT_FIVE, implemented on all platforms) -- miniterm application extended (CTRL+T -> menu) -- miniterm.py is now installed as "script" -- add scanlinux.py example -- add port_publisher example -- experimental RFC-2217 server support (examples/rfc2217_server.py) -- add ``getSettingsDict`` and ``applySettingsDict`` serial object methods -- use a ``poll`` based implementation on Posix, instead of a ``select`` based, - provides better error handling [removed again in later releases]. - -Bugfixes: - -- Improve and fix tcp_serial_redirector example. -- [Bug 2603052] 5-bit mode (needs 1.5 stop bits in some cases) - -Bugfixes (posix): - -- [Bug 2810169] Propagate exceptions raised in serialposix _reconfigure -- [Bug 2562610] setting non standard baud rates on Darwin (Emmanuel Blot) - -Bugfixes (win32): - -- [Bug 2469098] parity PARITY_MARK, PARITY_SPACE isn't supported on win32 -- [SF 2446218] outWaiting implemented -- [Bug 2392892] scanwin32.py better exception handling -- [Bug 2505422] scanwin32.py Vista 64bit compatibility - - -Version 2.5-rc2 2010-01-02 ---------------------------- -New Features: - -- Documentation update, now written with Sphinx/ReST -- Updated miniterm.py example -- experimental RFC-2217 client support (serial.rfc2217.Serial, see docs) -- add ``loop://`` device for testing. -- add ``serial.serial_for_url`` factory function (support for native ports and - ``rfc2217``, ``socket`` and ``loop`` URLs) -- add new example: ``rfc2217_server.py`` -- tests live in their own directory now (no longer in examples) - -Bugfixes: - -- [Bug 2915810] Fix for suboption parsing in rfc2217 -- Packaging bug (missed some files) - -Bugfixes (posix): - -- improve write timeout behavior -- [Bug 2836297] move Linux specific constants to not break other platforms -- ``poll`` based implementation for ``read`` is in a separate class - ``PosixPollSerial``, as it is not supported well on all platforms (the - default ``Serial`` class uses select). -- changed error handling in ``read`` so that disconnected devices are - detected. - - -Bugfixes (win32): - -- [Bug 2886763] hComPort doesn't get initialized for Serial(port=None) - - -Version 2.5 2010-07-22 ---------------------------- -New Features: - -- [Bug 2976262] dsrdtr should default to False - ``dsrdtr`` parameter default value changed from ``None`` (follow ``rtscts`` - setting) to ``False``. This means ``rtscts=True`` enables hardware flow - control on RTS/CTS but no longer also on DTR/DSR. This change mostly - affects Win32 as on other platforms, that setting was ignored anyway. -- Improved xreadlines, it is now a generator function that yields lines as they - are received (previously it called readlines which would only return all - lines read after a read-timeout). However xreadlines is deprecated and not - available when the io module is used. Use ``for line in Serial(...):`` - instead. - -Bugfixes: - -- [Bug 2925854] test.py produces exception with python 3.1 -- [Bug 3029812] 2.5rc2 readline(s) doesn't work - -Bugfixes (posix): - -- [BUG 3006606] Nonblocking error - Unix platform - -Bugfixes (win32): - -- [Bug 2998169] Memory corruption at faster transmission speeds. - (bug introduced in 2.5-rc1) - - -Version 2.6 2011-11-02 ---------------------------- -New Features: - -- Moved some of the examples to serial.tools so that they can be used - with ``python -m`` -- serial port enumeration now included as ``serial.tools.list_ports`` -- URL handlers for ``serial_for_url`` are now imported dynamically. This allows - to add protocols w/o editing files. The list - ``serial.protocol_handler_packages`` can be used to add or remove user - packages with protocol handlers (see docs for details). -- new URL type: hwgrep:// uses list_ports module to search for ports - by their description -- several internal changes to improve Python 3.x compatibility (setup.py, - use of absolute imports and more) - -Bugfixes: - -- [Bug 3093882] calling open() on an already open port now raises an exception -- [Bug 3245627] connection-lost let rfc2217 hangs in closed loop -- [Patch 3147043] readlines() to support multi-character eol - -Bugfixes (posix): - -- [Patch 3316943] Avoid unneeded termios.tcsetattr calls in serialposix.py -- [Patch 2912349] Serial Scan as a Module with Mac Support - -Bugfixes (win32): - -- [Bug 3057499] writeTimeoutError when write Timeout is 0 -- [Bug 3414327] Character out of range in list_ports_windows -- [Patch 3036175] Windows 98 Support fix -- [Patch 3054352] RTS automatic toggle, for RS485 functionality. -- Fix type definitions for 64 bit Windows compatibility - - -Version 2.7 2013-10-17 ---------------------------- -- Win32: setRTS and setDTR can be called before the port is opened and it will - set the initial state on port open. -- Posix: add platform specific method: outWaiting (already present for Win32) -- Posix: rename flowControl to setXON to match name on Win32, add - flowControlOut function -- rfc2217: zero polls value (baudrate, data size, stop bits, parity) (Erik - Lundh) -- Posix: [Patch pyserial:28] Accept any speed on Linux [update] -- Posix: [Patch pyserial:29] PosixSerial.read() should "ignore" errno.EINTR -- OSX: [Patch pyserial:27] Scan by VendorID/Product ID for USB Serial devices -- Ensure working with bytes in write() calls - -Bugfixes: - -- [Bug 3540332] SerialException not returned -- [Bug pyserial:145] Error in socket_connection.py -- [Bug pyserial:135] reading from socket with timeout=None causes TypeError -- [Bug pyserial:130] setup.py should not append py3k to package name -- [Bug pyserial:117] no error on lost conn w/socket:// - -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 -- [Bug pyserial:141] open: Pass errno from IOError to SerialException -- [Bug pyserial:125] Undefined 'base' on list_ports_posix.py, function usb_lsusb -- [Bug pyserial:151] Serial.write() without a timeout uses 100% CPU on POSIX -- [Patch pyserial:30] [PATCH 1/1] serial.Serial() should not raise IOError. - -Bugfixes (win32): - -- [Bug 3444941] ctypes.WinError() unicode error -- [Bug 3550043] on Windows in tools global name 'GetLastError' is not defined -- [Bug pyserial:146] flush() does nothing in windows (despite docs) -- [Bug pyserial:144] com0com ports ignored due to missing "friendly name" -- [Bug pyserial:152] Cannot configure port, some setting was wrong. Can leave - port handle open but port not accessible - - -Version 3.0a0 2015-09-22 --------------------------- -- Starting from this release, only Python 2.7 and 3.2 (or newer) are supported. - The source code is compatible to the 2.x and 3.x series without any changes. - The support for earlier Python versions than 2.7 is removed, please refer to - the pyserial-legacy (V2.x) series if older Python versions are a - requirement). -- Development moved to github, update links in docs. -- API changes: properties for ``rts``, ``dtr``, ``cts``, ``dsr``, ``cd``, ``ri``, - ``in_waiting`` (instead of get/set functions) -- remove file ``FileLike`` class, add ``read_until`` and ``iread_until`` to - ``SerialBase`` -- RS485 support changed (``rts_toggle`` removed, added ``serial.rs485`` module - and ``rs485_mode`` property) -- ``socket://`` and ``rfc2217://`` handlers use the IPv6 compatible - ``socket.create_connection`` -- New URL handler: ``spy:://``. -- URL handlers now require the proper format (``?`` and ``&``) for arguments - instead of ``/`` (e.g. ``rfc2217://localhost:7000?ign_set_control&timeout=5.5``) -- Remove obsolete examples. -- Finish update to BSD license. -- Use setuptools if available, fall back to distutils if unavailable. -- miniterm: changed command line options -- miniterm: support encodings on serial port -- miniterm: new transformations, by default escape/convert all control characters -- list_ports: improved, added USB location (Linux, Win32) -- refactored code -- [FTR pyserial:37] Support fileno() function in the socket protocol -- Posix: [Patch pyserial:31] Mark/space parity on Linux -- Linux: [Patch pyserial:32] Module list_ports for linux should include the - product information as description. -- Java: fix 2 bugs (stop bits if/else and non-integer timeouts) (Torsten - Roemer) -- Update wxSerialConfigDialog.py to use serial.tools.list_ports. -- [Patch pyserial:34] Improvements to port_publisher.py example -- [Feature pyserial:39] Support BlueTooth serial port discovery on Linux - -Bugfixes: - -- [Bug pyserial:157] Implement inWaiting in protocol_socket -- [Bug pyserial:166] RFC2217 connections always fail -- [Bug pyserial:172] applySettingsDict() throws an error if the settings dictionary is not complete -- [Bug pyserial:185] SocketSerial.read() never returns data when timeout==0 - -Bugfixes (posix): - -- [Bug pyserial:156] PosixSerial.open raises OSError rather than - SerialException when port open fails -- [Bug pyserial:163] serial.tools.list_ports.grep() fails if it encounters None type -- fix setXON -- [Patch pyserial:36 / 38] Make USB information work in python 3.4 and 2.7 -- clear OCRNL/ONLCR flags (CR/LF translation settings) -- [Feature pyserial:38] RS485 Support -- [Bug pyserial:170] list_ports_posix not working properly for Cygwin -- [Bug pyserial:187] improve support for FreeBSD (list_ports_posix) - -Bugfixes (win32): - -- [Bug pyserial:169] missing "import time" in serialwin32.py - -Bugfixes (cli): - -- [Bug pyserial:159] write() in serialcli.py not working with IronPython 2.7.4 - - -Version 3.0b1 2015-10-19 --------------------------- -- list_ports: add ``vid``, ``pid``, ``serial_number``, ``product``, - ``manufacturer`` and ``location`` attribute for USB devices. -- list_ports: update OSX implementation. -- list_ports: Raspberry Pi: internal port is found. -- serial_for_url: fix import (multiple packages in list) -- threaded: added new module implementing a reader thread -- tweak examples/wx* -- posix: add experimental implementation ``VTIMESerial`` -- new URL handler ``alt://`` to select alternative implementations - - -Version 3.0 2015-12-28 ------------------------- -- minor fixes to setup.py (file list), inter_byte_timeout (not stored when - passed to __init__), rfc2217 (behavior of close when open failed), - list_ports (__str__), loop://, renamed ReaderThread -- hwgrep:// added options to pick n'th port, skip busy ports -- miniterm: --ask option added - -Bugfixes (posix): - -- [#26/#30] always call tcsettattr on open -- [#42] fix disregard read timeout if there is more data -- [#45] check for write timeout, even if EAGAIN was raised - -Bugfixes (win32): - -- [#27] fix race condition in ``read()``, fix minimal timeout issue -- race condition in nonblocking case -- [#49] change exception type in case SetCommState fails -- [#50] fixed issue with 0 timeout on windows 10 - - -Version 3.0.1 2016-01-11 --------------------------- -- special case for FDTIBUS in list_ports on win32 (#61) - -Bugfixes: - -- ``Serial`` keyword arguments, more on backward compatibility, fix #55 -- list_ports: return name if product is None, fix for #54 -- port_publisher: restore some sorting of ports - - -Version 3.1.0 2016-05-27 --------------------------- -Improvements: - -- improve error handling in ``alt://`` handler -- ``socket://`` internally used select, improves timeout behavior -- initial state of RTS/DTR: ignore error when setting on open posix - (support connecting to pty's) -- code style updates -- posix: remove "number_to_device" which is not called anymore -- add cancel_read and cancel_write to win32 and posix implementations - -Bugfixes: - -- [#68] aio: catch errors and close connection -- [#87] hexlify: update codec for Python 2 -- [#100] setPort not implemented -- [#101] bug in serial.threaded.Packetizer with easy fix -- [#104] rfc2217 and socket: set timeout in create_connection -- [#107] miniterm.py fails to exit on failed serial port - -Bugfixes (posix): - -- [#59] fixes for RTS/DTR handling on open -- [#77] list_ports_osx: add missing import -- [#85] serialposix.py _set_rs485_mode() tries to read non-existing - rs485_settings.delay_rts_before_send -- [#96] patch: native RS485 is never enabled - -Bugfixes (win32): - -- fix bad super call and duplicate old-style __init__ call -- [#80] list_ports: Compatibility issue between Windows/Linux - - -Version 3.1.1 2016-06-12 --------------------------- -Improvements: - -- deprecate ``nonblocking()`` method on posix, the port is already in this - mode. -- style: use .format() in various places instead of "%" formatting - -Bugfixes: - -- [#122] fix bug in FramedPacket -- [#127] The Serial class in the .NET/Mono (IronPython) backend does not - implement the _reconfigure_port method -- [#123, #128] Avoid Python 3 syntax in aio module - -Bugfixes (posix): - -- [#126] PATCH: Check delay_before_tx/rx for None in serialposix.py -- posix: retry if interrupted in Serial.read - -Bugfixes (win32): - -- win32: handle errors of GetOverlappedResult in read(), fixes #121 - - -Version 3.2.0 2016-10-14 --------------------------- -See 3.2.1, this one missed a merge request related to removing aio. - - -Version 3.2.1 2016-10-14 --------------------------- -Improvements: - -- remove ``serial.aio`` in favor of separate package, ``pyserial-asyncio`` -- add client mode to example ``tcp_serial_redirect.py`` -- use of monotonic clock for timeouts, when available (Python 3.3 and up) -- [#169] arbitrary baud rate support for BSD family -- improve tests, improve ``loop://`` - -Bugfixes: - -- [#137] Exception while cancel in miniterm (python3) -- [#143] Class Serial in protocol_loop.py references variable before assigning - to it -- [#149] Python 3 fix for threaded.FramedPacket - -Bugfixes (posix): - -- [#133] _update_dtr_state throws Inappropriate ioctl for virtual serial - port created by socat on OS X -- [#157] Broken handling of CMSPAR in serialposix.py - -Bugfixes (win32): - -- [#144] Use Unicode API for list_ports -- [#145] list_ports_windows: support devices with only VID -- [#162] Write in non-blocking mode returns incorrect value on windows - - -Version 3.3 2017-03-08 ------------------------- -Improvements: - -- [#206] Exclusive access on POSIX. ``exclusive`` flag added. -- [#172] list_ports_windows: list_ports with 'manufacturer' info property -- [#174] miniterm: change cancel impl. for console -- [#182] serialutil: add overall timeout for read_until -- socket: use non-blocking socket and new Timeout class -- socket: implement a functional a reset_input_buffer -- rfc2217: improve read timeout implementation -- win32: include error message from system in ClearCommError exception -- and a few minor changes, docs - -Bugfixes: - -- [#183] rfc2217: Fix broken calls to to_bytes on Python3. -- [#188] rfc2217: fix auto-open use case when port is given as parameter - -Bugfixes (posix): - -- [#178] in read, count length of converted data -- [#189] fix return value of write - -Bugfixes (win32): - -- [#194] spurious write fails with ERROR_SUCCESS - - -Version 3.4 2017-07-22 ------------------------- -Improvements: - -- miniterm: suspend function (temporarily release port, :kbd:`Ctrl-T s`) -- [#240] context manager automatically opens port on ``__enter__`` -- [#141] list_ports: add interface number to location string -- [#225] protocol_socket: Retry if ``BlockingIOError`` occurs in - ``reset_input_buffer``. - -Bugfixes: - -- [#153] list_ports: option to include symlinked devices -- [#237] list_ports: workaround for special characters in port names - -Bugfixes (posix): - -- allow calling cancel functions w/o error if port is closed -- [#220] protocol_socket: sync error handling with posix version -- [#227] posix: ignore more blocking errors and EINTR, timeout only - applies to blocking I/O -- [#228] fix: port_publisher typo - - -Version 3.5b0 2020-09-21 ------------------------- -New Features: - -- [#411] Add a backend for Silicon Labs CP2110/4 HID-to-UART bridge. - (depends on `hid` module) - -Improvements: - -- [#315] Use absolute import everywhere -- [#351] win32: miniterm Working CMD.exe terminal using Windows 10 ANSI support -- [#354] Make ListPortInfo hashable -- [#372] threaded: "write" returns byte count -- [#400] Add bytesize and stopbits argument parser to tcp_serial_redirect -- [#408] loop: add out_waiting -- [#495] list_ports_linux: Correct "interface" property on Linux hosts -- [#500] Remove Python 3.2 and 3.3 from test -- [#261, #285, #296, #320, #333, #342, #356, #358, #389, #397, #510] doc updates -- miniterm: add :kbd:`CTRL+T Q` as alternative to exit -- miniterm: suspend function key changed to :kbd:`CTRL-T Z` -- add command line tool entries ``pyserial-miniterm`` (replaces ``miniterm.py``) - and ``pyserial-ports`` (runs ``serial.tools.list_ports``). -- ``python -m serial`` opens miniterm (use w/o args and it will print port - list too) [experimental] - -Bugfixes: - -- [#371] Don't open port if self.port is not set while entering context manager -- [#437, #502] refactor: raise new instances for PortNotOpenError and SerialTimeoutException -- [#261, #263] list_ports: set default `name` attribute -- [#286] fix: compare only of the same type in list_ports_common.ListPortInfo -- rfc2217/close(): fix race-condition -- [#305] return b'' when connection closes on rfc2217 connection -- [#386] rfc2217/close(): fix race condition -- Fixed flush_input_buffer() for situations where the remote end has closed the socket. -- [#441] reset_input_buffer() can hang on sockets -- examples: port_publisher python 3 fixes -- [#324] miniterm: Fix miniterm constructor exit_character and menu_character -- [#326] miniterm: use exclusive access for native serial ports by default -- [#497] miniterm: fix double use of CTRL-T + s use z for suspend instead -- [#443, #444] examples: refactor wx example, use Bind to avoid deprecated - warnings, IsChecked, unichr - -Bugfixes (posix): - -- [#265] posix: fix PosixPollSerial with timeout=None and add cancel support -- [#290] option for low latency mode on linux -- [#335] Add support to xr-usb-serial ports -- [#494] posix: Don't catch the SerialException we just raised -- [#519] posix: Fix custom baud rate to not temporarily set 38400 baud rates on linux -- [#509 #518] list_ports: use hardcoded path to library on osx - -Bugfixes (win32): - -- [#481] win32: extend RS485 error messages -- [#303] win32: do not check for links in serial.tools.list_ports -- [#430] Add WaitCommEvent function to win32 -- [#314, #433] tools/list_ports_windows: Scan both 'Ports' and 'Modem' device classes -- [#414] Serial number support for composite USB devices -- Added recursive search for device USB serial number to support composite devices - -Bugfixes (MacOS): - -- [#364] MacOS: rework list_ports to support unicode product descriptors. -- [#367] Mac and bsd fix _update_break_state - - -Version 3.5 2020-11-23 ----------------------- -See above (3.5b0) for what's all new in this release - -Bugfixes: - -- spy: ensure bytes in write() - -Bugfixes (posix): - -- [#540] serialposix: Fix inconsistent state after exception in open() - -Bugfixes (win32): - -- [#530] win32: Fix exception for composite serial number search on Windows - -Bugfixes (MacOS): - -- [#542] list_ports_osx: kIOMasterPortDefault no longer exported on Big Sur -- [#545, #545] list_ports_osx: getting USB info on BigSur/AppleSilicon diff --git a/pyserial-master/pyserial-master/LICENSE.txt b/pyserial-master/pyserial-master/LICENSE.txt deleted file mode 100644 index 8920d4e..0000000 --- a/pyserial-master/pyserial-master/LICENSE.txt +++ /dev/null @@ -1,39 +0,0 @@ -Copyright (c) 2001-2020 Chris Liechti -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------- -Note: -Individual files contain the following tag instead of the full license text. - - SPDX-License-Identifier: BSD-3-Clause - -This enables machine processing of license information based on the SPDX -License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/pyserial-master/pyserial-master/MANIFEST.in b/pyserial-master/pyserial-master/MANIFEST.in deleted file mode 100644 index 696a944..0000000 --- a/pyserial-master/pyserial-master/MANIFEST.in +++ /dev/null @@ -1,39 +0,0 @@ -include README.rst -include LICENSE.txt -include CHANGES.rst -include MANIFEST.in -include setup.py -include setup.cfg -include pylintrc - -include examples/at_protocol.py -include examples/port_publisher.py -include examples/port_publisher.sh -include examples/rfc2217_server.py -include examples/setup-miniterm-py2exe.py -include examples/setup-rfc2217_server-py2exe.py -include examples/setup-wxTerminal-py2exe.py -include examples/tcp_serial_redirect.py -include examples/wxSerialConfigDialog.py -include examples/wxSerialConfigDialog.wxg -include examples/wxTerminal.py -include examples/wxTerminal.wxg - -include test/handlers/__init__.py -include test/handlers/protocol_test.py -include test/run_all_tests.py -include test/test_advanced.py -include test/test_high_load.py -include test/test_iolib.py -include test/test.py -include test/test_readline.py -include test/test_rfc2217.py -include test/test_rs485.py -include test/test_settings_dict.py -include test/test_url.py - -include documentation/*.rst -include documentation/pyserial.png -include documentation/conf.py -include documentation/Makefile - diff --git a/pyserial-master/pyserial-master/README.rst b/pyserial-master/pyserial-master/README.rst deleted file mode 100644 index 2e793ca..0000000 --- a/pyserial-master/pyserial-master/README.rst +++ /dev/null @@ -1,56 +0,0 @@ -================================= - pySerial |build-status| |docs| -================================= - -Overview -======== -This module encapsulates the access for the serial port. It provides backends -for Python_ running on Windows, OSX, Linux, BSD (possibly any POSIX compliant -system) and IronPython. The module named "serial" automatically selects the -appropriate backend. - -- Project Homepage: https://github.com/pyserial/pyserial -- Download Page: https://pypi.python.org/pypi/pyserial - -BSD license, (C) 2001-2020 Chris Liechti - - -Documentation -============= -For API documentation, usage and examples see files in the "documentation" -directory. The ".rst" files can be read in any text editor or being converted to -HTML or PDF using Sphinx_. An HTML version is online at -https://pythonhosted.org/pyserial/ - -Examples -======== -Examples and unit tests are in the directory examples_. - - -Installation -============ -``pip install pyserial`` should work for most users. - -Detailed information can be found in `documentation/pyserial.rst`_. - -The usual setup.py for Python_ libraries is used for the source distribution. -Windows installers are also available (see download link above). - -or - -To install this package with conda run: - -``conda install -c conda-forge pyserial`` - -conda builds are available for linux, mac and windows. - -.. _`documentation/pyserial.rst`: https://github.com/pyserial/pyserial/blob/master/documentation/pyserial.rst#installation -.. _examples: https://github.com/pyserial/pyserial/blob/master/examples -.. _Python: http://python.org/ -.. _Sphinx: http://sphinx-doc.org/ -.. |build-status| image:: https://travis-ci.org/pyserial/pyserial.svg?branch=master - :target: https://travis-ci.org/pyserial/pyserial - :alt: Build status -.. |docs| image:: https://readthedocs.org/projects/pyserial/badge/?version=latest - :target: http://pyserial.readthedocs.io/ - :alt: Documentation diff --git a/pyserial-master/pyserial-master/documentation/Makefile b/pyserial-master/pyserial-master/documentation/Makefile deleted file mode 100644 index 8384360..0000000 --- a/pyserial-master/pyserial-master/documentation/Makefile +++ /dev/null @@ -1,88 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf _build/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html - @echo - @echo "Build finished. The HTML pages are in _build/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) _build/dirhtml - @echo - @echo "Build finished. The HTML pages are in _build/dirhtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in _build/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in _build/qthelp, like this:" - @echo "# qcollectiongenerator _build/qthelp/pySerial.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile _build/qthelp/pySerial.qhc" - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex - @echo - @echo "Build finished; the LaTeX files are in _build/latex." - @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ - "run these through (pdf)latex." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes - @echo - @echo "The overview file is in _build/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in _build/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in _build/doctest/output.txt." diff --git a/pyserial-master/pyserial-master/documentation/appendix.rst b/pyserial-master/pyserial-master/documentation/appendix.rst deleted file mode 100644 index fe03954..0000000 --- a/pyserial-master/pyserial-master/documentation/appendix.rst +++ /dev/null @@ -1,148 +0,0 @@ -========== - Appendix -========== - -How To -====== - -Enable :rfc:`2217` (and other URL handlers) in programs using pySerial. - Patch the code where the :class:`serial.Serial` is instantiated. - E.g. replace:: - - s = serial.Serial(...) - - it with:: - - s = serial.serial_for_url(...) - - or for backwards compatibility to old pySerial installations:: - - try: - s = serial.serial_for_url(...) - except AttributeError: - s = serial.Serial(...) - - Assuming the application already stores port names as strings that's all - that is required. The user just needs a way to change the port setting of - your application to an ``rfc2217://`` :ref:`URL ` (e.g. by editing a - configuration file, GUI dialog etc.). - - Please note that this enables all :ref:`URL ` types supported by - pySerial and that those involving the network are unencrypted and not - protected against eavesdropping. - -Test your setup. - Is the device not working as expected? Maybe it's time to check the - connection before proceeding. :ref:`miniterm` from the :ref:`examples` - can be used to open the serial port and do some basic tests. - - To test cables, connecting RX to TX (loop back) and typing some characters - in :ref:`miniterm` is a simple test. When the characters are displayed - on the screen, then at least RX and TX work (they still could be swapped - though). - - There is also a ``spy:://`` URL handler. It prints all calls (read/write, - control lines) to the serial port to a file or stderr. See :ref:`spy` - for details. - - -FAQ -=== -Example works in :ref:`miniterm` but not in script. - The RTS and DTR lines are switched when the port is opened. This may cause - some processing or reset on the connected device. In such a cases an - immediately following call to :meth:`write` may not be received by the - device. - - A delay after opening the port, before the first :meth:`write`, is - recommended in this situation. E.g. a ``time.sleep(1)`` - - -Application works when .py file is run, but fails when packaged (py2exe etc.) - py2exe and similar packaging programs scan the sources for import - statements and create a list of modules that they package. pySerial may - create two issues with that: - - - implementations for other modules are found. On Windows, it's safe to - exclude 'serialposix', 'serialjava' and 'serialcli' as these are not - used. - - - :func:`serial.serial_for_url` does a dynamic lookup of protocol handlers - at runtime. If this function is used, the desired handlers have to be - included manually (e.g. 'serial.urlhandler.protocol_socket', - 'serial.urlhandler.protocol_rfc2217', etc.). This can be done either with - the "includes" option in ``setup.py`` or by a dummy import in one of the - packaged modules. - -User supplied URL handlers - :func:`serial.serial_for_url` can be used to access "virtual" serial ports - identified by an :ref:`URL ` scheme. E.g. for the :rfc:`2217`: - ``rfc2217://``. - - Custom :ref:`URL ` handlers can be added by extending the module - search path in :data:`serial.protocol_handler_packages`. This is possible - starting from pySerial V2.6. - -``Permission denied`` errors - On POSIX based systems, the user usually needs to be in a special group to - have access to serial ports. - - On Debian based systems, serial ports are usually in the group ``dialout``, - so running ``sudo adduser $USER dialout`` (and logging-out and -in) enables - the user to access the port. - -Parity on Raspberry Pi - The Raspi has one full UART and a restricted one. On devices with built - in wireless (WIFI/BT) use the restricted one on the GPIO header pins. - If enhanced features are required, it is possible to swap UARTs, see - https://www.raspberrypi.org/documentation/configuration/uart.md - -Support for Python 2.6 or earlier - Support for older Python releases than 2.7 will not return to pySerial 3.x. - Python 2.7 is now many years old (released 2010). If you insist on using - Python 2.6 or earlier, it is recommend to use pySerial `2.7`_ - (or any 2.x version). - -.. _`2.7`: https://pypi.python.org/pypi/pyserial/2.7 - - -Related software -================ - -com0com - http://com0com.sourceforge.net/ - Provides virtual serial ports for Windows. - - -License -======= -Copyright (c) 2001-2020 Chris Liechti -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/pyserial-master/pyserial-master/documentation/conf.py b/pyserial-master/pyserial-master/documentation/conf.py deleted file mode 100644 index d878ea4..0000000 --- a/pyserial-master/pyserial-master/documentation/conf.py +++ /dev/null @@ -1,200 +0,0 @@ -# -*- coding: utf-8 -*- -# -# pySerial documentation build configuration file, created by -# sphinx-quickstart on Tue Jul 21 00:27:45 2009. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys, os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.append(os.path.abspath('.')) - -# -- General configuration ----------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.intersphinx'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'pySerial' -copyright = u'2001-2020, Chris Liechti' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '3.4' -# The full version, including alpha/beta/rc tags. -release = '3.4' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of documents that shouldn't be included in the build. -#unused_docs = [] - -# List of directories, relative to source directory, that shouldn't be searched -# for source files. -exclude_trees = ['_build'] - -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -#html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -html_logo = 'pyserial.png' - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_use_modindex = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = '' - -# Output file base name for HTML help builder. -#htmlhelp_basename = 'pySerialdoc' - - -# -- Options for LaTeX output -------------------------------------------------- - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'pySerial.tex', u'pySerial Documentation', - u'Chris Liechti', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -latex_logo = 'pyserial.png' - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_use_modindex = True - -# for external links to standard library -intersphinx_mapping = { - #~ 'python': ('http://docs.python.org', None), - 'py': ('http://docs.python.org', None), - } diff --git a/pyserial-master/pyserial-master/documentation/examples.rst b/pyserial-master/pyserial-master/documentation/examples.rst deleted file mode 100644 index 197c015..0000000 --- a/pyserial-master/pyserial-master/documentation/examples.rst +++ /dev/null @@ -1,274 +0,0 @@ -.. _examples: - -========== - Examples -========== - - -Miniterm -======== -Miniterm is now available as module instead of example. -see :ref:`miniterm` for details. - -miniterm.py_ - The miniterm program. - -setup-miniterm-py2exe.py_ - This is a py2exe setup script for Windows. It can be used to create a - standalone ``miniterm.exe``. - -.. _miniterm.py: https://github.com/pyserial/pyserial/blob/master/serial/tools/miniterm.py -.. _setup-miniterm-py2exe.py: https://github.com/pyserial/pyserial/blob/master/examples/setup-miniterm-py2exe.py - - -TCP/IP - serial bridge -====================== -This program opens a TCP/IP port. When a connection is made to that port (e.g. -with telnet) it forwards all data to the serial port and vice versa. - -This example only exports a raw socket connection. The next example -below gives the client much more control over the remote serial port. - -- The serial port settings are set on the command line when starting the - program. -- There is no possibility to change settings from remote. -- All data is passed through as-is. - -:: - - usage: tcp_serial_redirect.py [-h] [-q] [--parity {N,E,O,S,M}] [--rtscts] - [--xonxoff] [--rts RTS] [--dtr DTR] - [-P LOCALPORT] - SERIALPORT [BAUDRATE] - - Simple Serial to Network (TCP/IP) redirector. - - positional arguments: - SERIALPORT serial port name - BAUDRATE set baud rate, default: 9600 - - optional arguments: - -h, --help show this help message and exit - -q, --quiet suppress non error messages - - serial port: - --parity {N,E,O,S,M} set parity, one of {N E O S M}, default: N - --rtscts enable RTS/CTS flow control (default off) - --xonxoff enable software flow control (default off) - --rts RTS set initial RTS line state (possible values: 0, 1) - --dtr DTR set initial DTR line state (possible values: 0, 1) - - network settings: - -P LOCALPORT, --localport LOCALPORT - local TCP port - - NOTE: no security measures are implemented. Anyone can remotely connect to - this service over the network. Only one connection at once is supported. When - the connection is terminated it waits for the next connect. - - -tcp_serial_redirect.py_ - Main program. - -.. _tcp_serial_redirect.py: https://github.com/pyserial/pyserial/blob/master/examples/tcp_serial_redirect.py - - -Single-port TCP/IP - serial bridge (RFC 2217) -============================================= -Simple cross platform :rfc:`2217` serial port server. It uses threads and is -portable (runs on POSIX, Windows, etc). - -- The port settings and control lines (RTS/DTR) can be changed at any time - using :rfc:`2217` requests. The status lines (DSR/CTS/RI/CD) are polled every - second and notifications are sent to the client. -- Telnet character IAC (0xff) needs to be doubled in data stream. IAC followed - by another value is interpreted as Telnet command sequence. -- Telnet negotiation commands are sent when connecting to the server. -- RTS/DTR are activated on client connect and deactivated on disconnect. -- Default port settings are set again when client disconnects. - -:: - - usage: rfc2217_server.py [-h] [-p TCPPORT] [-v] SERIALPORT - - RFC 2217 Serial to Network (TCP/IP) redirector. - - positional arguments: - SERIALPORT - - optional arguments: - -h, --help show this help message and exit - -p TCPPORT, --localport TCPPORT - local TCP port, default: 2217 - -v, --verbose print more diagnostic messages (option can be given - multiple times) - - NOTE: no security measures are implemented. Anyone can remotely connect to - this service over the network. Only one connection at once is supported. When - the connection is terminated it waits for the next connect. - -.. versionadded:: 2.5 - -rfc2217_server.py_ - Main program. - -setup-rfc2217_server-py2exe.py_ - This is a py2exe setup script for Windows. It can be used to create a - standalone ``rfc2217_server.exe``. - -.. _rfc2217_server.py: https://github.com/pyserial/pyserial/blob/master/examples/rfc2217_server.py -.. _setup-rfc2217_server-py2exe.py: https://github.com/pyserial/pyserial/blob/master/examples/setup-rfc2217_server-py2exe.py - - -Multi-port TCP/IP - serial bridge (RFC 2217) -============================================ -This example implements a TCP/IP to serial port service that works with -multiple ports at once. It uses select, no threads, for the serial ports and -the network sockets and therefore runs on POSIX systems only. - -- Full control over the serial port with :rfc:`2217`. -- Check existence of ``/tty/USB0...8``. This is done every 5 seconds using - ``os.path.exists``. -- Send zeroconf announcements when port appears or disappears (uses - python-avahi and dbus). Service name: ``_serial_port._tcp``. -- Each serial port becomes available as one TCP/IP server. e.g. - ``/dev/ttyUSB0`` is reachable at ``:7000``. -- Single process for all ports and sockets (not per port). -- The script can be started as daemon. -- Logging to stdout or when run as daemon to syslog. -- Default port settings are set again when client disconnects. -- modem status lines (CTS/DSR/RI/CD) are not polled periodically and the server - therefore does not send NOTIFY_MODEMSTATE on its own. However it responds to - request from the client (i.e. use the ``poll_modem`` option in the URL when - using a pySerial client.) - -:: - - usage: port_publisher.py [options] - - Announce the existence of devices using zeroconf and provide - a TCP/IP <-> serial port gateway (implements RFC 2217). - - If running as daemon, write to syslog. Otherwise write to stdout. - - optional arguments: - -h, --help show this help message and exit - - serial port settings: - --ports-regex REGEX specify a regex to search against the serial devices - and their descriptions (default: /dev/ttyUSB[0-9]+) - - network settings: - --tcp-port PORT specify lowest TCP port number (default: 7000) - - daemon: - -d, --daemon start as daemon - --pidfile FILE specify a name for the PID file - - diagnostics: - -o FILE, --logfile FILE - write messages file instead of stdout - -q, --quiet suppress most diagnostic messages - -v, --verbose increase diagnostic messages - - NOTE: no security measures are implemented. Anyone can remotely connect to - this service over the network. Only one connection at once, per port, is - supported. When the connection is terminated, it waits for the next connect. - -Requirements: - -- Python (>= 2.4) -- python-avahi -- python-dbus -- python-serial (>= 2.5) - -Installation as daemon: - -- Copy the script ``port_publisher.py`` to ``/usr/local/bin``. -- Copy the script ``port_publisher.sh`` to ``/etc/init.d``. -- Add links to the runlevels using ``update-rc.d port_publisher.sh defaults 99`` -- That's it :-) the service will be started on next reboot. Alternatively run - ``invoke-rc.d port_publisher.sh start`` as root. - -.. versionadded:: 2.5 new example - -port_publisher.py_ - Multi-port TCP/IP-serial converter (RFC 2217) for POSIX environments. - -port_publisher.sh_ - Example init.d script. - -.. _port_publisher.py: https://github.com/pyserial/pyserial/blob/master/examples/port_publisher.py -.. _port_publisher.sh: https://github.com/pyserial/pyserial/blob/master/examples/port_publisher.sh - - -wxPython examples -================= -A simple terminal application for wxPython and a flexible serial port -configuration dialog are shown here. - -wxTerminal.py_ - A simple terminal application. Note that the length of the buffer is - limited by wx and it may suddenly stop displaying new input. - -wxTerminal.wxg_ - A wxGlade design file for the terminal application. - -wxSerialConfigDialog.py_ - A flexible serial port configuration dialog. - -wxSerialConfigDialog.wxg_ - The wxGlade design file for the configuration dialog. - -setup-wxTerminal-py2exe.py_ - A py2exe setup script to package the terminal application. - -.. _wxTerminal.py: https://github.com/pyserial/pyserial/blob/master/examples/wxTerminal.py -.. _wxTerminal.wxg: https://github.com/pyserial/pyserial/blob/master/examples/wxTerminal.wxg -.. _wxSerialConfigDialog.py: https://github.com/pyserial/pyserial/blob/master/examples/wxSerialConfigDialog.py -.. _wxSerialConfigDialog.wxg: https://github.com/pyserial/pyserial/blob/master/examples/wxSerialConfigDialog.wxg -.. _setup-wxTerminal-py2exe.py: https://github.com/pyserial/pyserial/blob/master/examples/setup-wxTerminal-py2exe.py - - - -Unit tests -========== -The project uses a number of unit test to verify the functionality. They all -need a loop back connector. The scripts itself contain more information. All -test scripts are contained in the directory ``test``. - -The unit tests are performed on port ``loop://`` unless a different device -name or URL is given on the command line (``sys.argv[1]``). e.g. to run the -test on an attached USB-serial converter ``hwgrep://USB`` could be used or -the actual name such as ``/dev/ttyUSB0`` or ``COM1`` (depending on platform). - -run_all_tests.py_ - Collect all tests from all ``test*`` files and run them. By default, the - ``loop://`` device is used. - -test.py_ - Basic tests (binary capabilities, timeout, control lines). - -test_advanced.py_ - Test more advanced features (properties). - -test_high_load.py_ - Tests involving sending a lot of data. - -test_readline.py_ - Tests involving ``readline``. - -test_iolib.py_ - Tests involving the :mod:`io` library. Only available for Python 2.6 and - newer. - -test_url.py_ - Tests involving the :ref:`URL ` feature. - -.. _run_all_tests.py: https://github.com/pyserial/pyserial/blob/master/test/run_all_tests.py -.. _test.py: https://github.com/pyserial/pyserial/blob/master/test/test.py -.. _test_advanced.py: https://github.com/pyserial/pyserial/blob/master/test/test_advanced.py -.. _test_high_load.py: https://github.com/pyserial/pyserial/blob/master/test/test_high_load.py -.. _test_readline.py: https://github.com/pyserial/pyserial/blob/master/test/test_readline.py -.. _test_iolib.py: https://github.com/pyserial/pyserial/blob/master/test/test_iolib.py -.. _test_url.py: https://github.com/pyserial/pyserial/blob/master/test/test_url.py diff --git a/pyserial-master/pyserial-master/documentation/index.rst b/pyserial-master/pyserial-master/documentation/index.rst deleted file mode 100644 index c3ca19d..0000000 --- a/pyserial-master/pyserial-master/documentation/index.rst +++ /dev/null @@ -1,44 +0,0 @@ -.. pySerial documentation master file -.. _welcome: - -Welcome to pySerial's documentation -=================================== - - -This module encapsulates the access for the serial port. It provides backends -for Python_ running on Windows, OSX, Linux, BSD (possibly any POSIX compliant -system) and IronPython. The module named "serial" automatically selects the -appropriate backend. - -Other pages (online) - -- `project page on GitHub`_ -- `Download Page`_ with releases -- This page, when viewed online is at https://pyserial.readthedocs.io/en/latest/ or - http://pythonhosted.org/pyserial/ . - -.. _Python: http://python.org/ -.. _`project page on GitHub`: https://github.com/pyserial/ -.. _`Download Page`: http://pypi.python.org/pypi/pyserial - - -Contents: - -.. toctree:: - :maxdepth: 2 - - pyserial - shortintro - pyserial_api - tools - url_handlers - examples - appendix - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/pyserial-master/pyserial-master/documentation/pyserial.png b/pyserial-master/pyserial-master/documentation/pyserial.png deleted file mode 100644 index 7fd45f4..0000000 Binary files a/pyserial-master/pyserial-master/documentation/pyserial.png and /dev/null differ diff --git a/pyserial-master/pyserial-master/documentation/pyserial.rst b/pyserial-master/pyserial-master/documentation/pyserial.rst deleted file mode 100644 index 080066f..0000000 --- a/pyserial-master/pyserial-master/documentation/pyserial.rst +++ /dev/null @@ -1,145 +0,0 @@ -========== - pySerial -========== - -Overview -======== - -This module encapsulates the access for the serial port. It provides backends -for Python_ running on Windows, OSX, Linux, BSD (possibly any POSIX compliant -system) and IronPython. The module named "serial" automatically selects the -appropriate backend. - -It is released under a free software license, see LICENSE_ for more -details. - -Copyright (C) 2001-2020 Chris Liechti - -Other pages (online) - -- `project page on GitHub`_ -- `Download Page`_ with releases (PyPi) -- This page, when viewed online is at https://pyserial.readthedocs.io/en/latest/ or - http://pythonhosted.org/pyserial/ . - -.. _Python: http://python.org/ -.. _LICENSE: appendix.html#license -.. _`project page on GitHub`: https://github.com/pyserial/pyserial/ -.. _`Download Page`: http://pypi.python.org/pypi/pyserial - - -Features -======== -- Same class based interface on all supported platforms. -- Access to the port settings through Python properties. -- Support for different byte sizes, stop bits, parity and flow control with - RTS/CTS and/or Xon/Xoff. -- Working with or without receive timeout. -- File like API with "read" and "write" ("readline" etc. also supported). -- The files in this package are 100% pure Python. -- The port is set up for binary transmission. No NULL byte stripping, CR-LF - translation etc. (which are many times enabled for POSIX.) This makes this - module universally useful. -- Compatible with :mod:`io` library -- RFC 2217 client (experimental), server provided in the examples. - - -Requirements -============ -- Python 2.7 or Python 3.4 and newer - -- If running on Windows: Windows 7 or newer - -- If running on Jython: "Java Communications" (JavaComm) or compatible - extension for Java - -For older installations (older Python versions or older operating systems), see -`older versions`_ below. - - -Installation -============ - -This installs a package that can be used from Python (``import serial``). - -To install for all users on the system, administrator rights (root) -may be required. - -From PyPI ---------- -pySerial can be installed from PyPI:: - - python -m pip install pyserial - -Using the `python`/`python3` executable of the desired version (2.7/3.x). - -Developers also may be interested to get the source archive, because it -contains examples, tests and the this documentation. - -From Conda ----------- -pySerial can be installed from Conda:: - - conda install pyserial - - or - - conda install -c conda-forge pyserial - -Currently the default conda channel will provide version 3.4 whereas the -conda-forge channel provides the current 3.x version. - -Conda: https://www.continuum.io/downloads - -From source (zip/tar.gz or checkout) ------------------------------------- -Download the archive from http://pypi.python.org/pypi/pyserial or -https://github.com/pyserial/pyserial/releases. -Unpack the archive, enter the ``pyserial-x.y`` directory and run:: - - python setup.py install - -Using the `python`/`python3` executable of the desired version (2.7/3.x). - -Packages --------- -There are also packaged versions for some Linux distributions: - -- Debian/Ubuntu: "python-serial", "python3-serial" -- Fedora / RHEL / CentOS / EPEL: "pyserial" -- Arch Linux: "python-pyserial" -- Gentoo: "dev-python/pyserial" - -Note that some distributions may package an older version of pySerial. -These packages are created and maintained by developers working on -these distributions. - -.. _PyPi: http://pypi.python.org/pypi/pyserial - - -References -========== -* Python: http://www.python.org/ -* Jython: http://www.jython.org/ -* IronPython: http://www.codeplex.com/IronPython - - -Older Versions -============== -Older versions are still available on the current download_ page or the `old -download`_ page. The last version of pySerial's 2.x series was `2.7`_, -compatible with Python 2.3 and newer and partially with early Python 3.x -versions. - -pySerial `1.21`_ is compatible with Python 2.0 on Windows, Linux and several -un*x like systems, MacOSX and Jython. - -On Windows, releases older than 2.5 will depend on pywin32_ (previously known as -win32all). WinXP is supported up to 3.0.1. - - -.. _`old download`: https://sourceforge.net/projects/pyserial/files/pyserial/ -.. _download: https://pypi.python.org/simple/pyserial/ -.. _pywin32: http://pypi.python.org/pypi/pywin32 -.. _`2.7`: https://pypi.python.org/pypi/pyserial/2.7 -.. _`1.21`: https://sourceforge.net/projects/pyserial/files/pyserial/1.21/pyserial-1.21.zip/download diff --git a/pyserial-master/pyserial-master/documentation/pyserial_api.rst b/pyserial-master/pyserial-master/documentation/pyserial_api.rst deleted file mode 100644 index e1ce049..0000000 --- a/pyserial-master/pyserial-master/documentation/pyserial_api.rst +++ /dev/null @@ -1,1309 +0,0 @@ -============== - pySerial API -============== - -.. module:: serial - -Classes -======= - -Native ports ------------- - -.. class:: Serial - - .. method:: __init__(port=None, baudrate=9600, bytesize=EIGHTBITS, parity=PARITY_NONE, stopbits=STOPBITS_ONE, timeout=None, xonxoff=False, rtscts=False, write_timeout=None, dsrdtr=False, inter_byte_timeout=None, exclusive=None) - - :param port: - Device name or :const:`None`. - - :param int baudrate: - Baud rate such as 9600 or 115200 etc. - - :param bytesize: - Number of data bits. Possible values: - :const:`FIVEBITS`, :const:`SIXBITS`, :const:`SEVENBITS`, - :const:`EIGHTBITS` - - :param parity: - Enable parity checking. Possible values: - :const:`PARITY_NONE`, :const:`PARITY_EVEN`, :const:`PARITY_ODD` - :const:`PARITY_MARK`, :const:`PARITY_SPACE` - - :param stopbits: - Number of stop bits. Possible values: - :const:`STOPBITS_ONE`, :const:`STOPBITS_ONE_POINT_FIVE`, - :const:`STOPBITS_TWO` - - :param float timeout: - Set a read timeout value in seconds. - - :param bool xonxoff: - Enable software flow control. - - :param bool rtscts: - Enable hardware (RTS/CTS) flow control. - - :param bool dsrdtr: - Enable hardware (DSR/DTR) flow control. - - :param float write_timeout: - Set a write timeout value in seconds. - - :param float inter_byte_timeout: - Inter-character timeout, :const:`None` to disable (default). - - :param bool exclusive: - Set exclusive access mode (POSIX only). A port cannot be opened in - exclusive access mode if it is already open in exclusive access mode. - - :exception ValueError: - Will be raised when parameter are out of range, e.g. baud rate, data bits. - - :exception SerialException: - In case the device can not be found or can not be configured. - - - The port is immediately opened on object creation, when a *port* is - given. It is not opened when *port* is :const:`None` and a successive call - to :meth:`open` is required. - - *port* is a device name: depending on operating system. e.g. - ``/dev/ttyUSB0`` on GNU/Linux or ``COM3`` on Windows. - - The parameter *baudrate* can be one of the standard values: - 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, - 9600, 19200, 38400, 57600, 115200. - These are well supported on all platforms. - - Standard values above 115200, such as: 230400, 460800, 500000, 576000, - 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, - 4000000 also work on many platforms and devices. - - Non-standard values are also supported on some platforms (GNU/Linux, MAC - OSX >= Tiger, Windows). Though, even on these platforms some serial - ports may reject non-standard values. - - Possible values for the parameter *timeout* which controls the behavior - of :meth:`read`: - - - ``timeout = None``: wait forever / until requested number of bytes - are received - - ``timeout = 0``: non-blocking mode, return immediately in any case, - returning zero or more, up to the requested number of bytes - - ``timeout = x``: set timeout to ``x`` seconds (float allowed) - returns immediately when the requested number of bytes are available, - otherwise wait until the timeout expires and return all bytes that - were received until then. - - :meth:`write` is blocking by default, unless *write_timeout* is set. - For possible values refer to the list for *timeout* above. - - Note that enabling both flow control methods (*xonxoff* and *rtscts*) - together may not be supported. It is common to use one of the methods - at once, not both. - - *dsrdtr* is not supported by all platforms (silently ignored). Setting - it to ``None`` has the effect that its state follows *rtscts*. - - Also consider using the function :func:`serial_for_url` instead of - creating Serial instances directly. - - .. versionchanged:: 2.5 - *dsrdtr* now defaults to ``False`` (instead of *None*) - .. versionchanged:: 3.0 numbers as *port* argument are no longer supported - .. versionadded:: 3.3 ``exclusive`` flag - - .. method:: open() - - Open port. The state of :attr:`rts` and :attr:`dtr` is applied. - - .. note:: - - Some OS and/or drivers may activate RTS and or DTR automatically, - as soon as the port is opened. There may be a glitch on RTS/DTR - when :attr:`rts` or :attr:`dtr` are set differently from their - default value (``True`` / active). - - .. note:: - - For compatibility reasons, no error is reported when applying - :attr:`rts` or :attr:`dtr` fails on POSIX due to EINVAL (22) or - ENOTTY (25). - - .. method:: close() - - Close port immediately. - - .. method:: __del__() - - Destructor, close port when serial port instance is freed. - - - The following methods may raise :exc:`SerialException` when applied to a closed - port. - - .. method:: read(size=1) - - :param size: Number of bytes to read. - :return: Bytes read from the port. - :rtype: bytes - - Read *size* bytes from the serial port. If a timeout is set it may - return fewer characters than requested. With no timeout it will block - until the requested number of bytes is read. - - .. versionchanged:: 2.5 - Returns an instance of :class:`bytes` when available (Python 2.6 - and newer) and :class:`str` otherwise. - - .. method:: read_until(expected=LF, size=None) - - :param expected: The byte string to search for. - :param size: Number of bytes to read. - :return: Bytes read from the port. - :rtype: bytes - - Read until an expected sequence is found ('\\n' by default), the size - is exceeded or until timeout occurs. If a timeout is set it may - return fewer characters than requested. With no timeout it will block - until the requested number of bytes is read. - - .. versionchanged:: 2.5 - Returns an instance of :class:`bytes` when available (Python 2.6 - and newer) and :class:`str` otherwise. - - .. versionchanged:: 3.5 - First argument was called ``terminator`` in previous versions. - - .. method:: write(data) - - :param data: Data to send. - :return: Number of bytes written. - :rtype: int - :exception SerialTimeoutException: - In case a write timeout is configured for the port and the time is - exceeded. - - Write the bytes *data* to the port. This should be of type ``bytes`` - (or compatible such as ``bytearray`` or ``memoryview``). Unicode - strings must be encoded (e.g. ``'hello'.encode('utf-8')``. - - .. versionchanged:: 2.5 - Accepts instances of :class:`bytes` and :class:`bytearray` when - available (Python 2.6 and newer) and :class:`str` otherwise. - - .. versionchanged:: 2.5 - Write returned ``None`` in previous versions. - - .. method:: flush() - - Flush of file like objects. In this case, wait until all data is - written. - - .. attribute:: in_waiting - - :getter: Get the number of bytes in the input buffer - :type: int - - Return the number of bytes in the receive buffer. - - .. versionchanged:: 3.0 changed to property from ``inWaiting()`` - - .. attribute:: out_waiting - - :getter: Get the number of bytes in the output buffer - :type: int - :platform: Posix - :platform: Windows - - Return the number of bytes in the output buffer. - - .. versionchanged:: 2.7 (Posix support added) - .. versionchanged:: 3.0 changed to property from ``outWaiting()`` - - .. method:: reset_input_buffer() - - Flush input buffer, discarding all its contents. - - .. versionchanged:: 3.0 renamed from ``flushInput()`` - - .. method:: reset_output_buffer() - - Clear output buffer, aborting the current output and - discarding all that is in the buffer. - - Note, for some USB serial adapters, this may only flush the buffer of - the OS and not all the data that may be present in the USB part. - - .. versionchanged:: 3.0 renamed from ``flushOutput()`` - - .. method:: send_break(duration=0.25) - - :param float duration: Time in seconds, to activate the BREAK condition. - - Send break condition. Timed, returns to idle state after given - duration. - - - .. attribute:: break_condition - - :getter: Get the current BREAK state - :setter: Control the BREAK state - :type: bool - - When set to ``True`` activate BREAK condition, else disable. - Controls TXD. When active, no transmitting is possible. - - .. attribute:: rts - - :setter: Set the state of the RTS line - :getter: Return the state of the RTS line - :type: bool - - Set RTS line to specified logic level. It is possible to assign this - value before opening the serial port, then the value is applied upon - :meth:`open` (with restrictions, see :meth:`open`). - - .. attribute:: dtr - - :setter: Set the state of the DTR line - :getter: Return the state of the DTR line - :type: bool - - Set DTR line to specified logic level. It is possible to assign this - value before opening the serial port, then the value is applied upon - :meth:`open` (with restrictions, see :meth:`open`). - - Read-only attributes: - - .. attribute:: name - - :getter: Device name. - :type: str - - .. versionadded:: 2.5 - - .. attribute:: cts - - :getter: Get the state of the CTS line - :type: bool - - Return the state of the CTS line. - - .. attribute:: dsr - - :getter: Get the state of the DSR line - :type: bool - - Return the state of the DSR line. - - .. attribute:: ri - - :getter: Get the state of the RI line - :type: bool - - Return the state of the RI line. - - .. attribute:: cd - - :getter: Get the state of the CD line - :type: bool - - Return the state of the CD line - - .. attribute:: is_open - - :getter: Get the state of the serial port, whether it's open. - :type: bool - - New values can be assigned to the following attributes (properties), the - port will be reconfigured, even if it's opened at that time: - - - .. attribute:: port - - :type: str - - Read or write port. When the port is already open, it will be closed - and reopened with the new setting. - - .. attribute:: baudrate - - :getter: Get current baud rate - :setter: Set new baud rate - :type: int - - Read or write current baud rate setting. - - .. attribute:: bytesize - - :getter: Get current byte size - :setter: Set new byte size. Possible values: - :const:`FIVEBITS`, :const:`SIXBITS`, :const:`SEVENBITS`, - :const:`EIGHTBITS` - :type: int - - Read or write current data byte size setting. - - .. attribute:: parity - - :getter: Get current parity setting - :setter: Set new parity mode. Possible values: - :const:`PARITY_NONE`, :const:`PARITY_EVEN`, :const:`PARITY_ODD` - :const:`PARITY_MARK`, :const:`PARITY_SPACE` - - Read or write current parity setting. - - .. attribute:: stopbits - - :getter: Get current stop bit setting - :setter: Set new stop bit setting. Possible values: - :const:`STOPBITS_ONE`, :const:`STOPBITS_ONE_POINT_FIVE`, - :const:`STOPBITS_TWO` - - Read or write current stop bit width setting. - - .. attribute:: timeout - - :getter: Get current read timeout setting - :setter: Set read timeout - :type: float (seconds) - - Read or write current read timeout setting. - - .. attribute:: write_timeout - - :getter: Get current write timeout setting - :setter: Set write timeout - :type: float (seconds) - - Read or write current write timeout setting. - - .. versionchanged:: 3.0 renamed from ``writeTimeout`` - - .. attribute:: inter_byte_timeout - - :getter: Get current inter byte timeout setting - :setter: Disable (``None``) or enable the inter byte timeout - :type: float or None - - Read or write current inter byte timeout setting. - - .. versionchanged:: 3.0 renamed from ``interCharTimeout`` - - .. attribute:: xonxoff - - :getter: Get current software flow control setting - :setter: Enable or disable software flow control - :type: bool - - Read or write current software flow control rate setting. - - .. attribute:: rtscts - - :getter: Get current hardware flow control setting - :setter: Enable or disable hardware flow control - :type: bool - - Read or write current hardware flow control setting. - - .. attribute:: dsrdtr - - :getter: Get current hardware flow control setting - :setter: Enable or disable hardware flow control - :type: bool - - Read or write current hardware flow control setting. - - .. attribute:: rs485_mode - - :getter: Get the current RS485 settings - :setter: Disable (``None``) or enable the RS485 settings - :type: :class:`rs485.RS485Settings` or ``None`` - :platform: Posix (Linux, limited set of hardware) - :platform: Windows (only RTS on TX possible) - - Attribute to configure RS485 support. When set to an instance of - :class:`rs485.RS485Settings` and supported by OS, RTS will be active - when data is sent and inactive otherwise (for reception). The - :class:`rs485.RS485Settings` class provides additional settings - supported on some platforms. - - .. versionadded:: 3.0 - - - The following constants are also provided: - - .. attribute:: BAUDRATES - - A list of valid baud rates. The list may be incomplete, such that higher - and/or intermediate baud rates may also be supported by the device - (Read Only). - - .. attribute:: BYTESIZES - - A list of valid byte sizes for the device (Read Only). - - .. attribute:: PARITIES - - A list of valid parities for the device (Read Only). - - .. attribute:: STOPBITS - - A list of valid stop bit widths for the device (Read Only). - - - The following methods are for compatibility with the :mod:`io` library. - - .. method:: readable() - - :return: True - - .. versionadded:: 2.5 - - .. method:: writable() - - :return: True - - .. versionadded:: 2.5 - - .. method:: seekable() - - :return: False - - .. versionadded:: 2.5 - - .. method:: readinto(b) - - :param b: bytearray or array instance - :return: Number of byte read - - Read up to len(b) bytes into :class:`bytearray` *b* and return the - number of bytes read. - - .. versionadded:: 2.5 - - .. method:: readline(size=-1) - - Provided via :meth:`io.IOBase.readline` See also :ref:`shortintro_readline`. - - .. method:: readlines(hint=-1) - - Provided via :meth:`io.IOBase.readlines`. See also :ref:`shortintro_readline`. - - .. method:: writelines(lines) - - Provided via :meth:`io.IOBase.writelines` - - The port settings can be read and written as dictionary. The following - keys are supported: ``write_timeout``, ``inter_byte_timeout``, - ``dsrdtr``, ``baudrate``, ``timeout``, ``parity``, ``bytesize``, - ``rtscts``, ``stopbits``, ``xonxoff`` - - .. method:: get_settings() - - :return: a dictionary with current port settings. - :rtype: dict - - Get a dictionary with port settings. This is useful to backup the - current settings so that a later point in time they can be restored - using :meth:`apply_settings`. - - Note that the state of control lines (RTS/DTR) are not part of the - settings. - - .. versionadded:: 2.5 - .. versionchanged:: 3.0 renamed from ``getSettingsDict`` - - .. method:: apply_settings(d) - - :param dict d: a dictionary with port settings. - - Applies a dictionary that was created by :meth:`get_settings`. Only - changes are applied and when a key is missing, it means that the - setting stays unchanged. - - Note that control lines (RTS/DTR) are not changed. - - .. versionadded:: 2.5 - .. versionchanged:: 3.0 renamed from ``applySettingsDict`` - - - .. _context-manager: - - This class can be used as context manager. The serial port is closed when - the context is left. - - .. method:: __enter__() - - :returns: Serial instance - - Returns the instance that was used in the ``with`` statement. - - Example: - - >>> with serial.serial_for_url(port) as s: - ... s.write(b'hello') - - The port is opened automatically: - - >>> port = serial.Serial() - >>> port.port = '...' - >>> with port as s: - ... s.write(b'hello') - - Which also means that ``with`` statements can be used repeatedly, - each time opening and closing the port. - - .. versionchanged:: 3.4 the port is automatically opened - - - .. method:: __exit__(exc_type, exc_val, exc_tb) - - Closes serial port (exceptions are not handled by ``__exit__``). - - - Platform specific methods. - - .. warning:: Programs using the following methods and attributes are not - portable to other platforms! - - .. method:: nonblocking() - - :platform: Posix - - .. deprecated:: 3.2 - The serial port is already opened in this mode. This method is not - needed and going away. - - - .. method:: fileno() - - :platform: Posix - :return: File descriptor. - - Return file descriptor number for the port that is opened by this object. - It is useful when serial ports are used with :mod:`select`. - - .. method:: set_input_flow_control(enable) - - :platform: Posix - :param bool enable: Set flow control state. - - Manually control flow - when software flow control is enabled. - - This will send XON (true) and XOFF (false) to the other device. - - .. versionadded:: 2.7 (Posix support added) - .. versionchanged:: 3.0 renamed from ``flowControlOut`` - - .. method:: set_output_flow_control(enable) - - :platform: Posix (HW and SW flow control) - :platform: Windows (SW flow control only) - :param bool enable: Set flow control state. - - Manually control flow of outgoing data - when hardware or software flow - control is enabled. - - Sending will be suspended when called with ``False`` and enabled when - called with ``True``. - - .. versionchanged:: 2.7 (renamed on Posix, function was called ``flowControl``) - .. versionchanged:: 3.0 renamed from ``setXON`` - - .. method:: cancel_read() - - :platform: Posix - :platform: Windows - - Cancel a pending read operation from another thread. A blocking - :meth:`read` call is aborted immediately. :meth:`read` will not report - any error but return all data received up to that point (similar to a - timeout). - - On Posix a call to `cancel_read()` may cancel a future :meth:`read` call. - - .. versionadded:: 3.1 - - .. method:: cancel_write() - - :platform: Posix - :platform: Windows - - Cancel a pending write operation from another thread. The - :meth:`write` method will return immediately (no error indicated). - However the OS may still be sending from the buffer, a separate call to - :meth:`reset_output_buffer` may be needed. - - On Posix a call to `cancel_write()` may cancel a future :meth:`write` call. - - .. versionadded:: 3.1 - - .. note:: The following members are deprecated and will be removed in a - future release. - - .. attribute:: portstr - - .. deprecated:: 2.5 use :attr:`name` instead - - .. method:: inWaiting() - - .. deprecated:: 3.0 see :attr:`in_waiting` - - .. method:: isOpen() - - .. deprecated:: 3.0 see :attr:`is_open` - - .. attribute:: writeTimeout - - .. deprecated:: 3.0 see :attr:`write_timeout` - - .. attribute:: interCharTimeout - - .. deprecated:: 3.0 see :attr:`inter_byte_timeout` - - .. method:: sendBreak(duration=0.25) - - .. deprecated:: 3.0 see :meth:`send_break` - - .. method:: flushInput() - - .. deprecated:: 3.0 see :meth:`reset_input_buffer` - - .. method:: flushOutput() - - .. deprecated:: 3.0 see :meth:`reset_output_buffer` - - .. method:: setBreak(level=True) - - .. deprecated:: 3.0 see :attr:`break_condition` - - .. method:: setRTS(level=True) - - .. deprecated:: 3.0 see :attr:`rts` - - .. method:: setDTR(level=True) - - .. deprecated:: 3.0 see :attr:`dtr` - - .. method:: getCTS() - - .. deprecated:: 3.0 see :attr:`cts` - - .. method:: getDSR() - - .. deprecated:: 3.0 see :attr:`dsr` - - .. method:: getRI() - - .. deprecated:: 3.0 see :attr:`ri` - - .. method:: getCD() - - .. deprecated:: 3.0 see :attr:`cd` - - .. method:: getSettingsDict() - - .. deprecated:: 3.0 see :meth:`get_settings` - - .. method:: applySettingsDict(d) - - .. deprecated:: 3.0 see :meth:`apply_settings` - - .. method:: outWaiting() - - .. deprecated:: 3.0 see :attr:`out_waiting` - - .. method:: setXON(level=True) - - .. deprecated:: 3.0 see :meth:`set_output_flow_control` - - .. method:: flowControlOut(enable) - - .. deprecated:: 3.0 see :meth:`set_input_flow_control` - - .. attribute:: rtsToggle - - :platform: Windows - - Attribute to configure RTS toggle control setting. When enabled and - supported by OS, RTS will be active when data is available and inactive - if no data is available. - - .. versionadded:: 2.6 - .. versionchanged:: 3.0 (removed, see :attr:`rs485_mode` instead) - - -Implementation detail: some attributes and functions are provided by the -class :class:`serial.SerialBase` which inherits from :class:`io.RawIOBase` -and some by the platform specific class and others by the base class -mentioned above. - - -RS485 support -------------- -The :class:`Serial` class has a :attr:`Serial.rs485_mode` attribute which allows to -enable RS485 specific support on some platforms. Currently Windows and Linux -(only a small number of devices) are supported. - -:attr:`Serial.rs485_mode` needs to be set to an instance of -:class:`rs485.RS485Settings` to enable or to ``None`` to disable this feature. - -Usage:: - - import serial - import serial.rs485 - ser = serial.Serial(...) - ser.rs485_mode = serial.rs485.RS485Settings(...) - ser.write(b'hello') - -There is a subclass :class:`rs485.RS485` available to emulate the RS485 support -on regular serial ports (``serial.rs485`` needs to be imported). - - -.. class:: rs485.RS485Settings - - A class that holds RS485 specific settings which are supported on - some platforms. - - .. versionadded:: 3.0 - - .. method:: __init__(rts_level_for_tx=True, rts_level_for_rx=False, loopback=False, delay_before_tx=None, delay_before_rx=None): - - :param bool rts_level_for_tx: - RTS level for transmission - - :param bool rts_level_for_rx: - RTS level for reception - - :param bool loopback: - When set to ``True`` transmitted data is also received. - - :param float delay_before_tx: - Delay after setting RTS but before transmission starts - - :param float delay_before_rx: - Delay after transmission ends and resetting RTS - - .. attribute:: rts_level_for_tx - - RTS level for transmission. - - .. attribute:: rts_level_for_rx - - RTS level for reception. - - .. attribute:: loopback - - When set to ``True`` transmitted data is also received. - - .. attribute:: delay_before_tx - - Delay after setting RTS but before transmission starts (seconds as float). - - .. attribute:: delay_before_rx - - Delay after transmission ends and resetting RTS (seconds as float). - - -.. class:: rs485.RS485 - - A subclass that replaces the :meth:`Serial.write` method with one that toggles RTS - according to the RS485 settings. - - Usage:: - - ser = serial.rs485.RS485(...) - ser.rs485_mode = serial.rs485.RS485Settings(...) - ser.write(b'hello') - - .. warning:: This may work unreliably on some serial ports (control signals not - synchronized or delayed compared to data). Using delays may be unreliable - (varying times, larger than expected) as the OS may not support very fine - grained delays (no smaller than in the order of tens of milliseconds). - - .. note:: Some implementations support this natively in the class - :class:`Serial`. Better performance can be expected when the native version - is used. - - .. note:: The loopback property is ignored by this implementation. The actual - behavior depends on the used hardware. - - - -:rfc:`2217` Network ports -------------------------- - -.. warning:: This implementation is currently in an experimental state. Use - at your own risk. - -.. class:: rfc2217.Serial - - This implements a :rfc:`2217` compatible client. Port names are :ref:`URL - ` in the form: ``rfc2217://:[?