src/helpers2.h File Reference

Declarations of helper functions for helpers.c. More...

#include "fap.h"

Include dependency graph for helpers2.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fapint_llist_item_t
 Linked list item. More...

Defines

#define MAX_DIGIS   8
 Max amount of path elements.
#define KNOT_TO_KMH   1.852
 Nautical miles per hour to kilometers per hour.
#define MPH_TO_KMH   1.609344
 Miles per hour to kilometers per hour.
#define KMH_TO_MS   10.0/36.0
 Kilometers per hour to meters per second.
#define MPH_TO_MS   (MPH_TO_KMH * KMH_TO_MS)
 Miles per hout to meters per second.
#define FT_TO_M   0.3048
 Feets to meters.
#define FAHRENHEIT_TO_CELCIUS(x)   ((x-32.0)/1.8)
 Fahrenheit to celcius degrees.
#define HINCH_TO_MM   0.254
 Hundredths of an inch to millimeters.

Functions

void fapint_clear_llist (fapint_llist_item_t *list)
 Cleanup function for linked list.
double fapint_get_pos_resolution (int const minute_digit_count)
 Return position resolution in meters based on the number of minute decimal digits.
int fapint_parse_symbol_from_dst_callsign (fap_packet_t *packet)
 Parse station symbol from GPSxyz or SPCxyz -formatted destination callsign.
int fapint_symbol_from_dst_type (char input[2], char *output)
 Maps destination callsign symbol chars to APRS symbol.
int fapint_is_number (char const *input)
 Returns 0 if string contains non-numeric chars, 1 if not.
int fapint_check_date (unsigned int year, unsigned int month, unsigned int day)
 Returns 1 if given date is valid. */.
int fapint_get_nmea_latlon (fap_packet_t *packet, char *field1, char *field2)
 Get coordinate from nmea fields.
void fapint_parse_comment_telemetry (fap_packet_t *packet, char **rest, unsigned int *rest_len)
 Parse base-91 telemetry from comment text.
void fapint_init_wx_report (fap_wx_report_t *wx_report)
 Set all fields of given wx report to NULL.
void fapint_init_telemetry_report (fap_telemetry_t *telemetry)
char * fapint_remove_part (char const *input, unsigned int const input_len, unsigned int const part_so, unsigned int const part_eo, unsigned int *result_len)
 Returns copy of given input with specified part removed.


Detailed Description

Declarations of helper functions for helpers.c.

Author:
Tapio Aaltonen

Definition in file helpers2.h.


Function Documentation

double fapint_get_pos_resolution ( int const   minute_digit_count  ) 

Return position resolution in meters based on the number of minute decimal digits.

Also accepts negative numbers, i.e. -1 for 10 minute resolution and -2 for 1 degree resolution. Calculation is based on latitude so it is worst case (resolution in longitude gets better as you get closer to the poles).

Definition at line 64 of file helpers2.c.

int fapint_symbol_from_dst_type ( char  input[2],
char *  output 
)

Maps destination callsign symbol chars to APRS symbol.

Contains a list of mappings from GPSxyz (or SPCxyz) to APRS symbols. Overlay characters (z) are not handled here.

Parameters:
input Two chars from destination callsign.
output Two chars ([0] and [1]) of aprs symbol.

Definition at line 202 of file helpers2.c.

int fapint_get_nmea_latlon ( fap_packet_t packet,
char *  field1,
char *  field2 
)

Get coordinate from nmea fields.

Field 2 is used to decide between latitude and longitude. If pos_resolution is not set, this will set it too.

Parameters:
packet Results are saved here.
field1 The (dd)dmm.m(mmm..) string.
field2 The north/south or east/west indicator.
Returns:
Zero for failure, non-zero for success.

Definition at line 420 of file helpers2.c.

void fapint_parse_comment_telemetry ( fap_packet_t packet,
char **  rest,
unsigned int *  rest_len 
)

Parse base-91 telemetry from comment text.

Parameters:
packet Results are saved here.
rest Comment text.
rest_len Lenght of rest in bytes.

Definition at line 541 of file helpers2.c.

void fapint_init_telemetry_report ( fap_telemetry_t telemetry  ) 

Numeric fields are set to 0, bits are set to ?.

Parameters:
report to reset.

Definition at line 721 of file helpers2.c.


Generated on Sun Nov 20 09:26:24 2011 for libfap by  doxygen 1.5.6