mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
Add isGPSDetected() capability probe to SensorManager
Lets applications know whether a GPS was actually detected (EnvironmentSensorManager reports its gps_detected state), e.g. to hide GPS-dependent UI when no receiver is attached.
This commit is contained in:
@@ -23,6 +23,7 @@ public:
|
|||||||
virtual const char* getSettingValue(int i) const { return NULL; }
|
virtual const char* getSettingValue(int i) const { return NULL; }
|
||||||
virtual bool setSettingValue(const char* name, const char* value) { return false; }
|
virtual bool setSettingValue(const char* name, const char* value) { return false; }
|
||||||
virtual LocationProvider* getLocationProvider() { return NULL; }
|
virtual LocationProvider* getLocationProvider() { return NULL; }
|
||||||
|
virtual bool isGPSDetected() const { return false; }
|
||||||
|
|
||||||
// Helper functions to manage setting by keys (useful in many places ...)
|
// Helper functions to manage setting by keys (useful in many places ...)
|
||||||
const char* getSettingByKey(const char* key) {
|
const char* getSettingByKey(const char* key) {
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public:
|
|||||||
#if ENV_INCLUDE_GPS
|
#if ENV_INCLUDE_GPS
|
||||||
EnvironmentSensorManager(LocationProvider &location): _location(&location){};
|
EnvironmentSensorManager(LocationProvider &location): _location(&location){};
|
||||||
LocationProvider* getLocationProvider() { return _location; }
|
LocationProvider* getLocationProvider() { return _location; }
|
||||||
|
bool isGPSDetected() const override { return gps_detected; }
|
||||||
#else
|
#else
|
||||||
EnvironmentSensorManager(){};
|
EnvironmentSensorManager(){};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user