1class pyqtSignal(): 2 def connect(self, targetSignal): pass 3 def emit(self, *args): pass 4from QtCore import * 5 6from QtWidgets import * 7 8import datetime 9 10class QSerialPort(QIODevice): 11 """""" 12 # Enum QSerialPort.SerialPortError 13 NoError = 0 14 DeviceNotFoundError = 0 15 PermissionError = 0 16 OpenError = 0 17 ParityError = 0 18 FramingError = 0 19 BreakConditionError = 0 20 WriteError = 0 21 ReadError = 0 22 ResourceError = 0 23 UnsupportedOperationError = 0 24 TimeoutError = 0 25 NotOpenError = 0 26 UnknownError = 0 27 28 # Enum QSerialPort.DataErrorPolicy 29 SkipPolicy = 0 30 PassZeroPolicy = 0 31 IgnorePolicy = 0 32 StopReceivingPolicy = 0 33 UnknownPolicy = 0 34 35 # Enum QSerialPort.PinoutSignal 36 NoSignal = 0 37 TransmittedDataSignal = 0 38 ReceivedDataSignal = 0 39 DataTerminalReadySignal = 0 40 DataCarrierDetectSignal = 0 41 DataSetReadySignal = 0 42 RingIndicatorSignal = 0 43 RequestToSendSignal = 0 44 ClearToSendSignal = 0 45 SecondaryTransmittedDataSignal = 0 46 SecondaryReceivedDataSignal = 0 47 48 # Enum QSerialPort.FlowControl 49 NoFlowControl = 0 50 HardwareControl = 0 51 SoftwareControl = 0 52 UnknownFlowControl = 0 53 54 # Enum QSerialPort.StopBits 55 OneStop = 0 56 OneAndHalfStop = 0 57 TwoStop = 0 58 UnknownStopBits = 0 59 60 # Enum QSerialPort.Parity 61 NoParity = 0 62 EvenParity = 0 63 OddParity = 0 64 SpaceParity = 0 65 MarkParity = 0 66 UnknownParity = 0 67 68 # Enum QSerialPort.DataBits 69 Data5 = 0 70 Data6 = 0 71 Data7 = 0 72 Data8 = 0 73 UnknownDataBits = 0 74 75 # Enum QSerialPort.BaudRate 76 Baud1200 = 0 77 Baud2400 = 0 78 Baud4800 = 0 79 Baud9600 = 0 80 Baud19200 = 0 81 Baud38400 = 0 82 Baud57600 = 0 83 Baud115200 = 0 84 UnknownBaud = 0 85 86 # Enum QSerialPort.Direction 87 Input = 0 88 Output = 0 89 AllDirections = 0 90 91 def __init__(self, parent = None): 92 '''void QSerialPort.__init__(QObject parent = None)''' 93 def __init__(self, name, parent = None): 94 '''void QSerialPort.__init__(str name, QObject parent = None)''' 95 def __init__(self, info, parent = None): 96 '''void QSerialPort.__init__(QSerialPortInfo info, QObject parent = None)''' 97 breakEnabledChanged = pyqtSignal() # void breakEnabledChanged(bool) - signal 98 def isBreakEnabled(self): 99 '''bool QSerialPort.isBreakEnabled()''' 100 return bool() 101 def handle(self): 102 '''int QSerialPort.handle()''' 103 return int() 104 def writeData(self, data): 105 '''int QSerialPort.writeData(str data)''' 106 return int() 107 def readLineData(self, maxlen): 108 '''str QSerialPort.readLineData(int maxlen)''' 109 return str() 110 def readData(self, maxlen): 111 '''str QSerialPort.readData(int maxlen)''' 112 return str() 113 settingsRestoredOnCloseChanged = pyqtSignal() # void settingsRestoredOnCloseChanged(bool) - signal 114 requestToSendChanged = pyqtSignal() # void requestToSendChanged(bool) - signal 115 dataTerminalReadyChanged = pyqtSignal() # void dataTerminalReadyChanged(bool) - signal 116 dataErrorPolicyChanged = pyqtSignal() # void dataErrorPolicyChanged(QSerialPort::DataErrorPolicy) - signal 117 flowControlChanged = pyqtSignal() # void flowControlChanged(QSerialPort::FlowControl) - signal 118 stopBitsChanged = pyqtSignal() # void stopBitsChanged(QSerialPort::StopBits) - signal 119 parityChanged = pyqtSignal() # void parityChanged(QSerialPort::Parity) - signal 120 dataBitsChanged = pyqtSignal() # void dataBitsChanged(QSerialPort::DataBits) - signal 121 baudRateChanged = pyqtSignal() # void baudRateChanged(qint32,QSerialPort::Directions) - signal 122 def setBreakEnabled(self, enabled = True): 123 '''bool QSerialPort.setBreakEnabled(bool enabled = True)''' 124 return bool() 125 def sendBreak(self, duration = 0): 126 '''bool QSerialPort.sendBreak(int duration = 0)''' 127 return bool() 128 def waitForBytesWritten(self, msecs): 129 '''bool QSerialPort.waitForBytesWritten(int msecs)''' 130 return bool() 131 def waitForReadyRead(self, msecs): 132 '''bool QSerialPort.waitForReadyRead(int msecs)''' 133 return bool() 134 def canReadLine(self): 135 '''bool QSerialPort.canReadLine()''' 136 return bool() 137 def bytesToWrite(self): 138 '''int QSerialPort.bytesToWrite()''' 139 return int() 140 def bytesAvailable(self): 141 '''int QSerialPort.bytesAvailable()''' 142 return int() 143 def isSequential(self): 144 '''bool QSerialPort.isSequential()''' 145 return bool() 146 def setReadBufferSize(self, size): 147 '''void QSerialPort.setReadBufferSize(int size)''' 148 def readBufferSize(self): 149 '''int QSerialPort.readBufferSize()''' 150 return int() 151 def clearError(self): 152 '''void QSerialPort.clearError()''' 153 def error(self): 154 '''QSerialPort.SerialPortError QSerialPort.error()''' 155 return QSerialPort.SerialPortError() 156 error = pyqtSignal() # void error(QSerialPort::SerialPortError) - signal 157 def dataErrorPolicy(self): 158 '''QSerialPort.DataErrorPolicy QSerialPort.dataErrorPolicy()''' 159 return QSerialPort.DataErrorPolicy() 160 def setDataErrorPolicy(self, policy = None): 161 '''bool QSerialPort.setDataErrorPolicy(QSerialPort.DataErrorPolicy policy = QSerialPort.IgnorePolicy)''' 162 return bool() 163 def atEnd(self): 164 '''bool QSerialPort.atEnd()''' 165 return bool() 166 def clear(self, dir = None): 167 '''bool QSerialPort.clear(QSerialPort.Directions dir = QSerialPort.AllDirections)''' 168 return bool() 169 def flush(self): 170 '''bool QSerialPort.flush()''' 171 return bool() 172 def pinoutSignals(self): 173 '''QSerialPort.PinoutSignals QSerialPort.pinoutSignals()''' 174 return QSerialPort.PinoutSignals() 175 def isRequestToSend(self): 176 '''bool QSerialPort.isRequestToSend()''' 177 return bool() 178 def setRequestToSend(self, set): 179 '''bool QSerialPort.setRequestToSend(bool set)''' 180 return bool() 181 def isDataTerminalReady(self): 182 '''bool QSerialPort.isDataTerminalReady()''' 183 return bool() 184 def setDataTerminalReady(self, set): 185 '''bool QSerialPort.setDataTerminalReady(bool set)''' 186 return bool() 187 def flowControl(self): 188 '''QSerialPort.FlowControl QSerialPort.flowControl()''' 189 return QSerialPort.FlowControl() 190 def setFlowControl(self, flow): 191 '''bool QSerialPort.setFlowControl(QSerialPort.FlowControl flow)''' 192 return bool() 193 def stopBits(self): 194 '''QSerialPort.StopBits QSerialPort.stopBits()''' 195 return QSerialPort.StopBits() 196 def setStopBits(self, stopBits): 197 '''bool QSerialPort.setStopBits(QSerialPort.StopBits stopBits)''' 198 return bool() 199 def parity(self): 200 '''QSerialPort.Parity QSerialPort.parity()''' 201 return QSerialPort.Parity() 202 def setParity(self, parity): 203 '''bool QSerialPort.setParity(QSerialPort.Parity parity)''' 204 return bool() 205 def dataBits(self): 206 '''QSerialPort.DataBits QSerialPort.dataBits()''' 207 return QSerialPort.DataBits() 208 def setDataBits(self, dataBits): 209 '''bool QSerialPort.setDataBits(QSerialPort.DataBits dataBits)''' 210 return bool() 211 def baudRate(self, dir = None): 212 '''int QSerialPort.baudRate(QSerialPort.Directions dir = QSerialPort.AllDirections)''' 213 return int() 214 def setBaudRate(self, baudRate, dir = None): 215 '''bool QSerialPort.setBaudRate(int baudRate, QSerialPort.Directions dir = QSerialPort.AllDirections)''' 216 return bool() 217 def settingsRestoredOnClose(self): 218 '''bool QSerialPort.settingsRestoredOnClose()''' 219 return bool() 220 def setSettingsRestoredOnClose(self, restore): 221 '''void QSerialPort.setSettingsRestoredOnClose(bool restore)''' 222 def close(self): 223 '''void QSerialPort.close()''' 224 def open(self, mode): 225 '''bool QSerialPort.open(QIODevice.OpenMode mode)''' 226 return bool() 227 def setPort(self, info): 228 '''void QSerialPort.setPort(QSerialPortInfo info)''' 229 def portName(self): 230 '''str QSerialPort.portName()''' 231 return str() 232 def setPortName(self, name): 233 '''void QSerialPort.setPortName(str name)''' 234 class PinoutSignals(): 235 """""" 236 def __init__(self): 237 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__init__()''' 238 return QSerialPort.PinoutSignals() 239 def __init__(self): 240 '''int QSerialPort.PinoutSignals.__init__()''' 241 return int() 242 def __init__(self): 243 '''void QSerialPort.PinoutSignals.__init__()''' 244 def __bool__(self): 245 '''int QSerialPort.PinoutSignals.__bool__()''' 246 return int() 247 def __ne__(self, f): 248 '''bool QSerialPort.PinoutSignals.__ne__(QSerialPort.PinoutSignals f)''' 249 return bool() 250 def __eq__(self, f): 251 '''bool QSerialPort.PinoutSignals.__eq__(QSerialPort.PinoutSignals f)''' 252 return bool() 253 def __invert__(self): 254 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__invert__()''' 255 return QSerialPort.PinoutSignals() 256 def __and__(self, mask): 257 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__and__(int mask)''' 258 return QSerialPort.PinoutSignals() 259 def __xor__(self, f): 260 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__xor__(QSerialPort.PinoutSignals f)''' 261 return QSerialPort.PinoutSignals() 262 def __xor__(self, f): 263 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__xor__(int f)''' 264 return QSerialPort.PinoutSignals() 265 def __or__(self, f): 266 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__or__(QSerialPort.PinoutSignals f)''' 267 return QSerialPort.PinoutSignals() 268 def __or__(self, f): 269 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__or__(int f)''' 270 return QSerialPort.PinoutSignals() 271 def __int__(self): 272 '''int QSerialPort.PinoutSignals.__int__()''' 273 return int() 274 def __ixor__(self, f): 275 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__ixor__(QSerialPort.PinoutSignals f)''' 276 return QSerialPort.PinoutSignals() 277 def __ior__(self, f): 278 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__ior__(QSerialPort.PinoutSignals f)''' 279 return QSerialPort.PinoutSignals() 280 def __iand__(self, mask): 281 '''QSerialPort.PinoutSignals QSerialPort.PinoutSignals.__iand__(int mask)''' 282 return QSerialPort.PinoutSignals() 283 class Directions(): 284 """""" 285 def __init__(self): 286 '''QSerialPort.Directions QSerialPort.Directions.__init__()''' 287 return QSerialPort.Directions() 288 def __init__(self): 289 '''int QSerialPort.Directions.__init__()''' 290 return int() 291 def __init__(self): 292 '''void QSerialPort.Directions.__init__()''' 293 def __bool__(self): 294 '''int QSerialPort.Directions.__bool__()''' 295 return int() 296 def __ne__(self, f): 297 '''bool QSerialPort.Directions.__ne__(QSerialPort.Directions f)''' 298 return bool() 299 def __eq__(self, f): 300 '''bool QSerialPort.Directions.__eq__(QSerialPort.Directions f)''' 301 return bool() 302 def __invert__(self): 303 '''QSerialPort.Directions QSerialPort.Directions.__invert__()''' 304 return QSerialPort.Directions() 305 def __and__(self, mask): 306 '''QSerialPort.Directions QSerialPort.Directions.__and__(int mask)''' 307 return QSerialPort.Directions() 308 def __xor__(self, f): 309 '''QSerialPort.Directions QSerialPort.Directions.__xor__(QSerialPort.Directions f)''' 310 return QSerialPort.Directions() 311 def __xor__(self, f): 312 '''QSerialPort.Directions QSerialPort.Directions.__xor__(int f)''' 313 return QSerialPort.Directions() 314 def __or__(self, f): 315 '''QSerialPort.Directions QSerialPort.Directions.__or__(QSerialPort.Directions f)''' 316 return QSerialPort.Directions() 317 def __or__(self, f): 318 '''QSerialPort.Directions QSerialPort.Directions.__or__(int f)''' 319 return QSerialPort.Directions() 320 def __int__(self): 321 '''int QSerialPort.Directions.__int__()''' 322 return int() 323 def __ixor__(self, f): 324 '''QSerialPort.Directions QSerialPort.Directions.__ixor__(QSerialPort.Directions f)''' 325 return QSerialPort.Directions() 326 def __ior__(self, f): 327 '''QSerialPort.Directions QSerialPort.Directions.__ior__(QSerialPort.Directions f)''' 328 return QSerialPort.Directions() 329 def __iand__(self, mask): 330 '''QSerialPort.Directions QSerialPort.Directions.__iand__(int mask)''' 331 return QSerialPort.Directions() 332 333 334class QSerialPortInfo(): 335 """""" 336 def __init__(self): 337 '''void QSerialPortInfo.__init__()''' 338 def __init__(self, port): 339 '''void QSerialPortInfo.__init__(QSerialPort port)''' 340 def __init__(self, name): 341 '''void QSerialPortInfo.__init__(str name)''' 342 def __init__(self, other): 343 '''void QSerialPortInfo.__init__(QSerialPortInfo other)''' 344 def serialNumber(self): 345 '''str QSerialPortInfo.serialNumber()''' 346 return str() 347 def isNull(self): 348 '''bool QSerialPortInfo.isNull()''' 349 return bool() 350 def availablePorts(self): 351 '''static list-of-QSerialPortInfo QSerialPortInfo.availablePorts()''' 352 return [QSerialPortInfo()] 353 def standardBaudRates(self): 354 '''static list-of-int QSerialPortInfo.standardBaudRates()''' 355 return [int()] 356 def isValid(self): 357 '''bool QSerialPortInfo.isValid()''' 358 return bool() 359 def isBusy(self): 360 '''bool QSerialPortInfo.isBusy()''' 361 return bool() 362 def hasProductIdentifier(self): 363 '''bool QSerialPortInfo.hasProductIdentifier()''' 364 return bool() 365 def hasVendorIdentifier(self): 366 '''bool QSerialPortInfo.hasVendorIdentifier()''' 367 return bool() 368 def productIdentifier(self): 369 '''int QSerialPortInfo.productIdentifier()''' 370 return int() 371 def vendorIdentifier(self): 372 '''int QSerialPortInfo.vendorIdentifier()''' 373 return int() 374 def manufacturer(self): 375 '''str QSerialPortInfo.manufacturer()''' 376 return str() 377 def description(self): 378 '''str QSerialPortInfo.description()''' 379 return str() 380 def systemLocation(self): 381 '''str QSerialPortInfo.systemLocation()''' 382 return str() 383 def portName(self): 384 '''str QSerialPortInfo.portName()''' 385 return str() 386 def swap(self, other): 387 '''void QSerialPortInfo.swap(QSerialPortInfo other)''' 388 389 390