-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpsreader.h
More file actions
57 lines (43 loc) · 985 Bytes
/
gpsreader.h
File metadata and controls
57 lines (43 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef SENSORS_H
#define SENSORS_H
#include <QObject>
#include <QtSerialPort/QSerialPort>
#include <QByteArray>
#include <QFile>
class GPSReader : public QObject
{
Q_OBJECT
public:
explicit GPSReader(QObject *parent = 0);
~GPSReader();
void stop();
bool openPort();
void readVersion();
void readTime();
void readSats();
bool hasGPS();
QString chipVersion();
QString lastMessage();
private:
QString filename;
QString lastmessage;
bool fileopened,goodtimestamp;
bool havegps;
QString chipset;
QString path;
int numsats,valid,messagecount;
int uptime,yr,mo,dy,hr,mn;
QSerialPort *gpsport;
QByteArray calc_crc(QByteArray in);
void decodeMessage(QByteArray ba);
QString binarymessage(QByteArray ba);
long getUpTime();
QByteArray ubxframe,writebuffer;
QFile glogfile;
bool incomplete;
int toread;
signals:
public slots:
void ReadData();
};
#endif // SENSORS_H