LP-56 - Better txpid option namings, fix tabs-spaces, tooltips. headers, variable...
[librepilot.git] / ground / openpilotgcs / src / plugins / gpsdisplay / nmeaparser.h
blob158704333dc6541629bc13f2e1f8564a61aaa385
1 /**
2 ******************************************************************************
4 * @file nmeaparser.h
5 * @author Sami Korhonen Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup GPSGadgetPlugin GPS Gadget Plugin
9 * @{
10 * @brief A gadget that displays GPS status and enables basic configuration
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef NMEAPARSER_H
29 #define NMEAPARSER_H
31 #include <QObject>
32 #include <QtCore>
33 #include <stdint.h>
34 #include "buffer.h"
35 #include "gpsparser.h"
37 // constants/macros/typdefs
38 #define NMEA_BUFFERSIZE 128
40 typedef struct struct_GpsData {
41 double Latitude;
42 double Longitude;
43 double Altitude;
44 double Groundspeed;
45 double Heading;
46 int SV;
47 int Status;
48 double PDOP;
49 double HDOP;
50 double VDOP;
51 double GeoidSeparation;
52 double GPStime;
53 double GPSdate;
54 } GpsData_t;
56 class NMEAParser : public GPSParser {
57 Q_OBJECT
59 public:
60 NMEAParser(QObject *parent = 0);
61 ~NMEAParser();
62 void processInputStream(char c);
63 char *nmeaGetPacketBuffer(void);
64 char nmeaChecksum(char *gps_buffer);
65 void nmeaTerminateAtChecksum(char *gps_buffer);
66 uint8_t nmeaProcess(cBuffer *rxBuffer);
67 void nmeaProcessGPGGA(char *packet);
68 void nmeaProcessGPRMC(char *packet);
69 void nmeaProcessGPVTG(char *packet);
70 void nmeaProcessGPGSA(char *packet);
71 void nmeaProcessGPGSV(char *packet);
72 void nmeaProcessGPZDA(char *packet);
73 GpsData_t GpsData;
74 cBuffer gpsRxBuffer;
75 char gpsRxData[512];
76 char NmeaPacket[NMEA_BUFFERSIZE];
77 uint32_t numUpdates;
78 uint32_t numErrors;
79 int32_t gpsRxOverflow;
82 #endif // NMEAPARSER_H