Commit Graph

48 Commits

Author SHA1 Message Date
lvitya
95f6beec4f Add $--VTG sentences.
* Fix padding problem in test_minmea_parse_gll1
* Add support for $--VTG sentences.
* Add tests for $--VTG sentences.
* Fix padding problem in test_minmea_parse_gll1. 2nd attempt.
2016-04-23 21:19:26 +02:00
Kosma Moczek
ae62148805 add minmea_checksum 2014-09-11 18:02:29 +02:00
Kosma Moczek
103a523096 tests.c: rename sequence -> sentence (I was drunk at the time?) 2014-09-11 15:29:53 +02:00
Kosma Moczek
bf0f7d30f9 [API CHANGE] minmea_check: add "strict" argument
In strict mode, non-checksummed frames are discarded.
2014-09-11 15:29:53 +02:00
Kosma Moczek
ea324ed49f tests.c: squash GCC's complaints, I'm tired of this shit 2014-09-02 23:08:14 +02:00
Kosma Moczek
b763062f8d tests.c: work around spurious compiler error when comparing large ints 2014-09-02 22:41:00 +02:00
Kosma Moczek
e81f908109 minmea_scan("f"): allow spaces at the start of the field 2014-07-30 15:18:22 +02:00
Kosma Moczek
b777fbe0b9 minmea_gettimeofday -> minmea_gettime 2014-07-11 12:18:47 +02:00
Kosma Moczek
7786885eef tests.c: shorter & consistent variable names 2014-06-18 11:41:41 +02:00
Kosma Moczek
eb6baa182e tests.c: add assert_float_eq() macro 2014-06-18 11:39:06 +02:00
Evgueni Souleimanov
40b3fdd80d tests: use fabsf (float), not fabs (double) in epsilon comparisons of floats
Fixes a mistake in commit f68eb7c
2014-06-17 21:23:09 -04:00
Evgueni Souleimanov
74e2ce002e add test for shorter GSV sentence, with 0 to 4 satellites 2014-06-17 20:46:21 -04:00
Evgueni Souleimanov
f68eb7c9fd fix "warning: comparing floating point with == or != is unsafe" (epsilon comparison)
Instead of comparing floats "x == y", perform comparison
"fabs(x - y) <= epsilon", where epsilon is acceptable error that
accumulates in computation of x and/or y.

Because in this case all integers are small and all floats are exactly
representable under IEEE754, epsilon may be zero in our tests.

This warning occurred when compiling using

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)

on CentOS 6.5 x86_64

using the following CFLAGS (locally inserted into Makefile)

CFLAGS = -g -Wall -Wextra -Wformat=2 -funsigned-char -fstrict-aliasing
 -Wstrict-aliasing -Wfloat-equal -Wundef -Wuninitialized -Wpointer-arith
 -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Waddress
 -Waggregate-return -Wstrict-prototypes -Wold-style-declaration
 -Wold-style-definition -Wmissing-parameter-type -Wmissing-prototypes
 -Wmissing-declarations -Wmissing-field-initializers -Wmissing-noreturn
 -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs
 -Wshadow -Wsign-compare -Wlogical-op -std=c99

and this make command:

make clean ; make example tests
2014-06-17 20:35:32 -04:00
Evgueni Souleimanov
52c077c5ac undo commit "tests: prevent compiler warning when comparing floats" 2014-06-17 20:35:32 -04:00
Evgueni Souleimanov
2ae5c4a645 fix "warning: no previous prototype for 'minmea_suite'"
This warning occurred when compiling using

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)

on CentOS 6.5 x86_64

using the following CFLAGS (locally inserted into Makefile)

CFLAGS = -g -Wall -Wextra -Wformat=2 -funsigned-char -fstrict-aliasing
 -Wstrict-aliasing -Wfloat-equal -Wundef -Wuninitialized -Wpointer-arith
 -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Waddress
 -Waggregate-return -Wstrict-prototypes -Wold-style-declaration
 -Wold-style-definition -Wmissing-parameter-type -Wmissing-prototypes
 -Wmissing-declarations -Wmissing-field-initializers -Wmissing-noreturn
 -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs
 -Wshadow -Wsign-compare -Wlogical-op -std=c99

and this make command:

make clean ; make example tests
2014-06-17 20:35:26 -04:00
Evgueni Souleimanov
0fc9cea986 fix "warning: old-style function definition"
This warning occurred when compiling using

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)

on CentOS 6.5 x86_64

using the following CFLAGS (locally inserted into Makefile)

CFLAGS = -g -Wall -Wextra -Wformat=2 -funsigned-char -fstrict-aliasing
 -Wstrict-aliasing -Wfloat-equal -Wundef -Wuninitialized -Wpointer-arith
 -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Waddress
 -Waggregate-return -Wstrict-prototypes -Wold-style-declaration
 -Wold-style-definition -Wmissing-parameter-type -Wmissing-prototypes
 -Wmissing-declarations -Wmissing-field-initializers -Wmissing-noreturn
 -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs
 -Wshadow -Wsign-compare -Wlogical-op -std=c99

and this make command:

make clean ; make example tests
2014-06-17 20:35:15 -04:00
Evgueni Souleimanov
1b3147c7e0 fix "warning: declaration of 'time' shadows a global declaration" (-Wshadow)
This warning occurred when compiling using

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)

on CentOS 6.5 x86_64

using the following CFLAGS (locally inserted into Makefile)

CFLAGS = -g -Wall -Wextra -Wformat=2 -funsigned-char -fstrict-aliasing
 -Wstrict-aliasing -Wfloat-equal -Wundef -Wuninitialized -Wpointer-arith
 -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Waddress
 -Waggregate-return -Wstrict-prototypes -Wold-style-declaration
 -Wold-style-definition -Wmissing-parameter-type -Wmissing-prototypes
 -Wmissing-declarations -Wmissing-field-initializers -Wmissing-noreturn
 -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs
 -Wshadow -Wsign-compare -Wlogical-op -std=c99

