rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
controllers
algo
nmea.h
Go to the documentation of this file.
1
/**
2
*
3
* https://github.com/wdalmut/libgps/tree/develop/src
4
*
5
*/
6
7
#pragma once
8
9
#include "
rusefi_types.h
"
10
11
#define GPS_MAX_STRING 256
12
13
typedef
enum
{
14
NMEA_UNKNOWN
= 0x00,
15
NMEA_GPRMC
= 0x01,
16
NMEA_GPGGA
= 0x02
17
}
nmea_message_type
;
18
19
#define _EMPTY 0x00
20
#define NMEA_GPRMC_STR "$GPRMC"
21
#define NMEA_GPGGA_STR "$GPGGA"
22
#define _COMPLETED 0x03
23
24
#define NMEA_CHECKSUM_ERR 0x80
25
#define NMEA_MESSAGE_ERR 0xC0
26
27
struct
GPSlocation
{
28
float
latitude
;
29
float
longitude
;
30
float
speed
;
31
float
altitude
;
32
float
course
;
33
efidatetime_t
time
;
34
nmea_message_type
type
;
35
int
quality
;
36
int
satellites
;
37
char
lat
;
// Northing Indicator N=North, S=South
38
char
lon
;
// Easting Indicator E=East, W=West
39
};
40
typedef
struct
GPSlocation
loc_t
;
41
42
nmea_message_type
nmea_get_message_type
(
const
char
*);
43
int
nmea_valid_checksum
(
const
char
*);
44
45
46
void
gps_location
(
loc_t
*,
char
const
*
const
);
47
48
static
int
str2int
(
const
char
* a,
const
int
len) {
49
int
i = 0, k = 0;
50
while
(i < len) {
51
k = (k << 3) + (k << 1) + (*a) -
'0'
;
52
a++;
53
i++;
54
}
55
return
k;
56
}
str2int
static int str2int(const char *a, const int len)
Definition
nmea.h:48
nmea_get_message_type
nmea_message_type nmea_get_message_type(const char *)
Definition
nmea.cpp:259
nmea_message_type
nmea_message_type
Definition
nmea.h:13
NMEA_UNKNOWN
@ NMEA_UNKNOWN
Definition
nmea.h:14
NMEA_GPGGA
@ NMEA_GPGGA
Definition
nmea.h:16
NMEA_GPRMC
@ NMEA_GPRMC
Definition
nmea.h:15
nmea_valid_checksum
int nmea_valid_checksum(const char *)
Definition
nmea.cpp:276
gps_location
void gps_location(loc_t *, char const *const)
Definition
nmea.cpp:298
rusefi_types.h
GPSlocation
Definition
nmea.h:27
GPSlocation::lat
char lat
Definition
nmea.h:37
GPSlocation::altitude
float altitude
Definition
nmea.h:31
GPSlocation::latitude
float latitude
Definition
nmea.h:28
GPSlocation::satellites
int satellites
Definition
nmea.h:36
GPSlocation::type
nmea_message_type type
Definition
nmea.h:34
GPSlocation::time
efidatetime_t time
Definition
nmea.h:33
GPSlocation::course
float course
Definition
nmea.h:32
GPSlocation::longitude
float longitude
Definition
nmea.h:29
GPSlocation::lon
char lon
Definition
nmea.h:38
GPSlocation::quality
int quality
Definition
nmea.h:35
GPSlocation::speed
float speed
Definition
nmea.h:30
efidatetime_t
Definition
rusefi_types.h:45
Generated on Sat Sep 27 2025 00:10:04 for rusEFI by
1.9.8