diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2018-09-28 10:36:11 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-09-28 10:36:11 -0700 |
commit | b18e6f9b8c87c9cfcfb70a7fc0d8abc4dba09731 (patch) | |
tree | babbc901f87f9e4a34211f1836d401204ed80992 /core | |
parent | 352ffcb3c5fe7ae430c43d882bc1965e787e71cb (diff) | |
parent | 2bef34e8b2b6ffa021cc5544efab5dfdcc802ef3 (diff) | |
download | gps-b18e6f9b8c87c9cfcfb70a7fc0d8abc4dba09731.tar.gz |
Merge "FR47184: tunc constrained and position assisted time estimator"
Diffstat (limited to 'core')
-rw-r--r-- | core/ContextBase.cpp | 13 | ||||
-rw-r--r-- | core/ContextBase.h | 4 | ||||
-rw-r--r-- | core/LocAdapterBase.cpp | 4 | ||||
-rw-r--r-- | core/LocAdapterBase.h | 1 | ||||
-rw-r--r-- | core/LocApiBase.cpp | 24 | ||||
-rw-r--r-- | core/LocApiBase.h | 11 |
6 files changed, 57 insertions, 0 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index fa87c3e..3d55e1c 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -74,6 +74,10 @@ const loc_param_s_type ContextBase::mGps_conf_table[] = {"MODEM_TYPE", &mGps_conf.MODEM_TYPE, NULL, 'n' }, {"MO_SUPL_HOST", &mGps_conf.MO_SUPL_HOST, NULL, 's' }, {"MO_SUPL_PORT", &mGps_conf.MO_SUPL_PORT, NULL, 'n' }, + {"CONSTRAINED_TIME_UNCERTAINTY_ENABLED", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED, NULL, 'n'}, + {"CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, NULL, 'f'}, + {"CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET", &mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET, NULL, 'n'}, + {"POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED", &mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED, NULL, 'n'}, }; const loc_param_s_type ContextBase::mSap_conf_table[] = @@ -156,6 +160,15 @@ void ContextBase::readConfig() /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */ mGps_conf.AGPS_CONFIG_INJECT = 1; + /* default configuration value of constrained time uncertainty mode: + feature disabled, time uncertainty threshold defined by modem, + and unlimited power budget */ + mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 0; + mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD = 0.0; + mGps_conf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0; + /* default configuration value of position assisted clock estimator mode */ + mGps_conf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0; + UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); diff --git a/core/ContextBase.h b/core/ContextBase.h index bdabf7b..8a3d300 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -67,6 +67,10 @@ typedef struct loc_gps_cfg_s uint32_t MODEM_TYPE; char MO_SUPL_HOST[LOC_MAX_PARAM_STRING]; uint32_t MO_SUPL_PORT; + uint32_t CONSTRAINED_TIME_UNCERTAINTY_ENABLED; + double CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD; + uint32_t CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET; + uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED; } loc_gps_cfg_s_type; /* NOTE: the implementaiton of the parser casts number diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp index 8197f4d..5a16b17 100644 --- a/core/LocAdapterBase.cpp +++ b/core/LocAdapterBase.cpp @@ -175,4 +175,8 @@ bool LocAdapterBase:: requestOdcpiEvent(OdcpiRequestInfo& /*request*/) DEFAULT_IMPL(false) +bool LocAdapterBase:: + reportGnssEngEnergyConsumedEvent(uint64_t /*energyConsumedSinceFirstBoot*/) +DEFAULT_IMPL(false) + } // namespace loc_core diff --git a/core/LocAdapterBase.h b/core/LocAdapterBase.h index 6b3e02f..abbf3d6 100644 --- a/core/LocAdapterBase.h +++ b/core/LocAdapterBase.h @@ -167,6 +167,7 @@ public: virtual void reportGnssSvIdConfigEvent(const GnssSvIdConfig& config); virtual void reportGnssSvTypeConfigEvent(const GnssSvTypeConfig& config); virtual bool requestOdcpiEvent(OdcpiRequestInfo& request); + virtual bool reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); }; } // namespace loc_core diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp index 7b52c82..99a089e 100644 --- a/core/LocApiBase.cpp +++ b/core/LocApiBase.cpp @@ -362,6 +362,13 @@ void LocApiBase::requestOdcpi(OdcpiRequestInfo& request) TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestOdcpiEvent(request)); } +void LocApiBase::reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssEngEnergyConsumedEvent( + energyConsumedSinceFirstBoot)); +} + void LocApiBase::reportSv(GnssSvNotification& svNotify) { const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS", @@ -540,6 +547,10 @@ void LocApiBase:: DEFAULT_IMPL() void LocApiBase:: + injectPosition(const GnssLocationInfoNotification & /*locationInfo*/, bool /*onDemandCpi*/) +DEFAULT_IMPL() + +void LocApiBase:: setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/) DEFAULT_IMPL() @@ -676,4 +687,17 @@ DEFAULT_IMPL() void LocApiBase::resetConstellationControl() DEFAULT_IMPL() +LocationError LocApiBase:: + setConstrainedTuncMode(bool /*enabled*/, + float /*tuncConstraint*/, + uint32_t /*energyBudget*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +LocationError LocApiBase:: + setPositionAssistedClockEstimatorMode(bool /*enabled*/) +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) + +LocationError LocApiBase:: + getGnssEnergyConsumed() +DEFAULT_IMPL(LOCATION_ERROR_SUCCESS) } // namespace loc_core diff --git a/core/LocApiBase.h b/core/LocApiBase.h index e80e273..d4d337a 100644 --- a/core/LocApiBase.h +++ b/core/LocApiBase.h @@ -183,6 +183,7 @@ public: void reportGnssSvIdConfig(const GnssSvIdConfig& config); void reportGnssSvTypeConfig(const GnssSvTypeConfig& config); void requestOdcpi(OdcpiRequestInfo& request); + void reportGnssEngEnergyConsumedEvent(uint64_t energyConsumedSinceFirstBoot); // downward calls // All below functions are to be defined by adapter specific modules: @@ -198,6 +199,10 @@ public: virtual void injectPosition(double latitude, double longitude, float accuracy); + + virtual void + injectPosition(const GnssLocationInfoNotification &locationInfo, bool onDemandCpi=false); + virtual void injectPosition(const Location& location, bool onDemandCpi); virtual void @@ -281,6 +286,12 @@ public: virtual void setConstellationControl(const GnssSvTypeConfig& config); virtual void getConstellationControl(); virtual void resetConstellationControl(); + + virtual LocationError setConstrainedTuncMode(bool enabled, + float tuncConstraint, + uint32_t energyBudget); + virtual LocationError setPositionAssistedClockEstimatorMode(bool enabled); + virtual LocationError getGnssEnergyConsumed(); }; typedef LocApiBase* (getLocApi_t)(LOC_API_ADAPTER_EVENT_MASK_T exMask, |