ExAIS.Data.NMEA (ExAis v0.2.4)

View Source

Handle the parsing of the NMEA sentence.

Summary

Functions

Parses a single NMEA sentence and returns a Map.

Functions

parse(string)

@spec parse(binary()) :: {:error, {:invalid_checksum, any()}} | {:ok, any()}

Parses a single NMEA sentence and returns a Map.

Examples

iex> NMEA.parse("!AIVDM,1,1,,B,177KQJ5000G?tO`K>RA1wUbN0TKH,0*5C")
{:ok, %{talker: "!AI", formatter: "VDM", total: "1", current: "1", sequential: "", channel: "B", payload: "177KQJ5000G?tO`K>RA1wUbN0TKH", padding: "0", checksum: "5C"}}
iex> NMEA.parse("$GPGLL,5133.81,N,00042.25,W*75")
{:ok, %{talker: "$GP", formatter: "GLL", latitude: "5133.81", north_south: "N", longitude: "00042.25", east_west: "W", checksum: "75"}}