View Source XGPS.Tools (Elixir.XGPS v0.5.0)

Several different helper functions.

Link to this section Summary

Functions

Will calculate and return a checksum defined for NMEA sentence.

Converts from hex-string to int.

Converts from int to hex-string.

Convert latitude from decimal degrees into degrees, minutes and bearing

Converts latitude from degrees, minutes and bearing into decimal degrees

Convert longitude from decimal degrees into degrees, minutes and bearing

Converts longitude from degrees, minutes and bearing into decimal degrees

Link to this section Functions

Link to this function

calculate_checksum(text)

View Source

Will calculate and return a checksum defined for NMEA sentence.

Link to this function

generate_rmc_and_gga_for_simulation(lat, lon, alt, date_time)

View Source
Link to this function

generate_rmc_and_gga_for_simulation_no_fix(date_time)

View Source
Link to this function

hex_string_to_int(string)

View Source

Converts from hex-string to int.

examples

Examples

iex> XGPS.Tools.hex_string_to_int "C0"
192

Converts from int to hex-string.

examples

Examples

iex> XGPS.Tools.int_to_hex_string 192
"C0"
Link to this function

lat_from_decimal_degrees(decimal_degrees)

View Source

Convert latitude from decimal degrees into degrees, minutes and bearing

examples

Examples

iex> XGPS.Tools.lat_from_decimal_degrees(54.686)
{54, 41.1600, "N"}

iex> XGPS.Tools.lat_from_decimal_degrees(-54.686)
{54, 41.1600, "S"}
Link to this function

lat_to_decimal_degrees(degrees, minutes, binary)

View Source

Converts latitude from degrees, minutes and bearing into decimal degrees

examples

Examples

iex> XGPS.Tools.lat_to_decimal_degrees(54, 41.1600, "N")
54.686

iex> XGPS.Tools.lat_to_decimal_degrees(54, 41.1600, "S")
-54.686
Link to this function

lon_from_decimal_degrees(decimal_degrees)

View Source

Convert longitude from decimal degrees into degrees, minutes and bearing

examples

Examples

XGPS.Tools.lon_from_decimal_degrees(25.26)
{25, 15.6, "E"}

XGPS.Tools.lon_from_decimal_degrees(-25.26)
{25, 15.6, "W"}
Link to this function

lon_to_decimal_degrees(degrees, minutes, binary)

View Source

Converts longitude from degrees, minutes and bearing into decimal degrees

examples

Examples

iex> XGPS.Tools.lon_to_decimal_degrees(25, 15.6, "E")
25.26

iex> XGPS.Tools.lon_to_decimal_degrees(25, 15.6, "W")
-25.26