libfap  1.5
helpers2.h
Go to the documentation of this file.
1 /* $Id: helpers2.h 226 2014-11-23 12:33:36Z oh2gve $
2  *
3  * Copyright 2005-2012 Tapio Sokura
4  * Copyright 2007-2012 Heikki Hannikainen
5  *
6  * Perl-to-C modifications
7  * Copyright 2009-2014 Tapio Aaltonen
8  *
9  * This file is part of libfap.
10  *
11  * Libfap may be copied only under the terms of either the Artistic License
12  * or the GNU General Public License, which may be found in the libfap
13  * source kit.
14  *
15  * APRS is a registered trademark of APRS Software and Bob Bruninga, WB4APR.
16 */
17 
24 #ifndef HELPERS2_H
25 #define HELPERS2_H
26 
27 
28 #include "fap.h"
29 
30 
32 #define MAX_DIGIS 8
33 
35 #define KNOT_TO_KMH 1.852
36 
38 #define MPH_TO_KMH 1.609344
39 
41 #define KMH_TO_MS 10.0/36.0
42 
44 #define MPH_TO_MS (MPH_TO_KMH * KMH_TO_MS)
45 
47 #define FT_TO_M 0.3048
48 
50 #define FAHRENHEIT_TO_CELCIUS(x) ((x-32.0)/1.8)
51 
53 #define HINCH_TO_MM 0.254
54 
55 
56 
58 typedef struct fapint_llist_item
59 {
61  char* text;
63  struct fapint_llist_item* next;
65 
66 
69 
70 
71 
73 
78 double fapint_get_pos_resolution(int const minute_digit_count);
79 
80 
83 
84 
86 
92 int fapint_symbol_from_dst_type(char input[2], char* output);
93 
94 
96 int fapint_is_number(char const* input);
97 
98 
100 int fapint_check_date(unsigned int year, unsigned int month, unsigned int day);
101 
102 
104 
112 int fapint_get_nmea_latlon(fap_packet_t* packet, char* field1, char* field2);
113 
114 
116 
121 void fapint_parse_comment_telemetry(fap_packet_t* packet, char** rest, unsigned int* rest_len);
122 
123 
125 void fapint_init_wx_report(fap_wx_report_t* wx_report);
126 
127 
130 
132 char* fapint_remove_part(char const* input, unsigned int const input_len,
133  unsigned int const part_so, unsigned int const part_eo,
134  unsigned int* result_len);
135 
136 
137 #endif // HELPERS2_H