data2kml.h
933 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
/*************************************************************************
* Data2Kml - Converting OBD/GPS data to KML
* Distributed under GPL v3.0 license
* (c)2013 Written by Stanley Huang
*************************************************************************/
typedef struct {
uint32_t timestamp;
uint32_t date;
uint32_t time;
float lat;
float lng;
float alt;
float speed;
int16_t acc[3];
uint16_t battery;
float* pidData;
int pidCount;
uint32_t flags;
void* next;
} DATASET;
#define FLAG_HAVE_LAT 0x1
#define FLAG_HAVE_LNG 0x2
#define FLAG_HAVE_DATE 0x4
#define FLAG_HAVE_TIME 0x8
typedef struct {
uint32_t timestamp;
uint32_t date;
uint32_t time;
} TIME_DATA;
typedef struct {
float lat;
float lng;
} COORDS;
typedef struct {
int state;
FILE* fp;
DATASET* data;
int datacount;
COORDS bounds[2];
uint8_t pidMap[65536];
float distance;
DATASET cur;
DATASET last;
uint32_t tsOffset;
} KML_DATA;