1 /* Copyright (c) 2011 Code Aurora Forum. All rights reserved. 2 * 3 * Redistribution and use in source and binary forms, with or without 4 * modification, are permitted provided that the following conditions are 5 * met: 6 * * Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * * Redistributions in binary form must reproduce the above 9 * copyright notice, this list of conditions and the following 10 * disclaimer in the documentation and/or other materials provided 11 * with the distribution. 12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13 * contributors may be used to endorse or promote products derived 14 * from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 */ 29 30 #ifndef LOC_CFG_H 31 #define LOC_CFG_H 32 33 #define LOC_MAX_PARAM_NAME 36 34 #define LOC_MAX_PARAM_STRING 80 35 #define LOC_MAX_PARAM_LINE 80 36 37 // Don't want to overwrite the pre-def'ed value 38 #ifndef GPS_CONF_FILE 39 #define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent 40 #endif 41 42 /*============================================================================= 43 * 44 * MODULE TYPE DECLARATION 45 * 46 *============================================================================*/ 47 typedef struct 48 { 49 char param_name[LOC_MAX_PARAM_NAME]; 50 void *param_ptr; 51 char param_type; /* 'n' for number; 's' for string */ 52 } loc_param_s_type; 53 54 /* GPS.conf support */ 55 typedef struct loc_gps_cfg_s 56 { 57 unsigned long INTERMEDIATE_POS; 58 unsigned long ACCURACY_THRES; 59 unsigned long ENABLE_WIPER; 60 unsigned long DEBUG_LEVEL; 61 unsigned long SUPL_VER; 62 unsigned long CAPABILITIES; 63 unsigned long TIMESTAMP; 64 unsigned long GYRO_BIAS_RANDOM_WALK_VALID; 65 double GYRO_BIAS_RANDOM_WALK; 66 unsigned long SENSOR_ACCEL_BATCHES_PER_SEC; 67 unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH; 68 unsigned long SENSOR_GYRO_BATCHES_PER_SEC; 69 unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH; 70 unsigned long SENSOR_CONTROL_MODE; 71 unsigned long SENSOR_USAGE; 72 // char string_val[LOC_MAX_PARAM_STRING + 1]; /* An example string value */ 73 } loc_gps_cfg_s_type; 74 75 /*============================================================================= 76 * 77 * MODULE EXTERNAL DATA 78 * 79 *============================================================================*/ 80 81 #ifdef __cplusplus 82 extern "C" { 83 #endif 84 85 extern loc_gps_cfg_s_type gps_conf; 86 87 /*============================================================================= 88 * 89 * MODULE EXPORTED FUNCTIONS 90 * 91 *============================================================================*/ 92 extern void loc_read_gps_conf(void); 93 94 #ifdef __cplusplus 95 } 96 #endif 97 98 #endif /* LOC_CFG_H */ 99