Split gps configuration file (change 1/2)
gps.conf now split into izat.conf: proprietary items sap.conf : sensor assisted positioning items gps.conf : items used in open source (gps.conf moved to open source) CRs-fixed: 461129 Change-Id: I819230ee3bb13aad0b91f7d33bfb9e57b6d1abe1
This commit is contained in:
parent
cb30de1efc
commit
d2873a0baf
5 changed files with 139 additions and 181 deletions
66
etc/gps.conf
66
etc/gps.conf
|
@ -1,3 +1,12 @@
|
||||||
|
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
|
||||||
|
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
|
||||||
|
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
|
||||||
|
|
||||||
|
# Error Estimate
|
||||||
|
# _SET = 1
|
||||||
|
# _CLEAR = 0
|
||||||
|
ERR_ESTIMATE=0
|
||||||
|
|
||||||
#Test
|
#Test
|
||||||
NTP_SERVER=time.gpsonextra.net
|
NTP_SERVER=time.gpsonextra.net
|
||||||
#Asia
|
#Asia
|
||||||
|
@ -7,13 +16,9 @@ NTP_SERVER=time.gpsonextra.net
|
||||||
#North America
|
#North America
|
||||||
# NTP_SERVER=north-america.pool.ntp.org
|
# NTP_SERVER=north-america.pool.ntp.org
|
||||||
|
|
||||||
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
|
|
||||||
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
|
|
||||||
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
|
|
||||||
|
|
||||||
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
|
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
|
||||||
# 4 - Debug, 5 - Verbose
|
# 4 - Debug, 5 - Verbose
|
||||||
DEBUG_LEVEL = 2
|
DEBUG_LEVEL = 3
|
||||||
|
|
||||||
# Intermediate position report, 1=enable, 0=disable
|
# Intermediate position report, 1=enable, 0=disable
|
||||||
INTERMEDIATE_POS=0
|
INTERMEDIATE_POS=0
|
||||||
|
@ -21,15 +26,11 @@ INTERMEDIATE_POS=0
|
||||||
# supl version 1.0
|
# supl version 1.0
|
||||||
SUPL_VER=0x10000
|
SUPL_VER=0x10000
|
||||||
|
|
||||||
# Error Estimate
|
|
||||||
# _SET = 1
|
|
||||||
# _CLEAR = 0
|
|
||||||
ERR_ESTIMATE=0
|
|
||||||
|
|
||||||
# GPS Capabilities bit mask
|
# GPS Capabilities bit mask
|
||||||
# SCHEDULING = 1
|
# SCHEDULING = 1
|
||||||
# MSB = 2
|
# MSB = 2
|
||||||
# MSA = 4
|
# MSA = 4
|
||||||
|
# ON_DEMAND_TIME = 0x10
|
||||||
# ULP = 0x20
|
# ULP = 0x20
|
||||||
# default = MSA | MSB | SCHEDULING | ULP
|
# default = MSA | MSB | SCHEDULING | ULP
|
||||||
CAPABILITIES=0x27
|
CAPABILITIES=0x27
|
||||||
|
@ -50,42 +51,17 @@ CAPABILITIES=0x27
|
||||||
# C2K_HOST=c2k.pde.com or IP
|
# C2K_HOST=c2k.pde.com or IP
|
||||||
# C2K_PORT=1234
|
# C2K_PORT=1234
|
||||||
|
|
||||||
################################
|
####################################
|
||||||
# Sensor Settings
|
# LTE Positioning Profile Settings
|
||||||
################################
|
####################################
|
||||||
|
# 0: Enable RRLP on LTE(Default)
|
||||||
# Needs to be set explicitly based on sensor
|
# 1: Enable LPP_User_Plane on LTE
|
||||||
# There is no default value.
|
# 2: Enable LPP_Control_Plane
|
||||||
#GYRO_BIAS_RANDOM_WALK=
|
# 3: Enable both LPP_User_Plane and LPP_Control_Plane
|
||||||
|
LPP_PROFILE = 0
|
||||||
SENSOR_ACCEL_BATCHES_PER_SEC=2
|
|
||||||
SENSOR_ACCEL_SAMPLES_PER_BATCH=5
|
|
||||||
SENSOR_GYRO_BATCHES_PER_SEC=2
|
|
||||||
SENSOR_GYRO_SAMPLES_PER_BATCH=5
|
|
||||||
|
|
||||||
# Sensor Control Mode (0=AUTO, 1=FORCE_ON)
|
|
||||||
SENSOR_CONTROL_MODE=0
|
|
||||||
|
|
||||||
# Enable or Disable Sensors for GPS use (0=Enable, 1=Disable)
|
|
||||||
SENSOR_USAGE=0
|
|
||||||
|
|
||||||
# Choose GSIFF sensor provider (1=DSPS, 2=Android NDK)
|
|
||||||
SENSOR_PROVIDER=1
|
|
||||||
|
|
||||||
################################
|
|
||||||
# Indoor Positioning Settings
|
|
||||||
################################
|
|
||||||
# 0: QUIPC disabled, 1: QUIPC enabled, 2: forced QUIPC only
|
|
||||||
QUIPC_ENABLED = 0
|
|
||||||
|
|
||||||
################################
|
################################
|
||||||
# EXTRA SETTINGS
|
# EXTRA SETTINGS
|
||||||
################################
|
################################
|
||||||
# Enable or Disable Wiper (1=Enable, 0=Disable)
|
# NMEA provider (1=Modem Processor, 0=Application Processor)
|
||||||
ENABLE_WIPER=1
|
NMEA_PROVIDER=0
|
||||||
|
|
||||||
####################################
|
|
||||||
# LTE Positioning Profile Settings
|
|
||||||
####################################
|
|
||||||
# 0: Enable RRLP on LTE(Default) 1: Enable LPP_User_Plane on LTE
|
|
||||||
LPP_PROFILE = 0
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -67,6 +67,14 @@
|
||||||
#define SUCCESS TRUE
|
#define SUCCESS TRUE
|
||||||
#define FAILURE FALSE
|
#define FAILURE FALSE
|
||||||
|
|
||||||
|
#ifndef GPS_CONF_FILE
|
||||||
|
#define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SAP_CONF_FILE
|
||||||
|
#define SAP_CONF_FILE "/etc/sap.conf"
|
||||||
|
#endif
|
||||||
|
|
||||||
static void loc_eng_deferred_action_thread(void* context);
|
static void loc_eng_deferred_action_thread(void* context);
|
||||||
static void* loc_eng_create_msg_q();
|
static void* loc_eng_create_msg_q();
|
||||||
static void loc_eng_free_msg(void* msg);
|
static void loc_eng_free_msg(void* msg);
|
||||||
|
@ -74,9 +82,10 @@ static void loc_eng_free_msg(void* msg);
|
||||||
pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t LocEngContext::lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER;
|
pthread_cond_t LocEngContext::cond = PTHREAD_COND_INITIALIZER;
|
||||||
LocEngContext* LocEngContext::me = NULL;
|
LocEngContext* LocEngContext::me = NULL;
|
||||||
boolean gpsConfigAlreadyRead = false;
|
boolean configAlreadyRead = false;
|
||||||
|
|
||||||
loc_gps_cfg_s_type gps_conf;
|
loc_gps_cfg_s_type gps_conf;
|
||||||
|
loc_sap_cfg_s_type sap_conf;
|
||||||
|
|
||||||
/* Parameter spec table */
|
/* Parameter spec table */
|
||||||
static loc_param_s_type loc_parameter_table[] =
|
static loc_param_s_type loc_parameter_table[] =
|
||||||
|
@ -87,22 +96,22 @@ static loc_param_s_type loc_parameter_table[] =
|
||||||
{"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'},
|
{"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'},
|
||||||
{"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'},
|
{"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'},
|
||||||
{"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'},
|
{"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'},
|
||||||
{"GYRO_BIAS_RANDOM_WALK", &gps_conf.GYRO_BIAS_RANDOM_WALK, &gps_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'},
|
{"GYRO_BIAS_RANDOM_WALK", &sap_conf.GYRO_BIAS_RANDOM_WALK, &sap_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'},
|
||||||
{"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
{"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||||
{"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
{"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||||
{"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
{"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||||
{"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
{"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||||
{"SENSOR_ACCEL_BATCHES_PER_SEC", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'},
|
{"SENSOR_ACCEL_BATCHES_PER_SEC", &sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'},
|
||||||
{"SENSOR_ACCEL_SAMPLES_PER_BATCH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'},
|
{"SENSOR_ACCEL_SAMPLES_PER_BATCH", &sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'},
|
||||||
{"SENSOR_GYRO_BATCHES_PER_SEC", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'},
|
{"SENSOR_GYRO_BATCHES_PER_SEC", &sap_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'},
|
||||||
{"SENSOR_GYRO_SAMPLES_PER_BATCH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'},
|
{"SENSOR_GYRO_SAMPLES_PER_BATCH", &sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'},
|
||||||
{"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'},
|
{"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'},
|
||||||
{"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
|
{"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
|
||||||
{"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &gps_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'},
|
{"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'},
|
||||||
{"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
|
{"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
|
||||||
{"SENSOR_CONTROL_MODE", &gps_conf.SENSOR_CONTROL_MODE, NULL, 'n'},
|
{"SENSOR_CONTROL_MODE", &sap_conf.SENSOR_CONTROL_MODE, NULL, 'n'},
|
||||||
{"SENSOR_USAGE", &gps_conf.SENSOR_USAGE, NULL, 'n'},
|
{"SENSOR_USAGE", &sap_conf.SENSOR_USAGE, NULL, 'n'},
|
||||||
{"SENSOR_ALGORITHM_CONFIG_MASK", &gps_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'},
|
{"SENSOR_ALGORITHM_CONFIG_MASK", &sap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'},
|
||||||
{"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'},
|
{"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'},
|
||||||
{"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'},
|
{"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'},
|
||||||
{"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
|
{"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
|
||||||
|
@ -118,31 +127,31 @@ static void loc_default_parameters(void)
|
||||||
gps_conf.SUPL_VER = 0x10000;
|
gps_conf.SUPL_VER = 0x10000;
|
||||||
gps_conf.CAPABILITIES = 0x7;
|
gps_conf.CAPABILITIES = 0x7;
|
||||||
|
|
||||||
gps_conf.GYRO_BIAS_RANDOM_WALK = 0;
|
sap_conf.GYRO_BIAS_RANDOM_WALK = 0;
|
||||||
gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2;
|
sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2;
|
||||||
gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5;
|
sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5;
|
||||||
gps_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2;
|
sap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2;
|
||||||
gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5;
|
sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5;
|
||||||
gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4;
|
sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4;
|
||||||
gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25;
|
sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25;
|
||||||
gps_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4;
|
sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4;
|
||||||
gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25;
|
sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25;
|
||||||
gps_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */
|
sap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */
|
||||||
gps_conf.SENSOR_USAGE = 0; /* Enabled */
|
sap_conf.SENSOR_USAGE = 0; /* Enabled */
|
||||||
gps_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/
|
sap_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/
|
||||||
|
|
||||||
/* Values MUST be set by OEMs in configuration for sensor-assisted
|
/* Values MUST be set by OEMs in configuration for sensor-assisted
|
||||||
navigation to work. There are NO default values */
|
navigation to work. There are NO default values */
|
||||||
gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||||
gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||||
gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||||
gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||||
|
|
||||||
gps_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0;
|
sap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0;
|
||||||
gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||||
gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||||
gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||||
gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||||
|
|
||||||
/* LTE Positioning Profile configuration is disable by default*/
|
/* LTE Positioning Profile configuration is disable by default*/
|
||||||
gps_conf.LPP_PROFILE = 0;
|
gps_conf.LPP_PROFILE = 0;
|
||||||
|
@ -371,7 +380,7 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data)
|
||||||
lpp_msg, loc_eng_free_msg);
|
lpp_msg, loc_eng_free_msg);
|
||||||
|
|
||||||
loc_eng_msg_sensor_control_config *sensor_control_config_msg(
|
loc_eng_msg_sensor_control_config *sensor_control_config_msg(
|
||||||
new loc_eng_msg_sensor_control_config(&loc_eng_data, gps_conf.SENSOR_USAGE));
|
new loc_eng_msg_sensor_control_config(&loc_eng_data, sap_conf.SENSOR_USAGE));
|
||||||
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
||||||
sensor_control_config_msg, loc_eng_free_msg);
|
sensor_control_config_msg, loc_eng_free_msg);
|
||||||
|
|
||||||
|
@ -381,40 +390,40 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data)
|
||||||
a_glonass_protocol_msg, loc_eng_free_msg);
|
a_glonass_protocol_msg, loc_eng_free_msg);
|
||||||
|
|
||||||
/* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */
|
/* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */
|
||||||
if( gps_conf.GYRO_BIAS_RANDOM_WALK_VALID ||
|
if( sap_conf.GYRO_BIAS_RANDOM_WALK_VALID ||
|
||||||
gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
||||||
gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
||||||
gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
|
||||||
gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID )
|
sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID )
|
||||||
{
|
{
|
||||||
loc_eng_msg_sensor_properties *sensor_properties_msg(
|
loc_eng_msg_sensor_properties *sensor_properties_msg(
|
||||||
new loc_eng_msg_sensor_properties(&loc_eng_data,
|
new loc_eng_msg_sensor_properties(&loc_eng_data,
|
||||||
gps_conf.GYRO_BIAS_RANDOM_WALK_VALID,
|
sap_conf.GYRO_BIAS_RANDOM_WALK_VALID,
|
||||||
gps_conf.GYRO_BIAS_RANDOM_WALK,
|
sap_conf.GYRO_BIAS_RANDOM_WALK,
|
||||||
gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||||
gps_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY,
|
sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY,
|
||||||
gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||||
gps_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY,
|
sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY,
|
||||||
gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||||
gps_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY,
|
sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY,
|
||||||
gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
|
||||||
gps_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY));
|
sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY));
|
||||||
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
||||||
sensor_properties_msg, loc_eng_free_msg);
|
sensor_properties_msg, loc_eng_free_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg(
|
loc_eng_msg_sensor_perf_control_config *sensor_perf_control_conf_msg(
|
||||||
new loc_eng_msg_sensor_perf_control_config(&loc_eng_data,
|
new loc_eng_msg_sensor_perf_control_config(&loc_eng_data,
|
||||||
gps_conf.SENSOR_CONTROL_MODE,
|
sap_conf.SENSOR_CONTROL_MODE,
|
||||||
gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH,
|
sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH,
|
||||||
gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC,
|
sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC,
|
||||||
gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH,
|
sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH,
|
||||||
gps_conf.SENSOR_GYRO_BATCHES_PER_SEC,
|
sap_conf.SENSOR_GYRO_BATCHES_PER_SEC,
|
||||||
gps_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH,
|
sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH,
|
||||||
gps_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH,
|
sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH,
|
||||||
gps_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH,
|
sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH,
|
||||||
gps_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH,
|
sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH,
|
||||||
gps_conf.SENSOR_ALGORITHM_CONFIG_MASK));
|
sap_conf.SENSOR_ALGORITHM_CONFIG_MASK));
|
||||||
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
||||||
sensor_perf_control_conf_msg, loc_eng_free_msg);
|
sensor_perf_control_conf_msg, loc_eng_free_msg);
|
||||||
}
|
}
|
||||||
|
@ -2228,14 +2237,15 @@ SIDE EFFECTS
|
||||||
int loc_eng_read_config(void)
|
int loc_eng_read_config(void)
|
||||||
{
|
{
|
||||||
ENTRY_LOG_CALLFLOW();
|
ENTRY_LOG_CALLFLOW();
|
||||||
if(gpsConfigAlreadyRead == false)
|
if(configAlreadyRead == false)
|
||||||
{
|
{
|
||||||
// Initialize our defaults before reading of configuration file overwrites them.
|
// Initialize our defaults before reading of configuration file overwrites them.
|
||||||
loc_default_parameters();
|
loc_default_parameters();
|
||||||
// Ee only want to parse the conf file once. This is a good place to ensure that.
|
// We only want to parse the conf file once. This is a good place to ensure that.
|
||||||
// In fact one day the conf file should go into context.
|
// In fact one day the conf file should go into context.
|
||||||
UTIL_READ_CONF(GPS_CONF_FILE, loc_parameter_table);
|
UTIL_READ_CONF(GPS_CONF_FILE, loc_parameter_table);
|
||||||
gpsConfigAlreadyRead = true;
|
UTIL_READ_CONF(SAP_CONF_FILE, loc_parameter_table);
|
||||||
|
configAlreadyRead = true;
|
||||||
} else {
|
} else {
|
||||||
LOC_LOGV("GPS Config file has already been read\n");
|
LOC_LOGV("GPS Config file has already been read\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,9 +163,16 @@ typedef struct loc_gps_cfg_s
|
||||||
unsigned long INTERMEDIATE_POS;
|
unsigned long INTERMEDIATE_POS;
|
||||||
unsigned long ACCURACY_THRES;
|
unsigned long ACCURACY_THRES;
|
||||||
unsigned long ENABLE_WIPER;
|
unsigned long ENABLE_WIPER;
|
||||||
uint8_t NMEA_PROVIDER;
|
|
||||||
unsigned long SUPL_VER;
|
unsigned long SUPL_VER;
|
||||||
unsigned long CAPABILITIES;
|
unsigned long CAPABILITIES;
|
||||||
|
unsigned long QUIPC_ENABLED;
|
||||||
|
unsigned long LPP_PROFILE;
|
||||||
|
uint8_t NMEA_PROVIDER;
|
||||||
|
unsigned long A_GLONASS_POS_PROTOCOL_SELECT;
|
||||||
|
} loc_gps_cfg_s_type;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
uint8_t GYRO_BIAS_RANDOM_WALK_VALID;
|
uint8_t GYRO_BIAS_RANDOM_WALK_VALID;
|
||||||
double GYRO_BIAS_RANDOM_WALK;
|
double GYRO_BIAS_RANDOM_WALK;
|
||||||
unsigned long SENSOR_ACCEL_BATCHES_PER_SEC;
|
unsigned long SENSOR_ACCEL_BATCHES_PER_SEC;
|
||||||
|
@ -178,10 +185,7 @@ typedef struct loc_gps_cfg_s
|
||||||
unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH;
|
unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH;
|
||||||
unsigned long SENSOR_CONTROL_MODE;
|
unsigned long SENSOR_CONTROL_MODE;
|
||||||
unsigned long SENSOR_USAGE;
|
unsigned long SENSOR_USAGE;
|
||||||
unsigned long QUIPC_ENABLED;
|
|
||||||
unsigned long LPP_PROFILE;
|
|
||||||
unsigned long SENSOR_ALGORITHM_CONFIG_MASK;
|
unsigned long SENSOR_ALGORITHM_CONFIG_MASK;
|
||||||
unsigned long A_GLONASS_POS_PROTOCOL_SELECT;
|
|
||||||
uint8_t ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
uint8_t ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||||
double ACCEL_RANDOM_WALK_SPECTRAL_DENSITY;
|
double ACCEL_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||||
uint8_t ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
uint8_t ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||||
|
@ -190,9 +194,10 @@ typedef struct loc_gps_cfg_s
|
||||||
double RATE_RANDOM_WALK_SPECTRAL_DENSITY;
|
double RATE_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||||
uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||||
double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY;
|
double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||||
} loc_gps_cfg_s_type;
|
} loc_sap_cfg_s_type;
|
||||||
|
|
||||||
extern loc_gps_cfg_s_type gps_conf;
|
extern loc_gps_cfg_s_type gps_conf;
|
||||||
|
extern loc_sap_cfg_s_type sap_conf;
|
||||||
|
|
||||||
int loc_eng_init(loc_eng_data_s_type &loc_eng_data,
|
int loc_eng_init(loc_eng_data_s_type &loc_eng_data,
|
||||||
LocCallbacks* callbacks,
|
LocCallbacks* callbacks,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -56,35 +56,8 @@ static loc_param_s_type loc_parameter_table[] =
|
||||||
{"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'},
|
{"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'},
|
||||||
{"TIMESTAMP", &TIMESTAMP, NULL, 'n'},
|
{"TIMESTAMP", &TIMESTAMP, NULL, 'n'},
|
||||||
};
|
};
|
||||||
|
|
||||||
int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type);
|
int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type);
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_default_parameters
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
Resets the parameters to default
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
N/A
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
None
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
===========================================================================*/
|
|
||||||
|
|
||||||
static void loc_default_parameters()
|
|
||||||
{
|
|
||||||
/* defaults */
|
|
||||||
DEBUG_LEVEL = 3; /* debug level */
|
|
||||||
TIMESTAMP = 0;
|
|
||||||
|
|
||||||
/* reset logging mechanism */
|
|
||||||
loc_logger_init(DEBUG_LEVEL, TIMESTAMP);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
FUNCTION trim_space
|
FUNCTION trim_space
|
||||||
|
|
||||||
|
@ -246,15 +219,14 @@ void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, u
|
||||||
loc_param_v_type config_value;
|
loc_param_v_type config_value;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
loc_default_parameters();
|
|
||||||
|
|
||||||
if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL)
|
if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s: using %s", __FUNCTION__, GPS_CONF_FILE);
|
LOC_LOGD("%s: using %s", __FUNCTION__, conf_file_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOC_LOGW("%s: no %s file found", __FUNCTION__, GPS_CONF_FILE);
|
LOC_LOGW("%s: no %s file found", __FUNCTION__, conf_file_name);
|
||||||
|
loc_logger_init(DEBUG_LEVEL, TIMESTAMP);
|
||||||
return; /* no parameter file */
|
return; /* no parameter file */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -36,11 +36,6 @@
|
||||||
#define LOC_MAX_PARAM_STRING 80
|
#define LOC_MAX_PARAM_STRING 80
|
||||||
#define LOC_MAX_PARAM_LINE 80
|
#define LOC_MAX_PARAM_LINE 80
|
||||||
|
|
||||||
// Don't want to overwrite the pre-def'ed value
|
|
||||||
#ifndef GPS_CONF_FILE
|
|
||||||
#define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define UTIL_READ_CONF_DEFAULT(filename) \
|
#define UTIL_READ_CONF_DEFAULT(filename) \
|
||||||
loc_read_conf((filename), NULL, 0);
|
loc_read_conf((filename), NULL, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue