-
Notifications
You must be signed in to change notification settings - Fork 0
/
gps.h
44 lines (34 loc) · 803 Bytes
/
gps.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
#pragma once
#include "Arduino.h"
struct GPSInfo {
char altitude[8];
char latitude[12];
char longitude[12];
byte satCount;
char time[12];
char fix;
GPSInfo();
void clear();
void setFix(char fix);
void setTime(const char *time);
void setLatitude(const char *latitude);
void setLongitude(const char *longitude);
void setAltitude(const char *altitude);
void setSatCount(const char *satCount);
void print();
};
struct GPSParser {
enum SentenceType {
SENTENCE_NONE = 0,
SENTENCE_GSA,
SENTENCE_GGA
};
void parse(char c);
void parseByChar(char c);
void processField(byte sentence, byte index, const char *value, byte length);
GPSInfo gpsInfo;
};
// GPS serial (hardware/software) functions
void gpsBegin();
byte gpsAvailable();
byte gpsRead();