Remarks

For additional info on NMEA sentences, an excellent reference can found here.

Characteristic Locus
Inheritance System.Object > NmeaSentence
Inherited Members System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace Meadow.Peripherals.Sensors.Location.Gnss
Assembly Meadow.dll

Syntax

public class NmeaSentence

Constructors

NmeaSentence()

Creates a new, empty NMEA sentence.

Declaration
public NmeaSentence()

Properties

Checksum

The checksum data of the data elements. Calculated by XORing all of the data elements.

Declaration
public byte Checksum { get; }

Property Value

Type Description
System.Byte

DataElements

A list of strings that represent the data elements within a NMEA sentence, between the prefix and the checksum data.

Declaration
public List<string> DataElements { get; set; }

Property Value

Type Description
System.Collections.Generic.List<System.String>

Prefix

The prefix, excluding the $ symbol and first two letters of the sentence, i.e.: RMC.

Declaration
public string Prefix { get; set; }

Property Value

Type Description
System.String

StartingDelimiter

The first character in the sentence. Usually $, but AIVDM/AIVDO sentences might start with !.

Declaration
public string StartingDelimiter { get; set; }

Property Value

Type Description
System.String

TalkerID

The first two letters (after the starting delimiter) comprise the Talker ID, which describes the system in use, for instance "GL" means that the data came from the GLONASS system. "BD" means BeiDou, etc.

Default value is "GP".

Declaration
public string TalkerID { get; set; }

Property Value

Type Description
System.String

TalkerSystemName

Retreives the full name associated with the TalkerID via the KnownTalkerIDs property of the Lookups class.

Declaration
public string TalkerSystemName { get; }

Property Value

Type Description
System.String

Methods

From(String)

Creates a NmeaSentence from a string. Will parse the prefix, data elements, and also valide the checksum. If the checksum is invalid, it will throw an ArgumentException, therefore this should be used in a try/catch block.

Declaration
public static NmeaSentence From(string sentence)

Parameters

Type Name Description
System.String sentence

A NMEA sentence string.

Returns

Type Description
NmeaSentence

A NmeaSentence class representing with the NMEA information loaded.

GetDataString()

Returns the NMEA sentence string without the checksum digits.

Declaration
protected string GetDataString()

Returns

Type Description
System.String

ToString()

Returns a fully-expressed NMEA data string, including the prefix, data elements, and checksum information.

I.e.: $GPRMC,000049.799,V,,,,,0.00,0.00,060180,,,N*48

Declaration
public override string ToString()

Returns

Type Description
System.String

A string of the sentence.

Overrides

System.Object.ToString()