NmeaLocationDataSource

An NMEA location data source object. This object will parse specific NMEA messages pushed into it. Valid GGA, GSA, GST, GSV, RMC, VTG messages are parsed and, depending upon the message type and contents, a LocationDataSourceLocationChangedEvent or NmeaLocationDataSourceSatellitesChangedEvent may be raised. The LocationDataSourceLocationChangedEvent will return a NmeaLocation object. The NmeaLocationDataSourceSatellitesChangedEvent will return an array of NmeaSatelliteInfo objects. This data source is based on NMEA version 4.11 (November 2018).

Since

200.1.0

Constructors

Link copied to clipboard
constructor(receiverSpatialReference: SpatialReference = SpatialReference(4_326, 115_700), outputSpatialReference: SpatialReference? = null, outputDatumTransformation: DatumTransformation? = null)

Creates an NMEA data source object.

Properties

Link copied to clipboard
open override val locationChanged: SharedFlow<NmeaLocation>

A SharedFlow that emits location changes.

Link copied to clipboard

The DatumTransformation to be used in the project operation. If set, this property will be used as the DatumTransformation in the call to GeometryEngine.projectOrNull(Geometry, SpatialReference, DatumTransformation). For this property to be used the NmeaLocationDataSource.outputSpatialReference also has to be set.

Link copied to clipboard

If set calls the GeometryEngine.projectOrNull(Geometry, SpatialReference) method to generate the output spatial reference. The projected point will be stored in NmeaLocation.position. If this property is null the NmeaLocation.position will be contain the original incoming x,y,z values from the NMEA data sentence and the NmeaLocationDataSource.receiverSpatialReference.

Link copied to clipboard

The SpatialReference to be assigned to the output NmeaLocation, the default is WGS84 By default this will be WGS84 for its horizontal (WKID=4326) and vertical reference systems (WKID=115700), this can be set to a different SpatialReference if a receiver returns locations in a different reference system.

Link copied to clipboard

Set the satellite info changed callback function for the location data source.

Inherited properties

Link copied to clipboard
val error: StateFlow<Throwable?>

An error that describes a problem encountered while starting or running the LocationDataSource. This property is used to notify the user about errors that occur in LocationDataSource. Such errors are critical for LocationDataSource and will cause it stop. If LocationDataSource cannot be started, or it stopped after a successful start, this property will store information related to what caused LocationDataSource to stop.

Link copied to clipboard
val headingChanged: SharedFlow<Double>

Set the heading changed callback function for the location data source.

Link copied to clipboard

The current status of the location data source. The status indicates if the location data source is starting, started, stopping, stopped, and has failed to start.

Functions

Link copied to clipboard
fun pushData(data: ByteArray?)

Reads the input NMEA data creating a NmeaLocation. The NMEA location data source needs to be started before calling this method. When pushing data:

Inherited functions

Link copied to clipboard
suspend fun start(): Result<Unit>

Starts the location data source asynchronously and prepares to begin receiving location updates.

Link copied to clipboard
suspend fun stop(): Result<Unit>

Stop the location data source asynchronously.