src/helpers2.c File Reference

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

#include "helpers2.h"
#include "fap.h"
#include "regs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <regex.h>
#include <ctype.h>
#include <math.h>

Include dependency graph for helpers2.c:

Go to the source code of this file.

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.
short fapint_valid_com_telem_char (char c)
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

Implementations of helper functions for helpers.c.

Author:
Tapio Aaltonen

Definition in file helpers2.c.


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