class QNmeaSatelliteInfoSource

The QNmeaSatelliteInfoSource class provides satellite information using an NMEA data source. More

Inheritance diagram of PySide6.QtPositioning.QNmeaSatelliteInfoSource

Synopsis

Methods

Virtual methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

NMEA is a commonly used protocol for the specification of one’s global position at a certain point in time. The QNmeaSatelliteInfoSource class reads NMEA data and uses it to provide information about satellites in view and satellites in use in form of lists of QGeoSatelliteInfo objects.

A QNmeaSatelliteInfoSource instance operates in either RealTimeMode or SimulationMode . These modes allow NMEA data to be read from either a live source of data, or replayed for simulation purposes from previously recorded NMEA data.

The source of NMEA data is set via setDevice() .

Use startUpdates() to start receiving regular satellite information updates and stopUpdates() to stop these updates. If you only require updates occasionally, you can call requestUpdate() to request a single update of both satellites in view and satellites in use.

The information about satellites in view is received via the satellitesInViewUpdated() signal.

The information about satellites in use is received via the satellitesInUseUpdated() signal.

class UpdateMode

Defines the available update modes.

Constant

Description

QNmeaSatelliteInfoSource.UpdateMode.RealTimeMode

Satellite information is read and distributed from the data source as it becomes available. Use this mode if you are using a live source of NMEA data (for example a GPS hardware device).

QNmeaSatelliteInfoSource.UpdateMode.SimulationMode

Satellite information is read and distributed from the data source at the given rate. The rate is determined by the SimulationUpdateInterval parameter. Use this mode if the data source contains previously recorded NMEA data and you want to replay the data for simulation purposes.

class SatelliteInfoParseStatus

Defines the parse status of satellite information. The satellite information can be split into multiple sentences, and we need to parse all of them.

Constant

Description

QNmeaSatelliteInfoSource.NotParsed

The data does not contain information about satellites.

QNmeaSatelliteInfoSource.PartiallyParsed

A valid satellite information is received and parsed, but it’s not complete, so we need to wait for another NMEA sentence.

QNmeaSatelliteInfoSource.FullyParsed

Satellite information was fully collected and parsed.

PySide6.QtPositioning.QNmeaSatelliteInfoSource.SimulationUpdateInterval
__init__(mode[, parent=None])
Parameters:

Constructs a QNmeaSatelliteInfoSource instance with the given parent and mode.

device()
Return type:

QIODevice

Returns the NMEA data source.

See also

setDevice()

parseSatelliteInfoFromNmea(data, infos, system)
Parameters:
  • dataQByteArrayView

  • infos – .list of QGeoSatelliteInfo

  • systemSatelliteSystem

Return type:

SatelliteInfoParseStatus

parseSatelliteInfoFromNmea(data, size, infos, system)
Parameters:
  • data – str

  • size – int

  • infos – .list of QGeoSatelliteInfo

  • systemSatelliteSystem

Return type:

SatelliteInfoParseStatus

Parses an NMEA sentence string to extract the information about satellites in view.

The default implementation will parse standard NMEA $GPGSV sentences. This method should be reimplemented in a subclass whenever the need to deal with non-standard NMEA sentences arises.

The parser reads size bytes from data and uses that information to fill infos list.

Returns SatelliteInfoParseStatus with parse result. Modifies infos list in case PartiallyParsed or FullyParsed is returned. Also sets the system to correct satellite system type. This is required to determine the system type in case there are no satellites in view.

parseSatellitesInUseFromNmea(data, pnrsInUse)
Parameters:
  • dataQByteArrayView

  • pnrsInUse – .list of int

Return type:

SatelliteSystem

parseSatellitesInUseFromNmea(data, size, pnrsInUse)
Parameters:
  • data – str

  • size – int

  • pnrsInUse – .list of int

Return type:

SatelliteSystem

Parses an NMEA sentence string to extract the IDs of satelites in use.

The default implementation will parse standard NMEA $GPGSA sentences. This method should be reimplemented in a subclass whenever the need to deal with non-standard NMEA sentences arises.

The parser reads size bytes from data and uses that information to fill pnrsInUse list.

Returns system type if the sentence was successfully parsed, otherwise returns Undefined and should not modifiy pnrsInUse.

setDevice(source)
Parameters:

sourceQIODevice

Sets the NMEA data source to device. If the device is not open, it will be opened in QIODevice::ReadOnly mode.

The source device can only be set once and must be set before calling startUpdates() or requestUpdate() .

Note

The device must emit QIODevice::readyRead() for the source to be notified when data is available for reading. QNmeaSatelliteInfoSource does not assume the ownership of the device, and hence does not deallocate it upon destruction.

See also

device()

setError(satelliteError)
Parameters:

satelliteErrorError

updateMode()
Return type:

UpdateMode

Returns the update mode.