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

childEvent

connectNotify

create

Returns a new serial port sensor.

customEvent

disconnectNotify

handleConnect

handleDisconnect

initIODevice

Initiates the I/O device.

isSignalConnected

parseData

Parses the data read from the device when available.

portName

Returns the serial port the sensor connects to.

readPropertiesFromElement

param element:

receivers

sender

senderSignalIndex

setPortName

Sets the serial port the sensor connects to.

timerEvent

type

rtype:

str

writePropertiesToElement

param element:

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:

QgsSerialPortSensor

customEvent(self, QEvent)
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)

Parses the data read from the device when available.

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
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