summaryrefslogtreecommitdiffstatshomepage
path: root/docs/library/pyb.UART.rst
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-10-24 22:35:11 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-10-25 08:25:34 +0300
commitcf6daa096681dd2926e37415eb10ac99c36f5c0d (patch)
treee4f61c073d9f88e9c5ae8fc0dfe84340aed96485 /docs/library/pyb.UART.rst
parent4a9c60cdfb509b61dd71dbaec36293239e6e53cc (diff)
downloadmicropython-cf6daa096681dd2926e37415eb10ac99c36f5c0d.tar.gz
micropython-cf6daa096681dd2926e37415eb10ac99c36f5c0d.zip
docs: Explicitly specify behavior of UART stream protocol methods on timeout.
Diffstat (limited to 'docs/library/pyb.UART.rst')
-rw-r--r--docs/library/pyb.UART.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/library/pyb.UART.rst b/docs/library/pyb.UART.rst
index 16b1a5b16c..7e207dcb51 100644
--- a/docs/library/pyb.UART.rst
+++ b/docs/library/pyb.UART.rst
@@ -119,14 +119,14 @@ Methods
*Note:* for 9 bit characters each character takes two bytes, ``nbytes`` must
be even, and the number of characters is ``nbytes/2``.
- Return value: a bytes object containing the bytes read in. Returns ``b''``
+ Return value: a bytes object containing the bytes read in. Returns ``None``
on timeout.
.. method:: uart.readall()
Read as much data as possible.
- Return value: a bytes object.
+ Return value: a bytes object or ``None`` on timeout.
.. method:: uart.readchar()
@@ -139,13 +139,14 @@ Methods
Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
that many bytes. Otherwise, read at most ``len(buf)`` bytes.
- Return value: number of bytes read and stored into ``buf``.
+ Return value: number of bytes read and stored into ``buf`` or ``None`` on
+ timeout.
.. method:: uart.readline()
Read a line, ending in a newline character.
- Return value: the line read.
+ Return value: the line read or ``None`` on timeout.
.. method:: uart.write(buf)
@@ -156,7 +157,7 @@ Methods
bytes are used for each character (little endian), and ``buf`` must contain
an even number of bytes.
- Return value: number of bytes written.
+ Return value: number of bytes written or ``None`` on timeout.
.. method:: uart.sendbreak()