QtSerialPort.pyi 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. # The PEP 484 type hints stub file for the QtSerialPort module.
  2. #
  3. # Generated by SIP 6.15.3
  4. #
  5. # Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. #
  7. # This file is part of PyQt6.
  8. #
  9. # This file may be used under the terms of the GNU General Public License
  10. # version 3.0 as published by the Free Software Foundation and appearing in
  11. # the file LICENSE included in the packaging of this file. Please review the
  12. # following information to ensure the GNU General Public License version 3.0
  13. # requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. #
  15. # If you do not wish to use this file under the terms of the GPL version 3.0
  16. # then you may purchase a commercial license. For more information contact
  17. # info@riverbankcomputing.com.
  18. #
  19. # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. import collections, re, typing, enum
  22. try:
  23. from warnings import deprecated
  24. except ImportError:
  25. pass
  26. import PyQt6.sip
  27. from PyQt6 import QtCore
  28. # Support for QDate, QDateTime and QTime.
  29. import datetime
  30. # Convenient type aliases.
  31. PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
  32. PYQT_SLOT = typing.Union[collections.abc.Callable[..., Any], QtCore.pyqtBoundSignal]
  33. class QSerialPort(QtCore.QIODevice):
  34. class SerialPortError(enum.Enum):
  35. NoError = ... # type: QSerialPort.SerialPortError
  36. DeviceNotFoundError = ... # type: QSerialPort.SerialPortError
  37. PermissionError = ... # type: QSerialPort.SerialPortError
  38. OpenError = ... # type: QSerialPort.SerialPortError
  39. WriteError = ... # type: QSerialPort.SerialPortError
  40. ReadError = ... # type: QSerialPort.SerialPortError
  41. ResourceError = ... # type: QSerialPort.SerialPortError
  42. UnsupportedOperationError = ... # type: QSerialPort.SerialPortError
  43. TimeoutError = ... # type: QSerialPort.SerialPortError
  44. NotOpenError = ... # type: QSerialPort.SerialPortError
  45. UnknownError = ... # type: QSerialPort.SerialPortError
  46. class PinoutSignal(enum.Flag):
  47. NoSignal = ... # type: QSerialPort.PinoutSignal
  48. DataTerminalReadySignal = ... # type: QSerialPort.PinoutSignal
  49. DataCarrierDetectSignal = ... # type: QSerialPort.PinoutSignal
  50. DataSetReadySignal = ... # type: QSerialPort.PinoutSignal
  51. RingIndicatorSignal = ... # type: QSerialPort.PinoutSignal
  52. RequestToSendSignal = ... # type: QSerialPort.PinoutSignal
  53. ClearToSendSignal = ... # type: QSerialPort.PinoutSignal
  54. SecondaryTransmittedDataSignal = ... # type: QSerialPort.PinoutSignal
  55. SecondaryReceivedDataSignal = ... # type: QSerialPort.PinoutSignal
  56. class FlowControl(enum.Enum):
  57. NoFlowControl = ... # type: QSerialPort.FlowControl
  58. HardwareControl = ... # type: QSerialPort.FlowControl
  59. SoftwareControl = ... # type: QSerialPort.FlowControl
  60. class StopBits(enum.Enum):
  61. OneStop = ... # type: QSerialPort.StopBits
  62. OneAndHalfStop = ... # type: QSerialPort.StopBits
  63. TwoStop = ... # type: QSerialPort.StopBits
  64. class Parity(enum.Enum):
  65. NoParity = ... # type: QSerialPort.Parity
  66. EvenParity = ... # type: QSerialPort.Parity
  67. OddParity = ... # type: QSerialPort.Parity
  68. SpaceParity = ... # type: QSerialPort.Parity
  69. MarkParity = ... # type: QSerialPort.Parity
  70. class DataBits(enum.Enum):
  71. Data5 = ... # type: QSerialPort.DataBits
  72. Data6 = ... # type: QSerialPort.DataBits
  73. Data7 = ... # type: QSerialPort.DataBits
  74. Data8 = ... # type: QSerialPort.DataBits
  75. class BaudRate(enum.Enum):
  76. Baud1200 = ... # type: QSerialPort.BaudRate
  77. Baud2400 = ... # type: QSerialPort.BaudRate
  78. Baud4800 = ... # type: QSerialPort.BaudRate
  79. Baud9600 = ... # type: QSerialPort.BaudRate
  80. Baud19200 = ... # type: QSerialPort.BaudRate
  81. Baud38400 = ... # type: QSerialPort.BaudRate
  82. Baud57600 = ... # type: QSerialPort.BaudRate
  83. Baud115200 = ... # type: QSerialPort.BaudRate
  84. class Direction(enum.Flag):
  85. Input = ... # type: QSerialPort.Direction
  86. Output = ... # type: QSerialPort.Direction
  87. AllDirections = ... # type: QSerialPort.Direction
  88. @typing.overload
  89. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  90. @typing.overload
  91. def __init__(self, name: str|None, parent: QtCore.QObject|None = ...) -> None: ...
  92. @typing.overload
  93. def __init__(self, info: 'QSerialPortInfo', parent: QtCore.QObject|None = ...) -> None: ...
  94. def setWriteBufferSize(self, size: int) -> None: ...
  95. def writeBufferSize(self) -> int: ...
  96. settingsRestoredOnCloseChanged: typing.ClassVar[QtCore.pyqtSignal]
  97. def setSettingsRestoredOnClose(self, restore: bool) -> None: ...
  98. def settingsRestoredOnClose(self) -> bool: ...
  99. errorOccurred: typing.ClassVar[QtCore.pyqtSignal]
  100. breakEnabledChanged: typing.ClassVar[QtCore.pyqtSignal]
  101. def isBreakEnabled(self) -> bool: ...
  102. def handle(self) -> PyQt6.sip.voidptr: ...
  103. def writeData(self, data: PyQt6.sip.array[bytes]) -> int: ...
  104. def readLineData(self, maxlen: int) -> bytes: ...
  105. def readData(self, maxlen: int) -> bytes: ...
  106. requestToSendChanged: typing.ClassVar[QtCore.pyqtSignal]
  107. dataTerminalReadyChanged: typing.ClassVar[QtCore.pyqtSignal]
  108. flowControlChanged: typing.ClassVar[QtCore.pyqtSignal]
  109. stopBitsChanged: typing.ClassVar[QtCore.pyqtSignal]
  110. parityChanged: typing.ClassVar[QtCore.pyqtSignal]
  111. dataBitsChanged: typing.ClassVar[QtCore.pyqtSignal]
  112. baudRateChanged: typing.ClassVar[QtCore.pyqtSignal]
  113. def setBreakEnabled(self, enabled: bool = ...) -> bool: ...
  114. def waitForBytesWritten(self, msecs: int = ...) -> bool: ...
  115. def waitForReadyRead(self, msecs: int = ...) -> bool: ...
  116. def canReadLine(self) -> bool: ...
  117. def bytesToWrite(self) -> int: ...
  118. def bytesAvailable(self) -> int: ...
  119. def isSequential(self) -> bool: ...
  120. def setReadBufferSize(self, size: int) -> None: ...
  121. def readBufferSize(self) -> int: ...
  122. def clearError(self) -> None: ...
  123. def error(self) -> 'QSerialPort.SerialPortError': ...
  124. def clear(self, dir: 'QSerialPort.Direction' = ...) -> bool: ...
  125. def flush(self) -> bool: ...
  126. def pinoutSignals(self) -> 'QSerialPort.PinoutSignal': ...
  127. def isRequestToSend(self) -> bool: ...
  128. def setRequestToSend(self, set: bool) -> bool: ...
  129. def isDataTerminalReady(self) -> bool: ...
  130. def setDataTerminalReady(self, set: bool) -> bool: ...
  131. def flowControl(self) -> 'QSerialPort.FlowControl': ...
  132. def setFlowControl(self, flow: 'QSerialPort.FlowControl') -> bool: ...
  133. def stopBits(self) -> 'QSerialPort.StopBits': ...
  134. def setStopBits(self, stopBits: 'QSerialPort.StopBits') -> bool: ...
  135. def parity(self) -> 'QSerialPort.Parity': ...
  136. def setParity(self, parity: 'QSerialPort.Parity') -> bool: ...
  137. def dataBits(self) -> 'QSerialPort.DataBits': ...
  138. def setDataBits(self, dataBits: 'QSerialPort.DataBits') -> bool: ...
  139. def baudRate(self, dir: 'QSerialPort.Direction' = ...) -> int: ...
  140. def setBaudRate(self, baudRate: int, dir: 'QSerialPort.Direction' = ...) -> bool: ...
  141. def close(self) -> None: ...
  142. def open(self, mode: QtCore.QIODeviceBase.OpenModeFlag) -> bool: ...
  143. def setPort(self, info: 'QSerialPortInfo') -> None: ...
  144. def portName(self) -> str: ...
  145. def setPortName(self, name: str|None) -> None: ...
  146. class QSerialPortInfo(PyQt6.sip.simplewrapper):
  147. @typing.overload
  148. def __init__(self) -> None: ...
  149. @typing.overload
  150. def __init__(self, port: QSerialPort) -> None: ...
  151. @typing.overload
  152. def __init__(self, name: str|None) -> None: ...
  153. @typing.overload
  154. def __init__(self, other: 'QSerialPortInfo') -> None: ...
  155. def serialNumber(self) -> str: ...
  156. def isNull(self) -> bool: ...
  157. @staticmethod
  158. def availablePorts() -> list['QSerialPortInfo']: ...
  159. @staticmethod
  160. def standardBaudRates() -> list[int]: ...
  161. def hasProductIdentifier(self) -> bool: ...
  162. def hasVendorIdentifier(self) -> bool: ...
  163. def productIdentifier(self) -> int: ...
  164. def vendorIdentifier(self) -> int: ...
  165. def manufacturer(self) -> str: ...
  166. def description(self) -> str: ...
  167. def systemLocation(self) -> str: ...
  168. def portName(self) -> str: ...
  169. def swap(self, other: 'QSerialPortInfo') -> None: ...