Aprs.UtilityHelpers (aprs v2.0.0)

View Source

Utility helpers for APRS parsing using binary pattern matching.

Summary

Functions

Returns the resolution in metres for a compressed APRS position.

Counts leading closing braces in a string.

Returns the resolution in metres for an NMEA position.

Parses an APRS timestamp relative to the supplied UTC clock.

Returns the latitude-derived resolution in metres for an APRS ambiguity level.

Parses an APRS timestamp using the current UTC time.

Functions

compressed_position_resolution()

@spec compressed_position_resolution() :: float()

Returns the resolution in metres for a compressed APRS position.

count_leading_braces(str)

@spec count_leading_braces(String.t()) :: non_neg_integer()

Counts leading closing braces in a string.

nmea_position_resolution()

@spec nmea_position_resolution() :: float()

Returns the resolution in metres for an NMEA position.

parse_timestamp(time, now \\ DateTime.utc_now())

@spec parse_timestamp(String.t(), DateTime.t()) :: integer() | nil

Parses an APRS timestamp relative to the supplied UTC clock.

Day-hour-minute timestamps which would otherwise be in the future are resolved against the previous month. Hour-minute-second timestamps similarly resolve against the previous day.

position_resolution(ambiguity)

@spec position_resolution(non_neg_integer()) :: float()

Returns the latitude-derived resolution in metres for an APRS ambiguity level.

validate_timestamp(time)

@spec validate_timestamp(String.t()) :: integer() | nil

Parses an APRS timestamp using the current UTC time.