diff --git a/src/TinyGsmClientBG96.h b/src/TinyGsmClientBG96.h index c49424c..3a3d287 100644 --- a/src/TinyGsmClientBG96.h +++ b/src/TinyGsmClientBG96.h @@ -330,7 +330,7 @@ class TinyGsmBG96 : public TinyGsmModem, } // get GPS informations - bool getGPSImpl(float* lat, float* lon, float* speed = 0, int* alt = 0, + bool getGPSImpl(float* lat, float* lon, float* speed = 0, float* alt = 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) { @@ -380,7 +380,7 @@ class TinyGsmBG96 : public TinyGsmModem, if (lat != NULL) *lat = ilat; if (lon != NULL) *lon = ilon; if (speed != NULL) *speed = ispeed; - if (alt != NULL) *alt = static_cast(ialt); + if (alt != NULL) *alt = ialt; if (vsat != NULL) *vsat = 0; if (usat != NULL) *usat = iusat; if (accuracy != NULL) *accuracy = iaccuracy; diff --git a/src/TinyGsmClientSIM7000.h b/src/TinyGsmClientSIM7000.h index e9159d3..2c7262c 100644 --- a/src/TinyGsmClientSIM7000.h +++ b/src/TinyGsmClientSIM7000.h @@ -423,7 +423,7 @@ class TinyGsmSim7000 : public TinyGsmModem, } // get GPS informations - bool getGPSImpl(float* lat, float* lon, float* speed = 0, int* alt = 0, + bool getGPSImpl(float* lat, float* lon, float* speed = 0, float* alt = 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) { @@ -480,7 +480,7 @@ class TinyGsmSim7000 : public TinyGsmModem, if (lat != NULL) *lat = ilat; if (lon != NULL) *lon = ilon; if (speed != NULL) *speed = ispeed; - if (alt != NULL) *alt = static_cast(ialt); + if (alt != NULL) *alt = ialt; if (vsat != NULL) *vsat = ivsat; if (usat != NULL) *usat = iusat; if (accuracy != NULL) *accuracy = iaccuracy; diff --git a/src/TinyGsmClientSIM7600.h b/src/TinyGsmClientSIM7600.h index 0f05a63..3d510be 100644 --- a/src/TinyGsmClientSIM7600.h +++ b/src/TinyGsmClientSIM7600.h @@ -438,7 +438,7 @@ class TinyGsmSim7600 : public TinyGsmModem, } // get GPS informations - bool getGPSImpl(float* lat, float* lon, float* speed = 0, int* alt = 0, + bool getGPSImpl(float* lat, float* lon, float* speed = 0, float* alt = 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) { @@ -449,8 +449,10 @@ class TinyGsmSim7600 : public TinyGsmModem, // TODO(?) Can 1 be returned if (fixMode == 1 || fixMode == 2 || fixMode == 3) { // init variables - float ilat = 0; - float ilon = 0; + float ilat = 0; + char north; + float ilon = 0; + char east; float ispeed = 0; float ialt = 0; int ivsat = 0; @@ -463,14 +465,14 @@ class TinyGsmSim7600 : public TinyGsmModem, int imin = 0; float secondWithSS = 0; - streamSkipUntil(','); // GPS satellite valid numbers - streamSkipUntil(','); // GLONASS satellite valid numbers - streamSkipUntil(','); // BEIDOU satellite valid numbers - ilat = streamGetFloatBefore(','); // Latitude in ddmm.mmmmmm - char northSouth = stream.read(); // N/S Indicator, N=north or S=south + streamSkipUntil(','); // GPS satellite valid numbers + streamSkipUntil(','); // GLONASS satellite valid numbers + streamSkipUntil(','); // BEIDOU satellite valid numbers + ilat = streamGetFloatBefore(','); // Latitude in ddmm.mmmmmm + north = stream.read(); // N/S Indicator, N=north or S=south streamSkipUntil(','); ilon = streamGetFloatBefore(','); // Longitude in ddmm.mmmmmm - char eastWest = stream.read(); // E/W Indicator, E=east or W=west + east = stream.read(); // E/W Indicator, E=east or W=west streamSkipUntil(','); // Date. Output format is ddmmyy @@ -496,12 +498,12 @@ class TinyGsmSim7600 : public TinyGsmModem, // Set pointers if (lat != NULL) *lat = (floor(ilat / 100) + fmod(ilat, 100.) / 60) * - (northSouth == 'N' ? 1 : -1); + (north == 'N' ? 1 : -1); if (lon != NULL) *lon = (floor(ilon / 100) + fmod(ilon, 100.) / 60) * - (eastWest == 'E' ? 1 : -1); + (east == 'E' ? 1 : -1); if (speed != NULL) *speed = ispeed; - if (alt != NULL) *alt = static_cast(ialt); + if (alt != NULL) *alt = ialt; if (vsat != NULL) *vsat = ivsat; if (usat != NULL) *usat = iusat; if (accuracy != NULL) *accuracy = iaccuracy; diff --git a/src/TinyGsmClientSIM808.h b/src/TinyGsmClientSIM808.h index 943fc84..ab699d1 100644 --- a/src/TinyGsmClientSIM808.h +++ b/src/TinyGsmClientSIM808.h @@ -50,7 +50,7 @@ class TinyGsmSim808 : public TinyGsmSim800, public TinyGsmGPS { // get GPS informations // works only with ans SIM808 V2 - bool getGPSImpl(float* lat, float* lon, float* speed = 0, int* alt = 0, + bool getGPSImpl(float* lat, float* lon, float* speed = 0, float* alt = 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) { @@ -107,7 +107,7 @@ class TinyGsmSim808 : public TinyGsmSim800, public TinyGsmGPS { if (lat != NULL) *lat = ilat; if (lon != NULL) *lon = ilon; if (speed != NULL) *speed = ispeed; - if (alt != NULL) *alt = static_cast(ialt); + if (alt != NULL) *alt = ialt; if (vsat != NULL) *vsat = ivsat; if (usat != NULL) *usat = iusat; if (accuracy != NULL) *accuracy = iaccuracy; diff --git a/src/TinyGsmClientSaraR4.h b/src/TinyGsmClientSaraR4.h index 7815089..dddcbc0 100644 --- a/src/TinyGsmClientSaraR4.h +++ b/src/TinyGsmClientSaraR4.h @@ -483,7 +483,7 @@ class TinyGsmSaraR4 : public TinyGsmModem, } inline bool getUbloxLocation(int8_t sensor, float* lat, float* lon, - float* speed = 0, int* alt = 0, int* vsat = 0, + float* speed = 0, float* alt = 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, @@ -556,7 +556,7 @@ class TinyGsmSaraR4 : public TinyGsmModem, if (lat != NULL) *lat = ilat; if (lon != NULL) *lon = ilon; if (speed != NULL) *speed = ispeed; - if (alt != NULL) *alt = static_cast(ialt); + if (alt != NULL) *alt = ialt; if (vsat != NULL) *vsat = 0; // Number of satellites viewed not reported; if (usat != NULL) *usat = iusat; if (accuracy != NULL) *accuracy = iaccuracy; @@ -578,7 +578,7 @@ class TinyGsmSaraR4 : public TinyGsmModem, return getUbloxLocation(2, lat, lon, 0, 0, 0, 0, accuracy, year, month, day, hour, minute, second); } - bool getGPSImpl(float* lat, float* lon, float* speed = 0, int* alt = 0, + bool getGPSImpl(float* lat, float* lon, float* speed = 0, float* alt = 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) { diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index bc551cf..6b64b59 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -450,7 +450,7 @@ class TinyGsmUBLOX : public TinyGsmModem, } inline bool getUbloxLocation(int8_t sensor, float* lat, float* lon, - float* speed = 0, int* alt = 0, int* vsat = 0, + float* speed = 0, float* alt = 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, @@ -523,7 +523,7 @@ class TinyGsmUBLOX : public TinyGsmModem, if (lat != NULL) *lat = ilat; if (lon != NULL) *lon = ilon; if (speed != NULL) *speed = ispeed; - if (alt != NULL) *alt = static_cast(ialt); + if (alt != NULL) *alt = ialt; if (vsat != NULL) *vsat = 0; // Number of satellites viewed not reported; if (usat != NULL) *usat = iusat; if (accuracy != NULL) *accuracy = iaccuracy; @@ -545,7 +545,7 @@ class TinyGsmUBLOX : public TinyGsmModem, return getUbloxLocation(2, lat, lon, 0, 0, 0, 0, accuracy, year, month, day, hour, minute, second); } - bool getGPSImpl(float* lat, float* lon, float* speed = 0, int* alt = 0, + bool getGPSImpl(float* lat, float* lon, float* speed = 0, float* alt = 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) { diff --git a/src/TinyGsmGPS.tpp b/src/TinyGsmGPS.tpp index 2ed3d25..9d09fc9 100644 --- a/src/TinyGsmGPS.tpp +++ b/src/TinyGsmGPS.tpp @@ -28,7 +28,7 @@ class TinyGsmGPS { String getGPSraw() { return thisModem().getGPSrawImpl(); } - bool getGPS(float* lat, float* lon, float* speed = 0, int* alt = 0, + bool getGPS(float* lat, float* lon, float* speed = 0, float* alt = 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) { @@ -61,7 +61,7 @@ class TinyGsmGPS { bool enableGPSImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED; bool disableGPSImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED; String getGPSrawImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED; - bool getGPSImpl(float* lat, float* lon, float* speed = 0, int* alt = 0, + bool getGPSImpl(float* lat, float* lon, float* speed = 0, float* alt = 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,