summaryrefslogtreecommitdiff
path: root/typings/serial/serialposix.pyi
blob: 9f41fd24c20e7648126643f28c7a16e2ddf9387e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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: ...