Browse Source

Alt now a float

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
v_master
Sara Damiano 5 years ago
parent
commit
6fc0c269cb
7 changed files with 28 additions and 26 deletions
  1. +2
    -2
      src/TinyGsmClientBG96.h
  2. +2
    -2
      src/TinyGsmClientSIM7000.h
  3. +14
    -12
      src/TinyGsmClientSIM7600.h
  4. +2
    -2
      src/TinyGsmClientSIM808.h
  5. +3
    -3
      src/TinyGsmClientSaraR4.h
  6. +3
    -3
      src/TinyGsmClientUBLOX.h
  7. +2
    -2
      src/TinyGsmGPS.tpp

+ 2
- 2
src/TinyGsmClientBG96.h View File

@ -330,7 +330,7 @@ class TinyGsmBG96 : public TinyGsmModem<TinyGsmBG96>,
}
// 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<TinyGsmBG96>,
if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon;
if (speed != NULL) *speed = ispeed;
if (alt != NULL) *alt = static_cast<int>(ialt);
if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = 0;
if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy;


+ 2
- 2
src/TinyGsmClientSIM7000.h View File

@ -423,7 +423,7 @@ class TinyGsmSim7000 : public TinyGsmModem<TinyGsmSim7000>,
}
// 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<TinyGsmSim7000>,
if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon;
if (speed != NULL) *speed = ispeed;
if (alt != NULL) *alt = static_cast<int>(ialt);
if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = ivsat;
if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy;


+ 14
- 12
src/TinyGsmClientSIM7600.h View File

@ -438,7 +438,7 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
}
// 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<TinyGsmSim7600>,
// 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<TinyGsmSim7600>,
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<TinyGsmSim7600>,
// 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<int>(ialt);
if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = ivsat;
if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy;


+ 2
- 2
src/TinyGsmClientSIM808.h View File

@ -50,7 +50,7 @@ class TinyGsmSim808 : public TinyGsmSim800, public TinyGsmGPS<TinyGsmSim808> {
// 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<TinyGsmSim808> {
if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon;
if (speed != NULL) *speed = ispeed;
if (alt != NULL) *alt = static_cast<int>(ialt);
if (alt != NULL) *alt = ialt;
if (vsat != NULL) *vsat = ivsat;
if (usat != NULL) *usat = iusat;
if (accuracy != NULL) *accuracy = iaccuracy;


+ 3
- 3
src/TinyGsmClientSaraR4.h View File

@ -483,7 +483,7 @@ class TinyGsmSaraR4 : public TinyGsmModem<TinyGsmSaraR4>,
}
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<TinyGsmSaraR4>,
if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon;
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 (usat != NULL) *usat = iusat;
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,
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) {


+ 3
- 3
src/TinyGsmClientUBLOX.h View File

@ -450,7 +450,7 @@ class TinyGsmUBLOX : public TinyGsmModem<TinyGsmUBLOX>,
}
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<TinyGsmUBLOX>,
if (lat != NULL) *lat = ilat;
if (lon != NULL) *lon = ilon;
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 (usat != NULL) *usat = iusat;
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,
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) {


+ 2
- 2
src/TinyGsmGPS.tpp View File

@ -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,


Loading…
Cancel
Save