Class: QgsSerialPortSensor¶
- class qgis.core.QgsSerialPortSensor¶
Bases:
QgsIODeviceSensor
A serial port sensor class
New in version 3.32.
QgsSerialPortSensor(parent: QObject = None) Constructor for a serial port sensor, bound to the specified
parent
.Methods
Returns the baudrate of the serial port the sensor connects to.
Returns a new serial port sensor.
Returns the current delimiter used to separate data frames.
Initiates the I/O
device
.Returns the serial port the sensor connects to.
- param element:
Sets the baudrate of the serial port the sensor connects to.
Sets the delimiter used to identify data frames out of the data received from the serial port.
Sets the serial port the sensor connects to.
- rtype:
str
- param element:
- baudRate(self) QSerialPort.BaudRate ¶
Returns the baudrate of the serial port the sensor connects to.
New in version 3.36.
- Return type:
QSerialPort.BaudRate
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- create(parent: QObject) QgsSerialPortSensor ¶
Returns a new serial port sensor.
The caller takes responsibility for deleting the returned object.
- Parameters:
parent (QObject) –
- Return type:
- customEvent(self, QEvent)¶
- delimiter(self) QByteArray ¶
Returns the current delimiter used to separate data frames. If empty, each serial port data update will be considered a data frame.
New in version 3.38.
- Return type:
QByteArray
- disconnectNotify(self, QMetaMethod)¶
- handleConnect(self)¶
- handleDisconnect(self)¶
- initIODevice(self, device: QIODevice)¶
Initiates the I/O
device
.Note
Takes ownership of the device.
- isSignalConnected(self, QMetaMethod) bool ¶
- parseData(self)¶
- portName(self) str ¶
Returns the serial port the sensor connects to.
- Return type:
str
- readPropertiesFromElement(self, element: QDomElement, document: QDomDocument) bool ¶
- Parameters:
element (QDomElement) –
document (QDomDocument) –
- Return type:
bool
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setBaudRate(self, baudRate: QSerialPort.BaudRate)¶
Sets the baudrate of the serial port the sensor connects to.
- Parameters:
baudRate (QSerialPort.BaudRate) – the baudrate (e.g. 9600)
New in version 3.36.
- setDelimiter(self, delimiter: QByteArray | bytes | bytearray)¶
Sets the delimiter used to identify data frames out of the data received from the serial port. If empty, each serial port data update will be considered a data frame.
- Parameters:
delimiter (Union[QByteArray) – Character used to identify data frames
New in version 3.38.
- setPortName(self, portName: str)¶
Sets the serial port the sensor connects to.
- Parameters:
portName (str) – the port name (e.g. COM4)
- timerEvent(self, QTimerEvent)¶
- type(self) str ¶
- Return type:
str
- writePropertiesToElement(self, element: QDomElement, document: QDomDocument) bool ¶
- Parameters:
element (QDomElement) –
document (QDomDocument) –
- Return type:
bool