Commit Graph

69 Commits

Author SHA1 Message Date
ladyada e4eb78f41c clangify 2020-01-17 16:18:09 -05:00
Rick Sellens eec5282c19 Reinsert strStartsWith() needed elsewhere 2020-01-08 12:05:07 -05:00
Rick Sellens 4a14547ede Improve NMEA sentence checking
Add check(), addChecksum(), tokenOnList(), and supporting variables. Modify parse() to use check() and test only on sentence name, e.g. GGA rather than $GPGGA. Uses strcmp() to eliminate the custom strStartsWith().
2020-01-08 11:04:21 -05:00
Rick Sellens ce333bf713 Move declarations to class private
Variables for buffering were global to the cpp file. Two instances would overwrite each other's buffers.
2019-12-29 12:10:39 -05:00
ladyada 1d2039d001 use i2c pointer 2019-11-23 14:31:33 -05:00
Lady Ada 7bb6e004a6 add SPI support - tested with TitanX1. 2019-11-16 19:06:07 -05:00
Bas Rijniersce 8d0224c6c9 Removed the accidental code duplication for 2019-11-02 17:46:55 -07:00
Bas Rijniersce ebde856657 Added support for the GSA sentence 2019-10-31 14:05:02 -07:00
Limor "Ladyada" Fried b985f2ed1d
Merge pull request #100 from adafruit/i2c
Add support for 'uart over i2c' GPS modules
2019-10-13 22:14:52 -04:00
ladyada 70bea470db doxy new Print support 2019-10-13 21:32:50 -04:00
ladyada ceabac597f nice kleen output! 2019-10-13 20:15:13 -04:00
ladyada 2213c03439 more workin' on i2c 2019-10-09 16:51:17 -04:00
Rick Sellens 1f8c5a58d7 Change GPS time alignment
Detect time first character of NMEA sentence received and treat that as corresponding to GPS timestamp in the sentence. Still some latency, but less than using the end of the receipt.
2019-09-29 12:26:01 -04:00
Ladyada d213ccc4cf basic i2c interfacing, GPS now subclasses Print so we can treat it like a serial connection 2019-08-30 02:18:01 -04:00
Mark Tomlin 460caf00c7 Fixed data type when flipping the sign. 2019-06-25 16:01:09 -04:00
Mark Tomlin 413455c985 Changed latitude_fixed to be negative when south of the equator and longitude_fixed to be negative when west of prime meridian.y 2019-06-25 01:43:40 -04:00
Matt Goodrich 8f64274401 Merge remote-tracking branch 'upstream/master' 2019-06-17 14:56:13 -04:00
Jesse Braham 85751e96f3 Parse sentences with GNSS identifiers 2019-06-14 13:41:42 -07:00
Matt Goodrich efa9bfd857 Fix for #41 and #68 time parsing issues, based on fixes from HamishB 2019-05-16 11:55:42 -04:00
sellensr e121bb53c8 Track when sentence received
Improve the time information by tracking from when a sentence is received, rather than when it is parsed. Track last valid Date, Time, and Fix separately.
2019-04-20 13:51:00 -04:00
sellensr 76a0384f71 parse() improvements
Split out separate functions to parse fragments of sentences for time, lat, lon, fix. No functional changes. Reduces repetition and makes parsing process more readable. Will make adding new sentences less cumbersome. The difference tracking gets a little wonky stretching across function boundaries.

Added timeSinceFix() to return seconds since a valid fix was received. Modified $GPGGA parsing to also set fix = true/false based on quality.