and this make command:

make clean ; make example tests
2014-06-17 20:33:47 -04:00
Kosma Moczek
7477e3caa3 minmea_parse_gll: make mode field optional 2014-06-17 15:00:51 +02:00
Kosma Moczek
f9394d2915 minmea_sentence_gll: adapt for new floating point format 2014-06-17 14:57:08 +02:00
Kosma Moczek
531192598d test_minmea_parse_gll1: keep naming consistent 2014-06-17 14:53:27 +02:00
Kosma Moczek
c375b8144b merge with master 2014-06-17 14:52:46 +02:00
Kosma Moczek
df695c4933 tests: prevent compiler warning when comparing floats 2014-06-17 12:22:48 +02:00
Kosma Moczek
334e63d599 tests.c: add minmea_scan("f") overflow tests 2014-04-27 17:05:21 +02:00
Kosma Moczek
14437a9631 [API change] add struct minmea_float w/ int_least32_t
This is an API breaker that incorporates the following big changes:

1. The (value, scale) float, as used in minmea, is a compound type. It
should be declared and used as such.

2. Some platforms, notably avr-gcc, have 16-bit ints. Make life easier
for them by using int_least32_t for floating point values.

3. As a side effect, the following functions were renamed:

* minmea_coord -> minmea_tocoord
* minmea_float -> minmea_tofloat

Migration guide for user code (easy unless you do fancy stuff):

1. Replace calls to minmea_{coord,float}.

2. Replace int32_t with int_least32_t in user code if your platform
requires this.
2014-04-27 16:22:37 +02:00
Kosma Moczek
6473d5b30e Merge commit 'pull/origin/5' 2014-04-24 16:02:40 +02:00
Kosma Moczek
e2e6a41209 tests.c: fix build errors introduced by #4
My bad for not checking this.
2014-04-24 15:58:12 +02:00
Kosma Moczek
08d28a590a Merge pull request #3 from eketh/master
Added support for GST frame
2014-04-24 11:55:54 +02:00
Kosma Moczek
b5b080cdaf Merge pull request #4 from mek-x/fix_gcc
Fixing compilation and tests for GCC on Linux
2014-04-24 11:32:20 +02:00
mek_x
daed9fd707 tests: added unit tests for gsv 2014-04-24 00:08:33 +02:00
mek_x
92a46f24e2 fix tests for gcc 2014-04-23 23:05:33 +02:00
Eketh
24968cb3ba Fixed spelling/codestyle 2014-04-23 19:57:30 +02:00
Kosma Moczek
dd2f2f20ff add support for optional fields (minmea_scan ";" modifier) 2014-04-23 18:15:26 +02:00
Edyta
3b6ba502bc minmea.h, minmea.c: Added support for GLL sentences 2014-04-15 17:45:29 +02:00
Kosma Moczek
ea1bbcbfa5 minmea: add minmea_talker_id() 2014-03-24 23:13:05 +01:00
Kosma Moczek
d973b98d66 minmea: don't include talker id in sentence type.
This is a backwards-incompatible change that I knew I'd have to
introduce sooner or later. Which means now.

Long story short: when I first started writing this library, I wanted to
make things simpler by treating the entire talker+sentence as one big
ID. Of course, this is an oversimplification, as there are different
talkers out there.

Turns out they're more common than I initially thought. I just came
across a module (read: I had one soldered to my board by our crazy
hardware guy) that spits out GPRMC, GLRMC or GNRMC depending on where it
got the data. I could have kludged around this, but here's this change,
for the purity of code.

Fortunately, we're the only users of this codebase as far as I know, so
no real harm is done - but it's a lesson to design my interfaces right
from the very start so I don't have to break compatibility and write
apologetic messages later on.
2014-03-24 22:40:25 +01:00
Kosma Moczek
0b044db606 tests: specify maximum minmea_scan coordinate range 2014-03-03 15:22:59 +01:00
Kosma Moczek
7543c35079 minmea_rescale: handle big values without overflow 2014-03-03 15:04:37 +01:00
Kosma Moczek
27d98bddde tests.c: add more test sequences (uBlox MAX7C) 2014-03-03 14:55:47 +01:00
Kosma Moczek
3c343f8e19 tests.c: use ck_assert_int_eq whenever possible 2014-02-28 15:20:30 +01:00
Kosma Moczek
4d0f78662f COPYING: include the no-warranty clause 2014-02-26 16:27:24 +01:00
Kosma Moczek
2e59e40886 GPGSA support: fix coding style bugs introduced as a result of fixing coding style bugs ;) 2014-02-26 15:10:28 +01:00
Kosma Moczek
d517458085 GPGSA support: adapt to project' coding style 2014-02-26 15:07:42 +01:00
Kosma Moczek
a04115b3f4 GPGSA support: fix indentation 2014-02-26 15:03:20 +01:00
Kosma Moczek
da55e342e3 Merge pull request #1 from dart50/master
Add support for $GPGSA sequences.
2014-02-26 14:57:00 +01:00
Kosma Moczek
c5860da6c8 hex2int: fix hex digit parsing 2014-02-26 13:19:00 +01:00
Denys Kuzmenko
e2838ed642 Add support for $GPGSA sequences. 2014-02-25 17:32:56 +01:00
Kosma Moczek
b341777f60 man, that license stuff is hard to do right 2014-02-16 20:03:14 +01:00
Kosma Moczek
56177f0e1c initial commit 2014-02-14 15:22:18 +01:00