-
Notifications
You must be signed in to change notification settings - Fork 1
/
GpsDataType.h
75 lines (61 loc) · 2.08 KB
/
GpsDataType.h
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
AeroQuad v3.0 - May 2011
www.AeroQuad.com
Copyright (c) 2011 Ted Carancho. All rights reserved.
An Open Source Arduino based multicopter.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _AQ_GPS_DATA_TYPE_H_
#define _AQ_GPS_DATA_TYPE_H_
enum {
GPS_INVALID_ACCURACY = 0xFFFFFFFF,
GPS_INVALID_AGE = 0xFFFFFFFF,
GPS_INVALID_ANGLE = 0x7FFFFFFF,
GPS_INVALID_ALTITUDE = 2147483647,//999999999,
GPS_INVALID_DATE = 0,
GPS_INVALID_TIME = 0xFFFFFFFF,
GPS_INVALID_SPEED = 999999999,
GPS_INVALID_FIX_TIME = 0xFFFFFFFF
};
enum {
GPS_DETECTING = 0,
GPS_NOFIX = 1,
GPS_FIX2D = 2,
GPS_FIX3D = 3,
GPS_FIX3DD = 4 // differential fix
};
enum {
GPS_UBLOX = 0,
GPS_NMEA = 1,
GPS_MTK16 = 2
};
#define GPS_INVALID_POSITION {GPS_INVALID_ANGLE, GPS_INVALID_ANGLE, 0}
struct GeodeticPosition {
int32_t latitude;
int32_t longitude;
};
struct gpsData {
int32_t lat,lon; // position as degrees (*10E7)
uint32_t fixage; // fix
uint32_t fixtime; // fix
uint32_t sentences; // sentences/packets processed from gps (just statistics)
uint8_t state; // gps state
uint8_t sats; // number of satellites active
uint8_t baudrate; // current baudrate (index) - used by autodetection
uint8_t type; // current type - used by autodetection
uint32_t idlecount; // how many times gpsUpdate has been called without getting a valid message
};
struct gpsConfigEntry {
const unsigned char *data;
const unsigned char len;
};
#endif