From 5cf1a8765707525916b8d54dee65432ae93475a0 Mon Sep 17 00:00:00 2001 From: a-f-G-U-C <65810997+a-f-G-U-C@users.noreply.github.com> Date: Thu, 2 Sep 2021 13:21:48 +0000 Subject: [PATCH] redefine hasLock() for UBlox GPS --- src/gps/UBloxGPS.cpp | 5 +++++ src/gps/UBloxGPS.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index aae4ecc35..2da2a21a8 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -196,6 +196,11 @@ bool UBloxGPS::lookForLocation() return foundLocation; } +bool UBloxGPS::hasLock() +{ + return (fixType >= 3 && fixType <= 4); +} + bool UBloxGPS::whileIdle() { // if using i2c or serial look too see if any chars are ready diff --git a/src/gps/UBloxGPS.h b/src/gps/UBloxGPS.h index 9fda4bd0e..009744a52 100644 --- a/src/gps/UBloxGPS.h +++ b/src/gps/UBloxGPS.h @@ -54,6 +54,7 @@ class UBloxGPS : public GPS * @return true if we've acquired a new location */ virtual bool lookForLocation(); + virtual bool hasLock(); /// If possible force the GPS into sleep/low power mode virtual void sleep();