Class: QgsGpsConnection

Abstract base class for connections to a GPS device.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: parseData()

Class Hierarchy

Inheritance diagram of qgis.core.QgsGpsConnection

Base classes

QObject

Subclasses

QgsNmeaConnection

Evaluates NMEA sentences coming from a GPS device.

QgsQtLocationConnection

A GPS connection subclass based on the Qt Location libraries.

class qgis.core.QgsGpsConnection[source]

Bases: QObject

__init__(dev: QIODevice | None)

Constructor

Parameters:

dev (Optional[QIODevice]) – input device for the connection (e.g. serial device). The class takes ownership of the object

Connected = 1
DataReceived = 2
GPSDataReceived = 3
NotConnected = 0
class Status

Bases: int

close(self) bool[source]

Closes connection to device

Return type:

bool

connect(self) bool[source]

Opens connection to device

Return type:

bool

currentGPSInformation(self) QgsGpsInformation[source]

Returns the current gps information (lat, lon, etc.)

Return type:

QgsGpsInformation

signal fixStatusChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lastValidLocation(self) QgsPoint[source]

Returns the last valid location obtained by the device.

Added in version 3.30.

Return type:

QgsPoint

signal nmeaSentenceReceived[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

abstract parseData(self)[source]

Parse available data source content

signal positionChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

setSource(self, source: QIODevice | None)[source]

Sets the GPS source. The class takes ownership of the device class

Parameters:

source (Optional[QIODevice])

signal stateChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

status(self) QgsGpsConnection.Status[source]

Returns the status. Possible state are not connected, connected, data received

Return type:

QgsGpsConnection.Status