Class: QgsSerialPortSensor¶
A serial port sensor class
Added in version 3.32.
Class Hierarchy¶
Base classes¶
An abstract class QIODevice-based sensor classes  | 
|
An abstract base class for sensor classes  | 
|
Methods
Returns the baudrate of the serial port the sensor connects to.  | 
|
Returns the current delimiter used to separate data frames.  | 
|
Returns the serial port the sensor connects to.  | 
|
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.  | 
Static Methods
Returns a new serial port sensor.  | 
- class qgis.core.QgsSerialPortSensor[source]¶
 Bases:
QgsIODeviceSensor- __init__(parent: QObject | None = None)
 Constructor for a serial port sensor, bound to the specified
parent.- Parameters:
 parent (Optional[QObject] = None)
- baudRate(self) QSerialPort.BaudRate[source]¶
 Returns the baudrate of the serial port the sensor connects to.
Added in version 3.36.
- Return type:
 QSerialPort.BaudRate
- static create(parent: QObject | None) QgsSerialPortSensor | None[source]¶
 Returns a new serial port sensor.
The caller takes responsibility for deleting the returned object.
- Parameters:
 parent (Optional[QObject])
- Return type:
 Optional[QgsSerialPortSensor]
- delimiter(self) QByteArray[source]¶
 Returns the current delimiter used to separate data frames. If empty, each serial port data update will be considered a data frame.
Added in version 3.38.
- Return type:
 QByteArray
- setBaudRate(self, baudRate: QSerialPort.BaudRate)[source]¶
 Sets the baudrate of the serial port the sensor connects to.
- Parameters:
 baudRate (QSerialPort.BaudRate) – the baudrate (e.g. 9600)
Added in version 3.36.
- setDelimiter(self, delimiter: QByteArray | bytes | bytearray)[source]¶
 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, bytes, bytearray]) – Character used to identify data frames
Added in version 3.38.