Rename endpoint, format

This commit is contained in:
Ádám Kovács
2023-12-08 07:41:47 +01:00
parent dd92fbc62f
commit fd5fc9e5f8
27 changed files with 781 additions and 117 deletions

View File

@@ -983,14 +983,14 @@ class UART:
poll.poll(timeout)
"""
...
def write(self, buf) -> int:
def write(self, buf) -> Union[int, None]:
"""
Write the buffer of bytes to the bus.
Return value: number of bytes written or ``None`` on timeout.
"""
...
def readinto(self, buf, nbytes: Optional[Any] = None) -> int:
def readinto(self, buf, nbytes: Optional[Any] = None) -> Union[int, None]:
"""
Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
that many bytes. Otherwise, read at most ``len(buf)`` bytes. It may return sooner if a timeout
@@ -1000,7 +1000,7 @@ class UART:
timeout.
"""
...
def readline(self) -> None:
def readline(self) -> Union[str, None]:
"""
Read a line, ending in a newline character. It may return sooner if a timeout
is reached. The timeout is configurable in the constructor.