-
Notifications
You must be signed in to change notification settings - Fork 12
/
GPS_DataType.h
56 lines (48 loc) · 1.34 KB
/
GPS_DataType.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
#ifndef GPSDATATYPE_H
#define GPSDATATYPE_H
#include <stdint.h>
enum {
GPS_INVALID_ACCURACY = 0xFFFFFFFF,
GPS_INVALID_AGE = 0xFFFFFFFF,
GPS_INVALID_ANGLE = 0x7FFFFFFF,
GPS_INVALID_ALTITUDE = 65535,
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, GPS_INVALID_ALTITUDE}
struct GeodeticPosition {
long latitude;
long longitude;
long altitude;
};
struct gpsData {
int32_t lat, lon; // position as degrees (*10E7)
int32_t course; // degrees (*10E5)
uint32_t speed; // cm/s
int32_t height; // mm (from ellipsoid)
uint32_t accuracy; // mm
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
int32_t velN, velE, velD; // cm/s
};
#endif