Merge pull request #35 from gdpinchina/master
Change dgps_age type from int to minmea_float
This commit is contained in:
commit
65bf740bd8
2
minmea.c
2
minmea.c
@ -415,7 +415,7 @@ bool minmea_parse_gga(struct minmea_sentence_gga *frame, const char *sentence)
|
|||||||
int latitude_direction;
|
int latitude_direction;
|
||||||
int longitude_direction;
|
int longitude_direction;
|
||||||
|
|
||||||
if (!minmea_scan(sentence, "tTfdfdiiffcfci_",
|
if (!minmea_scan(sentence, "tTfdfdiiffcfcf_",
|
||||||
type,
|
type,
|
||||||
&frame->time,
|
&frame->time,
|
||||||
&frame->latitude, &latitude_direction,
|
&frame->latitude, &latitude_direction,
|
||||||
|
2
minmea.h
2
minmea.h
@ -76,7 +76,7 @@ struct minmea_sentence_gga {
|
|||||||
struct minmea_float hdop;
|
struct minmea_float hdop;
|
||||||
struct minmea_float altitude; char altitude_units;
|
struct minmea_float altitude; char altitude_units;
|
||||||
struct minmea_float height; char height_units;
|
struct minmea_float height; char height_units;
|
||||||
int dgps_age;
|
struct minmea_float dgps_age;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum minmea_gll_status {
|
enum minmea_gll_status {
|
||||||
|
25
tests.c
25
tests.c
@ -508,19 +508,18 @@ START_TEST(test_minmea_parse_gga1)
|
|||||||
{
|
{
|
||||||
const char *sentence = "$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47";
|
const char *sentence = "$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47";
|
||||||
struct minmea_sentence_gga frame = {};
|
struct minmea_sentence_gga frame = {};
|
||||||
static const struct minmea_sentence_gga expected = {
|
struct minmea_sentence_gga expected = {};
|
||||||
.time = { 12, 35, 19, 0 },
|
expected.time = (struct minmea_time) { 12, 35, 19, 0 };
|
||||||
.latitude = { 4807038, 1000 },
|
expected.latitude = (struct minmea_float) { 4807038, 1000 };
|
||||||
.longitude = { 1131000, 1000 },
|
expected.longitude = (struct minmea_float) { 1131000, 1000 };
|
||||||
.fix_quality = 1,
|
expected.fix_quality = 1;
|
||||||
.satellites_tracked = 8,
|
expected.satellites_tracked = 8;
|
||||||
.hdop = { 9, 10 },
|
expected.hdop = (struct minmea_float) { 9, 10 };
|
||||||
.altitude = { 5454, 10 },
|
expected.altitude = (struct minmea_float) { 5454, 10 };
|
||||||
.altitude_units = 'M',
|
expected.altitude_units = 'M';
|
||||||
.height = { 469, 10 },
|
expected.height = (struct minmea_float) { 469, 10 };
|
||||||
.height_units = 'M',
|
expected.height_units = 'M';
|
||||||
.dgps_age = 0,
|
expected.dgps_age = (struct minmea_float) { 0, 0 };
|
||||||
};
|
|
||||||
ck_assert(minmea_check(sentence, false) == true);
|
ck_assert(minmea_check(sentence, false) == true);
|
||||||
ck_assert(minmea_check(sentence, true) == true);
|
ck_assert(minmea_check(sentence, true) == true);
|
||||||
ck_assert(minmea_parse_gga(&frame, sentence) == true);
|
ck_assert(minmea_parse_gga(&frame, sentence) == true);
|
||||||
|
Loading…
Reference in New Issue
Block a user