Aprs.NMEAHelpers (aprs v2.0.1)

View Source

NMEA coordinate, sentence, and Ultimeter packet parsing helpers for APRS.

Summary

Functions

Convert an NMEA DDMM.MMMM coordinate and its hemisphere letter to degrees.

Parse an NMEA sentence or a Peet Bros $ULTW packet.

Functions

parse_nmea_coordinate(value, direction)

@spec parse_nmea_coordinate(term(), term()) :: {:ok, float()} | {:error, String.t()}

Convert an NMEA DDMM.MMMM coordinate and its hemisphere letter to degrees.

Examples

iex> Aprs.NMEAHelpers.parse_nmea_coordinate("4903.50", "N")
{:ok, 49.05833333333333}

iex> Aprs.NMEAHelpers.parse_nmea_coordinate("4903.50", "X")
{:error, "Invalid coordinate direction"}

parse_nmea_sentence(sentence)

@spec parse_nmea_sentence(term()) :: {:ok, map()} | {:error, String.t()}

Parse an NMEA sentence or a Peet Bros $ULTW packet.

RMC, GGA, GLL, VTG and WPL are decoded, from any two-letter talker id ($GPRMC, $GNRMC, ...). The checksum is stripped and not verified.