Alt now a float

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2020-02-19 19:10:16 -05:00
parent 9751b6011a
commit 6fc0c269cb
7 changed files with 28 additions and 26 deletions

View File

@@ -330,7 +330,7 @@ class TinyGsmBG96 : public TinyGsmModem<TinyGsmBG96>,
} }
// get GPS informations // 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* vsat = 0, int* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* hour = 0, int* year = 0, int* month = 0, int* day = 0, int* hour = 0,
int* minute = 0, int* second = 0) { int* minute = 0, int* second = 0) {
@@ -380,7 +380,7 @@ class TinyGsmBG96 : public TinyGsmModem<TinyGsmBG96>,
if (lat != NULL) *lat = ilat; if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon; if (lon != NULL) *lon = ilon;
if (speed != NULL) *speed = ispeed; if (speed != NULL) *speed = ispeed;
if (alt != NULL) *alt = static_cast<int>(ialt); if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = 0; if (vsat != NULL) *vsat = 0;
if (usat != NULL) *usat = iusat; if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy; if (accuracy != NULL) *accuracy = iaccuracy;

View File

@@ -423,7 +423,7 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
} }
// get GPS informations // 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* vsat = 0, int* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* hour = 0, int* year = 0, int* month = 0, int* day = 0, int* hour = 0,
int* minute = 0, int* second = 0) { int* minute = 0, int* second = 0) {
@@ -480,7 +480,7 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
if (lat != NULL) *lat = ilat; if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon; if (lon != NULL) *lon = ilon;
if (speed != NULL) *speed = ispeed; if (speed != NULL) *speed = ispeed;
if (alt != NULL) *alt = static_cast<int>(ialt); if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = ivsat; if (vsat != NULL) *vsat = ivsat;
if (usat != NULL) *usat = iusat; if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy; if (accuracy != NULL) *accuracy = iaccuracy;

View File

@@ -438,7 +438,7 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
} }
// get GPS informations // 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* vsat = 0, int* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* hour = 0, int* year = 0, int* month = 0, int* day = 0, int* hour = 0,
int* minute = 0, int* second = 0) { int* minute = 0, int* second = 0) {
@@ -449,8 +449,10 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
// TODO(?) Can 1 be returned // TODO(?) Can 1 be returned
if (fixMode == 1 || fixMode == 2 || fixMode == 3) { if (fixMode == 1 || fixMode == 2 || fixMode == 3) {
// init variables // init variables
float ilat = 0; float ilat = 0;
float ilon = 0; char north;
float ilon = 0;
char east;
float ispeed = 0; float ispeed = 0;
float ialt = 0; float ialt = 0;
int ivsat = 0; int ivsat = 0;
@@ -463,14 +465,14 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
int imin = 0; int imin = 0;
float secondWithSS = 0; float secondWithSS = 0;
streamSkipUntil(','); // GPS satellite valid numbers streamSkipUntil(','); // GPS satellite valid numbers
streamSkipUntil(','); // GLONASS satellite valid numbers streamSkipUntil(','); // GLONASS satellite valid numbers
streamSkipUntil(','); // BEIDOU satellite valid numbers streamSkipUntil(','); // BEIDOU satellite valid numbers
ilat = streamGetFloatBefore(','); // Latitude in ddmm.mmmmmm ilat = streamGetFloatBefore(','); // Latitude in ddmm.mmmmmm
char northSouth = stream.read(); // N/S Indicator, N=north or S=south north = stream.read(); // N/S Indicator, N=north or S=south
streamSkipUntil(','); streamSkipUntil(',');
ilon = streamGetFloatBefore(','); // Longitude in ddmm.mmmmmm 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(','); streamSkipUntil(',');
// Date. Output format is ddmmyy // Date. Output format is ddmmyy
@@ -496,12 +498,12 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
// Set pointers // Set pointers
if (lat != NULL) if (lat != NULL)
*lat = (floor(ilat / 100) + fmod(ilat, 100.) / 60) * *lat = (floor(ilat / 100) + fmod(ilat, 100.) / 60) *
(northSouth == 'N' ? 1 : -1); (north == 'N' ? 1 : -1);
if (lon != NULL) if (lon != NULL)
*lon = (floor(ilon / 100) + fmod(ilon, 100.) / 60) * *lon = (floor(ilon / 100) + fmod(ilon, 100.) / 60) *
(eastWest == 'E' ? 1 : -1); (east == 'E' ? 1 : -1);
if (speed != NULL) *speed = ispeed; if (speed != NULL) *speed = ispeed;
if (alt != NULL) *alt = static_cast<int>(ialt); if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = ivsat; if (vsat != NULL) *vsat = ivsat;
if (usat != NULL) *usat = iusat; if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy; if (accuracy != NULL) *accuracy = iaccuracy;

View File

@@ -50,7 +50,7 @@ class TinyGsmSim808 : public TinyGsmSim800, public TinyGsmGPS<TinyGsmSim808> {
// get GPS informations // get GPS informations
// works only with ans SIM808 V2 // 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* vsat = 0, int* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* hour = 0, int* year = 0, int* month = 0, int* day = 0, int* hour = 0,
int* minute = 0, int* second = 0) { int* minute = 0, int* second = 0) {
@@ -107,7 +107,7 @@ class TinyGsmSim808 : public TinyGsmSim800, public TinyGsmGPS<TinyGsmSim808> {
if (lat != NULL) *lat = ilat; if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon; if (lon != NULL) *lon = ilon;
if (speed != NULL) *speed = ispeed; if (speed != NULL) *speed = ispeed;
if (alt != NULL) *alt = static_cast<int>(ialt); if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = ivsat; if (vsat != NULL) *vsat = ivsat;
if (usat != NULL) *usat = iusat; if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy; if (accuracy != NULL) *accuracy = iaccuracy;

View File

@@ -483,7 +483,7 @@ class TinyGsmSaraR4 : public TinyGsmModem<TinyGsmSaraR4>,
} }
inline bool getUbloxLocation(int8_t sensor, float* lat, float* lon, 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* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* year = 0, int* month = 0, int* day = 0,
int* hour = 0, int* minute = 0, int* hour = 0, int* minute = 0,
@@ -556,7 +556,7 @@ class TinyGsmSaraR4 : public TinyGsmModem<TinyGsmSaraR4>,
if (lat != NULL) *lat = ilat; if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon; if (lon != NULL) *lon = ilon;
if (speed != NULL) *speed = ispeed; if (speed != NULL) *speed = ispeed;
if (alt != NULL) *alt = static_cast<int>(ialt); if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = 0; // Number of satellites viewed not reported; if (vsat != NULL) *vsat = 0; // Number of satellites viewed not reported;
if (usat != NULL) *usat = iusat; if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy; if (accuracy != NULL) *accuracy = iaccuracy;
@@ -578,7 +578,7 @@ class TinyGsmSaraR4 : public TinyGsmModem<TinyGsmSaraR4>,
return getUbloxLocation(2, lat, lon, 0, 0, 0, 0, accuracy, year, month, day, return getUbloxLocation(2, lat, lon, 0, 0, 0, 0, accuracy, year, month, day,
hour, minute, second); 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* vsat = 0, int* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* hour = 0, int* year = 0, int* month = 0, int* day = 0, int* hour = 0,
int* minute = 0, int* second = 0) { int* minute = 0, int* second = 0) {

View File

@@ -450,7 +450,7 @@ class TinyGsmUBLOX : public TinyGsmModem<TinyGsmUBLOX>,
} }
inline bool getUbloxLocation(int8_t sensor, float* lat, float* lon, 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* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* year = 0, int* month = 0, int* day = 0,
int* hour = 0, int* minute = 0, int* hour = 0, int* minute = 0,
@@ -523,7 +523,7 @@ class TinyGsmUBLOX : public TinyGsmModem<TinyGsmUBLOX>,
if (lat != NULL) *lat = ilat; if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon; if (lon != NULL) *lon = ilon;
if (speed != NULL) *speed = ispeed; if (speed != NULL) *speed = ispeed;
if (alt != NULL) *alt = static_cast<int>(ialt); if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = 0; // Number of satellites viewed not reported; if (vsat != NULL) *vsat = 0; // Number of satellites viewed not reported;
if (usat != NULL) *usat = iusat; if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy; if (accuracy != NULL) *accuracy = iaccuracy;
@@ -545,7 +545,7 @@ class TinyGsmUBLOX : public TinyGsmModem<TinyGsmUBLOX>,
return getUbloxLocation(2, lat, lon, 0, 0, 0, 0, accuracy, year, month, day, return getUbloxLocation(2, lat, lon, 0, 0, 0, 0, accuracy, year, month, day,
hour, minute, second); 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* vsat = 0, int* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* hour = 0, int* year = 0, int* month = 0, int* day = 0, int* hour = 0,
int* minute = 0, int* second = 0) { int* minute = 0, int* second = 0) {

View File

@@ -28,7 +28,7 @@ class TinyGsmGPS {
String getGPSraw() { String getGPSraw() {
return thisModem().getGPSrawImpl(); 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* vsat = 0, int* usat = 0, float* accuracy = 0, int* year = 0,
int* month = 0, int* day = 0, int* hour = 0, int* minute = 0, int* month = 0, int* day = 0, int* hour = 0, int* minute = 0,
int* second = 0) { int* second = 0) {
@@ -61,7 +61,7 @@ class TinyGsmGPS {
bool enableGPSImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED; bool enableGPSImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED;
bool disableGPSImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED; bool disableGPSImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED;
String getGPSrawImpl() 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* vsat = 0, int* usat = 0, float* accuracy = 0,
int* year = 0, int* month = 0, int* day = 0, int* hour = 0, int* year = 0, int* month = 0, int* day = 0, int* hour = 0,
int* minute = 0, int* minute = 0,