Browse Source

getVelocity() returns 0 when parsing from lastPosition fails

tags/v1.2.0
Bertrand Lemasle 7 years ago
parent
commit
fe7723c9d9
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      GpsTracker/Gps.cpp

+ 1
- 1
GpsTracker/Gps.cpp View File

@@ -47,7 +47,7 @@ namespace gps {

uint8_t getVelocity() {
uint8_t velocity;
hardware::sim808::device.getGpsField(lastPosition, SIM808_GPS_FIELD::SPEED, &velocity);
if (!hardware::sim808::device.getGpsField(lastPosition, SIM808_GPS_FIELD::SPEED, &velocity)) velocity = 0;

VERBOSE_FORMAT("getVelocity", "%d", velocity);



Loading…
Cancel
Save