QtSerialPort.pyi 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. # Copyright (C) 2022 The Qt Company Ltd.
  2. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. """
  4. This file contains the exact signatures for all functions in module
  5. PySide6.QtSerialPort, except for defaults which are replaced by "...".
  6. """
  7. # mypy: disable-error-code="override, overload-overlap"
  8. # Module `PySide6.QtSerialPort`
  9. import PySide6.QtSerialPort
  10. import PySide6.QtCore
  11. import enum
  12. import typing
  13. from PySide6.QtCore import Signal
  14. from shiboken6 import Shiboken
  15. class QIntList: ...
  16. class QSerialPort(PySide6.QtCore.QIODevice):
  17. baudRateChanged : typing.ClassVar[Signal] = ... # baudRateChanged(int,QSerialPort::Directions)
  18. breakEnabledChanged : typing.ClassVar[Signal] = ... # breakEnabledChanged(bool)
  19. dataBitsChanged : typing.ClassVar[Signal] = ... # dataBitsChanged(QSerialPort::DataBits)
  20. dataTerminalReadyChanged : typing.ClassVar[Signal] = ... # dataTerminalReadyChanged(bool)
  21. errorOccurred : typing.ClassVar[Signal] = ... # errorOccurred(QSerialPort::SerialPortError)
  22. flowControlChanged : typing.ClassVar[Signal] = ... # flowControlChanged(QSerialPort::FlowControl)
  23. parityChanged : typing.ClassVar[Signal] = ... # parityChanged(QSerialPort::Parity)
  24. requestToSendChanged : typing.ClassVar[Signal] = ... # requestToSendChanged(bool)
  25. settingsRestoredOnCloseChanged: typing.ClassVar[Signal] = ... # settingsRestoredOnCloseChanged(bool)
  26. stopBitsChanged : typing.ClassVar[Signal] = ... # stopBitsChanged(QSerialPort::StopBits)
  27. class BaudRate(enum.IntEnum):
  28. Baud1200 = 0x4b0
  29. Baud2400 = 0x960
  30. Baud4800 = 0x12c0
  31. Baud9600 = 0x2580
  32. Baud19200 = 0x4b00
  33. Baud38400 = 0x9600
  34. Baud57600 = 0xe100
  35. Baud115200 = 0x1c200
  36. class DataBits(enum.Enum):
  37. Data5 = 0x5
  38. Data6 = 0x6
  39. Data7 = 0x7
  40. Data8 = 0x8
  41. class Direction(enum.Flag):
  42. Input = 0x1
  43. Output = 0x2
  44. AllDirections = 0x3
  45. class FlowControl(enum.Enum):
  46. NoFlowControl = 0x0
  47. HardwareControl = 0x1
  48. SoftwareControl = 0x2
  49. class Parity(enum.Enum):
  50. NoParity = 0x0
  51. EvenParity = 0x2
  52. OddParity = 0x3
  53. SpaceParity = 0x4
  54. MarkParity = 0x5
  55. class PinoutSignal(enum.Flag):
  56. NoSignal = 0x0
  57. DataTerminalReadySignal = 0x4
  58. DataCarrierDetectSignal = 0x8
  59. DataSetReadySignal = 0x10
  60. RingIndicatorSignal = 0x20
  61. RequestToSendSignal = 0x40
  62. ClearToSendSignal = 0x80
  63. SecondaryTransmittedDataSignal = 0x100
  64. SecondaryReceivedDataSignal = 0x200
  65. class SerialPortError(enum.Enum):
  66. NoError = 0x0
  67. DeviceNotFoundError = 0x1
  68. PermissionError = 0x2
  69. OpenError = 0x3
  70. WriteError = 0x4
  71. ReadError = 0x5
  72. ResourceError = 0x6
  73. UnsupportedOperationError = 0x7
  74. UnknownError = 0x8
  75. TimeoutError = 0x9
  76. NotOpenError = 0xa
  77. class StopBits(enum.Enum):
  78. OneStop = 0x1
  79. TwoStop = 0x2
  80. OneAndHalfStop = 0x3
  81. @typing.overload
  82. def __init__(self, info: PySide6.QtSerialPort.QSerialPortInfo, /, parent: PySide6.QtCore.QObject | None = ..., *, baudRate: int | None = ..., dataBits: PySide6.QtSerialPort.QSerialPort.DataBits | None = ..., parity: PySide6.QtSerialPort.QSerialPort.Parity | None = ..., stopBits: PySide6.QtSerialPort.QSerialPort.StopBits | None = ..., flowControl: PySide6.QtSerialPort.QSerialPort.FlowControl | None = ..., dataTerminalReady: bool | None = ..., requestToSend: bool | None = ..., error: PySide6.QtSerialPort.QSerialPort.SerialPortError | None = ..., breakEnabled: bool | None = ..., settingsRestoredOnClose: bool | None = ...) -> None: ...
  83. @typing.overload
  84. def __init__(self, name: str, /, parent: PySide6.QtCore.QObject | None = ..., *, baudRate: int | None = ..., dataBits: PySide6.QtSerialPort.QSerialPort.DataBits | None = ..., parity: PySide6.QtSerialPort.QSerialPort.Parity | None = ..., stopBits: PySide6.QtSerialPort.QSerialPort.StopBits | None = ..., flowControl: PySide6.QtSerialPort.QSerialPort.FlowControl | None = ..., dataTerminalReady: bool | None = ..., requestToSend: bool | None = ..., error: PySide6.QtSerialPort.QSerialPort.SerialPortError | None = ..., breakEnabled: bool | None = ..., settingsRestoredOnClose: bool | None = ...) -> None: ...
  85. @typing.overload
  86. def __init__(self, /, parent: PySide6.QtCore.QObject | None = ..., *, baudRate: int | None = ..., dataBits: PySide6.QtSerialPort.QSerialPort.DataBits | None = ..., parity: PySide6.QtSerialPort.QSerialPort.Parity | None = ..., stopBits: PySide6.QtSerialPort.QSerialPort.StopBits | None = ..., flowControl: PySide6.QtSerialPort.QSerialPort.FlowControl | None = ..., dataTerminalReady: bool | None = ..., requestToSend: bool | None = ..., error: PySide6.QtSerialPort.QSerialPort.SerialPortError | None = ..., breakEnabled: bool | None = ..., settingsRestoredOnClose: bool | None = ...) -> None: ...
  87. def baudRate(self, /, directions: PySide6.QtSerialPort.QSerialPort.Direction = ...) -> int: ...
  88. def bytesAvailable(self, /) -> int: ...
  89. def bytesToWrite(self, /) -> int: ...
  90. def canReadLine(self, /) -> bool: ...
  91. def clear(self, /, directions: PySide6.QtSerialPort.QSerialPort.Direction = ...) -> bool: ...
  92. def clearError(self, /) -> None: ...
  93. def close(self, /) -> None: ...
  94. def dataBits(self, /) -> PySide6.QtSerialPort.QSerialPort.DataBits: ...
  95. def error(self, /) -> PySide6.QtSerialPort.QSerialPort.SerialPortError: ...
  96. def flowControl(self, /) -> PySide6.QtSerialPort.QSerialPort.FlowControl: ...
  97. def flush(self, /) -> bool: ...
  98. def handle(self, /) -> int: ...
  99. def isBreakEnabled(self, /) -> bool: ...
  100. def isDataTerminalReady(self, /) -> bool: ...
  101. def isRequestToSend(self, /) -> bool: ...
  102. def isSequential(self, /) -> bool: ...
  103. def open(self, mode: PySide6.QtCore.QIODeviceBase.OpenModeFlag, /) -> bool: ...
  104. def parity(self, /) -> PySide6.QtSerialPort.QSerialPort.Parity: ...
  105. def pinoutSignals(self, /) -> PySide6.QtSerialPort.QSerialPort.PinoutSignal: ...
  106. def portName(self, /) -> str: ...
  107. def readBufferSize(self, /) -> int: ...
  108. def readData(self, maxSize: int, /) -> object: ...
  109. def readLineData(self, maxSize: int, /) -> object: ...
  110. def setBaudRate(self, baudRate: int, /, directions: PySide6.QtSerialPort.QSerialPort.Direction = ...) -> bool: ...
  111. def setBreakEnabled(self, /, set: bool = ...) -> bool: ...
  112. def setDataBits(self, dataBits: PySide6.QtSerialPort.QSerialPort.DataBits, /) -> bool: ...
  113. def setDataTerminalReady(self, set: bool, /) -> bool: ...
  114. def setFlowControl(self, flowControl: PySide6.QtSerialPort.QSerialPort.FlowControl, /) -> bool: ...
  115. def setParity(self, parity: PySide6.QtSerialPort.QSerialPort.Parity, /) -> bool: ...
  116. def setPort(self, info: PySide6.QtSerialPort.QSerialPortInfo, /) -> None: ...
  117. def setPortName(self, name: str, /) -> None: ...
  118. def setReadBufferSize(self, size: int, /) -> None: ...
  119. def setRequestToSend(self, set: bool, /) -> bool: ...
  120. def setSettingsRestoredOnClose(self, restore: bool, /) -> None: ...
  121. def setStopBits(self, stopBits: PySide6.QtSerialPort.QSerialPort.StopBits, /) -> bool: ...
  122. def setWriteBufferSize(self, size: int, /) -> None: ...
  123. def settingsRestoredOnClose(self, /) -> bool: ...
  124. def stopBits(self, /) -> PySide6.QtSerialPort.QSerialPort.StopBits: ...
  125. def waitForBytesWritten(self, /, msecs: int = ...) -> bool: ...
  126. def waitForReadyRead(self, /, msecs: int = ...) -> bool: ...
  127. def writeBufferSize(self, /) -> int: ...
  128. def writeData(self, data: bytes | bytearray | memoryview, maxSize: int, /) -> int: ...
  129. class QSerialPortInfo(Shiboken.Object):
  130. @typing.overload
  131. def __init__(self, /) -> None: ...
  132. @typing.overload
  133. def __init__(self, port: PySide6.QtSerialPort.QSerialPort, /) -> None: ...
  134. @typing.overload
  135. def __init__(self, other: PySide6.QtSerialPort.QSerialPortInfo, /) -> None: ...
  136. @typing.overload
  137. def __init__(self, name: str, /) -> None: ...
  138. def __copy__(self, /) -> typing.Self: ...
  139. @staticmethod
  140. def availablePorts() -> typing.List[PySide6.QtSerialPort.QSerialPortInfo]: ...
  141. def description(self, /) -> str: ...
  142. def hasProductIdentifier(self, /) -> bool: ...
  143. def hasVendorIdentifier(self, /) -> bool: ...
  144. def isNull(self, /) -> bool: ...
  145. def manufacturer(self, /) -> str: ...
  146. def portName(self, /) -> str: ...
  147. def productIdentifier(self, /) -> int: ...
  148. def serialNumber(self, /) -> str: ...
  149. @staticmethod
  150. def standardBaudRates() -> typing.List[int]: ...
  151. def swap(self, other: PySide6.QtSerialPort.QSerialPortInfo, /) -> None: ...
  152. def systemLocation(self, /) -> str: ...
  153. def vendorIdentifier(self, /) -> int: ...
  154. # eof