k3ng / k3ng_rotator_controller

K3NG Arduino Amateur Radio Rotator Controller
http://blog.radioartisan.com/yaesu-rotator-computer-serial-interface/
GNU General Public License v3.0
181 stars 126 forks source link

Enable GNRMC and GNGGA sentences in TinyGPS #75

Open K7MDL2 opened 4 years ago

K7MDL2 commented 4 years ago

Modern GPS can receive data from a number of GPS satellite systems now. Made a minor code change to TinyGPS.cpp to allow both the US GPS system GPRMC and GPGGA messages and the combined satellite services format GNRMC and GNGGA sentences which supply the same data from any available satellite source.

This came about plugging a BN-880 u-bloc Neo8/8 GPS with onboard HMC5883L compass into the project. The default message set is GNXX. Used U-Center program form u-blox to configure the message output to just GNRMC and GNGGA sentences to reduce CPU parsing overhead. This model GPS has onboard flash to store config changes.

Add 2 new sentences (GNXXX)

define _GPRMC_TERM "GPRMC"

define _GPGGA_TERM "GPGGA"

define _GNRMC_TERM "GNRMC" // support other systems

define _GNGGA_TERM "GNGGA" // support other systems

Match on either and convert to the standard sentence type. Here is the slightly revised part.

// the first term determines the sentence type if (_term_number == 0) { if (!gpsstrcmp(_term, _GPRMC_TERM) || !gpsstrcmp(_term, _GNRMC_TERM)) // support other systems with GNXXX and convert to standard sentence type _sentence_type = _GPS_SENTENCE_GPRMC; else if (!gpsstrcmp(_term, _GPGGA_TERM) || !gpsstrcmp(_term, _GNRMC_TERM)) // support other systems with GNXXX and convert to standard sentence type _sentence_type = _GPS_SENTENCE_GPGGA; else _sentence_type = _GPS_SENTENCE_OTHER; return false; }

I still have yet to make the 5883L compass work.