Add accuracy to GPS output, implent it for ublox

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2020-02-13 12:01:22 -05:00
parent a584f66161
commit 46d606260f
10 changed files with 204 additions and 81 deletions

View File

@@ -384,7 +384,7 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
// Follows all messaging functions per template
/*
* GPS location functions
* GPS/GNSS/GLONASS location functions
*/
protected:
// enable GPS
@@ -412,9 +412,9 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
// get GPS informations
bool getGPSImpl(float* lat, float* lon, float* speed = 0, int* alt = 0,
int* vsat = 0, int* usat = 0, int* year = 0, int* month = 0,
int* day = 0, int* hour = 0, int* minute = 0,
int* second = 0) {
int* vsat = 0, int* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* hour = 0,
int* minute = 0, int* second = 0) {
bool fix = false;
sendAT(GF("+CGNSINF"));
@@ -459,9 +459,10 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
streamSkipUntil(','); // Fix Mode
streamSkipUntil(','); // Reserved1
streamSkipUntil(','); // Horizontal Dilution Of Precision
streamSkipUntil(','); // Position Dilution Of Precision
streamSkipUntil(','); // Vertical Dilution Of Precision
streamSkipUntil(','); // Reserved2
if (accuracy != NULL)
*accuracy = streamGetFloat(','); // Position Dilution Of Precision
streamSkipUntil(','); // Vertical Dilution Of Precision
streamSkipUntil(','); // Reserved2
if (vsat != NULL) *vsat = streamGetInt(','); // GNSS Satellites in View
if (usat != NULL) *usat = streamGetInt(','); // GNSS Satellites Used
streamSkipUntil(','); // GLONASS Satellites Used