32 lines
941 B
C++
32 lines
941 B
C++
#pragma once
|
|
#include <Arduino.h>
|
|
|
|
namespace LocationManager {
|
|
|
|
enum class Source { GpsFix, IpGeolocation, Manual, Persisted, None };
|
|
|
|
void init();
|
|
void update();
|
|
void requestIpLookupIfNeeded();
|
|
void getHomeLocation(double& lat, double& lon);
|
|
|
|
Source currentSource();
|
|
void setManualLocation(double lat, double lon);
|
|
void setGpsEnabled(bool enabled);
|
|
bool isGpsEnabled();
|
|
|
|
void cycleGpsPinPair();
|
|
const char* currentGpsPinLabel();
|
|
|
|
bool hasGpsFix();
|
|
|
|
// UTC offset in seconds (including possible DST), determined during the
|
|
// IP geolocation query. 0/false, if not yet known.
|
|
bool hasUtcOffset();
|
|
int32_t utcOffsetSeconds();
|
|
|
|
// Whether the region (per IP geolocation country code) uses metric units
|
|
// (meters/km) instead of feet/miles. Default true (metric), until the
|
|
// IP query determines otherwise - currently only the USA is an exception.
|
|
bool useMetricUnits();
|
|
} |