summaryrefslogtreecommitdiff
path: root/documentation/pyserial_api.rst
diff options
context:
space:
mode:
authorDavid Patterson <dpatter877@gmail.com>2018-06-16 21:13:15 -0400
committerDavid Patterson <dpatter877@gmail.com>2018-06-16 21:13:15 -0400
commitdaaf33edd1a054a52fa8ec297a5767d06f96a942 (patch)
tree540331248beb30c2d63740f0080d64b1bb5834f2 /documentation/pyserial_api.rst
parentd7ae8f668f0d55abe2808144a1ee6c8e1254f13b (diff)
downloadpyserial-git-daaf33edd1a054a52fa8ec297a5767d06f96a942.tar.gz
Documented read_until and updated parameter name to reflect functionality beyond just line terminators.
Diffstat (limited to 'documentation/pyserial_api.rst')
-rw-r--r--documentation/pyserial_api.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/documentation/pyserial_api.rst b/documentation/pyserial_api.rst
index 2045244..c821773 100644
--- a/documentation/pyserial_api.rst
+++ b/documentation/pyserial_api.rst
@@ -157,6 +157,22 @@ Native ports
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 less characters as 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:: write(data)
:param data: Data to send.