diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-14 09:53:28 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-14 10:05:53 +0100 |
commit | a8049bb66f7bc62c9a33488615d0990e0a920520 (patch) | |
tree | 1372e18896897490650203efe72c8244a23204cf /typings/serial/serialposix.pyi | |
parent | 336d968dd2a4473b3acd71cfef86ad47a7901fbc (diff) |
build: add utility scripts
Diffstat (limited to 'typings/serial/serialposix.pyi')
-rw-r--r-- | typings/serial/serialposix.pyi | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/typings/serial/serialposix.pyi b/typings/serial/serialposix.pyi new file mode 100644 index 0000000..9f41fd2 --- /dev/null +++ b/typings/serial/serialposix.pyi @@ -0,0 +1,34 @@ +from typing import Any, Optional +from serial.serialutil import SerialBase + + +class PlatformSpecificBase: + ... + + +class PlatformSpecific(PlatformSpecificBase): + ... + + +class Serial(SerialBase, PlatformSpecific): + """\ + Serial port class POSIX implementation. Serial port configuration is + done with termios and fcntl. Runs on Linux and many other Un*x like + systems. + """ + + def close(self) -> None: + """Close port""" + ... + + def read(self, size: Optional[int] = ...) -> bytes: + """\ + Read size bytes from the serial port. 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. + """ + ... + + def __enter__(self) -> Serial: ... + + def __exit__(self, *args: Any, **kwargs: Any) -> None: ... |