IPIA Senior Project V2.0
Spring-Fall 2020
Loading...
Searching...
No Matches
GPS.h
Go to the documentation of this file.
1
12#ifndef GPS_H
13#define GPS_H
14#include <stdlib.h>
15#include <stdio.h>
16#include <string.h>
17#include <stdbool.h>
18#include <stdlib.h>
19#include <unistd.h>
20
21
35typedef struct{
36 uint8_t hour;
37 uint8_t minute;
38 uint8_t second;
39 uint16_t milli;
40}SysTime;
41
42
43
64typedef struct NMEA_GNRMC{
65 char *name;
66 char *utc_time;
67 char *status;
68 char *latitude;
70 char *longitude;
74 char *utc_date;
77
78
79
93typedef struct UTC_TIME{
94 char hour[3];
95 char minute[3];
96 char second[3];
97 char milli[4];
99
100
101
113typedef struct COORDINATE{
114 double latitude;
115 double longitude;
117
118
119
127char* token(char *str, char *delimiter);
128
129
136void print_NMEA_GNRMC(const NMEA_GNRMC *data);
137
138
139
146void print_UTC_TIME(const UTC_TIME *time);
147
148
155NMEA_GNRMC setGnrmc(char *str);
156
157
165
166
174
175
182void print_COORDINATE(const COORDINATE *tempCoordinate);
183
184
185
193double latitudeDegrees(char* latitude, char *direction);
194
195
203double longitudeDegrees(char *longitude,char *direction);
204
205
212double str_to_double(char* num);
213#endif
void print_UTC_TIME(const UTC_TIME *time)
Print the UTC_TIME Object.
Definition: GPS.c:59
void print_NMEA_GNRMC(const NMEA_GNRMC *data)
Print GNRMC structure.
Definition: GPS.c:15
COORDINATE setCoordinates(const NMEA_GNRMC *data)
Set Coordinate in COORDINATE object.
Definition: GPS.c:102
double str_to_double(char *num)
Convert string to floating point.
Definition: GPS.c:145
double longitudeDegrees(char *longitude, char *direction)
Convert longitude decimal value to degrees.
Definition: GPS.c:132
void print_COORDINATE(const COORDINATE *tempCoordinate)
Print coordinates members.
Definition: GPS.c:112
NMEA_GNRMC setGnrmc(char *str)
Parse string into NMEA_GNRMC object.
Definition: GPS.c:68
UTC_TIME setTime(char *utcTime)
Set UTC time in UTC_TIME object.
Definition: GPS.c:86
char * token(char *str, char *delimiter)
Tokenize a string by a delimiter.
Definition: GPS.c:28
double latitudeDegrees(char *latitude, char *direction)
Convert latitude decimal value to degrees.
Definition: GPS.c:118
UTC_TIME utcTime
Definition: sim33eau.h:30
COORDINATE object.
Definition: GPS.h:113
double latitude
Definition: GPS.h:114
double longitude
Definition: GPS.h:115
NMEA_GNRMC Time object.
Definition: GPS.h:64
char * speedOverGround
Definition: GPS.h:72
char * name
Definition: GPS.h:65
char * longitude
Definition: GPS.h:70
char * courseOverGround
Definition: GPS.h:73
char * latitudeDirection
Definition: GPS.h:69
char * latitude
Definition: GPS.h:68
char * utc_date
Definition: GPS.h:74
char * utc_time
Definition: GPS.h:66
char * modeIndicatorAndcheckSum
Definition: GPS.h:75
char * longitudeDirection
Definition: GPS.h:71
char * status
Definition: GPS.h:67
SysTime Time object.
Definition: GPS.h:35
uint8_t minute
Definition: GPS.h:37
uint8_t hour
Definition: GPS.h:36
uint16_t milli
Definition: GPS.h:39
uint8_t second
Definition: GPS.h:38
UTC_TIME object.
Definition: GPS.h:93
char second[3]
Definition: GPS.h:96
char milli[4]
Definition: GPS.h:97
char minute[3]
Definition: GPS.h:95
char hour[3]
Definition: GPS.h:94