diff options
author | sbrissen <sbrissen@hotmail.com> | 2015-03-27 07:42:06 -0400 |
---|---|---|
committer | sbrissen <sbrissen@hotmail.com> | 2015-03-27 07:42:06 -0400 |
commit | 3182bdfba841da29ebc66001ff019a0ec6cfb0c7 (patch) | |
tree | d87cfaf4406f99cc673f961cc0d83d628b5eb80c | |
parent | a37857119fb5880acecb5e4c65a7ed7bc9bc3228 (diff) | |
download | android_device_samsung_smdk4412-qcom-common-3182bdfba841da29ebc66001ff019a0ec6cfb0c7.tar.gz android_device_samsung_smdk4412-qcom-common-3182bdfba841da29ebc66001ff019a0ec6cfb0c7.tar.bz2 android_device_samsung_smdk4412-qcom-common-3182bdfba841da29ebc66001ff019a0ec6cfb0c7.zip |
smdk4412-qcom: Use gps hal from D2
Change-Id: Ifb845fbb8d0ef940d0ee7939e03efa321f9e895a
25 files changed, 203 insertions, 970 deletions
diff --git a/gps/Android.mk b/gps/Android.mk index a92484d..5365bf6 100644 --- a/gps/Android.mk +++ b/gps/Android.mk @@ -22,4 +22,8 @@ LOCAL_PATH := $(call my-dir) + +ifeq ($(BOARD_VENDOR),samsung) include $(call all-subdir-makefiles,$(LOCAL_PATH)) +endif + diff --git a/gps/core/Android.mk b/gps/core/Android.mk index 178e559..97f0785 100644 --- a/gps/core/Android.mk +++ b/gps/core/Android.mk @@ -1,5 +1,3 @@ -ifneq ($(BUILD_TINY_ANDROID),true) - LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -47,5 +45,3 @@ LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) -endif # not BUILD_TINY_ANDROID - diff --git a/gps/core/LocAdapterBase.cpp b/gps/core/LocAdapterBase.cpp index f54fdce..8bbe873 100644 --- a/gps/core/LocAdapterBase.cpp +++ b/gps/core/LocAdapterBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 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 * modification, are permitted provided that the following conditions are @@ -66,13 +66,6 @@ void LocAdapterBase:: void* svExt) DEFAULT_IMPL() -void LocAdapterBase:: - reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) -DEFAULT_IMPL() - -void LocAdapterBase:: - reportSvPolynomial(GnssSvPolynomial &svPolynomial) -DEFAULT_IMPL() void LocAdapterBase:: reportStatus(GpsStatusValue status) diff --git a/gps/core/LocAdapterBase.h b/gps/core/LocAdapterBase.h index e1b7831..d11e64a 100644 --- a/gps/core/LocAdapterBase.h +++ b/gps/core/LocAdapterBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, 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 * modification, are permitted provided that the following conditions are @@ -43,7 +43,7 @@ protected: const MsgTask* mMsgTask; inline LocAdapterBase(const MsgTask* msgTask) : - mEvtMask(0), mContext(NULL), mLocApi(NULL), mMsgTask(msgTask) {} + mEvtMask(0), mContext(NULL), mLocApi(NULL), mMsgTask(msgTask) {} public: inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, @@ -82,8 +82,6 @@ public: virtual void reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); - virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); - virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial); virtual void reportStatus(GpsStatusValue status); virtual void reportNmea(const char* nmea, int length); virtual bool reportXtraServer(const char* url1, const char* url2, diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp index d6ee53b..8b6713c 100644 --- a/gps/core/LocApiBase.cpp +++ b/gps/core/LocApiBase.cpp @@ -244,22 +244,6 @@ void LocApiBase::reportSv(GpsSvStatus &svStatus, ); } -void LocApiBase::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSvMeasurement(svMeasurementSet) - ); -} - -void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial) -{ - // loop through adapters, and deliver to all adapters. - TO_ALL_LOCADAPTERS( - mLocAdapters[i]->reportSvPolynomial(svPolynomial) - ); -} - void LocApiBase::reportStatus(GpsStatusValue status) { // loop through adapters, and deliver to all adapters. @@ -489,8 +473,4 @@ DEFAULT_IMPL(-1) int LocApiBase:: getGpsLock() DEFAULT_IMPL(-1) - -enum loc_api_adapter_err LocApiBase:: - setXtraVersionCheck(enum xtra_version_check check) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) } // namespace loc_core diff --git a/gps/core/LocApiBase.h b/gps/core/LocApiBase.h index ef64dda..1603e6b 100644 --- a/gps/core/LocApiBase.h +++ b/gps/core/LocApiBase.h @@ -52,13 +52,6 @@ int decodeAddress(char *addr_string, int string_size, #define TO_1ST_HANDLING_ADAPTER(adapters, call) \ for (int i = 0; i <MAX_ADAPTERS && NULL != (adapters)[i] && !(call); i++); -enum xtra_version_check { - DISABLED, - AUTO, - XTRA2, - XTRA3 -}; - class LocAdapterBase; struct LocSsrMsg; struct LocOpenMsg; @@ -112,8 +105,6 @@ public: void reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); - void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); - void reportSvPolynomial(GnssSvPolynomial &svPolynomial); void reportStatus(GpsStatusValue status); void reportNmea(const char* nmea, int length); void reportXtraServer(const char* url1, const char* url2, @@ -221,7 +212,6 @@ public: -1 on failure */ virtual int getGpsLock(void); - virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check); }; typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask, diff --git a/gps/core/UlpProxyBase.h b/gps/core/UlpProxyBase.h index e1fb5cd..9009757 100644 --- a/gps/core/UlpProxyBase.h +++ b/gps/core/UlpProxyBase.h @@ -62,14 +62,6 @@ public: void* svExt) { return false; } - inline virtual bool reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) { - return false; - } - - inline virtual bool reportSvPolynomial(GnssSvPolynomial &svPolynomial) - { - return false; - } inline virtual bool reportStatus(GpsStatusValue status) { return false; } diff --git a/gps/core/gps_extended_c.h b/gps/core/gps_extended_c.h index df20bdc..73dc77d 100644 --- a/gps/core/gps_extended_c.h +++ b/gps/core/gps_extended_c.h @@ -60,8 +60,6 @@ extern "C" { #define ULP_LOCATION_IS_FROM_ZPP 0x0004 /** Position is from a Geofence Breach Event */ #define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 -/** Position is from a Geofence Breach Event */ -#define ULP_LOCATION_IS_FROM_EXT_DR 0X0010 #define ULP_MIN_INTERVAL_INVALID 0xffffffff @@ -284,11 +282,9 @@ enum loc_api_adapter_err { LOC_API_ADAPTER_ERR_PHONE_OFFLINE = 7, LOC_API_ADAPTER_ERR_TIMEOUT = 8, LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT = 9, - LOC_API_ADAPTER_ERR_INTERNAL = 10, - /* equating engine down to phone offline, as they are the same errror */ - LOC_API_ADAPTER_ERR_ENGINE_DOWN = LOC_API_ADAPTER_ERR_PHONE_OFFLINE, - LOC_API_ADAPTER_ERR_FAILURE = 101, + LOC_API_ADAPTER_ERR_ENGINE_DOWN = 100, + LOC_API_ADAPTER_ERR_FAILURE, LOC_API_ADAPTER_ERR_UNKNOWN }; @@ -315,8 +311,6 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_BATCH_FULL, // Batching on full LOC_API_ADAPTER_BATCHED_POSITION_REPORT, // Batching on fix LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_REPORT, // - LOC_API_ADAPTER_GNSS_MEASUREMENT_REPORT, //GNSS Measurement Report - LOC_API_ADAPTER_GNSS_SV_POLYNOMIAL_REPORT, //GNSS SV Polynomial Report LOC_API_ADAPTER_EVENT_MAX }; @@ -343,598 +337,13 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_REQUEST_WIFI_AP_DATA (1<<LOC_API_ADAPTER_REQUEST_WIFI_AP_DATA) #define LOC_API_ADAPTER_BIT_BATCH_FULL (1<<LOC_API_ADAPTER_BATCH_FULL) #define LOC_API_ADAPTER_BIT_BATCHED_POSITION_REPORT (1<<LOC_API_ADAPTER_BATCHED_POSITION_REPORT) -#define LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT_REPORT (1<<LOC_API_ADAPTER_GNSS_MEASUREMENT_REPORT) -#define LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT (1<<LOC_API_ADAPTER_GNSS_SV_POLYNOMIAL_REPORT) - - typedef unsigned int LOC_API_ADAPTER_EVENT_MASK_T; -/*++ *********************************************** -** Satellite Measurement and Satellite Polynomial -** Structure definitions -** *********************************************** ---*/ -#define GNSS_SV_POLY_VELOCITY_COEF_MAX_SIZE 12 -#define GNSS_SV_POLY_XYZ_0_TH_ORDER_COEFF_MAX_SIZE 3 -#define GNSS_SV_POLY_XYZ_N_TH_ORDER_COEFF_MAX_SIZE 9 -#define GNSS_SV_POLY_SV_CLKBIAS_COEFF_MAX_SIZE 4 -#define GNSS_LOC_SV_MEAS_LIST_MAX_SIZE 16 - -enum ulp_gnss_sv_measurement_valid_flags{ - - ULP_GNSS_SV_MEAS_GPS_TIME = 0, - ULP_GNSS_SV_MEAS_PSUEDO_RANGE, - ULP_GNSS_SV_MEAS_MS_IN_WEEK, - ULP_GNSS_SV_MEAS_SUB_MSEC, - ULP_GNSS_SV_MEAS_CARRIER_PHASE, - ULP_GNSS_SV_MEAS_DOPPLER_SHIFT, - ULP_GNSS_SV_MEAS_CNO, - ULP_GNSS_SV_MEAS_LOSS_OF_LOCK, - - ULP_GNSS_SV_MEAS_MAX_VALID_FLAGS -}; - -#define ULP_GNSS_SV_MEAS_BIT_GPS_TIME (1<<ULP_GNSS_SV_MEAS_GPS_TIME) -#define ULP_GNSS_SV_MEAS_BIT_PSUEDO_RANGE (1<<ULP_GNSS_SV_MEAS_PSUEDO_RANGE) -#define ULP_GNSS_SV_MEAS_BIT_MS_IN_WEEK (1<<ULP_GNSS_SV_MEAS_MS_IN_WEEK) -#define ULP_GNSS_SV_MEAS_BIT_SUB_MSEC (1<<ULP_GNSS_SV_MEAS_SUB_MSEC) -#define ULP_GNSS_SV_MEAS_BIT_CARRIER_PHASE (1<<ULP_GNSS_SV_MEAS_CARRIER_PHASE) -#define ULP_GNSS_SV_MEAS_BIT_DOPPLER_SHIFT (1<<ULP_GNSS_SV_MEAS_DOPPLER_SHIFT) -#define ULP_GNSS_SV_MEAS_BIT_CNO (1<<ULP_GNSS_SV_MEAS_CNO) -#define ULP_GNSS_SV_MEAS_BIT_LOSS_OF_LOCK (1<<ULP_GNSS_SV_MEAS_LOSS_OF_LOCK) - -enum ulp_gnss_sv_poly_valid_flags{ - - ULP_GNSS_SV_POLY_GLO_FREQ = 0, - ULP_GNSS_SV_POLY_T0, - ULP_GNSS_SV_POLY_IODE, - ULP_GNSS_SV_POLY_FLAG, - ULP_GNSS_SV_POLY_POLYCOEFF_XYZ0, - ULP_GNSS_SV_POLY_POLYCOEFF_XYZN, - ULP_GNSS_SV_POLY_POLYCOEFF_OTHER, - ULP_GNSS_SV_POLY_SV_POSUNC, - ULP_GNSS_SV_POLY_IONODELAY, - ULP_GNSS_SV_POLY_IONODOT, - ULP_GNSS_SV_POLY_SBAS_IONODELAY, - ULP_GNSS_SV_POLY_SBAS_IONODOT, - ULP_GNSS_SV_POLY_TROPODELAY, - ULP_GNSS_SV_POLY_ELEVATION, - ULP_GNSS_SV_POLY_ELEVATIONDOT, - ULP_GNSS_SV_POLY_ELEVATIONUNC, - ULP_GNSS_SV_POLY_VELO_COEFF, - - ULP_GNSS_SV_POLY_VALID_FLAGS - -}; - -#define ULP_GNSS_SV_POLY_BIT_GLO_FREQ (1<<ULP_GNSS_SV_POLY_GLO_FREQ) -#define ULP_GNSS_SV_POLY_BIT_T0 (1<<ULP_GNSS_SV_POLY_T0) -#define ULP_GNSS_SV_POLY_BIT_IODE (1<<ULP_GNSS_SV_POLY_IODE) -#define ULP_GNSS_SV_POLY_BIT_FLAG (1<<ULP_GNSS_SV_POLY_FLAG) -#define ULP_GNSS_SV_POLY_BIT_POLYCOEFF_XYZ0 (1<<ULP_GNSS_SV_POLY_POLYCOEFF_XYZ0) -#define ULP_GNSS_SV_POLY_BIT_POLYCOEFF_XYZN (1<<ULP_GNSS_SV_POLY_POLYCOEFF_XYZN) -#define ULP_GNSS_SV_POLY_BIT_POLYCOEFF_OTHER (1<<ULP_GNSS_SV_POLY_POLYCOEFF_OTHER) -#define ULP_GNSS_SV_POLY_BIT_SV_POSUNC (1<<ULP_GNSS_SV_POLY_SV_POSUNC) -#define ULP_GNSS_SV_POLY_BIT_IONODELAY (1<<ULP_GNSS_SV_POLY_IONODELAY) -#define ULP_GNSS_SV_POLY_BIT_IONODOT (1<<ULP_GNSS_SV_POLY_IONODOT) -#define ULP_GNSS_SV_POLY_BIT_SBAS_IONODELAY (1<<ULP_GNSS_SV_POLY_SBAS_IONODELAY) -#define ULP_GNSS_SV_POLY_BIT_SBAS_IONODOT (1<<ULP_GNSS_SV_POLY_SBAS_IONODOT) -#define ULP_GNSS_SV_POLY_BIT_TROPODELAY (1<<ULP_GNSS_SV_POLY_TROPODELAY) -#define ULP_GNSS_SV_POLY_BIT_ELEVATION (1<<ULP_GNSS_SV_POLY_ELEVATION) -#define ULP_GNSS_SV_POLY_BIT_ELEVATIONDOT (1<<ULP_GNSS_SV_POLY_ELEVATIONDOT) -#define ULP_GNSS_SV_POLY_BIT_ELEVATIONUNC (1<<ULP_GNSS_SV_POLY_ELEVATIONUNC) -#define ULP_GNSS_SV_POLY_BIT_VELO_COEFF (1<<ULP_GNSS_SV_POLY_VELO_COEFF) - - -typedef enum -{ - GNSS_LOC_SV_SYSTEM_GPS = 1, - /**< GPS satellite. */ - GNSS_LOC_SV_SYSTEM_GALILEO = 2, - /**< GALILEO satellite. */ - GNSS_LOC_SV_SYSTEM_SBAS = 3, - /**< SBAS satellite. */ - GNSS_LOC_SV_SYSTEM_COMPASS = 4, - /**< COMPASS satellite. */ - GNSS_LOC_SV_SYSTEM_GLONASS = 5, - /**< GLONASS satellite. */ - GNSS_LOC_SV_SYSTEM_BDS = 6 - /**< BDS satellite. */ -} Gnss_LocSvSystemEnumType; - -typedef enum -{ - GNSS_LOC_FREQ_SOURCE_INVALID = 0, - /**< Source of the frequency is invalid */ - GNSS_LOC_FREQ_SOURCE_EXTERNAL = 1, - /**< Source of the frequency is from external injection */ - GNSS_LOC_FREQ_SOURCE_PE_CLK_REPORT = 2, - /**< Source of the frequency is from Navigation engine */ - GNSS_LOC_FREQ_SOURCE_UNKNOWN = 3 - /**< Source of the frequency is unknown */ -} Gnss_LocSourceofFreqEnumType; - -typedef struct -{ - size_t size; - float clockDrift; - /**< Receiver clock Drift \n - - Units: meter per sec \n - */ - float clockDriftUnc; - /**< Receiver clock Drift uncertainty \n - - Units: meter per sec \n - */ - Gnss_LocSourceofFreqEnumType sourceOfFreq; -}Gnss_LocRcvrClockFrequencyInfoStructType; - -typedef struct -{ - size_t size; - uint8_t leapSec; - /**< GPS time leap second delta to UTC time \n - - Units: sec \n - */ - uint8_t leapSecUnc; - /**< Uncertainty for GPS leap second \n - - Units: sec \n - */ -}Gnss_LeapSecondInfoStructType; - -typedef enum -{ - GNSS_LOC_SYS_TIME_BIAS_VALID = 0x01, - /**< System time bias valid */ - GNSS_LOC_SYS_TIME_BIAS_UNC_VALID = 0x02, - /**< System time bias uncertainty valid */ -}Gnss_LocInterSystemBiasValidMaskType; - -typedef struct -{ - size_t size; - uint32_t validMask; - /* Validity mask as per Gnss_LocInterSystemBiasValidMaskType */ - - float timeBias; - /**< System-1 to System-2 Time Bias \n - - Units: msec \n - */ - float timeBiasUnc; - /**< System-1 to System-2 Time Bias uncertainty \n - - Units: msec \n - */ -}Gnss_InterSystemBiasStructType; - - -typedef struct -{ - size_t size; - uint16_t systemWeek; - /**< System week number for GPS, BDS and GAL satellite systems. \n - Set to 65535 when invalid or not available. \n - Not valid for GLONASS system. \n - */ - - uint32_t systemMsec; - /**< System time msec. Time of Week for GPS, BDS, GAL and - Time of Day for GLONASS. - - Units: msec \n - */ - float systemClkTimeBias; - /**< System clock time bias \n - - Units: msec \n - System time = systemMsec - systemClkTimeBias \n - */ - float systemClkTimeUncMs; - /**< Single sided maximum time bias uncertainty \n - - Units: msec \n - */ -}Gnss_LocSystemTimeStructType; - -typedef struct { - - size_t size; - uint8_t gloFourYear; - /**< GLONASS four year number from 1996. Refer to GLONASS ICD.\n - Applicable only for GLONASS and shall be ignored for other constellations. \n - If unknown shall be set to 255 - */ - - uint16_t gloDays; - /**< GLONASS day number in four years. Refer to GLONASS ICD. - Applicable only for GLONASS and shall be ignored for other constellations. \n - If unknown shall be set to 65535 - */ - - uint32_t gloMsec; - /**< GLONASS time of day in msec. Refer to GLONASS ICD. - - Units: msec \n - */ - - float gloClkTimeBias; - /**< System clock time bias (sub-millisecond) \n - - Units: msec \n - System time = systemMsec - systemClkTimeBias \n - */ - - float gloClkTimeUncMs; - /**< Single sided maximum time bias uncertainty \n - - Units: msec \n - */ -}Gnss_LocGloTimeStructType; /* Type */ - -typedef struct { - - size_t size; - uint32_t refFCount; - /**< Receiver frame counter value at reference tick */ - - uint8_t systemRtc_valid; - /**< Validity indicator for System RTC */ - - uint64_t systemRtcMs; - /**< Platform system RTC value \n - - Units: msec \n - */ - - uint32_t sourceOfTime; - /**< Source of time information */ - -}Gnss_LocGnssTimeExtStructType; - - - -typedef enum -{ - GNSS_LOC_MEAS_STATUS_NULL = 0x00000000, - /**< No information state */ - GNSS_LOC_MEAS_STATUS_SM_VALID = 0x00000001, - /**< Code phase is known */ - GNSS_LOC_MEAS_STATUS_SB_VALID = 0x00000002, - /**< Sub-bit time is known */ - GNSS_LOC_MEAS_STATUS_MS_VALID = 0x00000004, - /**< Satellite time is known */ - GNSS_LOC_MEAS_STATUS_BE_CONFIRM = 0x00000008, - /**< Bit edge is confirmed from signal */ - GNSS_LOC_MEAS_STATUS_VELOCITY_VALID = 0x00000010, - /**< Satellite Doppler measured */ - GNSS_LOC_MEAS_STATUS_VELOCITY_FINE = 0x00000020, - /**< TRUE: Fine Doppler measured, FALSE: Coarse Doppler measured */ - GNSS_LOC_MEAS_STATUS_FROM_RNG_DIFF = 0x00000200, - /**< Range update from Satellite differences */ - GNSS_LOC_MEAS_STATUS_FROM_VE_DIFF = 0x00000400, - /**< Doppler update from Satellite differences */ - GNSS_LOC_MEAS_STATUS_DONT_USE_X = 0x00000800, - /**< Don't use measurement if bit is set */ - GNSS_LOC_MEAS_STATUS_DONT_USE_M = 0x000001000, - /**< Don't use measurement if bit is set */ - GNSS_LOC_MEAS_STATUS_DONT_USE_D = 0x000002000, - /**< Don't use measurement if bit is set */ - GNSS_LOC_MEAS_STATUS_DONT_USE_S = 0x000004000, - /**< Don't use measurement if bit is set */ - GNSS_LOC_MEAS_STATUS_DONT_USE_P = 0x000008000 - /**< Don't use measurement if bit is set */ -}Gnss_LocSvMeasStatusMaskType; - -typedef struct -{ - size_t size; - uint32_t svMs; - /**< Satellite time milisecond.\n - For GPS, BDS, GAL range of 0 thru (604800000-1) \n - For GLONASS range of 0 thru (86400000-1) \n - Valid when PD_LOC_MEAS_STATUS_MS_VALID bit is set in measurement status \n - Note: All SV times in the current measurement block are alredy propagated to common reference time epoch. \n - - Units: msec \n - */ - float svSubMs; - /**<Satellite time sub-millisecond. \n - Total SV Time = svMs + svSubMs \n - - Units: msec \n - */ - float svTimeUncMs; - /**< Satellite Time uncertainty \n - - Units: msec \n - */ - float dopplerShift; - /**< Satellite Doppler \n - - Units: meter per sec \n - */ - float dopplerShiftUnc; - /**< Satellite Doppler uncertainty\n - - Units: meter per sec \n - */ -}Gnss_LocSVTimeSpeedStructType; - -typedef enum -{ - GNSS_SV_STATE_IDLE = 0, - GNSS_SV_STATE_SEARCH = 1, - GNSS_SV_STATE_SEARCH_VERIFY = 2, - GNSS_SV_STATE_BIT_EDGE = 3, - GNSS_SV_STATE_VERIFY_TRACK = 4, - GNSS_SV_STATE_TRACK = 5, - GNSS_SV_STATE_RESTART = 6, - GNSS_SV_STATE_DPO_TRACK = 7 -} Gnss_LocSVStateEnumType; - -typedef enum -{ - GNSS_LOC_SVINFO_MASK_HAS_EPHEMERIS = 0x01, - /**< Ephemeris is available for this SV */ - GNSS_LOC_SVINFO_MASK_HAS_ALMANAC = 0x02 - /**< Almanac is available for this SV */ -}Gnss_LocSvInfoMaskT; - -typedef enum -{ - GNSS_LOC_SV_SRCH_STATUS_IDLE = 1, - /**< SV is not being actively processed */ - GNSS_LOC_SV_SRCH_STATUS_SEARCH = 2, - /**< The system is searching for this SV */ - GNSS_LOC_SV_SRCH_STATUS_TRACK = 3 - /**< SV is being tracked */ -}Gnss_LocSvSearchStatusEnumT; - - -typedef struct -{ - size_t size; - uint16_t gnssSvId; - /**< GNSS SV ID. - \begin{itemize1} - \item Range: \begin{itemize1} - \item For GPS: 1 to 32 - \item For GLONASS: 1 to 32 - \item For SBAS: 120 to 151 - \item For BDS: 201 to 237 - \end{itemize1} \end{itemize1} - The GPS and GLONASS SVs can be disambiguated using the system field. - */ - uint8_t gloFrequency; - /**< GLONASS frequency number + 7 \n - Valid only for GLONASS System \n - Shall be ignored for all other systems \n - - Range: 1 to 14 \n - */ - Gnss_LocSvSearchStatusEnumT svStatus; - /**< Satellite search state \n - @ENUM() - */ - bool healthStatus_valid; - /**< SV Health Status validity flag\n - - 0: Not valid \n - - 1: Valid \n - */ - uint8_t healthStatus; - /**< Health status. - \begin{itemize1} - \item Range: 0 to 1; 0 = unhealthy, \n 1 = healthy, 2 = unknown - \vspace{-0.18in} \end{itemize1} - */ - Gnss_LocSvInfoMaskT svInfoMask; - /**< Indicates whether almanac and ephemeris information is available. \n - @MASK() - */ - uint64_t measurementStatus; - /**< Bitmask indicating SV measurement status. - Valid bitmasks: \n - @MASK() - */ - uint16_t CNo; - /**< Carrier to Noise ratio \n - - Units: 0.1 dBHz \n - */ - uint16_t gloRfLoss; - /**< GLONASS Rf loss reference to Antenna. \n - - Units: dB, Scale: 0.1 \n - */ - bool lossOfLock; - /**< Loss of signal lock indicator \n - - 0: Signal in continuous track \n - - 1: Signal not in track \n - */ - int16_t measLatency; - /**< Age of the measurement. Positive value means measurement precedes ref time. \n - - Units: msec \n - */ - Gnss_LocSVTimeSpeedStructType svTimeSpeed; - /**< Unfiltered SV Time and Speed information - */ - float dopplerAccel; - /**< Satellite Doppler Accelertion\n - - Units: Hz/s \n - */ - bool multipathEstValid; - /**< Multipath estimate validity flag\n - - 0: Multipath estimate not valid \n - - 1: Multipath estimate valid \n - */ - float multipathEstimate; - /**< Estimate of multipath in measurement\n - - Units: Meters \n - */ - bool fineSpeedValid; - /**< Fine speed validity flag\n - - 0: Fine speed not valid \n - - 1: Fine speed valid \n - */ - float fineSpeed; - /**< Carrier phase derived speed \n - - Units: m/s \n - */ - bool fineSpeedUncValid; - /**< Fine speed uncertainty validity flag\n - - 0: Fine speed uncertainty not valid \n - - 1: Fine speed uncertainty valid \n - */ - float fineSpeedUnc; - /**< Carrier phase derived speed \n - - Units: m/s \n - */ - bool carrierPhaseValid; - /**< Carrier Phase measurement validity flag\n - - 0: Carrier Phase not valid \n - - 1: Carrier Phase valid \n - */ - double carrierPhase; - /**< Carrier phase measurement [L1 cycles] \n - */ - bool cycleSlipCountValid; - /**< Cycle slup count validity flag\n - - 0: Not valid \n - - 1: Valid \n - */ - uint8_t cycleSlipCount; - /**< Increments when a CSlip is detected */ - - bool svDirectionValid; - /**< Validity flag for SV direction */ - - float svAzimuth; - /**< Satellite Azimuth - - Units: radians \n - */ - float svElevation; - /**< Satellite Elevation - - Units: radians \n - */ -} Gnss_SVMeasurementStructType; - -/**< Maximum number of satellites in measurement block for given system. */ - -typedef struct -{ - size_t size; - Gnss_LocSvSystemEnumType system; - /**< Specifies the Satellite System Type - */ - bool isSystemTimeValid; - /**< Indicates whether System Time is Valid:\n - - 0x01 (TRUE) -- System Time is valid \n - - 0x00 (FALSE) -- System Time is not valid - */ - Gnss_LocSystemTimeStructType systemTime; - /**< System Time Information \n - */ - bool isGloTime_valid; - Gnss_LocGloTimeStructType gloTime; - - bool isSystemTimeExt_valid; - Gnss_LocGnssTimeExtStructType systemTimeExt; - - uint8_t numSvs; - /* Number of SVs in this report block */ - - Gnss_SVMeasurementStructType svMeasurement[GNSS_LOC_SV_MEAS_LIST_MAX_SIZE]; - /**< Satellite measurement Information \n - */ -} Gnss_ClockMeasurementStructType; - -typedef struct -{ - size_t size; - uint8_t seqNum; - /**< Current message Number */ - uint8_t maxMessageNum; - /**< Maximum number of message that will be sent for present time epoch. */ - - bool leapSecValid; - Gnss_LeapSecondInfoStructType leapSec; - - Gnss_InterSystemBiasStructType gpsGloInterSystemBias; - - Gnss_InterSystemBiasStructType gpsBdsInterSystemBias; - - Gnss_InterSystemBiasStructType gpsGalInterSystemBias; - - Gnss_InterSystemBiasStructType bdsGloInterSystemBias; - - Gnss_InterSystemBiasStructType galGloInterSystemBias; - - Gnss_InterSystemBiasStructType galBdsInterSystemBias; - - bool clockFreqValid; - Gnss_LocRcvrClockFrequencyInfoStructType clockFreq; /* Freq */ - bool gnssMeasValid; - Gnss_ClockMeasurementStructType gnssMeas; -} GnssSvMeasurementSet; - -typedef enum -{ - GNSS_SV_POLY_COEFF_VALID = 0x01, - /**< SV position in orbit coefficients are valid */ - GNSS_SV_POLY_IONO_VALID = 0x02, - /**< Iono estimates are valid */ - - GNSS_SV_POLY_TROPO_VALID = 0x04, - /**< Tropo estimates are valid */ - - GNSS_SV_POLY_ELEV_VALID = 0x08, - /**< Elevation, rate, uncertainty are valid */ - - GNSS_SV_POLY_SRC_ALM_CORR = 0x10, - /**< Polynomials based on XTRA */ - - GNSS_SV_POLY_SBAS_IONO_VALID = 0x20, - /**< SBAS IONO and rate are valid */ - - GNSS_SV_POLY_GLO_STR4 = 0x40 - /**< GLONASS String 4 has been received */ -}Gnss_SvPolyStatusMaskType; - - -typedef struct -{ - size_t size; - uint8_t gnssSvId; - /* GPS: 1-32, GLO: 65-96, 0: Invalid - All others are reserved - */ - int8_t freqNum; - /* Freq index, only valid if u_SysInd is GLO */ - - uint8_t svPolyFlags; - /* Indicate the validity of the elements - as per Gnss_SvPolyStatusMaskType - */ - - uint16_t is_valid; - - uint8_t iode; - /* Ephemeris reference time - GPS:Issue of Data Ephemeris used [unitless]. - GLO: Tb 7-bit, refer to ICD02 - */ - double T0; - /* Reference time for polynominal calculations - GPS: Secs in week. - GLO: Full secs since Jan/01/96 - */ - double polyCoeffXYZ0[GNSS_SV_POLY_XYZ_0_TH_ORDER_COEFF_MAX_SIZE]; - /* C0X, C0Y, C0Z */ - double polyCoefXYZN[GNSS_SV_POLY_XYZ_N_TH_ORDER_COEFF_MAX_SIZE]; - /* C1X, C2X ... C2Z, C3Z */ - float polyCoefOther[GNSS_SV_POLY_SV_CLKBIAS_COEFF_MAX_SIZE]; - /* C0T, C1T, C2T, C3T */ - float svPosUnc; /* SV position uncertainty [m]. */ - float ionoDelay; /* Ionospheric delay at d_T0 [m]. */ - float ionoDot; /* Iono delay rate [m/s]. */ - float sbasIonoDelay;/* SBAS Ionospheric delay at d_T0 [m]. */ - float sbasIonoDot; /* SBAS Iono delay rate [m/s]. */ - float tropoDelay; /* Tropospheric delay [m]. */ - float elevation; /* Elevation [rad] at d_T0 */ - float elevationDot; /* Elevation rate [rad/s] */ - float elevationUnc; /* SV elevation [rad] uncertainty */ - double velCoef[GNSS_SV_POLY_VELOCITY_COEF_MAX_SIZE]; - /* Coefficients of velocity poly */ -} GnssSvPolynomial; - - #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GPS_EXTENDED_C_H */ + diff --git a/gps/etc/gps.conf b/gps/etc/gps.conf index 18a0d5b..571b9df 100644 --- a/gps/etc/gps.conf +++ b/gps/etc/gps.conf @@ -1,21 +1,3 @@ -#Uncommenting these urls would only enable -#the power up auto injection and force injection(test case). -XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra2.bin -XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin -XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin - -#Version check for XTRA -#DISABLE = 0 -#AUTO = 1 -#XTRA2 = 2 -#XTRA3 = 3 -XTRA_VERSION_CHECK=0 - -# Error Estimate -# _SET = 1 -# _CLEAR = 0 -ERR_ESTIMATE=0 - #Test NTP_SERVER=time.gpsonextra.net #Asia @@ -25,9 +7,13 @@ NTP_SERVER=time.gpsonextra.net #North America # NTP_SERVER=north-america.pool.ntp.org +XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra2.bin +XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin +XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin + + # DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info # 4 - Debug, 5 - Verbose -# If DEBUG_LEVEL is commented, Android's logging levels will be used DEBUG_LEVEL = 2 # Intermediate position report, 1=enable, 0=disable @@ -36,13 +22,21 @@ INTERMEDIATE_POS=0 # supl version 1.0 SUPL_VER=0x10000 +# Error Estimate +# _SET = 1 +# _CLEAR = 0 +ERR_ESTIMATE=0 + +# Emergency SUPL, 1=enable, 0=disable +SUPL_ES=1 + # GPS Capabilities bit mask -# SCHEDULING = 0x01 -# MSB = 0x02 -# MSA = 0x04 +# SCHEDULING = 1 +# MSB = 2 +# MSA = 4 # ON_DEMAND_TIME = 0x10 -# GEOFENCE = 0x20 -# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE +# ULP = 0x20 +# default = MSA | MSB | SCHEDULING | ULP | ON_DEMAND_TIME CAPABILITIES=0x37 # Accuracy threshold for intermediate positions @@ -61,26 +55,63 @@ CAPABILITIES=0x37 # C2K_HOST=c2k.pde.com or IP # C2K_PORT=1234 -#################################### -# LTE Positioning Profile Settings -#################################### -# 0: Enable RRLP on LTE(Default) -# 1: Enable LPP_User_Plane on LTE -# 2: Enable LPP_Control_Plane -# 3: Enable both LPP_User_Plane and LPP_Control_Plane -# Sensor R&D : This will not be injected to MODEM -LPP_PROFILE=3 +################################ +# Sensor Settings +################################ + +# Needs to be set explicitly based on sensor +# There is no default value. +#GYRO_BIAS_RANDOM_WALK= +#ACCEL_RANDOM_WALK_SPECTRAL_DENSITY= +#ANGLE_RANDOM_WALK_SPECTRAL_DENSITY= +#RATE_RANDOM_WALK_SPECTRAL_DENSITY= +#VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY= + +# Sensor Sampling Rate Parameters for Low-Data Rate Filter (should be greater than 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 Sampling Rate Parameters for High-Data Rate Filter (should be greater than 0) +SENSOR_ACCEL_BATCHES_PER_SEC_HIGH=4 +SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH=25 +SENSOR_GYRO_BATCHES_PER_SEC_HIGH=4 +SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH=25 + +# 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 sensor provider interface(1=Sensor1 API, 2=Android NDK) +SENSOR_PROVIDER=2 + +# Bit mask used to define which sensor algorithms are used. +# Setting each bit has the following definition: +# 0x1 - DISABLE_INS_POSITIONING_FILTER +# 0x0 - ENABLE_INS_POSITIONING_FILTER +SENSOR_ALGORITHM_CONFIG_MASK=0x1 + +################################ +# Indoor Positioning Settings +################################ +# 0: QUIPC disabled, 1: QUIPC enabled, 2: forced QUIPC only +QUIPC_ENABLED = 0 ################################ # EXTRA SETTINGS ################################ +# Enable or Disable Wiper (1=Enable, 0=Disable) +ENABLE_WIPER=0 # NMEA provider (1=Modem Processor, 0=Application Processor) NMEA_PROVIDER=1 -################################################## -# Select Positioning Protocol on A-GLONASS system -################################################## -# 0x1: RRC CPlane -# 0x2: RRLP UPlane -# 0x4: LLP Uplane -A_GLONASS_POS_PROTOCOL_SELECT = 0x0 +#################################### +# LTE Positioning Profile Settings +#################################### +# 0: Enable RRLP on LTE(Default) +# 1: Enable LPP_User_Plane on LTE +# 2: Enable LPP_Control_Plane +# 3: Enable both LPP_User_Plane and LPP_Control_Plane +LPP_PROFILE = 3 diff --git a/gps/etc/sap.conf b/gps/etc/sap.conf index 6ef6a09..9aa93d7 100644 --- a/gps/etc/sap.conf +++ b/gps/etc/sap.conf @@ -39,4 +39,3 @@ SENSOR_PROVIDER=2 # 0x1 - DISABLE_INS_POSITIONING_FILTER # 0x0 - ENABLE_INS_POSITIONING_FILTER SENSOR_ALGORITHM_CONFIG_MASK=0x1 - diff --git a/gps/loc_api/libloc_api_50001/Android.mk b/gps/loc_api/libloc_api_50001/Android.mk index 75a5d2a..2e3dbdd 100644 --- a/gps/loc_api/libloc_api_50001/Android.mk +++ b/gps/loc_api/libloc_api_50001/Android.mk @@ -1,6 +1,3 @@ -ifneq ($(BUILD_TINY_ANDROID),true) -#Compile this library only for builds with the latest modem image - LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -41,7 +38,7 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core \ - device/samsung/jf-common/gps/loc_api/libloc_api_50001 + device/samsung/smdk4412-qcom-common/gps/loc_api/libloc_api_50001 LOCAL_COPY_HEADERS_TO:= libloc_eng/ LOCAL_COPY_HEADERS:= \ @@ -97,5 +94,3 @@ LOCAL_PRELINK_MODULE := false LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw include $(BUILD_SHARED_LIBRARY) - -endif # not BUILD_TINY_ANDROID diff --git a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp b/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp index 3d015cb..52a9402 100644 --- a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -178,23 +178,6 @@ void LocEngAdapter::reportSv(GpsSvStatus &svStatus, } } - -void LocEngAdapter::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) -{ - // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. - if (! mUlp->reportSvMeasurement(svMeasurementSet)) { - //Send to Internal Adapter later if needed by LA - } -} - -void LocEngAdapter::reportSvPolynomial(GnssSvPolynomial &svPolynomial) -{ - // We send SvMeasurementSet to AmtProxy/ULPProxy to be forwarded as necessary. - if (! mUlp->reportSvPolynomial(svPolynomial)) { - //Send to Internal Adapter later if needed by LA - } -} - void LocEngAdapter::setInSession(bool inSession) { mNavigating = inSession; @@ -319,25 +302,3 @@ void LocEngAdapter::handleEngineUpEvent() { sendMsg(new LocEngUp(mOwner)); } - -enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check) -{ - enum loc_api_adapter_err ret; - ENTRY_LOG(); - enum xtra_version_check eCheck; - switch (check) { - case 0: - eCheck = DISABLED; - case 1: - eCheck = AUTO; - case 2: - eCheck = XTRA2; - case 3: - eCheck = XTRA3; - defaul: - eCheck = DISABLED; - } - ret = mLocApi->setXtraVersionCheck(eCheck); - EXIT_LOG(%d, ret); - return ret; -} diff --git a/gps/loc_api/libloc_api_50001/LocEngAdapter.h b/gps/loc_api/libloc_api_50001/LocEngAdapter.h index 01726d2..932fea1 100644 --- a/gps/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/gps/loc_api/libloc_api_50001/LocEngAdapter.h @@ -249,7 +249,7 @@ public: { return mLocApi->getZppFix(zppLoc, tech_mask); } - enum loc_api_adapter_err setXtraVersionCheck(int check); + virtual void handleEngineDownEvent(); virtual void handleEngineUpEvent(); virtual void reportPosition(UlpLocation &location, @@ -260,8 +260,6 @@ public: virtual void reportSv(GpsSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); - virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet); - virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial); virtual void reportStatus(GpsStatusValue status); virtual void reportNmea(const char* nmea, int length); virtual bool reportXtraServer(const char* url1, const char* url2, @@ -300,7 +298,6 @@ public: { return mLocApi->getGpsLock(); } - }; #endif //LOC_API_ENG_ADAPTER_H diff --git a/gps/loc_api/libloc_api_50001/loc.cpp b/gps/loc_api/libloc_api_50001/loc.cpp index 3708eb2..9e08677 100644 --- a/gps/loc_api/libloc_api_50001/loc.cpp +++ b/gps/loc_api/libloc_api_50001/loc.cpp @@ -197,7 +197,6 @@ extern "C" const GpsInterface* get_gps_interface() switch (gnssType) { case GNSS_GSS: - case GNSS_AUTO: //APQ8064 gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); gss_fd = open("/dev/gss", O_RDONLY); @@ -242,9 +241,8 @@ SIDE EFFECTS static int loc_init(GpsCallbacks* callbacks) { int retVal = -1; - unsigned int target = (unsigned int) -1; - LOC_API_ADAPTER_EVENT_MASK_T event; ENTRY_LOG(); + LOC_API_ADAPTER_EVENT_MASK_T event; if (NULL == callbacks) { LOC_LOGE("loc_init failed. cb = NULL\n"); @@ -261,15 +259,6 @@ static int loc_init(GpsCallbacks* callbacks) LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; - target = loc_get_target(); - - /*For "auto" platform enable Measurement report and SV Polynomial report*/ - if(GNSS_AUTO == getTargetGnssType(target)) - { - event |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT_REPORT | - LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT; - } - LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */ callbacks->status_cb, /* status_cb */ local_sv_cb, /* sv_status_cb */ @@ -532,7 +521,7 @@ const GpsGeofencingInterface* get_geofence_interface(void) } dlerror(); /* Clear any existing error */ get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); - if ((error = dlerror()) != NULL && NULL != get_gps_geofence_interface) { + if ((error = dlerror()) != NULL) { LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); goto exit; } diff --git a/gps/loc_api/libloc_api_50001/loc_eng.cpp b/gps/loc_api/libloc_api_50001/loc_eng.cpp index cb3dcc6..f801909 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng.cpp @@ -121,7 +121,6 @@ static loc_param_s_type loc_parameter_table[] = {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'}, - {"XTRA_VERSION_CHECK", &gps_conf.XTRA_VERSION_CHECK, NULL, 'n'}, {"XTRA_SERVER_1", &gps_conf.XTRA_SERVER_1, NULL, 's'}, {"XTRA_SERVER_2", &gps_conf.XTRA_SERVER_2, NULL, 's'}, {"XTRA_SERVER_3", &gps_conf.XTRA_SERVER_3, NULL, 's'} @@ -129,20 +128,13 @@ static loc_param_s_type loc_parameter_table[] = static void loc_default_parameters(void) { - /*Defaults for gps.conf*/ + /* defaults */ gps_conf.INTERMEDIATE_POS = 0; gps_conf.ACCURACY_THRES = 0; gps_conf.NMEA_PROVIDER = 0; gps_conf.SUPL_VER = 0x10000; gps_conf.CAPABILITIES = 0x7; - /* LTE Positioning Profile configuration is disable by default*/ - gps_conf.LPP_PROFILE = 0; - /*By default no positioning protocol is selected on A-GLONASS system*/ - gps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; - /*XTRA version check is disabled by default*/ - gps_conf.XTRA_VERSION_CHECK=0; - /*Defaults for sap.conf*/ sap_conf.GYRO_BIAS_RANDOM_WALK = 0; sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; @@ -155,17 +147,26 @@ static void loc_default_parameters(void) sap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ sap_conf.SENSOR_USAGE = 0; /* Enabled */ sap_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 */ sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0; sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0; sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0; sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0; + sap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + + /* LTE Positioning Profile configuration is disable by default*/ + gps_conf.LPP_PROFILE = 0; + + /*By default no positioning protocol is selected on A-GLONASS system*/ + gps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; + /* default provider is SSC */ sap_conf.SENSOR_PROVIDER = 1; } @@ -1582,50 +1583,52 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) { ENTRY_LOG(); int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; - LocEngAdapter* adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); - adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); - adapter->sendMsg(new LocEngSensorControlConfig(adapter, sap_conf.SENSOR_USAGE, - sap_conf.SENSOR_PROVIDER)); - adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); - - /* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */ - if( sap_conf.GYRO_BIAS_RANDOM_WALK_VALID || - sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || - sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { - adapter->sendMsg(new LocEngSensorProperties(adapter, - sap_conf.GYRO_BIAS_RANDOM_WALK_VALID, - sap_conf.GYRO_BIAS_RANDOM_WALK, - sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, - sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, - sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, - sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, - sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY)); - } - - adapter->sendMsg(new LocEngSensorPerfControlConfig(adapter, - sap_conf.SENSOR_CONTROL_MODE, - sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, - sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, - sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, - sap_conf.SENSOR_GYRO_BATCHES_PER_SEC, - sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, - sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, - sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, - sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, - sap_conf.SENSOR_ALGORITHM_CONFIG_MASK)); - - adapter->sendMsg(new LocEngEnableData(adapter, NULL, 0, (agpsStatus ? 1:0))); - - loc_eng_xtra_version_check(loc_eng_data, gps_conf.XTRA_VERSION_CHECK); - - LOC_LOGD("loc_eng_reinit reinit() successful"); + if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) { + LOC_LOGD("loc_eng_reinit reinit() successful"); + + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); + adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); + adapter->sendMsg(new LocEngSensorControlConfig(adapter, sap_conf.SENSOR_USAGE, + sap_conf.SENSOR_PROVIDER)); + adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + + /* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */ + if( sap_conf.GYRO_BIAS_RANDOM_WALK_VALID || + sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) + { + adapter->sendMsg(new LocEngSensorProperties(adapter, + sap_conf.GYRO_BIAS_RANDOM_WALK_VALID, + sap_conf.GYRO_BIAS_RANDOM_WALK, + sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, + sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, + sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, + sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY)); + } + + adapter->sendMsg(new LocEngSensorPerfControlConfig(adapter, + sap_conf.SENSOR_CONTROL_MODE, + sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, + sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, + sap_conf.SENSOR_GYRO_BATCHES_PER_SEC, + sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, + sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, + sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, + sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, + sap_conf.SENSOR_ALGORITHM_CONFIG_MASK)); + + adapter->sendMsg(new LocEngEnableData(adapter, NULL, 0, (agpsStatus ? 1:0))); + } + EXIT_LOG(%d, ret_val); return ret_val; } @@ -1725,9 +1728,7 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) ret_val = loc_eng_data.adapter->startFix(); if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || - ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN || - ret_val == LOC_API_ADAPTER_ERR_PHONE_OFFLINE || - ret_val == LOC_API_ADAPTER_ERR_INTERNAL) + ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN) { loc_eng_data.adapter->setInSession(TRUE); loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); @@ -1988,6 +1989,7 @@ static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data) GpsLocationExtended locationExtended; memset(&locationExtended, 0, sizeof (GpsLocationExtended)); locationExtended.size = sizeof(locationExtended); + memset(&location, 0, sizeof location); ret_val = loc_eng_data.adapter->getZpp(location.gpsLocation, tech_mask); //Mark the location source as from ZPP diff --git a/gps/loc_api/libloc_api_50001/loc_eng.h b/gps/loc_api/libloc_api_50001/loc_eng.h index d5560b7..5d4e5de 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng.h +++ b/gps/loc_api/libloc_api_50001/loc_eng.h @@ -148,7 +148,6 @@ typedef struct loc_gps_cfg_s unsigned long LPP_PROFILE; uint8_t NMEA_PROVIDER; unsigned long A_GLONASS_POS_PROTOCOL_SELECT; - unsigned long XTRA_VERSION_CHECK; char XTRA_SERVER_1[MAX_XTRA_SERVER_URL_LENGTH]; char XTRA_SERVER_2[MAX_XTRA_SERVER_URL_LENGTH]; char XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH]; @@ -183,7 +182,6 @@ typedef struct extern loc_gps_cfg_s_type gps_conf; extern loc_sap_cfg_s_type sap_conf; -//loc_eng functions int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, LOC_API_ADAPTER_EVENT_MASK_T event, @@ -203,12 +201,6 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, LocPosMode ¶ms); const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data, const char* name); -int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, - LocServerType type, const char *hostname, int port); -void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); -int loc_eng_read_config(void); - -//loc_eng_agps functions void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* callbacks); int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, @@ -216,18 +208,28 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType); int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType); +int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, + LocServerType type, const char *hostname, int port); + + void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, int avaiable, const char* apn); -//loc_eng_xtra functions -int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, + +bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data, + char* command, int length); + + +void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); + +int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, GpsXtraExtCallbacks* callbacks); -int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, + +int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, char* data, int length); -int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data); -void loc_eng_xtra_version_check(loc_eng_data_s_type &loc_eng_data, int check); -//loc_eng_ni functions +int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data); + extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiExtCallbacks *callbacks); extern void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, @@ -236,6 +238,8 @@ extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, const GpsNiNotification *notif, const void* passThrough); extern void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data); +int loc_eng_read_config(void); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h index 1d8c142..5bd9795 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h +++ b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h @@ -33,11 +33,11 @@ #ifdef _ANDROID_ -#define GPSONE_LOC_API_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_q" -#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_resp_q" -#define QUIPC_CTRL_Q_PATH "/data/misc/location/gpsone_d/quipc_ctrl_q" -#define MSAPM_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapm_ctrl_q" -#define MSAPU_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapu_ctrl_q" +#define GPSONE_LOC_API_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_q" +#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/gpsone_d/gpsone_loc_api_resp_q" +#define QUIPC_CTRL_Q_PATH "/data/misc/gpsone_d/quipc_ctrl_q" +#define MSAPM_CTRL_Q_PATH "/data/misc/gpsone_d/msapm_ctrl_q" +#define MSAPU_CTRL_Q_PATH "/data/misc/gpsone_d/msapu_ctrl_q" #else diff --git a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 4c6b9a3..842eda1 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -119,17 +119,14 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, unsigned char generate_nmea) { ENTRY_LOG(); - time_t utcTime(location.gpsLocation.timestamp/1000); - tm * pTm = gmtime(&utcTime); - if (NULL == pTm) { - LOC_LOGE("gmtime failed"); - return; - } char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; char* pMarker = sentence; int lengthRemaining = sizeof(sentence); int length = 0; + + time_t utcTime(location.gpsLocation.timestamp/1000); + tm * pTm = gmtime(&utcTime); int utcYear = pTm->tm_year % 100; // 2 digit year int utcMonth = pTm->tm_mon + 1; // tm_mon starts at zero int utcDay = pTm->tm_mday; diff --git a/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp index 7bb8083..4582286 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp @@ -82,25 +82,6 @@ struct LocEngInjectXtraData : public LocMsg { } }; -struct LocEngSetXtraVersionCheck : public LocMsg { - LocEngAdapter *mAdapter; - int mCheck; - inline LocEngSetXtraVersionCheck(LocEngAdapter* adapter, - int check): - mAdapter(adapter), mCheck(check) {} - inline virtual void proc() const { - locallog(); - mAdapter->setXtraVersionCheck(mCheck); - } - inline void locallog() const { - LOC_LOGD("%s:%d]: mCheck: %d", - __func__, __LINE__, mCheck); - } - inline virtual void log() const { - locallog(); - } -}; - /*=========================================================================== FUNCTION loc_eng_xtra_init @@ -122,7 +103,6 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, { int ret_val = -1; loc_eng_xtra_data_s_type *xtra_module_data_ptr; - ENTRY_LOG(); if(callbacks == NULL) { LOC_LOGE("loc_eng_xtra_init: failed, cb is NULL"); @@ -133,7 +113,6 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, ret_val = 0; } - EXIT_LOG(%d, ret_val); return ret_val; } @@ -147,7 +126,8 @@ DEPENDENCIES N/A RETURN VALUE - 0 + 0: success + >0: failure SIDE EFFECTS N/A @@ -156,10 +136,9 @@ SIDE EFFECTS int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, char* data, int length) { - ENTRY_LOG(); LocEngAdapter* adapter = loc_eng_data.adapter; adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); - EXIT_LOG(%d, 0); + return 0; } /*=========================================================================== @@ -172,7 +151,7 @@ DEPENDENCIES N/A RETURN VALUE - 0 + length of server string SIDE EFFECTS N/A @@ -180,34 +159,9 @@ SIDE EFFECTS ===========================================================================*/ int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data) { - ENTRY_LOG(); LocEngAdapter* adapter = loc_eng_data.adapter; adapter->sendMsg(new LocEngRequestXtraServer(adapter)); - EXIT_LOG(%d, 0); - return 0; -} -/*=========================================================================== -FUNCTION loc_eng_xtra_version_check - -DESCRIPTION - Injects the enable/disable value for checking XTRA version - that is specified in gps.conf -DEPENDENCIES - N/A - -RETURN VALUE - none - -SIDE EFFECTS - N/A + return 0; -===========================================================================*/ -void loc_eng_xtra_version_check(loc_eng_data_s_type &loc_eng_data, - int check) -{ - ENTRY_LOG(); - LocEngAdapter *adapter = loc_eng_data.adapter; - adapter->sendMsg(new LocEngSetXtraVersionCheck(adapter, check)); - EXIT_LOG(%d, 0); } diff --git a/gps/utils/Android.mk b/gps/utils/Android.mk index a91a6ed..dcb55c2 100644 --- a/gps/utils/Android.mk +++ b/gps/utils/Android.mk @@ -1,6 +1,3 @@ -ifneq ($(BUILD_TINY_ANDROID),true) -#Compile this library only for builds with the latest modem image - LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -56,5 +53,3 @@ LOCAL_PRELINK_MODULE := false LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES) include $(BUILD_SHARED_LIBRARY) -endif # not BUILD_TINY_ANDROID - diff --git a/gps/utils/loc_log.cpp b/gps/utils/loc_log.cpp index 9a7ce5e..597b5b6 100644 --- a/gps/utils/loc_log.cpp +++ b/gps/utils/loc_log.cpp @@ -113,7 +113,6 @@ loc_name_val_s_type target_name[] = NAME_VAL(GNSS_GSS), NAME_VAL(GNSS_MDM), NAME_VAL(GNSS_QCA1530), - NAME_VAL(GNSS_AUTO), NAME_VAL(GNSS_UNKNOWN) }; diff --git a/gps/utils/loc_target.cpp b/gps/utils/loc_target.cpp index 4c41d93..4fcf21a 100644 --- a/gps/utils/loc_target.cpp +++ b/gps/utils/loc_target.cpp @@ -52,7 +52,6 @@ #define STR_SURF "Surf" #define STR_MTP "MTP" #define STR_APQ "apq" -#define STR_AUTO "auto" #define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') #define LENGTH(s) (sizeof(s) - 1) #define GPS_CHECK_NO_ERROR 0 @@ -175,70 +174,29 @@ unsigned int loc_get_target(void) if (gTarget != (unsigned int)-1) return gTarget; - static const char hw_platform[] = "/sys/devices/soc0/hw_platform"; - static const char id[] = "/sys/devices/soc0/soc_id"; - static const char hw_platform_dep[] = - "/sys/devices/system/soc/soc0/hw_platform"; - static const char id_dep[] = "/sys/devices/system/soc/soc0/id"; - static const char mdm[] = "/dev/mdm"; // No such file or directory + char hw_platform[] = "/sys/devices/system/soc/soc0/hw_platform"; + char id[] = "/sys/devices/system/soc/soc0/id"; + char mdm[] = "/dev/mdm"; // No such file or directory char rd_hw_platform[LINE_LEN]; char rd_id[LINE_LEN]; char rd_mdm[LINE_LEN]; - char baseband[LINE_LEN]; - if (is_qca1530()) { - gTarget = TARGET_QCA1530; - goto detected; - } - - loc_get_target_baseband(baseband, sizeof(baseband)); - - if (!access(hw_platform, F_OK)) { - read_a_line(hw_platform, rd_hw_platform, LINE_LEN); - } else { - read_a_line(hw_platform_dep, rd_hw_platform, LINE_LEN); - } - if (!access(id, F_OK)) { - read_a_line(id, rd_id, LINE_LEN); - } else { - read_a_line(id_dep, rd_id, LINE_LEN); - } - - if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) ) - { - gTarget = TARGET_AUTO; - goto detected; - } - - if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ - if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) - && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) - gTarget = TARGET_MPQ; - else + read_a_line(hw_platform, rd_hw_platform, LINE_LEN); + read_a_line(id, rd_id, LINE_LEN); + + if(!memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) + gTarget = TARGET_MPQ; + else if( (!memcmp(rd_hw_platform, STR_LIQUID, LENGTH(STR_LIQUID)) && IS_STR_END(rd_hw_platform[LENGTH(STR_LIQUID)])) || + (!memcmp(rd_hw_platform, STR_SURF, LENGTH(STR_SURF)) && IS_STR_END(rd_hw_platform[LENGTH(STR_SURF)])) ) { + if(!read_a_line( mdm, rd_mdm, LINE_LEN)) + gTarget = TARGET_MDM; + else if( (!memcmp(rd_id, APQ8064_ID_1, LENGTH(APQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_1)])) || + (!memcmp(rd_id, APQ8064_ID_2, LENGTH(APQ8064_ID_2)) && IS_STR_END(rd_id[LENGTH(APQ8064_ID_2)])) ) gTarget = TARGET_APQ_SA; } - else { - if( (!memcmp(rd_hw_platform, STR_LIQUID, LENGTH(STR_LIQUID)) - && IS_STR_END(rd_hw_platform[LENGTH(STR_LIQUID)])) || - (!memcmp(rd_hw_platform, STR_SURF, LENGTH(STR_SURF)) - && IS_STR_END(rd_hw_platform[LENGTH(STR_SURF)])) || - (!memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) - && IS_STR_END(rd_hw_platform[LENGTH(STR_MTP)]))) { - - if (!read_a_line( mdm, rd_mdm, LINE_LEN)) - gTarget = TARGET_MDM; - } - else if( (!memcmp(rd_id, MSM8930_ID_1, LENGTH(MSM8930_ID_1)) - && IS_STR_END(rd_id[LENGTH(MSM8930_ID_1)])) || - (!memcmp(rd_id, MSM8930_ID_2, LENGTH(MSM8930_ID_2)) - && IS_STR_END(rd_id[LENGTH(MSM8930_ID_2)])) ) - gTarget = TARGET_MSM_NO_SSC; - else - gTarget = TARGET_UNKNOWN; - } - -detected: - LOC_LOGD("HAL: %s returned %d", __FUNCTION__, gTarget); + else if( (!memcmp(rd_id, MSM8930_ID_1, LENGTH(MSM8930_ID_1)) && IS_STR_END(rd_id[LENGTH(MSM8930_ID_1)])) || + (!memcmp(rd_id, MSM8930_ID_2, LENGTH(MSM8930_ID_2)) && IS_STR_END(rd_id[LENGTH(MSM8930_ID_2)])) ) + gTarget = TARGET_MSM_NO_SSC; return gTarget; } diff --git a/gps/utils/loc_target.h b/gps/utils/loc_target.h index 873ddfc..9aa525f 100644 --- a/gps/utils/loc_target.h +++ b/gps/utils/loc_target.h @@ -35,7 +35,6 @@ #define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC) #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) #define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC) -#define TARGET_AUTO TARGET_SET(GNSS_AUTO, NO_SSC) #define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) #define getTargetGnssType(target) (target>>1) @@ -61,7 +60,6 @@ typedef enum { GNSS_GSS, GNSS_MDM, GNSS_QCA1530, - GNSS_AUTO, GNSS_UNKNOWN }GNSS_TARGET; diff --git a/gps/utils/loc_timer.c b/gps/utils/loc_timer.c index 2beca5f..1e4008e 100644 --- a/gps/utils/loc_timer.c +++ b/gps/utils/loc_timer.c @@ -101,28 +101,12 @@ static void *timer_thread(void *thread_data) break; } + pthread_mutex_destroy(&t->timer_mutex); + pthread_cond_destroy(&t->timer_cond); + if(ETIMEDOUT == ret) t->callback_func(t->user_data, ret); - // A (should be rare) race condition is that, when the loc_time_stop is called - // and acquired mutex, we reach here. pthread_mutex_destroy will fail with - // error code EBUSY. We give it 6 tries in 5 seconds. Should be eanough time - // for loc_timer_stop to complete. With the 7th try, we also perform unlock - // prior to destroy. - { - int i; - for (i = 0; EBUSY == pthread_mutex_destroy(&t->timer_mutex) && i <= 5; i++) { - if (i < 5) { - sleep(1); - } else { - // nah, forget it, something is seriously wrong. Mutex has been - // held too long. Unlock the mutext here. - pthread_mutex_unlock(&t->timer_mutex); - } - } - } - pthread_cond_destroy(&t->timer_cond); - free(t); LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); return NULL; @@ -191,8 +175,8 @@ _err: void loc_timer_stop(void* handle) { timer_data* t = (timer_data*)handle; - if (NULL != t && (READY == t->state || WAITING == t->state) && - pthread_mutex_lock(&(t->timer_mutex)) == 0) { + if (NULL != t && (READY == t->state || WAITING == t->state)) { + pthread_mutex_lock(&(t->timer_mutex)); if (READY == t->state || WAITING == t->state) { pthread_cond_signal(&t->timer_cond); t->state = ABORT; diff --git a/include/hardware/gps.h b/include/hardware/gps.h index 305a46f..61bea6f 100644 --- a/include/hardware/gps.h +++ b/include/hardware/gps.h @@ -398,6 +398,11 @@ typedef uint8_t GpsNavigationMessageType; #define AGPS_RIL_INTERFACE "agps_ril" /** + * The GPS chipset can use Psc for AGPS. + */ +#define AGPS_USE_PSC + +/** * Name for the GPS_Geofencing interface. */ #define GPS_GEOFENCING_INTERFACE "gps_geofencing" @@ -499,6 +504,9 @@ typedef struct { uint16_t mcc; uint16_t mnc; uint16_t lac; +#ifdef AGPS_USE_PSC + uint16_t psc; +#endif uint32_t cid; } AGpsRefLocationCellID; |