Browse Source

Avoid double read of gps position, leading to incomplete positions

tags/v1.2.2
Bertrand Lemasle 6 years ago
parent
commit
5e447a057b
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/Gps.cpp

+ 1
- 2
src/Gps.cpp View File

@@ -35,7 +35,7 @@ namespace gps {
SIM808_GPS_STATUS currentStatus = SIM808_GPS_STATUS::OFF; SIM808_GPS_STATUS currentStatus = SIM808_GPS_STATUS::OFF;
do { do {
currentStatus = hardware::sim808::device.getGpsStatus();
currentStatus = hardware::sim808::device.getGpsStatus(lastPosition);
if (currentStatus > SIM808_GPS_STATUS::FIX) break; //if we have an accurate fix, break right now if (currentStatus > SIM808_GPS_STATUS::FIX) break; //if we have an accurate fix, break right now
NOTICE_FORMAT("acquireCurrentPosition", "%d", currentStatus); NOTICE_FORMAT("acquireCurrentPosition", "%d", currentStatus);
@@ -45,7 +45,6 @@ namespace gps {
if (currentStatus > SIM808_GPS_STATUS::NO_FIX) { if (currentStatus > SIM808_GPS_STATUS::NO_FIX) {
lastStatus = currentStatus; lastStatus = currentStatus;
hardware::sim808::device.getGpsPosition(lastPosition);
} }
NOTICE_FORMAT("acquireCurrentPosition", "%d", currentStatus); NOTICE_FORMAT("acquireCurrentPosition", "%d", currentStatus);


Loading…
Cancel
Save