summaryrefslogtreecommitdiff
path: root/core/ContextBase.cpp
diff options
context:
space:
mode:
authorHarikrishnan Hariharan <hahariha@codeaurora.org>2018-02-22 11:31:38 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-02-25 23:28:54 -0800
commitcd1e0726c8d5f37c3ddfbb5d608a036a4b203e8d (patch)
treec43ad0dc4c6e416b5f2aa1ad68032ef85abb2c50 /core/ContextBase.cpp
parent980d403c819d1053f8f19f00f077dcfbe9dd68a3 (diff)
downloadgps-cd1e0726c8d5f37c3ddfbb5d608a036a4b203e8d.tar.gz
Reset MSA/MSB capabilities for APQ targets.
- Capabilities MSA/MSB should be reset even if defined in gps.conf for APQ/QSC targets. Since WWAN modem will not be available, we need to trigger Standalone fixes only. If MSB capability is set,then default position mode is MSB. - Handle the new string "qcs" for baseband for Gen9 APQ targets. - Make sure that ContextBase::readConfig avoid repeat initialize for config reading. Change-Id: Ic0a1e57dd76a88bf4d037cd374ceded84cc0f904 CRs-Fixed: 2193207
Diffstat (limited to 'core/ContextBase.cpp')
-rw-r--r--core/ContextBase.cpp132
1 files changed, 73 insertions, 59 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp
index 35e6585..47194cb 100644
--- a/core/ContextBase.cpp
+++ b/core/ContextBase.cpp
@@ -92,65 +92,79 @@ const loc_param_s_type ContextBase::mSap_conf_table[] =
void ContextBase::readConfig()
{
- /*Defaults for gps.conf*/
- mGps_conf.INTERMEDIATE_POS = 0;
- mGps_conf.ACCURACY_THRES = 0;
- mGps_conf.NMEA_PROVIDER = 0;
- mGps_conf.GPS_LOCK = 0;
- mGps_conf.SUPL_VER = 0x10000;
- mGps_conf.SUPL_MODE = 0x1;
- mGps_conf.SUPL_ES = 0;
- mGps_conf.SUPL_HOST[0] = 0;
- mGps_conf.SUPL_PORT = 0;
- mGps_conf.CAPABILITIES = 0x7;
- /* LTE Positioning Profile configuration is disable by default*/
- mGps_conf.LPP_PROFILE = 0;
- /*By default no positioning protocol is selected on A-GLONASS system*/
- mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0;
- /*XTRA version check is disabled by default*/
- mGps_conf.XTRA_VERSION_CHECK=0;
- /*Use emergency PDN by default*/
- mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1;
- /* By default no LPPe CP technology is enabled*/
- mGps_conf.LPPE_CP_TECHNOLOGY = 0;
- /* By default no LPPe UP technology is enabled*/
- mGps_conf.LPPE_UP_TECHNOLOGY = 0;
-
- /*Defaults for sap.conf*/
- mSap_conf.GYRO_BIAS_RANDOM_WALK = 0;
- mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2;
- mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5;
- mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2;
- mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5;
- mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4;
- mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25;
- mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4;
- mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25;
- mSap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */
- mSap_conf.SENSOR_USAGE = 0; /* Enabled */
- mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/
- /* Values MUST be set by OEMs in configuration for sensor-assisted
- navigation to work. There are NO default values */
- mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0;
- mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
- mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
- mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0;
- mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0;
- mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
- mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
- mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
- mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
- /* default provider is SSC */
- mSap_conf.SENSOR_PROVIDER = 1;
-
- /* None of the 10 slots for agps certificates are writable by default */
- mGps_conf.AGPS_CERT_WRITABLE_MASK = 0;
-
- /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */
- mGps_conf.AGPS_CONFIG_INJECT = 1;
-
- UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table);
- UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table);
+ static bool confReadDone = false;
+ if (!confReadDone) {
+ confReadDone = true;
+ /*Defaults for gps.conf*/
+ mGps_conf.INTERMEDIATE_POS = 0;
+ mGps_conf.ACCURACY_THRES = 0;
+ mGps_conf.NMEA_PROVIDER = 0;
+ mGps_conf.GPS_LOCK = 0;
+ mGps_conf.SUPL_VER = 0x10000;
+ mGps_conf.SUPL_MODE = 0x1;
+ mGps_conf.SUPL_ES = 0;
+ mGps_conf.SUPL_HOST[0] = 0;
+ mGps_conf.SUPL_PORT = 0;
+ mGps_conf.CAPABILITIES = 0x7;
+ /* LTE Positioning Profile configuration is disable by default*/
+ mGps_conf.LPP_PROFILE = 0;
+ /*By default no positioning protocol is selected on A-GLONASS system*/
+ mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0;
+ /*XTRA version check is disabled by default*/
+ mGps_conf.XTRA_VERSION_CHECK=0;
+ /*Use emergency PDN by default*/
+ mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1;
+ /* By default no LPPe CP technology is enabled*/
+ mGps_conf.LPPE_CP_TECHNOLOGY = 0;
+ /* By default no LPPe UP technology is enabled*/
+ mGps_conf.LPPE_UP_TECHNOLOGY = 0;
+
+ /*Defaults for sap.conf*/
+ mSap_conf.GYRO_BIAS_RANDOM_WALK = 0;
+ mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2;
+ mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5;
+ mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2;
+ mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5;
+ mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4;
+ mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25;
+ mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4;
+ mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25;
+ mSap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */
+ mSap_conf.SENSOR_USAGE = 0; /* Enabled */
+ mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/
+ /* Values MUST be set by OEMs in configuration for sensor-assisted
+ navigation to work. There are NO default values */
+ mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0;
+ mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
+ mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
+ mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0;
+ mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0;
+ mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
+ mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
+ mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
+ mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
+ /* default provider is SSC */
+ mSap_conf.SENSOR_PROVIDER = 1;
+
+ /* None of the 10 slots for agps certificates are writable by default */
+ mGps_conf.AGPS_CERT_WRITABLE_MASK = 0;
+
+ /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */
+ mGps_conf.AGPS_CONFIG_INJECT = 1;
+
+ UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table);
+ UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table);
+
+ switch (getTargetGnssType(loc_get_target())) {
+ case GNSS_GSS:
+ case GNSS_AUTO:
+ // For APQ targets, MSA/MSB capabilities should be reset
+ mGps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB);
+ break;
+ default:
+ break;
+ }
+ }
}
uint32_t ContextBase::getCarrierCapabilities() {