NmeaLocationDataSource

class NmeaLocationDataSource : LocationDataSource

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

Constructors

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

Creates an NMEA data source object.

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:

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

Start the location data source asynchronously.

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

Stop the location data source asynchronously.

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
open override val locationChanged: SharedFlow<NmeaLocation>

A SharedFlow that emits location changes.

Link copied to clipboard
val outputDatumTransformation: DatumTransformation?
Link copied to clipboard
val outputSpatialReference: SpatialReference?
Link copied to clipboard
val receiverSpatialReference: SpatialReference
Link copied to clipboard
val satellitesChanged: SharedFlow<List<NmeaSatelliteInfo>>

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

Link copied to clipboard
val status: StateFlow<LocationDataSourceStatus>