Added more output sentences to Adafruit_GPS.h to facilittate testing with different sentences.
2019-04-17 22:37:47 -04:00
Rick Sellens 4d064cb796 test parse string for $ 2019-04-17 12:23:58 -04:00
sellensr 44af8c9086 Index checksum explicitly on $ and *
parse() Improves slightly on https://github.com/adafruit/Adafruit_GPS/pull/86 by indexing on the position of the $ and the * in the string instead of the beginning and the end of the string.  Does not require sentence string have a particular termination, e.g. CRLF.
2019-04-16 19:49:01 -04:00
Rick Sellens b431f20491 update to strStartsWith()
strStartsWith(nmea, "$GPGLL") now used to identify the sentence.
2019-04-16 13:41:25 -04:00
Rick Sellens ff2c714d4d
Merge pull request #1 from adafruit/master
Update my fork from the adafruit repo
2019-04-16 13:00:42 -04:00
Rick Sellens 968e95344c Revert "parse checksum to *"
This reverts commit 0f867b508a.
2019-04-16 12:49:05 -04:00
Rick Sellens 37fed7f05d Revert "tidy lines and checksum"
This reverts commit 8bad5eacfb.
2019-04-16 12:48:02 -04:00
Matt Goodrich f8c5386402
Merge pull request #61 from pdoddster/master
Fail parser if no checksum
2019-04-16 10:18:02 -04:00
sellensr 8bad5eacfb tidy lines and checksum
Parse start of checksum as character after first $.
Don't include '\n' or '\r' in GPS lines read. Previous code was putting '\r' at the end of each line and '\n' at the start before the $, thus having to start the checksum calculation at the third character. This may break the spacing on some code that prints out the NMEA lines.
2019-04-15 13:50:37 -04:00
sellensr 0f867b508a parse checksum to *
Parse the NMEA checksum based on the location of the asterisk, rather than the end of the string. Avoids problems if line ends with other than CRLF.
2019-04-15 11:51:40 -04:00
sellensr 8e17fcc9a9 Add $GPGLL sentence to parsing
$GPGLL has fewer arguments in a different order. The $GPRMC code was directly copied and the order rearranged.
2019-04-14 20:25:59 -04:00
Sam Roberts f52a4d2939 Fix read() so NMEA sentences are properly CR-LF terminated 2019-04-09 19:57:35 -04:00
Matt Goodrich d7c9f848f6 Updated examples, split into HardwareSerial and SoftwareSerial; Removed NewSoftSerial 2019-03-14 14:22:28 -04:00
Matt Goodrich 8c064919ab Doxyfied; Added code of conduct; Updated README; Added travis.yml 2019-03-12 17:21:45 -04:00
driverblock 77fe348437 Add hardware serial locus erase example
Added GPS_HardwareSerial_LOCUS_Erase.
Increased timeout value on waitForSentence function
updated library version to 1.0.3
2017-08-02 11:24:18 -04:00
ladyada ea73a3a8f3 hardwareserial (non-interrupt) GPS LOCUS examplz 2017-08-01 23:27:56 -04:00
driverblock c12e424439 Add define to use Software Serial
Added a #define to enable software serial.  Comment it out to not
include software serial.  Forum user request for ability to eliminate
software serial.
https://forums.adafruit.com/viewtopic.php?f=51&t=103611#p519211
2016-09-25 10:26:05 -04:00
pdoddster 7fc1b4e15f Added else clause
If checksum wasn't there, parser was parsing anyways. If checksum is required we need to return false if not found.
2016-08-02 09:18:09 -07:00
ladyada 614f4df905 allow uin32_t bauds https://github.com/adafruit/Adafruit_GPS/issues/42 2016-07-11 23:36:54 -04:00
ladyada 69f4e8cff7 https://github.com/adafruit/Adafruit_GPS/issues/58
https://github.com/adafruit/Adafruit_GPS/issues/56
2016-07-11 23:34:17 -04:00
ladyada 461d908af8 checksum code really workin now
fixes https://github.com/adafruit/Adafruit-GPS-Library/issues/40
2015-11-30 00:01:35 -05:00
Tony DiCola eb4e66dcbe Merge branch 'master' of https://github.com/Jcps/Adafruit-GPS-Library into Jcps-master 2014-10-24 17:34:21 -07:00
Larry c85ca305f9 Fix warning about deprecated cast from string to char *. 2014-10-19 11:31:07 +13:00
Larry 4348639804 Fix warning about reaching end of non-void function. 2014-10-19 11:30:28 +13:00
Jack Sampson 3f4a1a5948 Addition of Google Maps friendly coordinates
Added a latitudeDegrees, which calculates the GPS position into only
degrees, which Google Maps uses.
2014-10-16 10:44:05 -04:00
driverblock 04fc848c26 fix parser when no fix
RMC and GGA sentences were no properly parsed when there was no fix.
They were assuming numeric values between commas, but you just get a
string of commas when there’s no fix. This was causing the RMC ate to
be parsed incorrectly.
2014-09-27 08:02:59 -04:00
driverblock e7a91195e5 Please don't eat the dollar sign
read() was eating the leading dollar sign on the double-buffer swap.
2014-09-15 14:27:53 -04:00
Tony DiCola 240f1bbdea Add fixed point minute scaling back with correct floating point conversion. 2014-08-11 11:01:50 -07:00
Tony DiCola 7ca1d78daa Remove scaling from minute calulcation.
Pull #13 added scaling of minute values by 50 / 3, but this seems to cause problems like minute values going over 60.  Removing this calculation to take the exact minute value given by the module.
2014-08-08 15:02:49 -07:00
Tony DiCola 4b2006754e Fix #14 by fixing compilation for Arduino Due, and updating due_parsing example text to clarify connections. 2014-08-07 13:08:27 -07:00