pud: adjust to new nmealib
[olsrd.git] / lib / pud / src / posFile.h
1 #ifndef _PUD_POSFILE_H_
2 #define _PUD_POSFILE_H_
3
4 /* Plugin includes */
5
6 /* OLSR includes */
7
8 /* System includes */
9 #include <stdbool.h>
10 #include <nmea/info.h>
11 #include <nmea/sentence.h>
12
13 /**
14  <pre>
15  field/sentence       GPGGA   GPGSA   GPGSV   GPRMC   GPVTG
16  present:               x       x       x       x       x
17  smask:                 x       x       x       x       x
18  utc (date):                                    x
19  utc (time):            x                       x
20  sig:                   x                       x1
21  fix:                           x               x1
22  PDOP:                          x                           =sqrt(2)*HDOP  (GPGSA)
23  HDOP:                  x       x
24  VDOP:                          x                           =HDOP          (GPGSA)
25  lat:                   x                       x
26  lon:                   x                       x
27  elv:                   x
28  speed:                                         x       x
29  track:                                         x       x
30  mtrack:                                                x
31  magvar:                                        x
32  satinfo (inuse count): x       x1
33  satinfo (inuse):               x
34  satinfo (inview):                      x
35
36  x1 = not present in the sentence but the library sets it up.
37  </pre>
38  */
39 #define POSFILE_DEFAULT_SMASK           (GPGGA | GPGSA | GPRMC | GPVTG)
40
41 /* no default utc: current time is always used */
42 #define POSFILE_DEFAULT_SIG             (NMEA_SIG_HIGH)
43 #define POSFILE_DEFAULT_FIX             (NMEA_FIX_BAD)
44 #define POSFILE_DEFAULT_HDOP            (0.0)
45 #define POSFILE_DEFAULT_LAT             (0.0)
46 #define POSFILE_DEFAULT_LON             (0.0)
47 #define POSFILE_DEFAULT_ELV             (0.0)
48 #define POSFILE_DEFAULT_SPEED           (0.0)
49 #define POSFILE_DEFAULT_TRACK           (0.0)
50 #define POSFILE_DEFAULT_MTRACK          (0.0)
51 #define POSFILE_DEFAULT_MAGVAR          (0.0)
52
53 #define POSFILE_CALCULATED_VDOP(hdop)   (hdop)
54 #define POSFILE_CALCULATED_PDOP(hdop)   (hdop * 1.414213562)
55
56 #define POSFILE_NAME_SIG                "sig"
57 #define POSFILE_NAME_FIX                "fix"
58 #define POSFILE_NAME_HDOP               "hdop"
59 #define POSFILE_NAME_LAT                "lat"
60 #define POSFILE_NAME_LON                "lon"
61 #define POSFILE_NAME_ELV                "elv"
62 #define POSFILE_NAME_SPEED              "speed"
63 #define POSFILE_NAME_TRACK              "track"
64 #define POSFILE_NAME_MTRACK             "mtrack"
65 #define POSFILE_NAME_MAGVAR             "magvar"
66
67 #define POSFILE_VALUE_SIG_BAD           "bad"
68 #define POSFILE_VALUE_SIG_LOW           "low"
69 #define POSFILE_VALUE_SIG_MID           "mid"
70 #define POSFILE_VALUE_SIG_HIGH          "high"
71
72 #define POSFILE_VALUE_FIX_BAD           "bad"
73 #define POSFILE_VALUE_FIX_2D            "2d"
74 #define POSFILE_VALUE_FIX_3D            "3d"
75
76 bool startPositionFile(void);
77 void stopPositionFile(void);
78 bool readPositionFile(char * fileName, nmeaINFO * nmeaInfo);
79
80 #endif /* _PUD_POSFILE_H_ */