land: gps: update to LA.UM.5.6.r1-04700-89xx.0
This commit is contained in:
parent
d7ca5a1a58
commit
89afb85701
99 changed files with 3690 additions and 722 deletions
|
@ -1,3 +1,4 @@
|
|||
# GPS
|
||||
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
|
||||
USE_DEVICE_SPECIFIC_GPS := true
|
||||
USE_DEVICE_SPECIFIC_LOC_API := true
|
||||
TARGET_NO_RPC := true
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2016 The CyanogenMod Project
|
||||
# Copyright (C) 2017 The LineageOS Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -14,4 +14,8 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
ifeq ($(TARGET_DEVICE),land)
|
||||
include $(call all-subdir-makefiles,$(LOCAL_PATH))
|
||||
endif
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = utils loc_api/libloc_api_50001 loc_api/loc_api_v02
|
||||
SUBDIRS = utils core loc_api
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = loc-api.pc
|
||||
pkgconfig_DATA = loc-hal.pc
|
||||
EXTRA_DIST = $(pkgconfig_DATA)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# configure.ac -- Autoconf script for gps loc_api
|
||||
# configure.ac -- Autoconf script for gps loc_hal
|
||||
#
|
||||
# Process this file with autoconf to produce a configure script
|
||||
|
||||
# Requires autoconf tool later than 2.61
|
||||
AC_PREREQ(2.61)
|
||||
# Initialize the gps loc_api package version 1.0.0
|
||||
AC_INIT([loc-api],1.0.0)
|
||||
# Initialize the gps loc-hal package version 1.0.0
|
||||
AC_INIT([loc-hal],1.0.0)
|
||||
# Does not strictly follow GNU Coding standards
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
# Disables auto rebuilding of configure, Makefile.ins
|
||||
|
@ -29,10 +29,22 @@ AC_PROG_MAKE_SET
|
|||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
# Checks for libraries.
|
||||
PKG_CHECK_MODULES([QMI], [qmi])
|
||||
AC_SUBST([QMI_CFLAGS])
|
||||
AC_SUBST([QMI_LIBS])
|
||||
|
||||
PKG_CHECK_MODULES([QMIF], [qmi-framework])
|
||||
AC_SUBST([QMIF_CFLAGS])
|
||||
AC_SUBST([QMIF_LIBS])
|
||||
|
||||
PKG_CHECK_MODULES([DATA], [data])
|
||||
AC_SUBST([DATA_CFLAGS])
|
||||
AC_SUBST([DATA_LIBS])
|
||||
|
||||
PKG_CHECK_MODULES([LOCPLA], [loc-pla])
|
||||
AC_SUBST([LOCPLA_CFLAGS])
|
||||
AC_SUBST([LOCPLA_LIBS])
|
||||
|
||||
AC_ARG_WITH([libhardware_includes],
|
||||
AC_HELP_STRING([--with-libhardware-includes=@<:@dir@:>@],
|
||||
[Specify the location of the libhardware headers]),
|
||||
|
@ -77,9 +89,9 @@ AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
|
|||
AC_CONFIG_FILES([ \
|
||||
Makefile \
|
||||
utils/Makefile \
|
||||
loc_api/libloc_api_50001/Makefile \
|
||||
loc_api/loc_api_v02/Makefile \
|
||||
loc-api.pc \
|
||||
core/Makefile \
|
||||
loc_api/Makefile \
|
||||
loc-hal.pc \
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
|
|
@ -20,7 +20,8 @@ LOCAL_SHARED_LIBRARIES := \
|
|||
libutils \
|
||||
libcutils \
|
||||
libgps.utils \
|
||||
libdl
|
||||
libdl \
|
||||
libloc_pla
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
LocApiBase.cpp \
|
||||
|
@ -35,7 +36,8 @@ LOCAL_CFLAGS += \
|
|||
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(TARGET_OUT_HEADERS)/gps.utils \
|
||||
$(TARGET_OUT_HEADERS)/libflp
|
||||
$(TARGET_OUT_HEADERS)/libflp \
|
||||
$(TARGET_OUT_HEADERS)/libloc_pla
|
||||
|
||||
LOCAL_COPY_HEADERS_TO:= libloc_core/
|
||||
LOCAL_COPY_HEADERS:= \
|
||||
|
|
|
@ -35,11 +35,32 @@
|
|||
#include <ContextBase.h>
|
||||
#include <msg_q.h>
|
||||
#include <loc_target.h>
|
||||
#include <log_util.h>
|
||||
#include <platform_lib_includes.h>
|
||||
#include <loc_log.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
loc_gps_cfg_s_type ContextBase::mGps_conf {0};
|
||||
loc_sap_cfg_s_type ContextBase::mSap_conf {0};
|
||||
|
||||
uint32_t ContextBase::getCarrierCapabilities() {
|
||||
#define carrierMSA (uint32_t)0x2
|
||||
#define carrierMSB (uint32_t)0x1
|
||||
#define gpsConfMSA (uint32_t)0x4
|
||||
#define gpsConfMSB (uint32_t)0x2
|
||||
uint32_t capabilities = mGps_conf.CAPABILITIES;
|
||||
if ((mGps_conf.SUPL_MODE & carrierMSA) != carrierMSA) {
|
||||
capabilities &= ~gpsConfMSA;
|
||||
}
|
||||
if ((mGps_conf.SUPL_MODE & carrierMSB) != carrierMSB) {
|
||||
capabilities &= ~gpsConfMSB;
|
||||
}
|
||||
|
||||
LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x",
|
||||
mGps_conf.CAPABILITIES, mGps_conf.SUPL_MODE, capabilities);
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
LBSProxyBase* ContextBase::getLBSProxy(const char* libName)
|
||||
{
|
||||
LBSProxyBase* proxy = NULL;
|
||||
|
@ -52,6 +73,10 @@ LBSProxyBase* ContextBase::getLBSProxy(const char* libName)
|
|||
proxy = (*getter)();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOC_LOGW("%s:%d]: FAILED TO LOAD libname: %s\n", __func__, __LINE__, libName);
|
||||
}
|
||||
if (NULL == proxy) {
|
||||
proxy = new LBSProxyBase();
|
||||
}
|
||||
|
@ -63,30 +88,29 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
|
|||
{
|
||||
LocApiBase* locApi = NULL;
|
||||
|
||||
// first if can not be MPQ
|
||||
if (TARGET_MPQ != loc_get_target()) {
|
||||
if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) {
|
||||
void *handle = NULL;
|
||||
//try to see if LocApiV02 is present
|
||||
if((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) {
|
||||
LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__);
|
||||
getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi");
|
||||
if(getter != NULL) {
|
||||
LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, __LINE__);
|
||||
locApi = (*getter)(mMsgTask, exMask, this);
|
||||
}
|
||||
if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) {
|
||||
void *handle = NULL;
|
||||
//try to see if LocApiV02 is present
|
||||
if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) {
|
||||
LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__);
|
||||
getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi");
|
||||
if (getter != NULL) {
|
||||
LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__,
|
||||
__LINE__);
|
||||
locApi = (*getter)(mMsgTask, exMask, this);
|
||||
}
|
||||
// only RPC is the option now
|
||||
else {
|
||||
LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC",
|
||||
__func__, __LINE__);
|
||||
handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW);
|
||||
if (NULL != handle) {
|
||||
getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi");
|
||||
if (NULL != getter) {
|
||||
LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__, __LINE__);
|
||||
locApi = (*getter)(mMsgTask, exMask, this);
|
||||
}
|
||||
}
|
||||
// only RPC is the option now
|
||||
else {
|
||||
LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC",
|
||||
__func__, __LINE__);
|
||||
handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW);
|
||||
if (NULL != handle) {
|
||||
getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi");
|
||||
if (NULL != getter) {
|
||||
LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__,
|
||||
__LINE__);
|
||||
locApi = (*getter)(mMsgTask, exMask, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,69 @@
|
|||
#include <LocApiBase.h>
|
||||
#include <LBSProxyBase.h>
|
||||
|
||||
#define MAX_XTRA_SERVER_URL_LENGTH 256
|
||||
|
||||
/* GPS.conf support */
|
||||
/* NOTE: the implementaiton of the parser casts number
|
||||
fields to 32 bit. To ensure all 'n' fields working,
|
||||
they must all be 32 bit fields. */
|
||||
typedef struct loc_gps_cfg_s
|
||||
{
|
||||
uint32_t INTERMEDIATE_POS;
|
||||
uint32_t ACCURACY_THRES;
|
||||
uint32_t SUPL_VER;
|
||||
uint32_t SUPL_MODE;
|
||||
uint32_t SUPL_ES;
|
||||
uint32_t CAPABILITIES;
|
||||
uint32_t LPP_PROFILE;
|
||||
uint32_t 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];
|
||||
uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL;
|
||||
uint32_t NMEA_PROVIDER;
|
||||
uint32_t GPS_LOCK;
|
||||
uint32_t A_GLONASS_POS_PROTOCOL_SELECT;
|
||||
uint32_t AGPS_CERT_WRITABLE_MASK;
|
||||
uint32_t AGPS_CONFIG_INJECT;
|
||||
uint32_t LPPE_CP_TECHNOLOGY;
|
||||
uint32_t LPPE_UP_TECHNOLOGY;
|
||||
uint32_t EXTERNAL_DR_ENABLED;
|
||||
} loc_gps_cfg_s_type;
|
||||
|
||||
/* NOTE: the implementaiton of the parser casts number
|
||||
fields to 32 bit. To ensure all 'n' fields working,
|
||||
they must all be 32 bit fields. */
|
||||
/* Meanwhile, *_valid fields are 8 bit fields, and 'f'
|
||||
fields are double. Rigid as they are, it is the
|
||||
the status quo, until the parsing mechanism is
|
||||
change, that is. */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t GYRO_BIAS_RANDOM_WALK_VALID;
|
||||
double GYRO_BIAS_RANDOM_WALK;
|
||||
uint32_t SENSOR_ACCEL_BATCHES_PER_SEC;
|
||||
uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH;
|
||||
uint32_t SENSOR_GYRO_BATCHES_PER_SEC;
|
||||
uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH;
|
||||
uint32_t SENSOR_ACCEL_BATCHES_PER_SEC_HIGH;
|
||||
uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH;
|
||||
uint32_t SENSOR_GYRO_BATCHES_PER_SEC_HIGH;
|
||||
uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH;
|
||||
uint32_t SENSOR_CONTROL_MODE;
|
||||
uint32_t SENSOR_USAGE;
|
||||
uint32_t SENSOR_ALGORITHM_CONFIG_MASK;
|
||||
uint8_t ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double ACCEL_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double ANGLE_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double RATE_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint32_t SENSOR_PROVIDER;
|
||||
} loc_sap_cfg_s_type;
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocAdapterBase;
|
||||
|
@ -58,6 +121,7 @@ public:
|
|||
inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; }
|
||||
inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); }
|
||||
inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); }
|
||||
inline bool hasNativeXtraClient() { return mLBSProxy->hasNativeXtraClient(); }
|
||||
inline void modemPowerVote(bool power) const { return mLBSProxy->modemPowerVote(power); }
|
||||
inline void requestUlp(LocAdapterBase* adapter,
|
||||
unsigned long capabilities) {
|
||||
|
@ -67,6 +131,12 @@ public:
|
|||
return mLBSProxy->getIzatDevId();
|
||||
}
|
||||
inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); }
|
||||
|
||||
static loc_gps_cfg_s_type mGps_conf;
|
||||
static loc_sap_cfg_s_type mSap_conf;
|
||||
|
||||
static uint32_t getCarrierCapabilities();
|
||||
|
||||
};
|
||||
|
||||
} // namespace loc_core
|
||||
|
|
|
@ -69,6 +69,7 @@ public:
|
|||
|
||||
(void)context;
|
||||
}
|
||||
inline virtual bool hasNativeXtraClient() const { return false; }
|
||||
inline virtual IzatDevId_t getIzatDevId() const { return 0; }
|
||||
};
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <dlfcn.h>
|
||||
#include <LocAdapterBase.h>
|
||||
#include <loc_target.h>
|
||||
#include <log_util.h>
|
||||
#include <platform_lib_log_util.h>
|
||||
#include <LocAdapterProxyBase.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
@ -80,11 +80,18 @@ void LocAdapterBase::
|
|||
}
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSv(QcomSvStatus &svStatus,
|
||||
reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSvPolynomial(GnssSvPolynomial &svPolynomial)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportStatus(GpsStatusValue status)
|
||||
|
@ -137,6 +144,6 @@ bool LocAdapterBase::
|
|||
DEFAULT_IMPL(false)
|
||||
|
||||
void LocAdapterBase::
|
||||
reportGpsMeasurementData(GpsData &gpsMeasurementData)
|
||||
reportGnssMeasurementData(GnssData &gnssMeasurementData)
|
||||
DEFAULT_IMPL()
|
||||
} // namespace loc_core
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2014,2016 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
|
||||
|
@ -78,6 +78,10 @@ public:
|
|||
mLocApi->updateEvtMask();
|
||||
}
|
||||
|
||||
inline bool isFeatureSupported(uint8_t featureVal) {
|
||||
return mLocApi->isFeatureSupported(featureVal);
|
||||
}
|
||||
|
||||
// This will be overridden by the individual adapters
|
||||
// if necessary.
|
||||
inline virtual void setUlpProxy(UlpProxyBase* ulp) {
|
||||
|
@ -98,9 +102,11 @@ public:
|
|||
void* locationExt,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
virtual void reportSv(QcomSvStatus &svStatus,
|
||||
virtual void reportSv(GnssSvStatus &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,
|
||||
|
@ -117,7 +123,7 @@ public:
|
|||
const void* data);
|
||||
inline virtual bool isInSession() { return false; }
|
||||
ContextBase* getContext() const { return mContext; }
|
||||
virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData);
|
||||
virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData);
|
||||
};
|
||||
|
||||
} // namespace loc_core
|
||||
|
|
|
@ -46,15 +46,15 @@ protected:
|
|||
inline virtual ~LocAdapterProxyBase() {
|
||||
delete mLocAdapterBase;
|
||||
}
|
||||
ContextBase* getContext() const {
|
||||
return mLocAdapterBase->getContext();
|
||||
}
|
||||
inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event,
|
||||
loc_registration_mask_status isEnabled) {
|
||||
mLocAdapterBase->updateEvtMask(event,isEnabled);
|
||||
}
|
||||
|
||||
public:
|
||||
inline ContextBase* getContext() const {
|
||||
return mLocAdapterBase->getContext();
|
||||
}
|
||||
inline virtual void handleEngineUpEvent() {};
|
||||
inline virtual void handleEngineDownEvent() {};
|
||||
inline virtual bool reportPosition(UlpLocation &location,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2014,2016 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
|
||||
|
@ -32,7 +32,7 @@
|
|||
#include <dlfcn.h>
|
||||
#include <LocApiBase.h>
|
||||
#include <LocAdapterBase.h>
|
||||
#include <log_util.h>
|
||||
#include <platform_lib_log_util.h>
|
||||
#include <LocDualContext.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
@ -132,6 +132,7 @@ LocApiBase::LocApiBase(const MsgTask* msgTask,
|
|||
mMask(0), mSupportedMsg(0), mContext(context)
|
||||
{
|
||||
memset(mLocAdapters, 0, sizeof(mLocAdapters));
|
||||
memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported));
|
||||
}
|
||||
|
||||
LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask()
|
||||
|
@ -236,13 +237,18 @@ void LocApiBase::reportPosition(UlpLocation &location,
|
|||
LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n "
|
||||
"altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n "
|
||||
"timestamp: %lld\n rawDataSize: %d\n rawData: %p\n "
|
||||
"Session status: %d\n Technology mask: %u",
|
||||
"Session status: %d\n Technology mask: %u\n "
|
||||
"SV used in fix (gps/glo/bds/gal) : (%x/%x/%x/%x)",
|
||||
location.gpsLocation.flags, location.position_source,
|
||||
location.gpsLocation.latitude, location.gpsLocation.longitude,
|
||||
location.gpsLocation.altitude, location.gpsLocation.speed,
|
||||
location.gpsLocation.bearing, location.gpsLocation.accuracy,
|
||||
location.gpsLocation.timestamp, location.rawDataSize,
|
||||
location.rawData, status, loc_technology_mask);
|
||||
location.rawData, status, loc_technology_mask,
|
||||
locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask,
|
||||
locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask,
|
||||
locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask,
|
||||
locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask);
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(
|
||||
mLocAdapters[i]->reportPosition(location,
|
||||
|
@ -253,29 +259,54 @@ void LocApiBase::reportPosition(UlpLocation &location,
|
|||
);
|
||||
}
|
||||
|
||||
void LocApiBase::reportSv(QcomSvStatus &svStatus,
|
||||
void LocApiBase::reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt)
|
||||
{
|
||||
const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS",
|
||||
"QZSS", "BEIDOU", "GALILEO" };
|
||||
|
||||
// print the SV info before delivering
|
||||
LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n gps/glo/bds in use"
|
||||
" mask: %x/%x/%x\n sv: prn snr elevation azimuth",
|
||||
svStatus.num_svs, svStatus.ephemeris_mask,
|
||||
svStatus.almanac_mask, svStatus.gps_used_in_fix_mask,
|
||||
svStatus.glo_used_in_fix_mask, svStatus.bds_used_in_fix_mask);
|
||||
for (int i = 0; i < svStatus.num_svs && i < GPS_MAX_SVS; i++) {
|
||||
LOC_LOGV(" %d: %d %f %f %f",
|
||||
i,
|
||||
svStatus.sv_list[i].prn,
|
||||
svStatus.sv_list[i].snr,
|
||||
svStatus.sv_list[i].elevation,
|
||||
svStatus.sv_list[i].azimuth);
|
||||
LOC_LOGV("num sv: %d\n"
|
||||
" sv: constellation svid cN0"
|
||||
" elevation azimuth flags",
|
||||
svStatus.num_svs);
|
||||
for (int i = 0; i < svStatus.num_svs && i < GNSS_MAX_SVS; i++) {
|
||||
if (svStatus.gnss_sv_list[i].constellation >
|
||||
sizeof(constellationString) / sizeof(constellationString[0]) - 1) {
|
||||
svStatus.gnss_sv_list[i].constellation = 0;
|
||||
}
|
||||
LOC_LOGV(" %03d: %*s %02d %f %f %f 0x%02X",
|
||||
i,
|
||||
13,
|
||||
constellationString[svStatus.gnss_sv_list[i].constellation],
|
||||
svStatus.gnss_sv_list[i].svid,
|
||||
svStatus.gnss_sv_list[i].c_n0_dbhz,
|
||||
svStatus.gnss_sv_list[i].elevation,
|
||||
svStatus.gnss_sv_list[i].azimuth,
|
||||
svStatus.gnss_sv_list[i].flags);
|
||||
}
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(
|
||||
mLocAdapters[i]->reportSv(svStatus,
|
||||
locationExtended,
|
||||
svExt)
|
||||
locationExtended,
|
||||
svExt)
|
||||
);
|
||||
}
|
||||
|
||||
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)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -358,16 +389,21 @@ void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList)
|
|||
mSupportedMsg = supportedMsgList;
|
||||
}
|
||||
|
||||
void LocApiBase::saveSupportedFeatureList(uint8_t *featureList)
|
||||
{
|
||||
memcpy((void *)mFeaturesSupported, (void *)featureList, sizeof(mFeaturesSupported));
|
||||
}
|
||||
|
||||
void* LocApiBase :: getSibling()
|
||||
DEFAULT_IMPL(NULL)
|
||||
|
||||
LocApiProxyBase* LocApiBase :: getLocApiProxy()
|
||||
DEFAULT_IMPL(NULL)
|
||||
|
||||
void LocApiBase::reportGpsMeasurementData(GpsData &gpsMeasurementData)
|
||||
void LocApiBase::reportGnssMeasurementData(GnssData &gnssMeasurementData)
|
||||
{
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGpsMeasurementData(gpsMeasurementData));
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementData(gnssMeasurementData));
|
||||
}
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
|
@ -445,6 +481,10 @@ enum loc_api_adapter_err LocApiBase::
|
|||
setSUPLVersion(uint32_t version)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setNMEATypes (uint32_t typesMask)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setLPPConfig(uint32_t profile)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
@ -481,12 +521,12 @@ enum loc_api_adapter_err LocApiBase::
|
|||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setExtPowerConfig(int isBatteryCharging)
|
||||
setAGLONASSProtocol(unsigned long aGlonassProtocol)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setAGLONASSProtocol(unsigned long aGlonassProtocol)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
getWwanZppFix(GpsLocation& zppLoc)
|
||||
|
@ -541,13 +581,18 @@ enum loc_api_adapter_err LocApiBase::
|
|||
setXtraVersionCheck(enum xtra_version_check check)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
int LocApiBase::
|
||||
updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event,
|
||||
loc_registration_mask_status isEnabled)
|
||||
DEFAULT_IMPL(-1)
|
||||
|
||||
bool LocApiBase::
|
||||
gnssConstellationConfig()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocApiBase::
|
||||
isFeatureSupported(uint8_t featureVal)
|
||||
{
|
||||
uint8_t arrayIndex = featureVal >> 3;
|
||||
uint8_t bitPos = featureVal & 7;
|
||||
|
||||
if (arrayIndex >= MAX_FEATURE_LENGTH) return false;
|
||||
return ((mFeaturesSupported[arrayIndex] >> bitPos ) & 0x1);
|
||||
}
|
||||
|
||||
} // namespace loc_core
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2014, 2016 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
|
||||
|
@ -33,7 +33,7 @@
|
|||
#include <ctype.h>
|
||||
#include <gps_extended.h>
|
||||
#include <MsgTask.h>
|
||||
#include <log_util.h>
|
||||
#include <platform_lib_log_util.h>
|
||||
|
||||
namespace loc_core {
|
||||
class ContextBase;
|
||||
|
@ -44,6 +44,7 @@ int decodeAddress(char *addr_string, int string_size,
|
|||
const char *data, int data_size);
|
||||
|
||||
#define MAX_ADAPTERS 10
|
||||
#define MAX_FEATURE_LENGTH 100
|
||||
|
||||
#define TO_ALL_ADAPTERS(adapters, call) \
|
||||
for (int i = 0; i < MAX_ADAPTERS && NULL != (adapters)[i]; i++) { \
|
||||
|
@ -81,6 +82,7 @@ class LocApiBase {
|
|||
ContextBase *mContext;
|
||||
LocAdapterBase* mLocAdapters[MAX_ADAPTERS];
|
||||
uint64_t mSupportedMsg;
|
||||
uint8_t mFeaturesSupported[MAX_FEATURE_LENGTH];
|
||||
|
||||
protected:
|
||||
virtual enum loc_api_adapter_err
|
||||
|
@ -113,9 +115,11 @@ public:
|
|||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask =
|
||||
LOC_POS_TECH_MASK_DEFAULT);
|
||||
void reportSv(QcomSvStatus &svStatus,
|
||||
void reportSv(GnssSvStatus &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,
|
||||
|
@ -130,7 +134,8 @@ public:
|
|||
void reportDataCallClosed();
|
||||
void requestNiNotify(GpsNiNotification ¬ify, const void* data);
|
||||
void saveSupportedMsgList(uint64_t supportedMsgList);
|
||||
void reportGpsMeasurementData(GpsData &gpsMeasurementData);
|
||||
void reportGnssMeasurementData(GnssData &gnssMeasurementData);
|
||||
void saveSupportedFeatureList(uint8_t *featureList);
|
||||
|
||||
// downward calls
|
||||
// All below functions are to be defined by adapter specific modules:
|
||||
|
@ -171,6 +176,8 @@ public:
|
|||
informNiResponse(GpsUserResponseType userResponse, const void* passThroughData);
|
||||
virtual enum loc_api_adapter_err
|
||||
setSUPLVersion(uint32_t version);
|
||||
virtual enum loc_api_adapter_err
|
||||
setNMEATypes (uint32_t typesMask);
|
||||
virtual enum loc_api_adapter_err
|
||||
setLPPConfig(uint32_t profile);
|
||||
virtual enum loc_api_adapter_err
|
||||
|
@ -197,10 +204,10 @@ public:
|
|||
int gyroSamplesPerBatchHigh,
|
||||
int gyroBatchesPerSecHigh,
|
||||
int algorithmConfig);
|
||||
virtual enum loc_api_adapter_err
|
||||
setExtPowerConfig(int isBatteryCharging);
|
||||
virtual enum loc_api_adapter_err
|
||||
setAGLONASSProtocol(unsigned long aGlonassProtocol);
|
||||
virtual enum loc_api_adapter_err
|
||||
setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP);
|
||||
virtual enum loc_api_adapter_err
|
||||
getWwanZppFix(GpsLocation & zppLoc);
|
||||
virtual enum loc_api_adapter_err
|
||||
|
@ -247,15 +254,15 @@ public:
|
|||
|
||||
virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check);
|
||||
|
||||
/*
|
||||
Update gps reporting events
|
||||
*/
|
||||
virtual int updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event,
|
||||
loc_registration_mask_status isEnabled);
|
||||
/*
|
||||
Check if the modem support the service
|
||||
*/
|
||||
virtual bool gnssConstellationConfig();
|
||||
|
||||
/*
|
||||
Check if a feature is supported
|
||||
*/
|
||||
bool isFeatureSupported(uint8_t featureVal);
|
||||
};
|
||||
|
||||
typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask,
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <unistd.h>
|
||||
#include <LocDualContext.h>
|
||||
#include <msg_q.h>
|
||||
#include <log_util.h>
|
||||
#include <platform_lib_log_util.h>
|
||||
#include <loc_log.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
@ -59,7 +59,11 @@ ContextBase* LocDualContext::mBgContext = NULL;
|
|||
ContextBase* LocDualContext::mInjectContext = NULL;
|
||||
// the name must be shorter than 15 chars
|
||||
const char* LocDualContext::mLocationHalName = "Loc_hal_worker";
|
||||
#ifndef USE_GLIB
|
||||
const char* LocDualContext::mLBSLibName = "liblbs_core.so";
|
||||
#else
|
||||
const char* LocDualContext::mLBSLibName = "liblbs_core.so.1";
|
||||
#endif
|
||||
|
||||
pthread_mutex_t LocDualContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
|
|
46
gps/core/Makefile.am
Normal file
46
gps/core/Makefile.am
Normal file
|
@ -0,0 +1,46 @@
|
|||
AM_CFLAGS = -I./ \
|
||||
-I../utils \
|
||||
$(LOCPLA_CFLAGS) \
|
||||
-I$(WORKSPACE)/gps-noship/flp \
|
||||
-D__func__=__PRETTY_FUNCTION__ \
|
||||
-fno-short-enums
|
||||
|
||||
libloc_core_la_h_sources = \
|
||||
LocApiBase.h \
|
||||
LocAdapterBase.h \
|
||||
ContextBase.h \
|
||||
LocDualContext.h \
|
||||
LBSProxyBase.h \
|
||||
UlpProxyBase.h \
|
||||
gps_extended_c.h \
|
||||
gps_extended.h \
|
||||
loc_core_log.h \
|
||||
LocAdapterProxyBase.h
|
||||
|
||||
libloc_core_la_c_sources = \
|
||||
LocApiBase.cpp \
|
||||
LocAdapterBase.cpp \
|
||||
ContextBase.cpp \
|
||||
LocDualContext.cpp \
|
||||
loc_core_log.cpp
|
||||
|
||||
library_includedir = $(pkgincludedir)/core
|
||||
|
||||
library_include_HEADERS = $(libloc_core_la_h_sources)
|
||||
|
||||
libloc_core_la_SOURCES = $(libloc_core_la_c_sources)
|
||||
|
||||
if USE_GLIB
|
||||
libloc_core_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_core_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_core_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_core_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_core_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_core_la_LIBADD = -lstdc++ -ldl $(LOCPLA_LIBS) ../utils/libgps_utils_so.la
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_core.la
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2013-2016, 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
|
||||
|
@ -30,10 +30,7 @@
|
|||
#define ULP_PROXY_BASE_H
|
||||
|
||||
#include <gps_extended.h>
|
||||
|
||||
struct FlpExtLocation_s;
|
||||
struct FlpExtBatchOptions;
|
||||
|
||||
#include "fused_location_extended.h"
|
||||
namespace loc_core {
|
||||
|
||||
class LocAdapterBase;
|
||||
|
@ -66,7 +63,7 @@ public:
|
|||
(void)loc_technology_mask;
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportSv(QcomSvStatus &svStatus,
|
||||
inline virtual bool reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt) {
|
||||
(void)svStatus;
|
||||
|
@ -74,6 +71,16 @@ public:
|
|||
(void)svExt;
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) {
|
||||
(void)svMeasurementSet;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline virtual bool reportSvPolynomial(GnssSvPolynomial &svPolynomial)
|
||||
{
|
||||
(void)svPolynomial;
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportStatus(GpsStatusValue status) {
|
||||
|
||||
(void)status;
|
||||
|
@ -94,12 +101,17 @@ public:
|
|||
(void)active;
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportPositions(const struct FlpExtLocation_s* locations,
|
||||
inline virtual bool reportPositions(const FlpExtLocation* locations,
|
||||
int32_t number_of_locations) {
|
||||
(void)locations;
|
||||
(void)number_of_locations;
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportDeleteAidingData(GpsAidingData aidingData)
|
||||
{
|
||||
(void)aidingData;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace loc_core
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2013-2015, 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
|
||||
|
@ -29,11 +29,19 @@
|
|||
#ifndef GPS_EXTENDED_H
|
||||
#define GPS_EXTENDED_H
|
||||
|
||||
#include <gps_extended_c.h>
|
||||
/**
|
||||
* @file
|
||||
* @brief C++ declarations for GPS types
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <gps_extended_c.h>
|
||||
#if defined(USE_GLIB) || defined(OFF_TARGET)
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
struct LocPosMode
|
||||
{
|
||||
|
@ -42,14 +50,17 @@ struct LocPosMode
|
|||
uint32_t min_interval;
|
||||
uint32_t preferred_accuracy;
|
||||
uint32_t preferred_time;
|
||||
bool share_position;
|
||||
char credentials[14];
|
||||
char provider[8];
|
||||
LocPosMode(LocPositionMode m, GpsPositionRecurrence recr,
|
||||
uint32_t gap, uint32_t accu, uint32_t time,
|
||||
const char* cred, const char* prov) :
|
||||
bool sp, const char* cred, const char* prov) :
|
||||
mode(m), recurrence(recr),
|
||||
min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap),
|
||||
preferred_accuracy(accu), preferred_time(time) {
|
||||
min_interval(gap < GPS_MIN_POSSIBLE_FIX_INTERVAL_MS ?
|
||||
GPS_MIN_POSSIBLE_FIX_INTERVAL_MS : gap),
|
||||
preferred_accuracy(accu), preferred_time(time),
|
||||
share_position(sp) {
|
||||
memset(credentials, 0, sizeof(credentials));
|
||||
memset(provider, 0, sizeof(provider));
|
||||
if (NULL != cred) {
|
||||
|
@ -63,8 +74,9 @@ struct LocPosMode
|
|||
inline LocPosMode() :
|
||||
mode(LOC_POSITION_MODE_MS_BASED),
|
||||
recurrence(GPS_POSITION_RECURRENCE_PERIODIC),
|
||||
min_interval(MIN_POSSIBLE_FIX_INTERVAL),
|
||||
preferred_accuracy(50), preferred_time(120000) {
|
||||
min_interval(GPS_DEFAULT_FIX_INTERVAL_MS),
|
||||
preferred_accuracy(50), preferred_time(120000),
|
||||
share_position(true) {
|
||||
memset(credentials, 0, sizeof(credentials));
|
||||
memset(provider, 0, sizeof(provider));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2013-2015, 2016 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
|
||||
|
@ -29,15 +29,21 @@
|
|||
#ifndef GPS_EXTENDED_C_H
|
||||
#define GPS_EXTENDED_C_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <time.h>
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief C++ declarations for GPS types
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** Location has valid source information. */
|
||||
#define LOCATION_HAS_SOURCE_INFO 0x0020
|
||||
|
@ -68,6 +74,8 @@ extern "C" {
|
|||
#define ULP_LOCATION_IS_FROM_NLP 0x0020
|
||||
/** Position is from PIP */
|
||||
#define ULP_LOCATION_IS_FROM_PIP 0x0040
|
||||
/** Position is from external DR solution*/
|
||||
#define ULP_LOCATION_IS_FROM_EXT_DR 0X0080
|
||||
|
||||
#define ULP_MIN_INTERVAL_INVALID 0xffffffff
|
||||
|
||||
|
@ -82,6 +90,11 @@ enum loc_registration_mask_status {
|
|||
LOC_REGISTRATION_MASK_DISABLED
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
LOC_SUPPORTED_FEATURE_ODCPI_2_V02 = 0, /**< Support ODCPI version 2 feature */
|
||||
LOC_SUPPORTED_FEATURE_WIFI_AP_DATA_INJECT_2_V02 /**< Support Wifi AP data inject version 2 feature */
|
||||
} loc_supported_feature_enum;
|
||||
|
||||
typedef struct {
|
||||
/** set to sizeof(UlpLocation) */
|
||||
size_t size;
|
||||
|
@ -165,14 +178,14 @@ typedef struct {
|
|||
} AGpsExtCallbacks;
|
||||
|
||||
|
||||
typedef void (*loc_ni_notify_callback)(GpsNiNotification *notification, bool esEnalbed);
|
||||
/** GPS NI callback structure. */
|
||||
typedef struct
|
||||
{
|
||||
/**
|
||||
* Sends the notification request from HAL to GPSLocationProvider.
|
||||
*/
|
||||
gps_ni_notify_callback notify_cb;
|
||||
gps_create_thread create_thread_cb;
|
||||
loc_ni_notify_callback notify_cb;
|
||||
} GpsNiExtCallbacks;
|
||||
|
||||
typedef enum loc_server_type {
|
||||
|
@ -195,7 +208,24 @@ typedef enum loc_position_mode_type {
|
|||
|
||||
} LocPositionMode;
|
||||
|
||||
#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */
|
||||
/**
|
||||
* @brief Minimum allowed value for fix interval.
|
||||
*
|
||||
* This value is a sanity limit in GPS framework. The hardware has own internal
|
||||
* limits that may not match this value
|
||||
*
|
||||
* @sa GPS_DEFAULT_FIX_INTERVAL_MS
|
||||
*/
|
||||
|
||||
#define GPS_MIN_POSSIBLE_FIX_INTERVAL_MS 100
|
||||
/**
|
||||
* @brief Default value for fix interval.
|
||||
*
|
||||
* This value is used by default whenever appropriate.
|
||||
*
|
||||
* @sa GPS_MIN_POSSIBLE_FIX_INTERVAL_MS
|
||||
*/
|
||||
#define GPS_DEFAULT_FIX_INTERVAL_MS 1000
|
||||
|
||||
/** Flags to indicate which values are valid in a GpsLocationExtended. */
|
||||
typedef uint16_t GpsLocationExtendedFlags;
|
||||
|
@ -223,6 +253,18 @@ typedef uint16_t GpsLocationExtendedFlags;
|
|||
#define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_MINOR 0x0400
|
||||
/** GpsLocationExtended has valid Elliptical Horizontal Uncertainty Azimuth */
|
||||
#define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_AZIMUTH 0x0800
|
||||
/** GpsLocationExtended has valid gnss sv used in position data */
|
||||
#define GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA 0x1000
|
||||
|
||||
/** GPS PRN Range */
|
||||
#define GPS_SV_PRN_MIN 1
|
||||
#define GPS_SV_PRN_MAX 32
|
||||
#define GLO_SV_PRN_MIN 65
|
||||
#define GLO_SV_PRN_MAX 96
|
||||
#define BDS_SV_PRN_MIN 201
|
||||
#define BDS_SV_PRN_MAX 235
|
||||
#define GAL_SV_PRN_MIN 301
|
||||
#define GAL_SV_PRN_MAX 336
|
||||
|
||||
typedef enum {
|
||||
LOC_RELIABILITY_NOT_SET = 0,
|
||||
|
@ -232,6 +274,20 @@ typedef enum {
|
|||
LOC_RELIABILITY_HIGH = 4
|
||||
}LocReliability;
|
||||
|
||||
typedef struct {
|
||||
struct timespec apTimeStamp;
|
||||
/*boottime received from pps-ktimer*/
|
||||
float apTimeStampUncertaintyMs;
|
||||
/* timestamp uncertainty in milli seconds */
|
||||
}Gnss_ApTimeStampStructType;
|
||||
|
||||
typedef struct {
|
||||
uint64_t gps_sv_used_ids_mask;
|
||||
uint64_t glo_sv_used_ids_mask;
|
||||
uint64_t gal_sv_used_ids_mask;
|
||||
uint64_t bds_sv_used_ids_mask;
|
||||
} GnssSvUsedInPosition;
|
||||
|
||||
/** Represents gps location extended. */
|
||||
typedef struct {
|
||||
/** set to sizeof(GpsLocationExtended) */
|
||||
|
@ -264,49 +320,12 @@ typedef struct {
|
|||
float horUncEllipseSemiMinor;
|
||||
/* Elliptical Horizontal Uncertainty Azimuth */
|
||||
float horUncEllipseOrientAzimuth;
|
||||
|
||||
Gnss_ApTimeStampStructType timeStamp;
|
||||
/** Gnss sv used in position data */
|
||||
GnssSvUsedInPosition gnss_sv_used_ids;
|
||||
} GpsLocationExtended;
|
||||
|
||||
/** Represents SV status. */
|
||||
typedef struct {
|
||||
/** set to sizeof(QcomSvStatus) */
|
||||
size_t size;
|
||||
|
||||
/** Number of SVs currently visible. */
|
||||
int num_svs;
|
||||
|
||||
/** Contains an array of SV information. */
|
||||
GpsSvInfo sv_list[GPS_MAX_SVS];
|
||||
|
||||
/** Represents a bit mask indicating which SVs
|
||||
* have ephemeris data.
|
||||
*/
|
||||
uint32_t ephemeris_mask;
|
||||
|
||||
/** Represents a bit mask indicating which SVs
|
||||
* have almanac data.
|
||||
*/
|
||||
uint32_t almanac_mask;
|
||||
|
||||
/**
|
||||
* Represents a bit mask indicating which GPS SVs
|
||||
* were used for computing the most recent position fix.
|
||||
*/
|
||||
uint32_t gps_used_in_fix_mask;
|
||||
|
||||
/**
|
||||
* Represents a bit mask indicating which GLONASS SVs
|
||||
* were used for computing the most recent position fix.
|
||||
*/
|
||||
uint32_t glo_used_in_fix_mask;
|
||||
|
||||
/**
|
||||
* Represents a bit mask indicating which BDS SVs
|
||||
* were used for computing the most recent position fix.
|
||||
*/
|
||||
uint64_t bds_used_in_fix_mask;
|
||||
|
||||
} QcomSvStatus;
|
||||
|
||||
enum loc_sess_status {
|
||||
LOC_SESS_SUCCESS,
|
||||
LOC_SESS_INTERMEDIATE,
|
||||
|
@ -324,6 +343,34 @@ typedef uint32_t LocPosTechMask;
|
|||
#define LOC_POS_TECH_MASK_AFLT ((LocPosTechMask)0x00000040)
|
||||
#define LOC_POS_TECH_MASK_HYBRID ((LocPosTechMask)0x00000080)
|
||||
|
||||
// Nmea sentence types mask
|
||||
typedef uint32_t NmeaSentenceTypesMask;
|
||||
#define LOC_NMEA_MASK_GGA_V02 ((NmeaSentenceTypesMask)0x00000001) /**< Enable GGA type */
|
||||
#define LOC_NMEA_MASK_RMC_V02 ((NmeaSentenceTypesMask)0x00000002) /**< Enable RMC type */
|
||||
#define LOC_NMEA_MASK_GSV_V02 ((NmeaSentenceTypesMask)0x00000004) /**< Enable GSV type */
|
||||
#define LOC_NMEA_MASK_GSA_V02 ((NmeaSentenceTypesMask)0x00000008) /**< Enable GSA type */
|
||||
#define LOC_NMEA_MASK_VTG_V02 ((NmeaSentenceTypesMask)0x00000010) /**< Enable VTG type */
|
||||
#define LOC_NMEA_MASK_PQXFI_V02 ((NmeaSentenceTypesMask)0x00000020) /**< Enable PQXFI type */
|
||||
#define LOC_NMEA_MASK_PSTIS_V02 ((NmeaSentenceTypesMask)0x00000040) /**< Enable PSTIS type */
|
||||
#define LOC_NMEA_MASK_GLGSV_V02 ((NmeaSentenceTypesMask)0x00000080) /**< Enable GLGSV type */
|
||||
#define LOC_NMEA_MASK_GNGSA_V02 ((NmeaSentenceTypesMask)0x00000100) /**< Enable GNGSA type */
|
||||
#define LOC_NMEA_MASK_GNGNS_V02 ((NmeaSentenceTypesMask)0x00000200) /**< Enable GNGNS type */
|
||||
#define LOC_NMEA_MASK_GARMC_V02 ((NmeaSentenceTypesMask)0x00000400) /**< Enable GARMC type */
|
||||
#define LOC_NMEA_MASK_GAGSV_V02 ((NmeaSentenceTypesMask)0x00000800) /**< Enable GAGSV type */
|
||||
#define LOC_NMEA_MASK_GAGSA_V02 ((NmeaSentenceTypesMask)0x00001000) /**< Enable GAGSA type */
|
||||
#define LOC_NMEA_MASK_GAVTG_V02 ((NmeaSentenceTypesMask)0x00002000) /**< Enable GAVTG type */
|
||||
#define LOC_NMEA_MASK_GAGGA_V02 ((NmeaSentenceTypesMask)0x00004000) /**< Enable GAGGA type */
|
||||
#define LOC_NMEA_MASK_PQGSA_V02 ((NmeaSentenceTypesMask)0x00008000) /**< Enable PQGSA type */
|
||||
#define LOC_NMEA_MASK_PQGSV_V02 ((NmeaSentenceTypesMask)0x00010000) /**< Enable PQGSV type */
|
||||
#define LOC_NMEA_ALL_SUPPORTED_MASK (LOC_NMEA_MASK_GGA_V02 | LOC_NMEA_MASK_RMC_V02 | \
|
||||
LOC_NMEA_MASK_GSV_V02 | LOC_NMEA_MASK_GSA_V02 | LOC_NMEA_MASK_VTG_V02 | \
|
||||
LOC_NMEA_MASK_PQXFI_V02 | LOC_NMEA_MASK_PSTIS_V02 | LOC_NMEA_MASK_GLGSV_V02 | \
|
||||
LOC_NMEA_MASK_GNGSA_V02 | LOC_NMEA_MASK_GNGNS_V02 | LOC_NMEA_MASK_GARMC_V02 | \
|
||||
LOC_NMEA_MASK_GAGSV_V02 | LOC_NMEA_MASK_GAGSA_V02 | LOC_NMEA_MASK_GAVTG_V02 | \
|
||||
LOC_NMEA_MASK_GAGGA_V02 | LOC_NMEA_MASK_PQGSA_V02 | LOC_NMEA_MASK_PQGSV_V02 )
|
||||
|
||||
|
||||
|
||||
typedef enum {
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0,
|
||||
LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM,
|
||||
|
@ -386,6 +433,8 @@ 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_GDT_UPLOAD_BEGIN_REQ, // GDT upload start request
|
||||
LOC_API_ADAPTER_GDT_UPLOAD_END_REQ, // GDT upload end request
|
||||
LOC_API_ADAPTER_GNSS_MEASUREMENT, // GNSS Measurement report
|
||||
|
@ -416,6 +465,8 @@ 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)
|
||||
#define LOC_API_ADAPTER_BIT_GDT_UPLOAD_BEGIN_REQ (1<<LOC_API_ADAPTER_GDT_UPLOAD_BEGIN_REQ)
|
||||
#define LOC_API_ADAPTER_BIT_GDT_UPLOAD_END_REQ (1<<LOC_API_ADAPTER_GDT_UPLOAD_END_REQ)
|
||||
#define LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT (1<<LOC_API_ADAPTER_GNSS_MEASUREMENT)
|
||||
|
@ -443,6 +494,593 @@ typedef uint32_t LOC_GPS_LOCK_MASK;
|
|||
#define isGpsLockMT(lock) ((lock) & ((LOC_GPS_LOCK_MASK)2))
|
||||
#define isGpsLockAll(lock) (((lock) & ((LOC_GPS_LOCK_MASK)3)) == 3)
|
||||
|
||||
/*++ ***********************************************
|
||||
** 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_ENHANCED_IOD,
|
||||
|
||||
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)
|
||||
#define ULP_GNSS_SV_POLY_BIT_ENHANCED_IOD (1<<ULP_GNSS_SV_POLY_ENHANCED_IOD)
|
||||
|
||||
|
||||
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;
|
||||
Gnss_ApTimeStampStructType timeStamp;
|
||||
|
||||
} 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
|
||||
*/
|
||||
|
||||
uint32_t is_valid;
|
||||
|
||||
uint16_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 */
|
||||
uint32_t enhancedIOD; /* Enhanced Reference Time */
|
||||
} GnssSvPolynomial;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
#define LOG_TAG "LocSvc_core_log"
|
||||
|
||||
#include <loc_log.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_core_log.h>
|
||||
#include <platform_lib_includes.h>
|
||||
|
||||
void LocPosMode::logv() const
|
||||
{
|
||||
|
|
|
@ -16,14 +16,11 @@ XTRA_VERSION_CHECK=0
|
|||
# _CLEAR = 0
|
||||
ERR_ESTIMATE=0
|
||||
|
||||
#Test
|
||||
NTP_SERVER=time.gpsonextra.net
|
||||
#Asia
|
||||
# NTP_SERVER=asia.pool.ntp.org
|
||||
#Europe
|
||||
# NTP_SERVER=europe.pool.ntp.org
|
||||
#North America
|
||||
# NTP_SERVER=north-america.pool.ntp.org
|
||||
#NTP server
|
||||
NTP_SERVER=time.izatcloud.net
|
||||
|
||||
#XTRA CA path
|
||||
XTRA_CA_PATH=/system/etc/security/cacerts
|
||||
|
||||
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
|
||||
# 4 - Debug, 5 - Verbose
|
||||
|
@ -49,7 +46,7 @@ SUPL_ES=0
|
|||
#Choose PDN for Emergency SUPL
|
||||
#1 - Use emergency PDN
|
||||
#0 - Use regular SUPL PDN for Emergency SUPL
|
||||
USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
|
||||
USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=0
|
||||
|
||||
#SUPL_MODE is a bit mask set in config.xml per carrier by default.
|
||||
#If it is uncommented here, this value will overwrite the value from
|
||||
|
@ -115,3 +112,72 @@ SGLTE_TARGET=0
|
|||
# 0x2: RRLP UPlane
|
||||
# 0x4: LLP Uplane
|
||||
A_GLONASS_POS_PROTOCOL_SELECT = 0
|
||||
|
||||
##################################################
|
||||
# Select technology for LPPe Control Plane
|
||||
##################################################
|
||||
# 0x1: DBH for LPPe CP
|
||||
# 0x2: WLAN AP Measurements for LPPe CP
|
||||
LPPE_CP_TECHNOLOGY = 0
|
||||
|
||||
##################################################
|
||||
# Select technology for LPPe User Plane
|
||||
##################################################
|
||||
# 0x1: DBH for LPPe UP
|
||||
# 0x2: WLAN AP Measurements for LPPe UP
|
||||
LPPE_UP_TECHNOLOGY = 0
|
||||
|
||||
##################################################
|
||||
# AGPS_CONFIG_INJECT
|
||||
##################################################
|
||||
# enable/disable injection of AGPS configurations:
|
||||
# SUPL_VER
|
||||
# SUPL_HOST
|
||||
# SUPL_PORT
|
||||
# C2K_HOST
|
||||
# C2K_PORT
|
||||
# LPP_PROFILE
|
||||
# A_GLONASS_POS_PROTOCOL_SELECT
|
||||
# 0: disable
|
||||
# 1: enable
|
||||
AGPS_CONFIG_INJECT = 1
|
||||
# AP Coarse Timestamp Uncertainty
|
||||
##################################################
|
||||
# default : 10
|
||||
# or as per clock uncertainty of product
|
||||
AP_TIMESTAMP_UNCERTAINTY = 10
|
||||
|
||||
#####################################
|
||||
# GNSS PPS settings
|
||||
#####################################
|
||||
#AP DR engine availability status
|
||||
# 0 : NO AP DR (default)
|
||||
# 1 : AP DR enabled
|
||||
#EXTERNAL_DR_ENABLED = 0
|
||||
|
||||
#####################################
|
||||
#DR_SYNC Pulse Availability
|
||||
#####################################
|
||||
# 0 : DR_SYNC pulse not available (default)
|
||||
# 1 : DR_SYNC pulse available
|
||||
DR_SYNC_ENABLED = 0
|
||||
|
||||
#####################################
|
||||
#PPS Device name
|
||||
#####################################
|
||||
PPS_DEVICENAME = /dev/pps0
|
||||
|
||||
#####################################
|
||||
#AP Clock Accuracy
|
||||
#####################################
|
||||
AP_CLOCK_PPM = 100
|
||||
|
||||
#####################################
|
||||
#MAX ms difference to detect missing pulse
|
||||
#####################################
|
||||
MISSING_PULSE_TIME_DELTA = 900
|
||||
|
||||
#####################################
|
||||
#Propagation time uncertainty
|
||||
#####################################
|
||||
PROPAGATION_TIME_UNCERTAINTY = 1
|
||||
|
|
10
gps/loc-hal.pc.in
Normal file
10
gps/loc-hal.pc.in
Normal file
|
@ -0,0 +1,10 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: loc-hal
|
||||
Description: QTI GPS Loc HAL
|
||||
Version: @VERSION
|
||||
Libs: -L${libdir} -lgps_utils_so -lloc_core -lloc_eng_so -lgps_default_so -lloc_ds_api -lloc_api_v02
|
||||
Cflags: -I${includedir} -I${includedir}/loc-hal/utils -I${includedir}/loc-hal/core -I${includedir}/loc-hal
|
133
gps/loc_api/Makefile.am
Normal file
133
gps/loc_api/Makefile.am
Normal file
|
@ -0,0 +1,133 @@
|
|||
AM_CFLAGS = \
|
||||
-I./ \
|
||||
-I../core \
|
||||
-I./libloc_api_50001 \
|
||||
-I../utils \
|
||||
$(LOCPLA_CFLAGS) \
|
||||
-fno-short-enums \
|
||||
-D__func__=__PRETTY_FUNCTION__ \
|
||||
-DTARGET_USES_QCOM_BSP
|
||||
|
||||
libloc_eng_so_la_h_sources = \
|
||||
loc_eng_dmn_conn_glue_msg.h \
|
||||
loc_eng_dmn_conn_glue_pipe.h \
|
||||
loc_eng_dmn_conn.h \
|
||||
loc_eng_dmn_conn_handler.h \
|
||||
loc_eng_dmn_conn_thread_helper.h
|
||||
|
||||
libloc_eng_so_la_SOURCES = \
|
||||
libloc_api_50001/loc_eng.cpp \
|
||||
libloc_api_50001/loc_eng_agps.cpp \
|
||||
libloc_api_50001/loc_eng_xtra.cpp \
|
||||
libloc_api_50001/loc_eng_ni.cpp \
|
||||
libloc_api_50001/loc_eng_log.cpp \
|
||||
libloc_api_50001/loc_eng_nmea.cpp \
|
||||
libloc_api_50001/LocEngAdapter.cpp \
|
||||
libloc_api_50001/loc_eng_dmn_conn.cpp \
|
||||
libloc_api_50001/loc_eng_dmn_conn_handler.cpp \
|
||||
libloc_api_50001/loc_eng_dmn_conn_thread_helper.c \
|
||||
libloc_api_50001/loc_eng_dmn_conn_glue_msg.c \
|
||||
libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c
|
||||
|
||||
libloc_eng_so_la_SOURCES += libloc_eng_so_la_h_sources
|
||||
|
||||
if USE_GLIB
|
||||
libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_eng_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_eng_so_la_LIBADD = -lstdc++ -ldl -llog $(LOCPLA_LIBS) ../utils/libgps_utils_so.la ../core/libloc_core.la
|
||||
|
||||
|
||||
libgps_default_so_la_SOURCES = \
|
||||
libloc_api_50001/loc.cpp \
|
||||
libloc_api_50001/gps.c
|
||||
|
||||
if USE_GLIB
|
||||
libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libgps_default_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libgps_default_so_la_LIBADD = -lstdc++ -llog $(LOCPLA_LIBS) ../utils/libgps_utils_so.la ../core/libloc_core.la -ldl libloc_eng_so.la
|
||||
|
||||
|
||||
libloc_ds_api_CFLAGS = \
|
||||
$(QMIF_CFLAGS) \
|
||||
$(QMI_CFLAGS) \
|
||||
$(DATA_CFLAGS) \
|
||||
-I$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api
|
||||
|
||||
libloc_ds_api_la_SOURCES = \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api/ds_client.c
|
||||
|
||||
if USE_GLIB
|
||||
libloc_ds_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_ds_api_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_ds_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_ds_api_la_LDFLAGS += -Wl,--export-dynamic
|
||||
libloc_ds_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_ds_api_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_ds_api_la_CFLAGS = $(AM_CFLAGS) $(libloc_ds_api_CFLAGS)
|
||||
libloc_ds_api_la_LDFLAGS = -lstdc++ -lpthread -Wl,--export-dynamic -shared -version-info 1:0:0
|
||||
libloc_ds_api_la_LDFLAGS += -Wl,--export-dynamic
|
||||
libloc_ds_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) $(libloc_ds_api_CFLAGS)
|
||||
endif
|
||||
|
||||
libloc_ds_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) -lqmiservices -ldsi_netctrl $(LOCPLA_LIBS) ../utils/libgps_utils_so.la
|
||||
#libloc_ds_api_la_LIBADD = -lstdc++ $(QMIF_LIBS) -lqmiservices $(LOCPLA_LIBS) ../utils/libgps_utils_so.la
|
||||
|
||||
libloc_api_v02_CFLAGS = \
|
||||
$(QMIF_CFLAGS) \
|
||||
-I$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api \
|
||||
-I$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02
|
||||
|
||||
libloc_api_v02_la_SOURCES = \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/LocApiV02.cpp \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_log.c \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_client.c \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_sync_req.c \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/location_service_v02.c
|
||||
|
||||
if USE_GLIB
|
||||
libloc_api_v02_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_api_v02_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_api_v02_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_api_v02_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(libloc_api_v02_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_api_v02_la_CFLAGS = $(AM_CFLAGS) $(libloc_api_v02_CFLAGS)
|
||||
libloc_api_v02_la_LDFLAGS = -lstdc++ -lpthread -shared -version-info 1:0:0
|
||||
libloc_api_v02_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) $(libloc_api_v02_CFLAGS)
|
||||
endif
|
||||
|
||||
libloc_api_v02_la_CXXFLAGS = -std=c++0x
|
||||
libloc_api_v02_la_LIBADD = -lstdc++ -lqmi_cci -lqmi_common_so $(QMIF_LIBS) $(LOCPLA_LIBS) ../core/libloc_core.la ../utils/libgps_utils_so.la libloc_ds_api.la
|
||||
|
||||
library_include_HEADERS = \
|
||||
libloc_api_50001/LocEngAdapter.h \
|
||||
libloc_api_50001/loc.h \
|
||||
libloc_api_50001/loc_eng.h \
|
||||
libloc_api_50001/loc_eng_xtra.h \
|
||||
libloc_api_50001/loc_eng_ni.h \
|
||||
libloc_api_50001/loc_eng_agps.h \
|
||||
libloc_api_50001/loc_eng_msg.h \
|
||||
libloc_api_50001/loc_eng_log.h \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/ds_api/ds_client.h \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/location_service_v02.h \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_log.h \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_v02_client.h \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_api_sync_req.h \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/LocApiV02.h \
|
||||
$(WORKSPACE)/qcom-opensource/location/loc_api/loc_api_v02/loc_util_log.h
|
||||
|
||||
library_includedir = $(pkgincludedir)
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_eng_so.la libgps_default_so.la libloc_ds_api.la libloc_api_v02.la
|
|
@ -67,9 +67,11 @@ protected:
|
|||
open(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
||||
virtual enum loc_api_adapter_err
|
||||
close();
|
||||
LocApiRpc(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask);
|
||||
|
||||
public:
|
||||
LocApiRpc(const MsgTask* msgTask,
|
||||
static LocApiRpc* createLocApiRpc(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask);
|
||||
~LocApiRpc();
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include <LocAdapterBase.h>
|
||||
#include <loc_api_fixup.h>
|
||||
#include <loc_api_rpc_glue.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_log.h>
|
||||
#include <loc_api_log.h>
|
||||
#ifdef USE_GLIB
|
||||
|
@ -132,6 +131,17 @@ const rpc_loc_event_mask_type LocApiRpc::locBits[] =
|
|||
RPC_LOC_EVENT_WPS_NEEDED_REQUEST
|
||||
};
|
||||
|
||||
LocApiRpc*
|
||||
LocApiRpc::createLocApiRpc(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase* context)
|
||||
{
|
||||
if (NULL == msgTask) {
|
||||
return NULL;
|
||||
}
|
||||
return new LocApiRpc(msgTask, exMask, context);
|
||||
}
|
||||
|
||||
// constructor
|
||||
LocApiRpc::LocApiRpc(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
|
@ -797,7 +807,7 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re
|
|||
|
||||
void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr)
|
||||
{
|
||||
QcomSvStatus SvStatus = {0};
|
||||
QtiGnssSvStatus SvStatus = {0};
|
||||
GpsLocationExtended locationExtended = {0};
|
||||
locationExtended.size = sizeof(locationExtended);
|
||||
int num_svs_max = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011 The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011, 2014 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
|
||||
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "loc_api_log.h"
|
||||
#include "loc_log.h"
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include "rpc/rpc.h"
|
||||
#include "loc_api_fixup.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2012,2014 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
|
||||
|
@ -62,7 +62,6 @@
|
|||
#endif /* USE_GLIB */
|
||||
|
||||
/* Logging Improvement */
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
/*Maximum number of Modem init*/
|
||||
#define RPC_TRY_NUM 10
|
||||
|
|
|
@ -16,7 +16,8 @@ LOCAL_SHARED_LIBRARIES := \
|
|||
libdl \
|
||||
liblog \
|
||||
libloc_core \
|
||||
libgps.utils
|
||||
libgps.utils \
|
||||
libloc_pla
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
loc_eng.cpp \
|
||||
|
@ -41,8 +42,9 @@ LOCAL_CFLAGS += \
|
|||
LOCAL_C_INCLUDES:= \
|
||||
$(TARGET_OUT_HEADERS)/gps.utils \
|
||||
$(TARGET_OUT_HEADERS)/libloc_core \
|
||||
$(call project-path-for,qcom-gps)/loc_api/libloc_api_50001 \
|
||||
$(TARGET_OUT_HEADERS)/libflp
|
||||
hardware/qcom/gps/loc_api/libloc_api_50001 \
|
||||
$(TARGET_OUT_HEADERS)/libflp \
|
||||
$(TARGET_OUT_HEADERS)/libloc_pla
|
||||
|
||||
LOCAL_COPY_HEADERS_TO:= libloc_eng/
|
||||
LOCAL_COPY_HEADERS:= \
|
||||
|
@ -75,7 +77,8 @@ LOCAL_SHARED_LIBRARIES := \
|
|||
libloc_eng \
|
||||
libloc_core \
|
||||
libgps.utils \
|
||||
libdl
|
||||
libdl \
|
||||
libloc_pla
|
||||
|
||||
ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false)
|
||||
endif
|
||||
|
@ -88,6 +91,10 @@ LOCAL_CFLAGS += \
|
|||
-fno-short-enums \
|
||||
-D_ANDROID_ \
|
||||
|
||||
ifeq ($(TARGET_BUILD_VARIANT),user)
|
||||
LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_USES_QCOM_BSP), true)
|
||||
LOCAL_CFLAGS += -DTARGET_USES_QCOM_BSP
|
||||
endif
|
||||
|
@ -96,7 +103,8 @@ endif
|
|||
LOCAL_C_INCLUDES:= \
|
||||
$(TARGET_OUT_HEADERS)/gps.utils \
|
||||
$(TARGET_OUT_HEADERS)/libloc_core \
|
||||
$(TARGET_OUT_HEADERS)/libflp
|
||||
$(TARGET_OUT_HEADERS)/libflp \
|
||||
$(TARGET_OUT_HEADERS)/libloc_pla
|
||||
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
|
|
|
@ -81,6 +81,7 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
|
|||
{
|
||||
memset(&mFixCriteria, 0, sizeof(mFixCriteria));
|
||||
mFixCriteria.mode = LOC_POSITION_MODE_INVALID;
|
||||
clearGnssSvUsedListData();
|
||||
LOC_LOGD("LocEngAdapter created");
|
||||
}
|
||||
|
||||
|
@ -194,11 +195,9 @@ void LocEngAdapter::setXtraUserAgent() {
|
|||
fclose(file);
|
||||
|
||||
// remove trailing spaces
|
||||
char *s;
|
||||
s = buf + strlen(buf);
|
||||
while (--s >= buf) {
|
||||
if (!isspace(*s)) break;
|
||||
*s = 0;
|
||||
size_t len = strlen(buf);
|
||||
while (--len >= 0 && isspace(buf[len])) {
|
||||
buf[len] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -377,14 +376,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location,
|
|||
}
|
||||
}
|
||||
|
||||
void LocInternalAdapter::reportSv(QcomSvStatus &svStatus,
|
||||
void LocInternalAdapter::reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt){
|
||||
sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus,
|
||||
locationExtended, svExt));
|
||||
}
|
||||
|
||||
void LocEngAdapter::reportSv(QcomSvStatus &svStatus,
|
||||
void LocEngAdapter::reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt)
|
||||
{
|
||||
|
@ -397,6 +396,23 @@ void LocEngAdapter::reportSv(QcomSvStatus &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;
|
||||
|
@ -534,9 +550,8 @@ enum loc_api_adapter_err LocEngAdapter::setTime(GpsUtcTime time,
|
|||
if (mSupportsTimeInjection) {
|
||||
LOC_LOGD("%s:%d]: Injecting time", __func__, __LINE__);
|
||||
result = mLocApi->setTime(time, timeReference, uncertainty);
|
||||
} else {
|
||||
mSupportsTimeInjection = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -566,26 +581,10 @@ enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check)
|
|||
return ret;
|
||||
}
|
||||
|
||||
void LocEngAdapter::reportGpsMeasurementData(GpsData &gpsMeasurementData)
|
||||
void LocEngAdapter::reportGnssMeasurementData(GnssData &gnssMeasurementData)
|
||||
{
|
||||
sendMsg(new LocEngReportGpsMeasurement(mOwner,
|
||||
gpsMeasurementData));
|
||||
}
|
||||
|
||||
/*
|
||||
Update Registration Mask
|
||||
*/
|
||||
void LocEngAdapter::updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event,
|
||||
loc_registration_mask_status isEnabled)
|
||||
{
|
||||
LOC_LOGD("entering %s", __func__);
|
||||
int result = LOC_API_ADAPTER_ERR_FAILURE;
|
||||
result = mLocApi->updateRegistrationMask(event, isEnabled);
|
||||
if (result == LOC_API_ADAPTER_ERR_SUCCESS) {
|
||||
LOC_LOGD("%s] update registration mask succeed.", __func__);
|
||||
} else {
|
||||
LOC_LOGE("%s] update registration mask failed.", __func__);
|
||||
}
|
||||
sendMsg(new LocEngReportGnssMeasurement(mOwner,
|
||||
gnssMeasurementData));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2016, 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
|
||||
|
@ -33,7 +33,6 @@
|
|||
#include <hardware/gps.h>
|
||||
#include <loc.h>
|
||||
#include <loc_eng_log.h>
|
||||
#include <log_util.h>
|
||||
#include <LocAdapterBase.h>
|
||||
#include <LocDualContext.h>
|
||||
#include <UlpProxyBase.h>
|
||||
|
@ -55,7 +54,7 @@ public:
|
|||
void* locationExt,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
virtual void reportSv(QcomSvStatus &svStatus,
|
||||
virtual void reportSv(GnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt);
|
||||
virtual void reportStatus(GpsStatusValue status);
|
||||
|
@ -80,11 +79,14 @@ class LocEngAdapter : public LocAdapterBase {
|
|||
unsigned int mPowerVote;
|
||||
static const unsigned int POWER_VOTE_RIGHT = 0x20;
|
||||
static const unsigned int POWER_VOTE_VALUE = 0x10;
|
||||
|
||||
/** Gnss sv used in position data */
|
||||
GnssSvUsedInPosition mGnssSvIdUsedInPosition;
|
||||
bool mGnssSvIdUsedInPosAvail;
|
||||
public:
|
||||
bool mSupportsAgpsRequests;
|
||||
bool mSupportsPositionInjection;
|
||||
bool mSupportsTimeInjection;
|
||||
GnssSystemInfo mGnssInfo;
|
||||
|
||||
LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
void* owner, ContextBase* context,
|
||||
|
@ -105,8 +107,30 @@ public:
|
|||
inline bool hasCPIExtendedCapabilities() {
|
||||
return mContext->hasCPIExtendedCapabilities();
|
||||
}
|
||||
inline bool hasNativeXtraClient() {
|
||||
return mContext->hasNativeXtraClient();
|
||||
}
|
||||
inline const MsgTask* getMsgTask() { return mMsgTask; }
|
||||
|
||||
inline void clearGnssSvUsedListData() {
|
||||
mGnssSvIdUsedInPosAvail = false;
|
||||
memset(&mGnssSvIdUsedInPosition, 0, sizeof (GnssSvUsedInPosition));
|
||||
}
|
||||
|
||||
inline void setGnssSvUsedListData(GnssSvUsedInPosition gnssSvUsedIds) {
|
||||
mGnssSvIdUsedInPosAvail = true;
|
||||
memcpy(&mGnssSvIdUsedInPosition, &gnssSvUsedIds,
|
||||
sizeof(GnssSvUsedInPosition));
|
||||
}
|
||||
|
||||
inline GnssSvUsedInPosition getGnssSvUsedListData() {
|
||||
return mGnssSvIdUsedInPosition;
|
||||
}
|
||||
|
||||
inline bool isGnssSvIdUsedInPosAvail() {
|
||||
return mGnssSvIdUsedInPosAvail;
|
||||
}
|
||||
|
||||
inline enum loc_api_adapter_err
|
||||
startFix()
|
||||
{
|
||||
|
@ -186,6 +210,11 @@ public:
|
|||
{
|
||||
return mLocApi->setSUPLVersion(version);
|
||||
}
|
||||
inline enum loc_api_adapter_err
|
||||
setNMEATypes (uint32_t typesMask)
|
||||
{
|
||||
return mLocApi->setNMEATypes(typesMask);
|
||||
}
|
||||
inline enum loc_api_adapter_err
|
||||
setLPPConfig(uint32_t profile)
|
||||
{
|
||||
|
@ -221,16 +250,16 @@ public:
|
|||
gyroSamplesPerBatchHigh, gyroBatchesPerSecHigh,
|
||||
algorithmConfig);
|
||||
}
|
||||
inline virtual enum loc_api_adapter_err
|
||||
setExtPowerConfig(int isBatteryCharging)
|
||||
{
|
||||
return mLocApi->setExtPowerConfig(isBatteryCharging);
|
||||
}
|
||||
inline virtual enum loc_api_adapter_err
|
||||
setAGLONASSProtocol(unsigned long aGlonassProtocol)
|
||||
{
|
||||
return mLocApi->setAGLONASSProtocol(aGlonassProtocol);
|
||||
}
|
||||
inline virtual enum loc_api_adapter_err
|
||||
setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP)
|
||||
{
|
||||
return mLocApi->setLPPeProtocol(lppeCP, lppeUP);
|
||||
}
|
||||
inline virtual int initDataServiceClient()
|
||||
{
|
||||
return mLocApi->initDataServiceClient();
|
||||
|
@ -269,9 +298,11 @@ public:
|
|||
void* locationExt,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
virtual void reportSv(QcomSvStatus &svStatus,
|
||||
virtual void reportSv(GnssSvStatus &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,
|
||||
|
@ -284,7 +315,7 @@ public:
|
|||
virtual bool requestSuplES(int connHandle);
|
||||
virtual bool reportDataCallOpened();
|
||||
virtual bool reportDataCallClosed();
|
||||
virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData);
|
||||
virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData);
|
||||
|
||||
inline const LocPosMode& getPositionMode() const
|
||||
{return mFixCriteria;}
|
||||
|
@ -336,12 +367,6 @@ public:
|
|||
return mLocApi->getGpsLock();
|
||||
}
|
||||
|
||||
/*
|
||||
Update Registration Mask
|
||||
*/
|
||||
void updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event,
|
||||
loc_registration_mask_status isEnabled);
|
||||
|
||||
/*
|
||||
Set Gnss Constellation Config
|
||||
*/
|
||||
|
|
|
@ -1,76 +1,78 @@
|
|||
AM_CFLAGS = \
|
||||
-I../../utils \
|
||||
-I../../platform_lib_abstractions \
|
||||
-fno-short-enums \
|
||||
-DFEATURE_GNSS_BIT_API
|
||||
|
||||
libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp
|
||||
|
||||
if USE_GLIB
|
||||
libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_adapter_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_adapter_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la
|
||||
|
||||
|
||||
libloc_eng_so_la_SOURCES = \
|
||||
loc_eng.cpp \
|
||||
loc_eng_agps.cpp \
|
||||
loc_eng_xtra.cpp \
|
||||
loc_eng_ni.cpp \
|
||||
loc_eng_log.cpp \
|
||||
loc_eng_dmn_conn.cpp \
|
||||
loc_eng_dmn_conn_handler.cpp \
|
||||
loc_eng_dmn_conn_thread_helper.c \
|
||||
loc_eng_dmn_conn_glue_msg.c \
|
||||
loc_eng_dmn_conn_glue_pipe.c
|
||||
|
||||
|
||||
if USE_GLIB
|
||||
libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_eng_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la
|
||||
|
||||
|
||||
libgps_default_so_la_SOURCES = \
|
||||
loc.cpp \
|
||||
gps.c
|
||||
|
||||
if USE_GLIB
|
||||
libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libgps_default_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la
|
||||
|
||||
library_include_HEADERS = \
|
||||
LocEngAdapter.h \
|
||||
loc.h \
|
||||
loc_eng.h \
|
||||
loc_eng_xtra.h \
|
||||
loc_eng_ni.h \
|
||||
loc_eng_agps.h \
|
||||
loc_eng_msg.h \
|
||||
loc_eng_log.h
|
||||
|
||||
library_includedir = $(pkgincludedir)/libloc_api_50001
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_adapter_so.la libloc_eng_so.la libgps_default_so.la
|
||||
AM_CFLAGS = \
|
||||
-I../../utils \
|
||||
-I../../platform_lib_abstractions \
|
||||
-I$(WORKSPACE)/gps-noship/flp \
|
||||
-fno-short-enums \
|
||||
-D__func__=__PRETTY_FUNCTION__ \
|
||||
-DFEATURE_GNSS_BIT_API
|
||||
|
||||
libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp
|
||||
|
||||
if USE_GLIB
|
||||
libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_adapter_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_adapter_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la
|
||||
|
||||
|
||||
libloc_eng_so_la_SOURCES = \
|
||||
loc_eng.cpp \
|
||||
loc_eng_agps.cpp \
|
||||
loc_eng_xtra.cpp \
|
||||
loc_eng_ni.cpp \
|
||||
loc_eng_log.cpp \
|
||||
loc_eng_dmn_conn.cpp \
|
||||
loc_eng_dmn_conn_handler.cpp \
|
||||
loc_eng_dmn_conn_thread_helper.c \
|
||||
loc_eng_dmn_conn_glue_msg.c \
|
||||
loc_eng_dmn_conn_glue_pipe.c
|
||||
|
||||
|
||||
if USE_GLIB
|
||||
libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_eng_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la
|
||||
|
||||
|
||||
libgps_default_so_la_SOURCES = \
|
||||
loc.cpp \
|
||||
gps.c
|
||||
|
||||
if USE_GLIB
|
||||
libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libgps_default_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la
|
||||
|
||||
library_include_HEADERS = \
|
||||
LocEngAdapter.h \
|
||||
loc.h \
|
||||
loc_eng.h \
|
||||
loc_eng_xtra.h \
|
||||
loc_eng_ni.h \
|
||||
loc_eng_agps.h \
|
||||
loc_eng_msg.h \
|
||||
loc_eng_log.h
|
||||
|
||||
library_includedir = $(pkgincludedir)/libloc_api_50001
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_adapter_so.la libloc_eng_so.la libgps_default_so.la
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2016, 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,6 +43,7 @@
|
|||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <LocDualContext.h>
|
||||
#include <platform_lib_includes.h>
|
||||
#include <cutils/properties.h>
|
||||
|
||||
using namespace loc_core;
|
||||
|
@ -52,9 +53,15 @@ using namespace loc_core;
|
|||
//Globals defns
|
||||
static gps_location_callback gps_loc_cb = NULL;
|
||||
static gps_sv_status_callback gps_sv_cb = NULL;
|
||||
static gps_ni_notify_callback gps_ni_cb = NULL;
|
||||
|
||||
static void local_loc_cb(UlpLocation* location, void* locExt);
|
||||
static void local_sv_cb(GpsSvStatus* sv_status, void* svExt);
|
||||
static void local_ni_cb(GpsNiNotification *notification, bool esEnalbed);
|
||||
|
||||
GpsNiExtCallbacks sGpsNiExtCallbacks = {
|
||||
local_ni_cb
|
||||
};
|
||||
|
||||
static const GpsGeofencingInterface* get_geofence_interface(void);
|
||||
|
||||
|
@ -192,17 +199,18 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
const GpsInterface* gps_get_hardware_interface ()
|
||||
extern "C" const GpsInterface* gps_get_hardware_interface ()
|
||||
{
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
const GpsInterface* ret_val;
|
||||
|
||||
char propBuf[PROPERTY_VALUE_MAX];
|
||||
memset(propBuf, 0, sizeof(propBuf));
|
||||
|
||||
loc_eng_read_config();
|
||||
|
||||
// check to see if GPS should be disabled
|
||||
property_get("gps.disable", propBuf, "");
|
||||
platform_lib_abstraction_property_get("gps.disable", propBuf, "");
|
||||
if (propBuf[0] == '1')
|
||||
{
|
||||
LOC_LOGD("gps_get_interface returning NULL because gps.disable=1\n");
|
||||
|
@ -275,6 +283,7 @@ SIDE EFFECTS
|
|||
static int loc_init(GpsCallbacks* callbacks)
|
||||
{
|
||||
int retVal = -1;
|
||||
unsigned int target = (unsigned int) -1;
|
||||
ENTRY_LOG();
|
||||
LOC_API_ADAPTER_EVENT_MASK_T event;
|
||||
|
||||
|
@ -285,6 +294,7 @@ static int loc_init(GpsCallbacks* callbacks)
|
|||
}
|
||||
|
||||
event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT |
|
||||
LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT |
|
||||
LOC_API_ADAPTER_BIT_SATELLITE_REPORT |
|
||||
LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST |
|
||||
LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST |
|
||||
|
@ -293,6 +303,17 @@ 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();
|
||||
|
||||
/* If platform is "auto" and external dr enabled then enable
|
||||
** Measurement report and SV Polynomial report
|
||||
*/
|
||||
if((1 == gps_conf.EXTERNAL_DR_ENABLED))
|
||||
{
|
||||
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 */
|
||||
|
@ -304,6 +325,8 @@ static int loc_init(GpsCallbacks* callbacks)
|
|||
NULL, /* location_ext_parser */
|
||||
NULL, /* sv_ext_parser */
|
||||
callbacks->request_utc_time_cb, /* request_utc_time_cb */
|
||||
callbacks->set_system_info_cb, /* set_system_info_cb */
|
||||
callbacks->gnss_sv_status_cb, /* gnss_sv_status_cb */
|
||||
};
|
||||
|
||||
gps_loc_cb = callbacks->location_cb;
|
||||
|
@ -312,9 +335,10 @@ static int loc_init(GpsCallbacks* callbacks)
|
|||
retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL);
|
||||
loc_afw_data.adapter->mSupportsAgpsRequests = !loc_afw_data.adapter->hasAgpsExtendedCapabilities();
|
||||
loc_afw_data.adapter->mSupportsPositionInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities();
|
||||
loc_afw_data.adapter->mSupportsTimeInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities();
|
||||
loc_afw_data.adapter->mSupportsTimeInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities()
|
||||
&& !loc_afw_data.adapter->hasNativeXtraClient();
|
||||
loc_afw_data.adapter->setGpsLockMsg(0);
|
||||
loc_afw_data.adapter->requestUlp(getCarrierCapabilities());
|
||||
loc_afw_data.adapter->requestUlp(ContextBase::getCarrierCapabilities());
|
||||
loc_afw_data.adapter->setXtraUserAgent();
|
||||
|
||||
if(retVal) {
|
||||
|
@ -450,8 +474,12 @@ static int loc_set_position_mode(GpsPositionMode mode,
|
|||
break;
|
||||
}
|
||||
|
||||
// set position sharing option to true
|
||||
bool sharePosition = true;
|
||||
|
||||
LocPosMode params(locMode, recurrence, min_interval,
|
||||
preferred_accuracy, preferred_time, NULL, NULL);
|
||||
preferred_accuracy, preferred_time,
|
||||
sharePosition, NULL, NULL);
|
||||
ret_val = loc_eng_set_position_mode(loc_afw_data, params);
|
||||
|
||||
EXIT_LOG(%d, ret_val);
|
||||
|
@ -538,6 +566,7 @@ SIDE EFFECTS
|
|||
static void loc_delete_aiding_data(GpsAidingData f)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
|
||||
loc_eng_delete_aiding_data(loc_afw_data, f);
|
||||
|
||||
EXIT_LOG(%s, VOID_RET);
|
||||
|
@ -565,10 +594,14 @@ 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;
|
||||
}
|
||||
}
|
||||
if (NULL == get_gps_geofence_interface) {
|
||||
LOC_LOGE ("%s, get_gps_geofence_interface is NULL\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
geofence_interface = get_gps_geofence_interface();
|
||||
|
||||
|
@ -613,7 +646,7 @@ const void* loc_get_extension(const char* name)
|
|||
else if (strcmp(name, AGPS_RIL_INTERFACE) == 0)
|
||||
{
|
||||
char baseband[PROPERTY_VALUE_MAX];
|
||||
property_get("ro.baseband", baseband, "msm");
|
||||
platform_lib_abstraction_property_get("ro.baseband", baseband, "msm");
|
||||
if (strcmp(baseband, "csfb") == 0)
|
||||
{
|
||||
ret_val = &sLocEngAGpsRilInterface;
|
||||
|
@ -730,7 +763,7 @@ static int loc_agps_open_with_apniptype(const char* apn, ApnIpType apnIpType)
|
|||
bearerType = AGPS_APN_BEARER_IPV4V6;
|
||||
break;
|
||||
default:
|
||||
bearerType = AGPS_APN_BEARER_INVALID;
|
||||
bearerType = AGPS_APN_BEARER_IPV4;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -960,7 +993,8 @@ SIDE EFFECTS
|
|||
void loc_ni_init(GpsNiCallbacks *callbacks)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
loc_eng_ni_init(loc_afw_data,(GpsNiExtCallbacks*) callbacks);
|
||||
gps_ni_cb = callbacks->notify_cb;
|
||||
loc_eng_ni_init(loc_afw_data, &sGpsNiExtCallbacks);
|
||||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
|
@ -1075,3 +1109,10 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt)
|
|||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
static void local_ni_cb(GpsNiNotification *notification, bool esEnalbed)
|
||||
{
|
||||
if (NULL != gps_ni_cb) {
|
||||
gps_ni_cb(notification);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ extern "C" {
|
|||
#endif /* __cplusplus */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <cutils/properties.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <gps_extended.h>
|
||||
|
||||
|
@ -57,6 +56,8 @@ typedef struct {
|
|||
loc_ext_parser location_ext_parser;
|
||||
loc_ext_parser sv_ext_parser;
|
||||
gps_request_utc_time request_utc_time_cb;
|
||||
gnss_set_system_info set_system_info_cb;
|
||||
gnss_sv_status_callback gnss_sv_status_cb;
|
||||
} LocCallbacks;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2009-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2009-2016, 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
|
||||
|
@ -47,19 +47,8 @@
|
|||
#include <new>
|
||||
#include <LocEngAdapter.h>
|
||||
|
||||
#include <cutils/sched_policy.h>
|
||||
#ifndef USE_GLIB
|
||||
#include <utils/SystemClock.h>
|
||||
#include <utils/Log.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <glib.h>
|
||||
#include <sys/syscall.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <loc_eng.h>
|
||||
#include <loc_eng_ni.h>
|
||||
#include <loc_eng_dmn_conn.h>
|
||||
|
@ -68,8 +57,7 @@
|
|||
#include <loc_eng_nmea.h>
|
||||
#include <msg_q.h>
|
||||
#include <loc.h>
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
#include "loc_core_log.h"
|
||||
#include "loc_eng_log.h"
|
||||
|
||||
|
@ -90,8 +78,6 @@ using namespace loc_core;
|
|||
|
||||
boolean configAlreadyRead = false;
|
||||
unsigned int agpsStatus = 0;
|
||||
loc_gps_cfg_s_type gps_conf;
|
||||
loc_sap_cfg_s_type sap_conf;
|
||||
|
||||
/* Parameter spec table */
|
||||
static const loc_param_s_type gps_conf_table[] =
|
||||
|
@ -100,8 +86,11 @@ static const loc_param_s_type gps_conf_table[] =
|
|||
{"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'},
|
||||
{"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'},
|
||||
{"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
|
||||
{"LPPE_CP_TECHNOLOGY", &gps_conf.LPPE_CP_TECHNOLOGY, NULL, 'n'},
|
||||
{"LPPE_UP_TECHNOLOGY", &gps_conf.LPPE_UP_TECHNOLOGY, NULL, 'n'},
|
||||
{"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'},
|
||||
{"SUPL_MODE", &gps_conf.SUPL_MODE, NULL, 'n'},
|
||||
{"SUPL_ES", &gps_conf.SUPL_ES, NULL, 'n'},
|
||||
{"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'},
|
||||
{"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'},
|
||||
{"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'},
|
||||
|
@ -111,6 +100,8 @@ static const loc_param_s_type gps_conf_table[] =
|
|||
{"XTRA_SERVER_2", &gps_conf.XTRA_SERVER_2, NULL, 's'},
|
||||
{"XTRA_SERVER_3", &gps_conf.XTRA_SERVER_3, NULL, 's'},
|
||||
{"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'},
|
||||
{"AGPS_CONFIG_INJECT", &gps_conf.AGPS_CONFIG_INJECT, NULL, 'n'},
|
||||
{"EXTERNAL_DR_ENABLED", &gps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'},
|
||||
};
|
||||
|
||||
static const loc_param_s_type sap_conf_table[] =
|
||||
|
@ -143,6 +134,7 @@ static void loc_default_parameters(void)
|
|||
gps_conf.GPS_LOCK = 0;
|
||||
gps_conf.SUPL_VER = 0x10000;
|
||||
gps_conf.SUPL_MODE = 0x3;
|
||||
gps_conf.SUPL_ES = 0;
|
||||
gps_conf.CAPABILITIES = 0x7;
|
||||
/* LTE Positioning Profile configuration is disable by default*/
|
||||
gps_conf.LPP_PROFILE = 0;
|
||||
|
@ -152,6 +144,10 @@ static void loc_default_parameters(void)
|
|||
gps_conf.XTRA_VERSION_CHECK=0;
|
||||
/*Use emergency PDN by default*/
|
||||
gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1;
|
||||
/* By default no LPPe CP technology is enabled*/
|
||||
gps_conf.LPPE_CP_TECHNOLOGY = 0;
|
||||
/* By default no LPPe UP technology is enabled*/
|
||||
gps_conf.LPPE_UP_TECHNOLOGY = 0;
|
||||
|
||||
/*Defaults for sap.conf*/
|
||||
sap_conf.GYRO_BIAS_RANDOM_WALK = 0;
|
||||
|
@ -182,6 +178,9 @@ static void loc_default_parameters(void)
|
|||
|
||||
/* None of the 10 slots for agps certificates are writable by default */
|
||||
gps_conf.AGPS_CERT_WRITABLE_MASK = 0;
|
||||
|
||||
/* inject supl config to modem with config values from config.xml or gps.conf, default 1 */
|
||||
gps_conf.AGPS_CONFIG_INJECT = 1;
|
||||
}
|
||||
|
||||
// 2nd half of init(), singled out for
|
||||
|
@ -208,6 +207,7 @@ static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data);
|
|||
static void deleteAidingData(loc_eng_data_s_type &logEng);
|
||||
static AgpsStateMachine*
|
||||
getAgpsStateMachine(loc_eng_data_s_type& logEng, AGpsExtType agpsType);
|
||||
static void createAgnssNifs(loc_eng_data_s_type& locEng);
|
||||
static int dataCallCb(void *cb_data);
|
||||
static void update_aiding_data_for_deletion(loc_eng_data_s_type& loc_eng_data) {
|
||||
if (loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON &&
|
||||
|
@ -290,6 +290,7 @@ LocEngStopFix::LocEngStopFix(LocEngAdapter* adapter) :
|
|||
inline void LocEngStopFix::proc() const
|
||||
{
|
||||
loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner();
|
||||
mAdapter->clearGnssSvUsedListData();
|
||||
loc_eng_stop_handler(*locEng);
|
||||
}
|
||||
inline void LocEngStopFix::locallog() const
|
||||
|
@ -408,7 +409,9 @@ struct LocEngSetServerIpv4 : public LocMsg {
|
|||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mAdapter->setServer(mNlAddr, mPort, mServerType);
|
||||
if (gps_conf.AGPS_CONFIG_INJECT) {
|
||||
mAdapter->setServer(mNlAddr, mPort, mServerType);
|
||||
}
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("LocEngSetServerIpv4 - addr: %x, port: %d, type: %s",
|
||||
|
@ -439,7 +442,9 @@ struct LocEngSetServerUrl : public LocMsg {
|
|||
delete[] mUrl;
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mAdapter->setServer(mUrl, mLen);
|
||||
if (gps_conf.AGPS_CONFIG_INJECT) {
|
||||
mAdapter->setServer(mUrl, mLen);
|
||||
}
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("LocEngSetServerUrl - url: %s", mUrl);
|
||||
|
@ -460,7 +465,9 @@ struct LocEngAGlonassProtocol : public LocMsg {
|
|||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mAdapter->setAGLONASSProtocol(mAGlonassProtocl);
|
||||
if (gps_conf.AGPS_CONFIG_INJECT) {
|
||||
mAdapter->setAGLONASSProtocol(mAGlonassProtocl);
|
||||
}
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl);
|
||||
|
@ -470,6 +477,29 @@ struct LocEngAGlonassProtocol : public LocMsg {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
struct LocEngLPPeProtocol : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
const unsigned long mLPPeCP;
|
||||
const unsigned long mLPPeUP;
|
||||
inline LocEngLPPeProtocol(LocEngAdapter* adapter,
|
||||
unsigned long lppeCP, unsigned long lppeUP) :
|
||||
LocMsg(), mAdapter(adapter), mLPPeCP(lppeCP), mLPPeUP(lppeUP)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mAdapter->setLPPeProtocol(mLPPeCP, mLPPeUP);
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("LPPe CP: 0x%lx LPPe UP: 0x%1x", mLPPeCP, mLPPeUP);
|
||||
}
|
||||
inline virtual void log() const {
|
||||
locallog();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// case LOC_ENG_MSG_SUPL_VERSION:
|
||||
struct LocEngSuplVer : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
|
@ -481,7 +511,9 @@ struct LocEngSuplVer : public LocMsg {
|
|||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mAdapter->setSUPLVersion(mSuplVer);
|
||||
if (gps_conf.AGPS_CONFIG_INJECT) {
|
||||
mAdapter->setSUPLVersion(mSuplVer);
|
||||
}
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("SUPL Version: %d", mSuplVer);
|
||||
|
@ -492,15 +524,15 @@ struct LocEngSuplVer : public LocMsg {
|
|||
};
|
||||
|
||||
struct LocEngSuplMode : public LocMsg {
|
||||
UlpProxyBase* mUlp;
|
||||
LocEngAdapter* mAdapter;
|
||||
|
||||
inline LocEngSuplMode(UlpProxyBase* ulp) :
|
||||
LocMsg(), mUlp(ulp)
|
||||
inline LocEngSuplMode(LocEngAdapter* adapter) :
|
||||
LocMsg(), mAdapter(adapter)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mUlp->setCapabilities(getCarrierCapabilities());
|
||||
mAdapter->getUlpProxy()->setCapabilities(ContextBase::getCarrierCapabilities());
|
||||
}
|
||||
inline void locallog() const {
|
||||
}
|
||||
|
@ -509,6 +541,31 @@ struct LocEngSuplMode : public LocMsg {
|
|||
}
|
||||
};
|
||||
|
||||
// case LOC_ENG_MSG_SET_NMEA_TYPE:
|
||||
struct LocEngSetNmeaTypes : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
uint32_t nmeaTypesMask;
|
||||
inline LocEngSetNmeaTypes(LocEngAdapter* adapter,
|
||||
uint32_t typesMask) :
|
||||
LocMsg(), mAdapter(adapter), nmeaTypesMask(typesMask)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
// set the nmea types
|
||||
mAdapter->setNMEATypes(nmeaTypesMask);
|
||||
}
|
||||
inline void locallog() const
|
||||
{
|
||||
LOC_LOGV("LocEngSetNmeaTypes %u\n",nmeaTypesMask);
|
||||
}
|
||||
inline virtual void log() const
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// case LOC_ENG_MSG_LPP_CONFIG:
|
||||
struct LocEngLppConfig : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
|
@ -520,7 +577,9 @@ struct LocEngLppConfig : public LocMsg {
|
|||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mAdapter->setLPPConfig(mLppConfig);
|
||||
if (gps_conf.AGPS_CONFIG_INJECT) {
|
||||
mAdapter->setLPPConfig(mLppConfig);
|
||||
}
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("LocEngLppConfig - profile: %d", mLppConfig);
|
||||
|
@ -699,29 +758,6 @@ struct LocEngSensorPerfControlConfig : public LocMsg {
|
|||
}
|
||||
};
|
||||
|
||||
// case LOC_ENG_MSG_EXT_POWER_CONFIG:
|
||||
struct LocEngExtPowerConfig : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
const int mIsBatteryCharging;
|
||||
inline LocEngExtPowerConfig(LocEngAdapter* adapter,
|
||||
int isBatteryCharging) :
|
||||
LocMsg(), mAdapter(adapter),
|
||||
mIsBatteryCharging(isBatteryCharging)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mAdapter->setExtPowerConfig(mIsBatteryCharging);
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("LocEngExtPowerConfig - isBatteryCharging: %d",
|
||||
mIsBatteryCharging);
|
||||
}
|
||||
inline virtual void log() const {
|
||||
locallog();
|
||||
}
|
||||
};
|
||||
|
||||
// case LOC_ENG_MSG_REPORT_POSITION:
|
||||
LocEngReportPosition::LocEngReportPosition(LocAdapterBase* adapter,
|
||||
UlpLocation &loc,
|
||||
|
@ -771,6 +807,10 @@ void LocEngReportPosition::proc() const {
|
|||
(gps_conf.ACCURACY_THRES != 0) &&
|
||||
(mLocation.gpsLocation.accuracy >
|
||||
gps_conf.ACCURACY_THRES)))) {
|
||||
if (mLocationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA)
|
||||
{
|
||||
adapter->setGnssSvUsedListData(mLocationExtended.gnss_sv_used_ids);
|
||||
}
|
||||
locEng->location_cb((UlpLocation*)&(mLocation),
|
||||
(void*)mLocationExt);
|
||||
reported = true;
|
||||
|
@ -828,7 +868,7 @@ void LocEngReportPosition::send() const {
|
|||
|
||||
// case LOC_ENG_MSG_REPORT_SV:
|
||||
LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter,
|
||||
QcomSvStatus &sv,
|
||||
GnssSvStatus &sv,
|
||||
GpsLocationExtended &locExtended,
|
||||
void* svExt) :
|
||||
LocMsg(), mAdapter(adapter), mSvStatus(sv),
|
||||
|
@ -845,14 +885,57 @@ void LocEngReportSv::proc() const {
|
|||
|
||||
if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION)
|
||||
{
|
||||
if (locEng->sv_status_cb != NULL) {
|
||||
locEng->sv_status_cb((GpsSvStatus*)&(mSvStatus),
|
||||
(void*)mSvExt);
|
||||
GnssSvStatus gnssSvStatus;
|
||||
memcpy(&gnssSvStatus,&mSvStatus,sizeof(GnssSvStatus));
|
||||
if (adapter->isGnssSvIdUsedInPosAvail())
|
||||
{
|
||||
GnssSvUsedInPosition gnssSvIdUsedInPosition =
|
||||
adapter->getGnssSvUsedListData();
|
||||
int numSv = gnssSvStatus.num_svs;
|
||||
int16_t gnssSvId = 0;
|
||||
uint64_t svUsedIdMask = 0;
|
||||
for (int i=0; i < numSv; i++)
|
||||
{
|
||||
gnssSvId = gnssSvStatus.gnss_sv_list[i].svid;
|
||||
switch(gnssSvStatus.gnss_sv_list[i].constellation) {
|
||||
case GNSS_CONSTELLATION_GPS:
|
||||
svUsedIdMask = gnssSvIdUsedInPosition.gps_sv_used_ids_mask;
|
||||
break;
|
||||
case GNSS_CONSTELLATION_GLONASS:
|
||||
svUsedIdMask = gnssSvIdUsedInPosition.glo_sv_used_ids_mask;
|
||||
break;
|
||||
case GNSS_CONSTELLATION_BEIDOU:
|
||||
svUsedIdMask = gnssSvIdUsedInPosition.bds_sv_used_ids_mask;
|
||||
break;
|
||||
case GNSS_CONSTELLATION_GALILEO:
|
||||
svUsedIdMask = gnssSvIdUsedInPosition.gal_sv_used_ids_mask;
|
||||
break;
|
||||
default:
|
||||
svUsedIdMask = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
// If SV ID was used in previous position fix, then set USED_IN_FIX
|
||||
// flag, else clear the USED_IN_FIX flag.
|
||||
if (svUsedIdMask & (1 << (gnssSvId - 1)))
|
||||
{
|
||||
gnssSvStatus.gnss_sv_list[i].flags |= GNSS_SV_FLAGS_USED_IN_FIX;
|
||||
}
|
||||
else
|
||||
{
|
||||
gnssSvStatus.gnss_sv_list[i].flags &= ~GNSS_SV_FLAGS_USED_IN_FIX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (locEng->gnss_sv_status_cb != NULL) {
|
||||
LOC_LOGE("Calling gnss_sv_status_cb");
|
||||
locEng->gnss_sv_status_cb((GnssSvStatus*)&(gnssSvStatus));
|
||||
}
|
||||
|
||||
if (locEng->generateNmea)
|
||||
{
|
||||
loc_eng_nmea_generate_sv(locEng, mSvStatus, mLocationExtended);
|
||||
loc_eng_nmea_generate_sv(locEng, gnssSvStatus, mLocationExtended);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1089,7 +1172,7 @@ LocEngRequestSuplEs::LocEngRequestSuplEs(void* locEng, int id) :
|
|||
}
|
||||
void LocEngRequestSuplEs::proc() const {
|
||||
loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
|
||||
if (locEng->ds_nif) {
|
||||
if (locEng->ds_nif && gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) {
|
||||
AgpsStateMachine* sm = locEng->ds_nif;
|
||||
DSSubscriber s(sm, mID);
|
||||
sm->subscribeRsrc((Subscriber*)&s);
|
||||
|
@ -1213,16 +1296,7 @@ LocEngReqRelWifi::~LocEngReqRelWifi() {
|
|||
}
|
||||
void LocEngReqRelWifi::proc() const {
|
||||
loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
|
||||
if (locEng->wifi_nif) {
|
||||
WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId);
|
||||
if (mIsReq) {
|
||||
locEng->wifi_nif->subscribeRsrc((Subscriber*)&s);
|
||||
} else {
|
||||
locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s);
|
||||
}
|
||||
} else {
|
||||
locEng->adapter->atlOpenStatus(mSenderId, 0, NULL, -1, mType);
|
||||
}
|
||||
locEng->adapter->atlOpenStatus(mSenderId, 0, NULL, -1, mType);
|
||||
}
|
||||
inline void LocEngReqRelWifi::locallog() const {
|
||||
LOC_LOGV("%s - senderId: %d, ssid: %s, password: %s",
|
||||
|
@ -1376,6 +1450,32 @@ struct LocEngSetCapabilities : public LocMsg {
|
|||
}
|
||||
};
|
||||
|
||||
struct LocEngSetSystemInfo : public LocMsg {
|
||||
loc_eng_data_s_type* mLocEng;
|
||||
inline LocEngSetSystemInfo(loc_eng_data_s_type* locEng) :
|
||||
LocMsg(), mLocEng(locEng)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
if (NULL != mLocEng->set_system_info_cb) {
|
||||
LOC_LOGV("calling set_system_info_cb 0x%x",
|
||||
mLocEng->adapter->mGnssInfo.year_of_hw);
|
||||
mLocEng->set_system_info_cb(&(mLocEng->adapter->mGnssInfo));
|
||||
}
|
||||
else {
|
||||
LOC_LOGV("set_system_info_cb is NULL.\n");
|
||||
}
|
||||
}
|
||||
inline void locallog() const
|
||||
{
|
||||
LOC_LOGV("LocEngSetSystemInfo");
|
||||
}
|
||||
inline virtual void log() const
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
};
|
||||
// case LOC_ENG_MSG_LOC_INIT:
|
||||
struct LocEngInit : public LocMsg {
|
||||
loc_eng_data_s_type* mLocEng;
|
||||
|
@ -1388,6 +1488,7 @@ struct LocEngInit : public LocMsg {
|
|||
loc_eng_reinit(*mLocEng);
|
||||
// set the capabilities
|
||||
mLocEng->adapter->sendMsg(new LocEngSetCapabilities(mLocEng));
|
||||
mLocEng->adapter->sendMsg(new LocEngSetSystemInfo(mLocEng));
|
||||
}
|
||||
inline void locallog() const
|
||||
{
|
||||
|
@ -1404,16 +1505,18 @@ struct LocEngInit : public LocMsg {
|
|||
|
||||
// case LOC_ENG_MSG_ATL_OPEN_SUCCESS:
|
||||
struct LocEngAtlOpenSuccess : public LocMsg {
|
||||
AgpsStateMachine* mStateMachine;
|
||||
loc_eng_data_s_type* mLocEng;
|
||||
const AGpsExtType mAgpsType;
|
||||
const int mLen;
|
||||
char* mAPN;
|
||||
const AGpsBearerType mBearerType;
|
||||
inline LocEngAtlOpenSuccess(AgpsStateMachine* statemachine,
|
||||
inline LocEngAtlOpenSuccess(loc_eng_data_s_type* locEng,
|
||||
const AGpsExtType agpsType,
|
||||
const char* name,
|
||||
int len,
|
||||
AGpsBearerType btype) :
|
||||
LocMsg(),
|
||||
mStateMachine(statemachine), mLen(len),
|
||||
mLocEng(locEng), mAgpsType(agpsType), mLen(len),
|
||||
mAPN(new char[len+1]), mBearerType(btype)
|
||||
{
|
||||
memcpy((void*)mAPN, (void*)name, len);
|
||||
|
@ -1425,14 +1528,15 @@ struct LocEngAtlOpenSuccess : public LocMsg {
|
|||
delete[] mAPN;
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mStateMachine->setBearer(mBearerType);
|
||||
mStateMachine->setAPN(mAPN, mLen);
|
||||
mStateMachine->onRsrcEvent(RSRC_GRANTED);
|
||||
AgpsStateMachine* sm = getAgpsStateMachine(*mLocEng, mAgpsType);
|
||||
sm->setBearer(mBearerType);
|
||||
sm->setAPN(mAPN, mLen);
|
||||
sm->onRsrcEvent(RSRC_GRANTED);
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("LocEngAtlOpenSuccess agps type: %s\n apn: %s\n"
|
||||
" bearer type: %s",
|
||||
loc_get_agps_type_name(mStateMachine->getType()),
|
||||
loc_get_agps_type_name(mAgpsType),
|
||||
mAPN,
|
||||
loc_get_agps_bear_name(mBearerType));
|
||||
}
|
||||
|
@ -1443,13 +1547,16 @@ struct LocEngAtlOpenSuccess : public LocMsg {
|
|||
|
||||
// case LOC_ENG_MSG_ATL_CLOSED:
|
||||
struct LocEngAtlClosed : public LocMsg {
|
||||
AgpsStateMachine* mStateMachine;
|
||||
inline LocEngAtlClosed(AgpsStateMachine* statemachine) :
|
||||
LocMsg(), mStateMachine(statemachine) {
|
||||
loc_eng_data_s_type* mLocEng;
|
||||
const AGpsExtType mAgpsType;
|
||||
inline LocEngAtlClosed(loc_eng_data_s_type* locEng,
|
||||
const AGpsExtType agpsType) :
|
||||
LocMsg(), mLocEng(locEng), mAgpsType(agpsType) {
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mStateMachine->onRsrcEvent(RSRC_RELEASED);
|
||||
AgpsStateMachine* sm = getAgpsStateMachine(*mLocEng, mAgpsType);
|
||||
sm->onRsrcEvent(RSRC_RELEASED);
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("LocEngAtlClosed");
|
||||
|
@ -1461,13 +1568,16 @@ struct LocEngAtlClosed : public LocMsg {
|
|||
|
||||
// case LOC_ENG_MSG_ATL_OPEN_FAILED:
|
||||
struct LocEngAtlOpenFailed : public LocMsg {
|
||||
AgpsStateMachine* mStateMachine;
|
||||
inline LocEngAtlOpenFailed(AgpsStateMachine* statemachine) :
|
||||
LocMsg(), mStateMachine(statemachine) {
|
||||
loc_eng_data_s_type* mLocEng;
|
||||
const AGpsExtType mAgpsType;
|
||||
inline LocEngAtlOpenFailed(loc_eng_data_s_type* locEng,
|
||||
const AGpsExtType agpsType) :
|
||||
LocMsg(), mLocEng(locEng), mAgpsType(agpsType) {
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mStateMachine->onRsrcEvent(RSRC_DENIED);
|
||||
AgpsStateMachine* sm = getAgpsStateMachine(*mLocEng, mAgpsType);
|
||||
sm->onRsrcEvent(RSRC_DENIED);
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("LocEngAtlOpenFailed");
|
||||
|
@ -1509,22 +1619,17 @@ inline void LocEngUp::log() const {
|
|||
locallog();
|
||||
}
|
||||
|
||||
struct LocEngDataClientInit : public LocMsg {
|
||||
struct LocEngAgnssNifInit : public LocMsg {
|
||||
loc_eng_data_s_type* mLocEng;
|
||||
inline LocEngDataClientInit(loc_eng_data_s_type* locEng) :
|
||||
inline LocEngAgnssNifInit(loc_eng_data_s_type* locEng) :
|
||||
LocMsg(), mLocEng(locEng) {
|
||||
locallog();
|
||||
}
|
||||
virtual void proc() const {
|
||||
loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng;
|
||||
if(!locEng->adapter->initDataServiceClient()) {
|
||||
locEng->ds_nif = new DSStateMachine(servicerTypeExt,
|
||||
(void *)dataCallCb,
|
||||
locEng->adapter);
|
||||
}
|
||||
createAgnssNifs(*mLocEng);
|
||||
}
|
||||
void locallog() const {
|
||||
LOC_LOGV("LocEngDataClientInit\n");
|
||||
LOC_LOGV("LocEngAgnssNifInit\n");
|
||||
}
|
||||
virtual void log() const {
|
||||
locallog();
|
||||
|
@ -1577,29 +1682,6 @@ struct LocEngInstallAGpsCert : public LocMsg {
|
|||
}
|
||||
};
|
||||
|
||||
struct LocEngUpdateRegistrationMask : public LocMsg {
|
||||
loc_eng_data_s_type* mLocEng;
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mMask;
|
||||
loc_registration_mask_status mIsEnabled;
|
||||
inline LocEngUpdateRegistrationMask(loc_eng_data_s_type* locEng,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
loc_registration_mask_status isEnabled) :
|
||||
LocMsg(), mLocEng(locEng), mMask(mask), mIsEnabled(isEnabled) {
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng;
|
||||
locEng->adapter->updateRegistrationMask(mMask,
|
||||
mIsEnabled);
|
||||
}
|
||||
void locallog() const {
|
||||
LOC_LOGV("LocEngUpdateRegistrationMask\n");
|
||||
}
|
||||
virtual void log() const {
|
||||
locallog();
|
||||
}
|
||||
};
|
||||
|
||||
struct LocEngGnssConstellationConfig : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
inline LocEngGnssConstellationConfig(LocEngAdapter* adapter) :
|
||||
|
@ -1607,10 +1689,13 @@ struct LocEngGnssConstellationConfig : public LocMsg {
|
|||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mAdapter->mGnssInfo.size = sizeof(GnssSystemInfo);
|
||||
if (mAdapter->gnssConstellationConfig()) {
|
||||
LOC_LOGV("Modem supports GNSS measurements\n");
|
||||
gps_conf.CAPABILITIES |= GPS_CAPABILITY_MEASUREMENTS;
|
||||
mAdapter->mGnssInfo.year_of_hw = 2016;
|
||||
} else {
|
||||
mAdapter->mGnssInfo.year_of_hw = 2015;
|
||||
LOC_LOGV("Modem does not support GNSS measurements\n");
|
||||
}
|
||||
}
|
||||
|
@ -1623,50 +1708,59 @@ struct LocEngGnssConstellationConfig : public LocMsg {
|
|||
};
|
||||
|
||||
// case LOC_ENG_MSG_REPORT_GNSS_MEASUREMENT:
|
||||
LocEngReportGpsMeasurement::LocEngReportGpsMeasurement(void* locEng,
|
||||
GpsData &gpsData) :
|
||||
LocMsg(), mLocEng(locEng), mGpsData(gpsData)
|
||||
LocEngReportGnssMeasurement::LocEngReportGnssMeasurement(void* locEng,
|
||||
GnssData &gnssData) :
|
||||
LocMsg(), mLocEng(locEng), mGnssData(gnssData)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
void LocEngReportGpsMeasurement::proc() const {
|
||||
void LocEngReportGnssMeasurement::proc() const {
|
||||
loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng;
|
||||
if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION)
|
||||
{
|
||||
if (locEng->gps_measurement_cb != NULL) {
|
||||
locEng->gps_measurement_cb((GpsData*)&(mGpsData));
|
||||
if (locEng->gnss_measurement_cb != NULL) {
|
||||
LOC_LOGV("Calling gnss_measurement_cb");
|
||||
locEng->gnss_measurement_cb((GnssData*)&(mGnssData));
|
||||
}
|
||||
}
|
||||
}
|
||||
void LocEngReportGpsMeasurement::locallog() const {
|
||||
void LocEngReportGnssMeasurement::locallog() const {
|
||||
IF_LOC_LOGV {
|
||||
LOC_LOGV("%s:%d]: Received in GPS HAL."
|
||||
"GNSS Measurements count: %d \n",
|
||||
__func__, __LINE__, mGpsData.measurement_count);
|
||||
for (int i =0; i< mGpsData.measurement_count && i < GPS_MAX_SVS; i++) {
|
||||
__func__, __LINE__, mGnssData.measurement_count);
|
||||
for (int i =0; i< mGnssData.measurement_count && i < GNSS_MAX_SVS; i++) {
|
||||
LOC_LOGV(" GNSS measurement data in GPS HAL: \n"
|
||||
" GPS_HAL => Measurement ID | prn | time_offset_ns | state |"
|
||||
" received_gps_tow_ns| c_n0_dbhz | pseudorange_rate_mps |"
|
||||
" GPS_HAL => Measurement ID | svid | time_offset_ns | state |"
|
||||
" c_n0_dbhz | pseudorange_rate_mps |"
|
||||
" pseudorange_rate_uncertainty_mps |"
|
||||
" accumulated_delta_range_state | flags \n"
|
||||
" GPS_HAL => %d | %d | %f | %d | %lld | %f | %f | %f | %d | %d \n",
|
||||
" GPS_HAL => %d | %d | %f | %d | %f | %f | %f | %d | %d \n",
|
||||
i,
|
||||
mGpsData.measurements[i].prn,
|
||||
mGpsData.measurements[i].time_offset_ns,
|
||||
mGpsData.measurements[i].state,
|
||||
mGpsData.measurements[i].received_gps_tow_ns,
|
||||
mGpsData.measurements[i].c_n0_dbhz,
|
||||
mGpsData.measurements[i].pseudorange_rate_mps,
|
||||
mGpsData.measurements[i].pseudorange_rate_uncertainty_mps,
|
||||
mGpsData.measurements[i].accumulated_delta_range_state,
|
||||
mGpsData.measurements[i].flags);
|
||||
mGnssData.measurements[i].svid,
|
||||
mGnssData.measurements[i].time_offset_ns,
|
||||
mGnssData.measurements[i].state,
|
||||
mGnssData.measurements[i].c_n0_dbhz,
|
||||
mGnssData.measurements[i].pseudorange_rate_mps,
|
||||
mGnssData.measurements[i].pseudorange_rate_uncertainty_mps,
|
||||
mGnssData.measurements[i].accumulated_delta_range_state,
|
||||
mGnssData.measurements[i].flags);
|
||||
}
|
||||
LOC_LOGV(" GPS_HAL => Clocks Info: type | time_ns \n"
|
||||
" GPS_HAL => Clocks Info: %d | %lld", mGpsData.clock.type,
|
||||
mGpsData.clock.time_ns);
|
||||
LOC_LOGV(" GPS_HAL => Clocks Info: \n"
|
||||
" time_ns | full_bias_ns | bias_ns | bias_uncertainty_ns | "
|
||||
" drift_nsps | drift_uncertainty_nsps | hw_clock_discontinuity_count | flags"
|
||||
" GPS_HAL => Clocks Info: %lld | %lld | %g | %g | %g | %g | %d | 0x%04x\n",
|
||||
mGnssData.clock.time_ns,
|
||||
mGnssData.clock.full_bias_ns,
|
||||
mGnssData.clock.bias_ns,
|
||||
mGnssData.clock.bias_uncertainty_ns,
|
||||
mGnssData.clock.drift_nsps,
|
||||
mGnssData.clock.drift_uncertainty_nsps,
|
||||
mGnssData.clock.hw_clock_discontinuity_count,
|
||||
mGnssData.clock.flags);
|
||||
}
|
||||
}
|
||||
inline void LocEngReportGpsMeasurement::log() const {
|
||||
inline void LocEngReportGnssMeasurement::log() const {
|
||||
locallog();
|
||||
}
|
||||
|
||||
|
@ -1683,24 +1777,6 @@ inline void LocEngReportGpsMeasurement::log() const {
|
|||
}
|
||||
#define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret)
|
||||
|
||||
uint32_t getCarrierCapabilities() {
|
||||
#define carrierMSA (uint32_t)0x2
|
||||
#define carrierMSB (uint32_t)0x1
|
||||
#define gpsConfMSA (uint32_t)0x4
|
||||
#define gpsConfMSB (uint32_t)0x2
|
||||
uint32_t capabilities = gps_conf.CAPABILITIES;
|
||||
if ((gps_conf.SUPL_MODE & carrierMSA) != carrierMSA) {
|
||||
capabilities &= ~gpsConfMSA;
|
||||
}
|
||||
if ((gps_conf.SUPL_MODE & carrierMSB) != carrierMSB) {
|
||||
capabilities &= ~gpsConfMSB;
|
||||
}
|
||||
|
||||
LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x",
|
||||
gps_conf.CAPABILITIES, gps_conf.SUPL_MODE, capabilities);
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
FUNCTION loc_eng_init
|
||||
|
||||
|
@ -1746,6 +1822,8 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
|
|||
loc_eng_data.acquire_wakelock_cb = callbacks->acquire_wakelock_cb;
|
||||
loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb;
|
||||
loc_eng_data.request_utc_time_cb = callbacks->request_utc_time_cb;
|
||||
loc_eng_data.set_system_info_cb = callbacks->set_system_info_cb;
|
||||
loc_eng_data.gnss_sv_status_cb = callbacks->gnss_sv_status_cb;
|
||||
loc_eng_data.location_ext_parser = callbacks->location_ext_parser ?
|
||||
callbacks->location_ext_parser : noProc;
|
||||
loc_eng_data.sv_ext_parser = callbacks->sv_ext_parser ?
|
||||
|
@ -1761,7 +1839,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
|
|||
event = event ^ LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; // unregister for modem NMEA report
|
||||
loc_eng_data.generateNmea = true;
|
||||
}
|
||||
else
|
||||
else if (gps_conf.NMEA_PROVIDER == NMEA_PROVIDER_MP)
|
||||
{
|
||||
loc_eng_data.generateNmea = false;
|
||||
}
|
||||
|
@ -1770,6 +1848,8 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
|
|||
new LocEngAdapter(event, &loc_eng_data, context,
|
||||
(LocThread::tCreate)callbacks->create_thread_cb);
|
||||
|
||||
loc_eng_data.adapter->mGnssInfo.size = sizeof(GnssSystemInfo);
|
||||
loc_eng_data.adapter->mGnssInfo.year_of_hw = 2015;
|
||||
LOC_LOGD("loc_eng_init created client, id = %p\n",
|
||||
loc_eng_data.adapter);
|
||||
loc_eng_data.adapter->sendMsg(new LocEngInit(&loc_eng_data));
|
||||
|
@ -1790,6 +1870,15 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data)
|
|||
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));
|
||||
adapter->sendMsg(new LocEngLPPeProtocol(adapter, gps_conf.LPPE_CP_TECHNOLOGY,
|
||||
gps_conf.LPPE_UP_TECHNOLOGY));
|
||||
|
||||
if (!loc_eng_data.generateNmea)
|
||||
{
|
||||
NmeaSentenceTypesMask typesMask = LOC_NMEA_ALL_SUPPORTED_MASK;
|
||||
LOC_LOGD("loc_eng_init setting nmea types, mask = %u\n",typesMask);
|
||||
adapter->sendMsg(new LocEngSetNmeaTypes(adapter,typesMask));
|
||||
}
|
||||
|
||||
/* 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 ||
|
||||
|
@ -1974,7 +2063,6 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data)
|
|||
int ret_val = LOC_API_ADAPTER_ERR_SUCCESS;
|
||||
|
||||
if (loc_eng_data.adapter->isInSession()) {
|
||||
|
||||
ret_val = loc_eng_data.adapter->stopFix();
|
||||
loc_eng_data.adapter->setInSession(FALSE);
|
||||
}
|
||||
|
@ -2135,6 +2223,9 @@ void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData
|
|||
ENTRY_LOG_CALLFLOW();
|
||||
INIT_CHECK(loc_eng_data.adapter, return);
|
||||
|
||||
//report delete aiding data to ULP to send to DRPlugin
|
||||
loc_eng_data.adapter->getUlpProxy()->reportDeleteAidingData(f);
|
||||
|
||||
loc_eng_data.adapter->sendMsg(new LocEngDelAidData(&loc_eng_data, f));
|
||||
|
||||
EXIT_LOG(%s, VOID_RET);
|
||||
|
@ -2296,28 +2387,9 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call
|
|||
LocEngAdapter* adapter = loc_eng_data.adapter;
|
||||
loc_eng_data.agps_status_cb = callbacks->status_cb;
|
||||
|
||||
loc_eng_data.internet_nif = new AgpsStateMachine(servicerTypeAgps,
|
||||
(void *)loc_eng_data.agps_status_cb,
|
||||
AGPS_TYPE_WWAN_ANY,
|
||||
false);
|
||||
loc_eng_data.wifi_nif = new AgpsStateMachine(servicerTypeAgps,
|
||||
(void *)loc_eng_data.agps_status_cb,
|
||||
AGPS_TYPE_WIFI,
|
||||
true);
|
||||
|
||||
if ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) ||
|
||||
(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB)) {
|
||||
loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps,
|
||||
(void *)loc_eng_data.agps_status_cb,
|
||||
AGPS_TYPE_SUPL,
|
||||
false);
|
||||
|
||||
if (NULL != adapter) {
|
||||
if (adapter->mSupportsAgpsRequests) {
|
||||
if(gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) {
|
||||
loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data));
|
||||
}
|
||||
loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb,
|
||||
NULL, NULL, &loc_eng_data);
|
||||
adapter->sendMsg(new LocEngAgnssNifInit(&loc_eng_data));
|
||||
}
|
||||
loc_eng_agps_reinit(loc_eng_data);
|
||||
}
|
||||
|
@ -2333,23 +2405,55 @@ static void deleteAidingData(loc_eng_data_s_type &logEng) {
|
|||
}
|
||||
}
|
||||
|
||||
// must be called under msg handler context
|
||||
static void createAgnssNifs(loc_eng_data_s_type& locEng) {
|
||||
bool agpsCapable = ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) ||
|
||||
(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB));
|
||||
LocEngAdapter* adapter = locEng.adapter;
|
||||
if (NULL != adapter && adapter->mSupportsAgpsRequests) {
|
||||
if (NULL == locEng.internet_nif) {
|
||||
locEng.internet_nif= new AgpsStateMachine(servicerTypeAgps,
|
||||
(void *)locEng.agps_status_cb,
|
||||
AGPS_TYPE_WWAN_ANY,
|
||||
false);
|
||||
}
|
||||
if (agpsCapable) {
|
||||
if (NULL == locEng.agnss_nif) {
|
||||
locEng.agnss_nif = new AgpsStateMachine(servicerTypeAgps,
|
||||
(void *)locEng.agps_status_cb,
|
||||
AGPS_TYPE_SUPL,
|
||||
false);
|
||||
}
|
||||
if (NULL == locEng.ds_nif &&
|
||||
gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL &&
|
||||
0 == adapter->initDataServiceClient()) {
|
||||
locEng.ds_nif = new DSStateMachine(servicerTypeExt,
|
||||
(void *)dataCallCb,
|
||||
locEng.adapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// must be called under msg handler context
|
||||
static AgpsStateMachine*
|
||||
getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) {
|
||||
AgpsStateMachine* stateMachine;
|
||||
switch (agpsType) {
|
||||
case AGPS_TYPE_WIFI: {
|
||||
stateMachine = locEng.wifi_nif;
|
||||
break;
|
||||
}
|
||||
case AGPS_TYPE_INVALID:
|
||||
case AGPS_TYPE_SUPL: {
|
||||
stateMachine = locEng.agnss_nif;
|
||||
break;
|
||||
}
|
||||
case AGPS_TYPE_SUPL_ES: {
|
||||
locEng.ds_nif ?
|
||||
stateMachine = locEng.ds_nif:
|
||||
if (gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) {
|
||||
if (NULL == locEng.ds_nif) {
|
||||
createAgnssNifs(locEng);
|
||||
}
|
||||
stateMachine = locEng.ds_nif;
|
||||
} else {
|
||||
stateMachine = locEng.agnss_nif;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -2391,10 +2495,9 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType,
|
|||
LOC_LOGD("loc_eng_agps_open APN name = [%s]", apn);
|
||||
|
||||
int apn_len = smaller_of(strlen (apn), MAX_APN_LEN);
|
||||
AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType);
|
||||
|
||||
loc_eng_data.adapter->sendMsg(
|
||||
new LocEngAtlOpenSuccess(sm, apn, apn_len, bearerType));
|
||||
new LocEngAtlOpenSuccess(&loc_eng_data, agpsType,
|
||||
apn, apn_len, bearerType));
|
||||
|
||||
EXIT_LOG(%d, 0);
|
||||
return 0;
|
||||
|
@ -2423,8 +2526,8 @@ int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType)
|
|||
INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb,
|
||||
return -1);
|
||||
|
||||
AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType);
|
||||
loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(sm));
|
||||
loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(&loc_eng_data,
|
||||
agpsType));
|
||||
|
||||
EXIT_LOG(%d, 0);
|
||||
return 0;
|
||||
|
@ -2453,8 +2556,8 @@ int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agps
|
|||
INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb,
|
||||
return -1);
|
||||
|
||||
AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType);
|
||||
loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(sm));
|
||||
loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(&loc_eng_data,
|
||||
agpsType));
|
||||
|
||||
EXIT_LOG(%d, 0);
|
||||
return 0;
|
||||
|
@ -2728,15 +2831,22 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data,
|
|||
gps_conf.A_GLONASS_POS_PROTOCOL_SELECT));
|
||||
}
|
||||
if (gps_conf_tmp.SUPL_MODE != gps_conf.SUPL_MODE) {
|
||||
adapter->sendMsg(new LocEngSuplMode(adapter->getUlpProxy()));
|
||||
adapter->sendMsg(new LocEngSuplMode(adapter));
|
||||
}
|
||||
// we always update lock mask, this is because if this is dsds device, we would not
|
||||
// know if modem has switched dds, if so, lock mask may also need to be updated.
|
||||
// if we have power vote, HAL is on, lock mask 0; else gps_conf.GPS_LOCK.
|
||||
adapter->setGpsLockMsg(adapter->getPowerVote() ? 0 : gps_conf.GPS_LOCK);
|
||||
}
|
||||
|
||||
gps_conf_tmp.SUPL_VER = gps_conf.SUPL_VER;
|
||||
gps_conf_tmp.LPP_PROFILE = gps_conf.LPP_PROFILE;
|
||||
gps_conf_tmp.A_GLONASS_POS_PROTOCOL_SELECT = gps_conf.A_GLONASS_POS_PROTOCOL_SELECT;
|
||||
gps_conf_tmp.SUPL_MODE = gps_conf.SUPL_MODE;
|
||||
gps_conf_tmp.SUPL_ES = gps_conf.SUPL_ES;
|
||||
gps_conf_tmp.GPS_LOCK = gps_conf.GPS_LOCK;
|
||||
gps_conf_tmp.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL =
|
||||
gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL;
|
||||
gps_conf = gps_conf_tmp;
|
||||
}
|
||||
|
||||
|
@ -2857,34 +2967,12 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data)
|
|||
if (loc_eng_data.adapter->isInSession()) {
|
||||
// This sets the copy in adapter to modem
|
||||
loc_eng_data.adapter->setInSession(false);
|
||||
loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter));
|
||||
loc_eng_start_handler(loc_eng_data);
|
||||
}
|
||||
|
||||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
#ifdef USE_GLIB
|
||||
/*===========================================================================
|
||||
FUNCTION set_sched_policy
|
||||
|
||||
DESCRIPTION
|
||||
Local copy of this function which bypasses android set_sched_policy
|
||||
|
||||
DEPENDENCIES
|
||||
None
|
||||
|
||||
RETURN VALUE
|
||||
0
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int set_sched_policy(int tid, SchedPolicy policy)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
/*===========================================================================
|
||||
FUNCTION loc_eng_read_config
|
||||
|
||||
|
@ -2942,8 +3030,8 @@ int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data,
|
|||
{
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
|
||||
STATE_CHECK((NULL == loc_eng_data.gps_measurement_cb),
|
||||
"gps measurement already initialized",
|
||||
STATE_CHECK((NULL == loc_eng_data.gnss_measurement_cb),
|
||||
"gnss measurement already initialized",
|
||||
return GPS_MEASUREMENT_ERROR_ALREADY_INIT);
|
||||
STATE_CHECK((callbacks != NULL),
|
||||
"callbacks can not be NULL",
|
||||
|
@ -2954,12 +3042,9 @@ int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data,
|
|||
|
||||
// updated the mask
|
||||
LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT;
|
||||
loc_eng_data.adapter->sendMsg(new LocEngUpdateRegistrationMask(
|
||||
&loc_eng_data,
|
||||
event,
|
||||
LOC_REGISTRATION_MASK_ENABLED));
|
||||
loc_eng_data.adapter->updateEvtMask(event, LOC_REGISTRATION_MASK_ENABLED);
|
||||
// set up the callback
|
||||
loc_eng_data.gps_measurement_cb = callbacks->measurement_callback;
|
||||
loc_eng_data.gnss_measurement_cb = callbacks->gnss_measurement_callback;
|
||||
LOC_LOGD ("%s, event masks updated successfully", __func__);
|
||||
|
||||
return GPS_MEASUREMENT_OPERATION_SUCCESS;
|
||||
|
@ -2989,11 +3074,8 @@ void loc_eng_gps_measurement_close(loc_eng_data_s_type &loc_eng_data)
|
|||
|
||||
// updated the mask
|
||||
LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT;
|
||||
loc_eng_data.adapter->sendMsg(new LocEngUpdateRegistrationMask(
|
||||
&loc_eng_data,
|
||||
event,
|
||||
LOC_REGISTRATION_MASK_DISABLED));
|
||||
loc_eng_data.adapter->updateEvtMask(event, LOC_REGISTRATION_MASK_DISABLED);
|
||||
// set up the callback
|
||||
loc_eng_data.gps_measurement_cb = NULL;
|
||||
loc_eng_data.gnss_measurement_cb = NULL;
|
||||
EXIT_LOG(%d, 0);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2009-2014, 2016 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
|
||||
|
@ -54,7 +54,6 @@ typedef unsigned char boolean;
|
|||
#include <loc_eng_agps.h>
|
||||
#include <loc_cfg.h>
|
||||
#include <loc_log.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_eng_agps.h>
|
||||
#include <LocEngAdapter.h>
|
||||
|
||||
|
@ -67,7 +66,8 @@ typedef unsigned char boolean;
|
|||
#define FAILURE FALSE
|
||||
#define INVALID_ATL_CONNECTION_HANDLE -1
|
||||
|
||||
#define MAX_XTRA_SERVER_URL_LENGTH 256
|
||||
#define gps_conf ContextBase::mGps_conf
|
||||
#define sap_conf ContextBase::mSap_conf
|
||||
|
||||
enum loc_nmea_provider_e_type {
|
||||
NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA
|
||||
|
@ -89,12 +89,14 @@ typedef struct loc_eng_data_s
|
|||
loc_sv_status_cb_ext sv_status_cb;
|
||||
agps_status_extended agps_status_cb;
|
||||
gps_nmea_callback nmea_cb;
|
||||
gps_ni_notify_callback ni_notify_cb;
|
||||
loc_ni_notify_callback ni_notify_cb;
|
||||
gps_set_capabilities set_capabilities_cb;
|
||||
gps_acquire_wakelock acquire_wakelock_cb;
|
||||
gps_release_wakelock release_wakelock_cb;
|
||||
gps_request_utc_time request_utc_time_cb;
|
||||
gps_measurement_callback gps_measurement_cb;
|
||||
gnss_set_system_info set_system_info_cb;
|
||||
gnss_sv_status_callback gnss_sv_status_cb;
|
||||
gnss_measurement_callback gnss_measurement_cb;
|
||||
boolean intermediateFix;
|
||||
AGpsStatusValue agps_status;
|
||||
loc_eng_xtra_data_s_type xtra_module_data;
|
||||
|
@ -103,7 +105,6 @@ typedef struct loc_eng_data_s
|
|||
// AGPS state machines
|
||||
AgpsStateMachine* agnss_nif;
|
||||
AgpsStateMachine* internet_nif;
|
||||
AgpsStateMachine* wifi_nif;
|
||||
//State machine for Data Services
|
||||
AgpsStateMachine* ds_nif;
|
||||
|
||||
|
@ -119,7 +120,8 @@ typedef struct loc_eng_data_s
|
|||
|
||||
// For nmea generation
|
||||
boolean generateNmea;
|
||||
uint32_t sv_used_mask;
|
||||
uint32_t gps_used_mask;
|
||||
uint32_t glo_used_mask;
|
||||
float hdop;
|
||||
float pdop;
|
||||
float vdop;
|
||||
|
@ -139,68 +141,6 @@ typedef struct loc_eng_data_s
|
|||
loc_ext_parser sv_ext_parser;
|
||||
} loc_eng_data_s_type;
|
||||
|
||||
/* GPS.conf support */
|
||||
/* NOTE: the implementaiton of the parser casts number
|
||||
fields to 32 bit. To ensure all 'n' fields working,
|
||||
they must all be 32 bit fields. */
|
||||
typedef struct loc_gps_cfg_s
|
||||
{
|
||||
uint32_t INTERMEDIATE_POS;
|
||||
uint32_t ACCURACY_THRES;
|
||||
uint32_t SUPL_VER;
|
||||
uint32_t SUPL_MODE;
|
||||
uint32_t CAPABILITIES;
|
||||
uint32_t LPP_PROFILE;
|
||||
uint32_t 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];
|
||||
uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL;
|
||||
uint32_t NMEA_PROVIDER;
|
||||
uint32_t GPS_LOCK;
|
||||
uint32_t A_GLONASS_POS_PROTOCOL_SELECT;
|
||||
uint32_t AGPS_CERT_WRITABLE_MASK;
|
||||
} loc_gps_cfg_s_type;
|
||||
|
||||
/* NOTE: the implementaiton of the parser casts number
|
||||
fields to 32 bit. To ensure all 'n' fields working,
|
||||
they must all be 32 bit fields. */
|
||||
/* Meanwhile, *_valid fields are 8 bit fields, and 'f'
|
||||
fields are double. Rigid as they are, it is the
|
||||
the status quo, until the parsing mechanism is
|
||||
change, that is. */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t GYRO_BIAS_RANDOM_WALK_VALID;
|
||||
double GYRO_BIAS_RANDOM_WALK;
|
||||
uint32_t SENSOR_ACCEL_BATCHES_PER_SEC;
|
||||
uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH;
|
||||
uint32_t SENSOR_GYRO_BATCHES_PER_SEC;
|
||||
uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH;
|
||||
uint32_t SENSOR_ACCEL_BATCHES_PER_SEC_HIGH;
|
||||
uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH;
|
||||
uint32_t SENSOR_GYRO_BATCHES_PER_SEC_HIGH;
|
||||
uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH;
|
||||
uint32_t SENSOR_CONTROL_MODE;
|
||||
uint32_t SENSOR_USAGE;
|
||||
uint32_t SENSOR_ALGORITHM_CONFIG_MASK;
|
||||
uint8_t ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double ACCEL_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double ANGLE_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double RATE_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint32_t SENSOR_PROVIDER;
|
||||
} loc_sap_cfg_s_type;
|
||||
|
||||
extern loc_gps_cfg_s_type gps_conf;
|
||||
extern loc_sap_cfg_s_type sap_conf;
|
||||
|
||||
|
||||
uint32_t getCarrierCapabilities();
|
||||
|
||||
//loc_eng functions
|
||||
int loc_eng_init(loc_eng_data_s_type &loc_eng_data,
|
||||
LocCallbacks* callbacks,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2014, 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
|
||||
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include <loc_eng_agps.h>
|
||||
#include <loc_eng_log.h>
|
||||
#include <log_util.h>
|
||||
#include <platform_lib_includes.h>
|
||||
#include <loc_eng_dmn_conn_handler.h>
|
||||
#include <loc_eng_dmn_conn.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2014, 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
|
||||
|
@ -40,10 +40,14 @@
|
|||
#include <linked_list.h>
|
||||
#include <loc_timer.h>
|
||||
#include <LocEngAdapter.h>
|
||||
#include <platform_lib_includes.h>
|
||||
#if defined(USE_GLIB) && !defined(OFF_TARGET)
|
||||
#include <glib.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
// forward declaration
|
||||
class AgpsStateMachine;
|
||||
class Subscriber;
|
||||
struct Subscriber;
|
||||
|
||||
// NIF resource events
|
||||
typedef enum {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2012,2014 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
|
||||
|
@ -37,8 +37,7 @@
|
|||
#include <grp.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
#include "loc_eng_dmn_conn_glue_msg.h"
|
||||
#include "loc_eng_dmn_conn_handler.h"
|
||||
#include "loc_eng_dmn_conn.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011,2014 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
|
||||
|
@ -31,8 +31,7 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
#include "loc_eng_dmn_conn_glue_msg.h"
|
||||
#include "loc_eng_dmn_conn_handler.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2012,2014 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
|
||||
|
@ -37,8 +37,7 @@
|
|||
#include <sys/stat.h>
|
||||
|
||||
#include "loc_eng_dmn_conn_glue_pipe.h"
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
/*===========================================================================
|
||||
FUNCTION loc_eng_dmn_conn_glue_pipeget
|
||||
|
||||
|
@ -110,8 +109,10 @@ SIDE EFFECTS
|
|||
int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd)
|
||||
{
|
||||
close(fd);
|
||||
if (pipe_name) unlink(pipe_name);
|
||||
LOC_LOGD("fd = %d, %s\n", fd, pipe_name);
|
||||
if (pipe_name != NULL) {
|
||||
unlink(pipe_name);
|
||||
LOC_LOGD("fd = %d, %s\n", fd, pipe_name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2012,2014 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
|
||||
|
@ -31,8 +31,7 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
#include "loc_eng_msg.h"
|
||||
#include "loc_eng_dmn_conn.h"
|
||||
#include "loc_eng_dmn_conn_handler.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011,2014 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
|
||||
|
@ -28,8 +28,7 @@
|
|||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
#include "loc_eng_dmn_conn_thread_helper.h"
|
||||
|
||||
/*===========================================================================
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2014, 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
|
||||
|
@ -34,16 +34,16 @@
|
|||
#include <gps_extended.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_eng_log.h>
|
||||
#include <loc_eng.h>
|
||||
#include <MsgTask.h>
|
||||
#include <LocEngAdapter.h>
|
||||
#include <platform_lib_includes.h>
|
||||
|
||||
#ifndef SSID_BUF_SIZE
|
||||
#define SSID_BUF_SIZE (32+1)
|
||||
#endif
|
||||
#ifdef USE_GLIB
|
||||
#if defined(USE_GLIB) && !defined(OFF_TARGET)
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg {
|
|||
|
||||
struct LocEngReportSv : public LocMsg {
|
||||
LocAdapterBase* mAdapter;
|
||||
const QcomSvStatus mSvStatus;
|
||||
const GnssSvStatus mSvStatus;
|
||||
const GpsLocationExtended mLocationExtended;
|
||||
const void* mSvExt;
|
||||
LocEngReportSv(LocAdapterBase* adapter,
|
||||
QcomSvStatus &sv,
|
||||
GnssSvStatus &sv,
|
||||
GpsLocationExtended &locExtended,
|
||||
void* svExtended);
|
||||
virtual void proc() const;
|
||||
|
@ -289,11 +289,11 @@ struct LocEngGetZpp : public LocMsg {
|
|||
void send() const;
|
||||
};
|
||||
|
||||
struct LocEngReportGpsMeasurement : public LocMsg {
|
||||
struct LocEngReportGnssMeasurement : public LocMsg {
|
||||
void* mLocEng;
|
||||
const GpsData mGpsData;
|
||||
LocEngReportGpsMeasurement(void* locEng,
|
||||
GpsData &gpsData);
|
||||
const GnssData mGnssData;
|
||||
LocEngReportGnssMeasurement(void* locEng,
|
||||
GnssData &gnssData);
|
||||
virtual void proc() const;
|
||||
void locallog() const;
|
||||
virtual void log() const;
|
||||
|
|
|
@ -43,8 +43,7 @@
|
|||
|
||||
#include <loc_eng.h>
|
||||
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
|
||||
using namespace loc_core;
|
||||
|
||||
|
@ -189,7 +188,7 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
|
|||
}
|
||||
|
||||
CALLBACK_LOG_CALLFLOW("ni_notify_cb - id", %d, notif->notification_id);
|
||||
loc_eng_data.ni_notify_cb((GpsNiNotification*)notif);
|
||||
loc_eng_data.ni_notify_cb((GpsNiNotification*)notif, gps_conf.SUPL_ES != 0);
|
||||
}
|
||||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012, 2016, 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
|
||||
|
@ -29,14 +29,10 @@
|
|||
|
||||
#define LOG_NDDEBUG 0
|
||||
#define LOG_TAG "LocSvc_eng_nmea"
|
||||
#define GPS_PRN_START 1
|
||||
#define GPS_PRN_END 32
|
||||
#define GLONASS_PRN_START 65
|
||||
#define GLONASS_PRN_END 96
|
||||
#include <loc_eng.h>
|
||||
#include <loc_eng_nmea.h>
|
||||
#include <math.h>
|
||||
#include "log_util.h"
|
||||
#include <platform_lib_includes.h>
|
||||
|
||||
/*===========================================================================
|
||||
FUNCTION loc_eng_nmea_send
|
||||
|
@ -92,8 +88,12 @@ int loc_eng_nmea_put_checksum(char *pNmea, int maxSize)
|
|||
length++;
|
||||
}
|
||||
|
||||
// length now contains nmea sentence string length not including $ sign.
|
||||
int checksumLength = snprintf(pNmea,(maxSize-length-1),"*%02X\r\n", checksum);
|
||||
return (length + checksumLength);
|
||||
|
||||
// total length of nmea sentence is length of nmea sentence inc $ sign plus
|
||||
// length of checksum (+1 is to cover the $ character in the length).
|
||||
return (length + checksumLength + 1);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
@ -101,6 +101,12 @@ FUNCTION loc_eng_nmea_generate_pos
|
|||
|
||||
DESCRIPTION
|
||||
Generate NMEA sentences generated based on position report
|
||||
Currently below sentences are generated within this function:
|
||||
- $GPGSA : GPS DOP and active SVs
|
||||
- $GNGSA : GLONASS DOP and active SVs
|
||||
- $GPVTG : Track made good and ground speed
|
||||
- $GPRMC : Recommended minimum navigation information
|
||||
- $GPGGA : Time, position and fix related data
|
||||
|
||||
DEPENDENCIES
|
||||
NONE
|
||||
|
@ -144,7 +150,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
|
||||
uint32_t svUsedCount = 0;
|
||||
uint32_t svUsedList[32] = {0};
|
||||
uint32_t mask = loc_eng_data_p->sv_used_mask;
|
||||
uint32_t mask = loc_eng_data_p->gps_used_mask;
|
||||
for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++)
|
||||
{
|
||||
if (mask & 1)
|
||||
|
@ -152,7 +158,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
mask = mask >> 1;
|
||||
}
|
||||
// clear the cache so they can't be used again
|
||||
loc_eng_data_p->sv_used_mask = 0;
|
||||
loc_eng_data_p->gps_used_mask = 0;
|
||||
|
||||
char fixType;
|
||||
if (svUsedCount == 0)
|
||||
|
@ -210,6 +216,99 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
|
||||
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
|
||||
|
||||
// ------------------
|
||||
// ------$GNGSA------
|
||||
// ------------------
|
||||
uint32_t gloUsedCount = 0;
|
||||
uint32_t gloUsedList[32] = {0};
|
||||
|
||||
// Reset locals for GNGSA sentence generation
|
||||
pMarker = sentence;
|
||||
lengthRemaining = sizeof(sentence);
|
||||
mask = loc_eng_data_p->glo_used_mask;
|
||||
fixType = '\0';
|
||||
|
||||
// Parse the glonass sv mask, and fetch glo sv ids
|
||||
// Mask corresponds to the offset.
|
||||
// GLONASS SV ids are from 65-96
|
||||
const int GLONASS_SV_ID_OFFSET = 64;
|
||||
for (uint8_t i = 1; mask > 0 && gloUsedCount < 32; i++)
|
||||
{
|
||||
if (mask & 1)
|
||||
gloUsedList[gloUsedCount++] = i + GLONASS_SV_ID_OFFSET;
|
||||
mask = mask >> 1;
|
||||
}
|
||||
// clear the cache so they can't be used again
|
||||
loc_eng_data_p->glo_used_mask = 0;
|
||||
|
||||
if (gloUsedCount == 0)
|
||||
fixType = '1'; // no fix
|
||||
else if (gloUsedCount <= 3)
|
||||
fixType = '2'; // 2D fix
|
||||
else
|
||||
fixType = '3'; // 3D fix
|
||||
|
||||
// Start printing the sentence
|
||||
// Format: $--GSA,a,x,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,p.p,h.h,v.v*cc
|
||||
// GNGSA : for glonass SVs
|
||||
// a : Mode : A : Automatic, allowed to automatically switch 2D/3D
|
||||
// x : Fixtype : 1 (no fix), 2 (2D fix), 3 (3D fix)
|
||||
// xx : 12 SV ID
|
||||
// p.p : Position DOP (Dilution of Precision)
|
||||
// h.h : Horizontal DOP
|
||||
// v.v : Vertical DOP
|
||||
// cc : Checksum value
|
||||
length = snprintf(pMarker, lengthRemaining, "$GNGSA,A,%c,", fixType);
|
||||
|
||||
if (length < 0 || length >= lengthRemaining)
|
||||
{
|
||||
LOC_LOGE("NMEA Error in string formatting");
|
||||
return;
|
||||
}
|
||||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
// Add first 12 GLONASS satellite IDs
|
||||
for (uint8_t i = 0; i < 12; i++)
|
||||
{
|
||||
if (i < gloUsedCount)
|
||||
length = snprintf(pMarker, lengthRemaining, "%02d,", gloUsedList[i]);
|
||||
else
|
||||
length = snprintf(pMarker, lengthRemaining, ",");
|
||||
|
||||
if (length < 0 || length >= lengthRemaining)
|
||||
{
|
||||
LOC_LOGE("NMEA Error in string formatting");
|
||||
return;
|
||||
}
|
||||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
}
|
||||
|
||||
// Add the position/horizontal/vertical DOP values
|
||||
if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP)
|
||||
{ // dop is in locationExtended, (QMI)
|
||||
length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f",
|
||||
locationExtended.pdop,
|
||||
locationExtended.hdop,
|
||||
locationExtended.vdop);
|
||||
}
|
||||
else if (loc_eng_data_p->pdop > 0 && loc_eng_data_p->hdop > 0 && loc_eng_data_p->vdop > 0)
|
||||
{ // dop was cached from sv report (RPC)
|
||||
length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f",
|
||||
loc_eng_data_p->pdop,
|
||||
loc_eng_data_p->hdop,
|
||||
loc_eng_data_p->vdop);
|
||||
}
|
||||
else
|
||||
{ // no dop
|
||||
length = snprintf(pMarker, lengthRemaining, ",,");
|
||||
}
|
||||
|
||||
/* Sentence is ready, add checksum and broadcast */
|
||||
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
|
||||
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
|
||||
|
||||
// ------------------
|
||||
// ------$GPVTG------
|
||||
// ------------------
|
||||
|
@ -565,6 +664,10 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
|
||||
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
|
||||
|
||||
strlcpy(sentence, "$GNGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence));
|
||||
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
|
||||
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
|
||||
|
||||
strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence));
|
||||
length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
|
||||
loc_eng_nmea_send(sentence, length, loc_eng_data_p);
|
||||
|
@ -604,7 +707,7 @@ SIDE EFFECTS
|
|||
|
||||
===========================================================================*/
|
||||
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
||||
const QcomSvStatus &svStatus, const GpsLocationExtended &locationExtended)
|
||||
const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
|
||||
|
@ -621,15 +724,27 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
|
||||
//Count GPS SVs for saparating GPS from GLONASS and throw others
|
||||
|
||||
loc_eng_data_p->gps_used_mask = 0;
|
||||
loc_eng_data_p->glo_used_mask = 0;
|
||||
for(svNumber=1; svNumber <= svCount; svNumber++) {
|
||||
if( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START)&&
|
||||
(svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) )
|
||||
if (GNSS_CONSTELLATION_GPS == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
{
|
||||
// cache the used in fix mask, as it will be needed to send $GPGSA
|
||||
// during the position report
|
||||
if (GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & GNSS_SV_FLAGS_USED_IN_FIX))
|
||||
{
|
||||
loc_eng_data_p->gps_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1));
|
||||
}
|
||||
gpsCount++;
|
||||
}
|
||||
else if( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) &&
|
||||
(svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) )
|
||||
else if (GNSS_CONSTELLATION_GLONASS == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
{
|
||||
// cache the used in fix mask, as it will be needed to send $GNGSA
|
||||
// during the position report
|
||||
if (GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & GNSS_SV_FLAGS_USED_IN_FIX))
|
||||
{
|
||||
loc_eng_data_p->glo_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1));
|
||||
}
|
||||
glnCount++;
|
||||
}
|
||||
}
|
||||
|
@ -669,13 +784,12 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
|
||||
for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++)
|
||||
{
|
||||
if( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START) &&
|
||||
(svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) )
|
||||
if (GNSS_CONSTELLATION_GPS == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
{
|
||||
length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,",
|
||||
svStatus.sv_list[svNumber-1].prn,
|
||||
(int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int
|
||||
(int)(0.5 + svStatus.sv_list[svNumber-1].azimuth)); //float to int
|
||||
svStatus.gnss_sv_list[svNumber-1].svid,
|
||||
(int)(0.5 + svStatus.gnss_sv_list[svNumber-1].elevation), //float to int
|
||||
(int)(0.5 + svStatus.gnss_sv_list[svNumber-1].azimuth)); //float to int
|
||||
|
||||
if (length < 0 || length >= lengthRemaining)
|
||||
{
|
||||
|
@ -685,10 +799,10 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if (svStatus.sv_list[svNumber-1].snr > 0)
|
||||
if (svStatus.gnss_sv_list[svNumber-1].c_n0_dbhz > 0)
|
||||
{
|
||||
length = snprintf(pMarker, lengthRemaining,"%02d",
|
||||
(int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int
|
||||
(int)(0.5 + svStatus.gnss_sv_list[svNumber-1].c_n0_dbhz)); //float to int
|
||||
|
||||
if (length < 0 || length >= lengthRemaining)
|
||||
{
|
||||
|
@ -747,13 +861,13 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
|
||||
for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++)
|
||||
{
|
||||
if( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) &&
|
||||
(svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) ) {
|
||||
if (GNSS_CONSTELLATION_GLONASS == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
{
|
||||
|
||||
length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,",
|
||||
svStatus.sv_list[svNumber-1].prn,
|
||||
(int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int
|
||||
(int)(0.5 + svStatus.sv_list[svNumber-1].azimuth)); //float to int
|
||||
svStatus.gnss_sv_list[svNumber - 1].svid,
|
||||
(int)(0.5 + svStatus.gnss_sv_list[svNumber - 1].elevation), //float to int
|
||||
(int)(0.5 + svStatus.gnss_sv_list[svNumber - 1].azimuth)); //float to int
|
||||
|
||||
if (length < 0 || length >= lengthRemaining)
|
||||
{
|
||||
|
@ -763,10 +877,10 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if (svStatus.sv_list[svNumber-1].snr > 0)
|
||||
if (svStatus.gnss_sv_list[svNumber - 1].c_n0_dbhz > 0)
|
||||
{
|
||||
length = snprintf(pMarker, lengthRemaining,"%02d",
|
||||
(int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int
|
||||
(int)(0.5 + svStatus.gnss_sv_list[svNumber - 1].c_n0_dbhz)); //float to int
|
||||
|
||||
if (length < 0 || length >= lengthRemaining)
|
||||
{
|
||||
|
@ -790,10 +904,6 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
|
||||
}//if
|
||||
|
||||
// cache the used in fix mask, as it will be needed to send $GPGSA
|
||||
// during the position report
|
||||
loc_eng_data_p->sv_used_mask = svStatus.gps_used_in_fix_mask;
|
||||
|
||||
// For RPC, the DOP are sent during sv report, so cache them
|
||||
// now to be sent during position report.
|
||||
// For QMI, the DOP will be in position report.
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p);
|
||||
int loc_eng_nmea_put_checksum(char *pNmea, int maxSize);
|
||||
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const QcomSvStatus &svStatus, const GpsLocationExtended &locationExtended);
|
||||
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended);
|
||||
void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const UlpLocation &location, const GpsLocationExtended &locationExtended, unsigned char generate_nmea);
|
||||
|
||||
#endif // LOC_ENG_NMEA_H
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2009-2014, 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
|
||||
|
@ -32,8 +32,7 @@
|
|||
|
||||
#include <loc_eng.h>
|
||||
#include <MsgTask.h>
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
|
||||
using namespace loc_core;
|
||||
|
||||
|
@ -124,6 +123,13 @@ int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data,
|
|||
loc_eng_xtra_data_s_type *xtra_module_data_ptr;
|
||||
ENTRY_LOG();
|
||||
|
||||
if(!loc_eng_data.adapter->mSupportsTimeInjection
|
||||
|| loc_eng_data.adapter->hasNativeXtraClient()) {
|
||||
LOC_LOGD("XTRA is already supported. disable it here.\n");
|
||||
EXIT_LOG(%d, 1); // return 1 denote failure
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(callbacks == NULL) {
|
||||
LOC_LOGE("loc_eng_xtra_init: failed, cb is NULL");
|
||||
} else {
|
||||
|
|
|
@ -6,11 +6,13 @@ LOCAL_PATH := $(call my-dir)
|
|||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
|
||||
## Libs
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libutils \
|
||||
libcutils \
|
||||
liblog
|
||||
liblog \
|
||||
libloc_pla
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
loc_log.cpp \
|
||||
|
@ -38,7 +40,7 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic
|
|||
|
||||
## Includes
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/platform_lib_abstractions
|
||||
$(TARGET_OUT_HEADERS)/libloc_pla
|
||||
|
||||
LOCAL_COPY_HEADERS_TO:= gps.utils/
|
||||
LOCAL_COPY_HEADERS:= \
|
||||
|
@ -54,9 +56,6 @@ LOCAL_COPY_HEADERS:= \
|
|||
loc_target.h \
|
||||
loc_timer.h \
|
||||
LocSharedLock.h \
|
||||
platform_lib_abstractions/platform_lib_includes.h \
|
||||
platform_lib_abstractions/platform_lib_time.h \
|
||||
platform_lib_abstractions/platform_lib_macros.h \
|
||||
loc_misc_utils.h
|
||||
|
||||
LOCAL_MODULE := libgps.utils
|
||||
|
@ -66,5 +65,7 @@ LOCAL_MODULE_TAGS := optional
|
|||
LOCAL_PRELINK_MODULE := false
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
include $(addsuffix /Android.mk, $(addprefix $(LOCAL_PATH)/, platform_lib_abstractions))
|
||||
endif # not BUILD_TINY_ANDROID
|
||||
endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <LocThread.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include <platform_lib_macros.h>
|
||||
|
||||
class LocThreadDelegate {
|
||||
LocRunnable* mRunnable;
|
||||
|
@ -84,7 +85,8 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator,
|
|||
if (mThandle) {
|
||||
// set thread name
|
||||
char lname[16];
|
||||
int len = sizeof(lname) - 1;
|
||||
int len = (sizeof(lname)>sizeof(threadName)) ?
|
||||
(sizeof(threadName) -1):(sizeof(lname) - 1);
|
||||
memcpy(lname, threadName, len);
|
||||
lname[len] = 0;
|
||||
// set the thread name here
|
||||
|
|
|
@ -505,8 +505,13 @@ int LocTimerDelegate::ranks(LocRankable& rankable) {
|
|||
LocTimerDelegate* timer = (LocTimerDelegate*)(&rankable);
|
||||
if (timer) {
|
||||
// larger time ranks lower!!!
|
||||
// IOW, if input obj has bigger tv_sec, this obj outRanks higher
|
||||
// IOW, if input obj has bigger tv_sec/tv_nsec, this obj outRanks higher
|
||||
rank = timer->mFutureTime.tv_sec - mFutureTime.tv_sec;
|
||||
if(0 == rank)
|
||||
{
|
||||
//rank against tv_nsec for msec accuracy
|
||||
rank = (int)(timer->mFutureTime.tv_nsec - mFutureTime.tv_nsec);
|
||||
}
|
||||
}
|
||||
return rank;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#define __LOC_TIMER_CPP_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <log_util.h>
|
||||
#include <platform_lib_includes.h>
|
||||
|
||||
// opaque class to provide service implementation.
|
||||
class LocTimerDelegate;
|
||||
|
|
|
@ -5,22 +5,33 @@ AM_CFLAGS = -Wundef \
|
|||
-fno-inline \
|
||||
-fno-short-enums \
|
||||
-fpic \
|
||||
-I../platform_lib_abstractions
|
||||
-I./ \
|
||||
$(LOCPLA_CFLAGS)
|
||||
|
||||
libgps_utils_so_la_h_sources = log_util.h \
|
||||
msg_q.h \
|
||||
linked_list.h \
|
||||
loc_cfg.h \
|
||||
loc_log.h \
|
||||
../platform_lib_abstractions/platform_lib_includes.h \
|
||||
../platform_lib_abstractions/platform_lib_time.h \
|
||||
../platform_lib_abstractions/platform_lib_macros.h
|
||||
libgps_utils_so_la_h_sources = \
|
||||
msg_q.h \
|
||||
linked_list.h \
|
||||
loc_cfg.h \
|
||||
loc_log.h \
|
||||
loc_target.h \
|
||||
loc_timer.h \
|
||||
MsgTask.h \
|
||||
LocHeap.h \
|
||||
LocThread.h \
|
||||
LocTimer.h \
|
||||
loc_misc_utils.h
|
||||
|
||||
libgps_utils_so_la_c_sources = linked_list.c \
|
||||
msg_q.c \
|
||||
loc_cfg.cpp \
|
||||
loc_log.cpp \
|
||||
../platform_lib_abstractions/elapsed_millis_since_boot.cpp
|
||||
libgps_utils_so_la_c_sources = \
|
||||
linked_list.c \
|
||||
msg_q.c \
|
||||
loc_cfg.cpp \
|
||||
loc_log.cpp \
|
||||
loc_target.cpp \
|
||||
LocHeap.cpp \
|
||||
LocTimer.cpp \
|
||||
LocThread.cpp \
|
||||
MsgTask.cpp \
|
||||
loc_misc_utils.cpp
|
||||
|
||||
library_includedir = $(pkgincludedir)/utils
|
||||
|
||||
|
@ -38,7 +49,7 @@ libgps_utils_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
|||
libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libgps_utils_so_la_LIBADD = -lstdc++ -lcutils
|
||||
libgps_utils_so_la_LIBADD = -lstdc++ -llog $(LOCPLA_LIBS)
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libgps_utils_so.la
|
||||
|
|
|
@ -29,12 +29,11 @@
|
|||
#define LOG_NDDEBUG 0
|
||||
#define LOG_TAG "LocSvc_MsgTask"
|
||||
|
||||
#include <cutils/sched_policy.h>
|
||||
#include <unistd.h>
|
||||
#include <MsgTask.h>
|
||||
#include <msg_q.h>
|
||||
#include <log_util.h>
|
||||
#include <loc_log.h>
|
||||
#include <platform_lib_includes.h>
|
||||
|
||||
static void LocMsgDestroy(void* msg) {
|
||||
delete (LocMsg*)msg;
|
||||
|
@ -63,9 +62,9 @@ MsgTask::~MsgTask() {
|
|||
}
|
||||
|
||||
void MsgTask::destroy() {
|
||||
LocThread* thread = mThread;
|
||||
msg_q_unblock((void*)mQ);
|
||||
if (mThread) {
|
||||
LocThread* thread = mThread;
|
||||
if (thread) {
|
||||
mThread = NULL;
|
||||
delete thread;
|
||||
} else {
|
||||
|
@ -79,7 +78,7 @@ void MsgTask::sendMsg(const LocMsg* msg) const {
|
|||
|
||||
void MsgTask::prerun() {
|
||||
// make sure we do not run in background scheduling group
|
||||
set_sched_policy(gettid(), SP_FOREGROUND);
|
||||
platform_lib_abstraction_set_sched_policy(platform_lib_abstraction_gettid(), PLA_SP_FOREGROUND);
|
||||
}
|
||||
|
||||
bool MsgTask::run() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011,2014 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
|
||||
|
@ -31,8 +31,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#define LOG_TAG "LocSvc_utils_ll"
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <loc_cfg.h>
|
||||
#include <log_util.h>
|
||||
#include <platform_lib_includes.h>
|
||||
#include <loc_misc_utils.h>
|
||||
#ifdef USE_GLIB
|
||||
#include <glib.h>
|
||||
|
|
|
@ -34,11 +34,7 @@
|
|||
#include <sys/time.h>
|
||||
#include "loc_log.h"
|
||||
#include "msg_q.h"
|
||||
#ifdef USE_GLIB
|
||||
#include <time.h>
|
||||
#endif /* USE_GLIB */
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
|
||||
#define BUFFER_SIZE 120
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <log_util.h>
|
||||
#include <platform_lib_log_util.h>
|
||||
#include <loc_misc_utils.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <cutils/properties.h>
|
||||
#include "loc_target.h"
|
||||
#include "loc_log.h"
|
||||
#include "log_util.h"
|
||||
#include <platform_lib_includes.h>
|
||||
|
||||
#define APQ8064_ID_1 "109"
|
||||
#define APQ8064_ID_2 "153"
|
||||
|
@ -49,11 +49,12 @@
|
|||
#define APQ8074_ID_1 "184"
|
||||
|
||||
#define LINE_LEN 100
|
||||
#define STR_LIQUID "Liquid"
|
||||
#define STR_SURF "Surf"
|
||||
#define STR_MTP "MTP"
|
||||
#define STR_APQ "apq"
|
||||
#define STR_AUTO "auto"
|
||||
#define STR_LIQUID "Liquid"
|
||||
#define STR_SURF "Surf"
|
||||
#define STR_MTP "MTP"
|
||||
#define STR_APQ "apq"
|
||||
#define STR_APQ_NO_WGR "baseband_apq_nowgr"
|
||||
#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
|
||||
|
@ -112,7 +113,7 @@ static bool is_qca1530(void)
|
|||
|
||||
for (i = 0; i < QCA1530_DETECT_TIMEOUT; ++i)
|
||||
{
|
||||
ret = property_get(qca1530_property_name, buf, NULL);
|
||||
ret = platform_lib_abstraction_property_get(qca1530_property_name, buf, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
LOC_LOGV( "qca1530: property %s is not accessible, ret=%d",
|
||||
|
@ -174,6 +175,20 @@ void loc_get_platform_name(char *platform_name, int array_length)
|
|||
}
|
||||
}
|
||||
|
||||
/*The character array passed to this function should have length
|
||||
of atleast PROPERTY_VALUE_MAX*/
|
||||
void loc_get_auto_platform_name(char *platform_name, int array_length)
|
||||
{
|
||||
if(platform_name && (array_length >= PROPERTY_VALUE_MAX)) {
|
||||
property_get("ro.hardware.type", platform_name, "");
|
||||
LOC_LOGD("%s:%d]: Autoplatform name: %s\n", __func__, __LINE__, platform_name);
|
||||
}
|
||||
else {
|
||||
LOC_LOGE("%s:%d]: Null parameter or array length less than PROPERTY_VALUE_MAX\n",
|
||||
__func__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int loc_get_target(void)
|
||||
{
|
||||
if (gTarget != (unsigned int)-1)
|
||||
|
@ -190,6 +205,7 @@ unsigned int loc_get_target(void)
|
|||
char rd_id[LINE_LEN];
|
||||
char rd_mdm[LINE_LEN];
|
||||
char baseband[LINE_LEN];
|
||||
char rd_auto_platform[LINE_LEN];
|
||||
|
||||
if (is_qca1530()) {
|
||||
gTarget = TARGET_QCA1530;
|
||||
|
@ -208,16 +224,26 @@ unsigned int loc_get_target(void)
|
|||
} else {
|
||||
read_a_line(id_dep, rd_id, LINE_LEN);
|
||||
}
|
||||
if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) )
|
||||
|
||||
/*check automotive platform*/
|
||||
loc_get_auto_platform_name(rd_auto_platform, sizeof(rd_auto_platform));
|
||||
if( !memcmp(rd_auto_platform, STR_AUTO, LENGTH(STR_AUTO)) )
|
||||
{
|
||||
gTarget = TARGET_AUTO;
|
||||
goto detected;
|
||||
}
|
||||
|
||||
if( !memcmp(baseband, STR_APQ_NO_WGR, LENGTH(STR_APQ_NO_WGR)) ){
|
||||
|
||||
gTarget = TARGET_NO_GNSS;
|
||||
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;
|
||||
gTarget = TARGET_NO_GNSS;
|
||||
else
|
||||
gTarget = TARGET_APQ_SA;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#define TARGET_DEFAULT TARGET_SET(GNSS_MSM, HAS_SSC)
|
||||
#define TARGET_MDM TARGET_SET(GNSS_MDM, HAS_SSC)
|
||||
#define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC)
|
||||
#define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC)
|
||||
#define TARGET_NO_GNSS 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)
|
||||
|
@ -52,6 +52,10 @@ void loc_get_target_baseband(char *baseband, int array_length);
|
|||
/*The character array passed to this function should have length
|
||||
of atleast PROPERTY_VALUE_MAX*/
|
||||
void loc_get_platform_name(char *platform_name, int array_length);
|
||||
/*The character array passed to this function should have length
|
||||
of atleast PROPERTY_VALUE_MAX*/
|
||||
void loc_get_auto_platform_name(char *platform_name, int array_length);
|
||||
|
||||
/*Reads the property ro.lean to identify if this is a lean target
|
||||
Returns:
|
||||
0 if not a lean and mean target
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#include <stddef.h>
|
||||
|
||||
#include <platform_lib_includes.h>
|
||||
/*
|
||||
user_data: client context pointer, passthrough. Originally received
|
||||
from calling client when loc_timer_start() is called.
|
||||
|
|
|
@ -159,6 +159,12 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); }
|
|||
} \
|
||||
} while(0)
|
||||
|
||||
#define LOC_LOG_HEAD(tag,fmt) "%s:%d][" tag "] " fmt "\n"
|
||||
#define LOC_LOGv(tag,fmt,...) LOC_LOGV(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define LOC_LOGw(tag,fmt,...) LOC_LOGW(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define LOC_LOGd(tag,fmt,...) LOC_LOGD(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define LOC_LOGe(tag,fmt,...) LOC_LOGE(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
|
||||
#define LOG_I(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGI, ID, WHAT, SPEC, VAL)
|
||||
#define LOG_V(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGV, ID, WHAT, SPEC, VAL)
|
||||
#define LOG_E(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGE, ID, WHAT, SPEC, VAL)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2012,2014 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
|
||||
|
@ -29,8 +29,7 @@
|
|||
#include "msg_q.h"
|
||||
|
||||
#define LOG_TAG "LocSvc_utils_q"
|
||||
#include "log_util.h"
|
||||
#include "platform_lib_includes.h"
|
||||
#include <platform_lib_includes.h>
|
||||
#include "linked_list.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
5
gps/utils/platform_lib_abstractions/Android.mk
Normal file
5
gps/utils/platform_lib_abstractions/Android.mk
Normal file
|
@ -0,0 +1,5 @@
|
|||
ifneq ($(BUILD_TINY_ANDROID),true)
|
||||
|
||||
include $(call all-subdir-makefiles)
|
||||
|
||||
endif
|
5
gps/utils/platform_lib_abstractions/loc_pla/Android.mk
Normal file
5
gps/utils/platform_lib_abstractions/loc_pla/Android.mk
Normal file
|
@ -0,0 +1,5 @@
|
|||
ifneq ($(BUILD_TINY_ANDROID),true)
|
||||
|
||||
include $(call all-subdir-makefiles)
|
||||
|
||||
endif
|
10
gps/utils/platform_lib_abstractions/loc_pla/Makefile.am
Normal file
10
gps/utils/platform_lib_abstractions/loc_pla/Makefile.am
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Makefile.am for gps loc-pla
|
||||
#
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = loc-pla.pc
|
||||
EXTRA_DIST = $(pkgconfig_DATA)
|
61
gps/utils/platform_lib_abstractions/loc_pla/configure.ac
Normal file
61
gps/utils/platform_lib_abstractions/loc_pla/configure.ac
Normal file
|
@ -0,0 +1,61 @@
|
|||
# configure.ac -- Autoconf script for gps loc-pla
|
||||
#
|
||||
# Process this file with autoconf to produce a configure script
|
||||
|
||||
# Requires autoconf tool later than 2.61
|
||||
AC_PREREQ(2.61)
|
||||
# Initialize the gps loc-pla package version 1.0.0
|
||||
AC_INIT([loc-pla],1.0.0)
|
||||
# Does not strictly follow GNU Coding standards
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
# Disables auto rebuilding of configure, Makefile.ins
|
||||
AM_MAINTAINER_MODE
|
||||
# Verifies the --srcdir is correct by checking for the path
|
||||
AC_CONFIG_SRCDIR([include/platform_lib_includes.h])
|
||||
# defines some macros variable to be included by source
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_AWK
|
||||
AC_PROG_CPP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
# Checks for libraries.
|
||||
PKG_CHECK_MODULES([LOCSTUB], [loc-stub])
|
||||
AC_SUBST([LOCSTUB_CFLAGS])
|
||||
AC_SUBST([LOCSTUB_LIBS])
|
||||
|
||||
AC_ARG_WITH([glib],
|
||||
AC_HELP_STRING([--with-glib],
|
||||
[enable glib, building HLOS systems which use glib]))
|
||||
|
||||
if (test "x${with_glib}" = "xyes"); then
|
||||
AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
|
||||
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
|
||||
AC_MSG_ERROR(GThread >= 2.16 is required))
|
||||
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
|
||||
AC_MSG_ERROR(GLib >= 2.16 is required))
|
||||
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
|
||||
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
|
||||
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
|
||||
|
||||
AC_CONFIG_FILES([ \
|
||||
Makefile \
|
||||
src/Makefile \
|
||||
loc-pla.pc \
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
|
@ -0,0 +1,45 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __PLATFORM_LIB_ANDROID_RUNTIME_H__
|
||||
#define __PLATFORM_LIB_ANDROID_RUNTIME_H__
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
pthread_t platform_lib_abstraction_createJavaThread(const char* name, void (*start)(void *), void* arg);
|
||||
#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION platform_lib_abstraction_createJavaThread
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /*__PLATFORM_LIB_ANDROID_RUNTIME_H__ */
|
|
@ -0,0 +1,41 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __PLATFORM_LIB_GETTID_H__
|
||||
#define __PLATFORM_LIB_GETTID_H__
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
pid_t platform_lib_abstraction_gettid();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __PLATFORM_LIB_GETTID_H__ */
|
|
@ -0,0 +1,40 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __PLATFORM_LIB_INCLUDES_H__
|
||||
#define __PLATFORM_LIB_INCLUDES_H__
|
||||
|
||||
#include "platform_lib_android_runtime.h"
|
||||
#include "platform_lib_gettid.h"
|
||||
#include "platform_lib_log_util.h"
|
||||
#include "platform_lib_macros.h"
|
||||
#include "platform_lib_property_service.h"
|
||||
#include "platform_lib_sched_policy.h"
|
||||
#include "platform_lib_time.h"
|
||||
|
||||
#endif /* __PLATFORM_LIB_INCLUDES_H__ */
|
|
@ -0,0 +1,196 @@
|
|||
/* Copyright (c) 2011-2014 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __PLATFORM_LIB_LOG_UTIL_H__
|
||||
#define __PLATFORM_LIB_LOG_UTIL_H__
|
||||
|
||||
#include "platform_lib_macros.h"
|
||||
|
||||
#ifndef USE_GLIB
|
||||
#include <log_util.h>
|
||||
#else
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef LOG_TAG
|
||||
#define LOG_TAG "GPS_UTILS"
|
||||
#endif /* LOG_TAG */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/*=============================================================================
|
||||
*
|
||||
* LOC LOGGER TYPE DECLARATION
|
||||
*
|
||||
*============================================================================*/
|
||||
/* LOC LOGGER */
|
||||
typedef struct loc_logger_s
|
||||
{
|
||||
unsigned long DEBUG_LEVEL;
|
||||
unsigned long TIMESTAMP;
|
||||
} loc_logger_s_type;
|
||||
|
||||
/*=============================================================================
|
||||
*
|
||||
* EXTERNAL DATA
|
||||
*
|
||||
*============================================================================*/
|
||||
extern loc_logger_s_type loc_logger;
|
||||
|
||||
// Logging Improvements
|
||||
extern const char *loc_logger_boolStr[];
|
||||
|
||||
extern const char *boolStr[];
|
||||
extern const char VOID_RET[];
|
||||
extern const char FROM_AFW[];
|
||||
extern const char TO_MODEM[];
|
||||
extern const char FROM_MODEM[];
|
||||
extern const char TO_AFW[];
|
||||
extern const char EXIT_TAG[];
|
||||
extern const char ENTRY_TAG[];
|
||||
extern const char EXIT_ERROR_TAG[];
|
||||
|
||||
/*=============================================================================
|
||||
*
|
||||
* MODULE EXPORTED FUNCTIONS
|
||||
*
|
||||
*============================================================================*/
|
||||
void loc_logger_init(unsigned long debug, unsigned long timestamp);
|
||||
char* get_timestamp(char* str, unsigned long buf_size);
|
||||
|
||||
#ifndef DEBUG_DMN_LOC_API
|
||||
|
||||
/* LOGGING MACROS */
|
||||
/*loc_logger.DEBUG_LEVEL is initialized to 0xff in loc_cfg.cpp
|
||||
if that value remains unchanged, it means gps.conf did not
|
||||
provide a value and we default to the initial value to use
|
||||
Android's logging levels*/
|
||||
#define IF_LOC_LOGE if((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||
|
||||
#define IF_LOC_LOGW if((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||
|
||||
#define IF_LOC_LOGI if((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||
|
||||
#define IF_LOC_LOGD if((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||
|
||||
#define IF_LOC_LOGV if((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5))
|
||||
|
||||
#define LOC_LOGE(...) \
|
||||
IF_LOC_LOGE { ALOGE("E/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("E/" __VA_ARGS__); }
|
||||
|
||||
#define LOC_LOGW(...) \
|
||||
IF_LOC_LOGW { ALOGE("W/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/" __VA_ARGS__); }
|
||||
|
||||
#define LOC_LOGI(...) \
|
||||
IF_LOC_LOGI { ALOGE("I/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/" __VA_ARGS__); }
|
||||
|
||||
#define LOC_LOGD(...) \
|
||||
IF_LOC_LOGD { ALOGE("D/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/" __VA_ARGS__); }
|
||||
|
||||
#define LOC_LOGV(...) \
|
||||
IF_LOC_LOGV { ALOGE("V/" __VA_ARGS__); } \
|
||||
else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); }
|
||||
|
||||
#else /* DEBUG_DMN_LOC_API */
|
||||
|
||||
#define LOC_LOGE(...) ALOGE("E/" __VA_ARGS__)
|
||||
|
||||
#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__)
|
||||
|
||||
#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__)
|
||||
|
||||
#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__)
|
||||
|
||||
#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__)
|
||||
|
||||
#endif /* DEBUG_DMN_LOC_API */
|
||||
|
||||
/*=============================================================================
|
||||
*
|
||||
* LOGGING IMPROVEMENT MACROS
|
||||
*
|
||||
*============================================================================*/
|
||||
#define LOG_(LOC_LOG, ID, WHAT, SPEC, VAL) \
|
||||
do { \
|
||||
if (loc_logger.TIMESTAMP) { \
|
||||
char ts[32]; \
|
||||
LOC_LOG("[%s] %s %s line %d " #SPEC, \
|
||||
get_timestamp(ts, sizeof(ts)), ID, WHAT, __LINE__, VAL); \
|
||||
} else { \
|
||||
LOC_LOG("%s %s line %d " #SPEC, \
|
||||
ID, WHAT, __LINE__, VAL); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define LOC_LOG_HEAD(tag,fmt) "%s:%d][" tag "] " fmt "\n"
|
||||
#define LOC_LOGv(tag,fmt,...) LOC_LOGV(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define LOC_LOGw(tag,fmt,...) LOC_LOGW(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define LOC_LOGd(tag,fmt,...) LOC_LOGD(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
#define LOC_LOGe(tag,fmt,...) LOC_LOGE(LOC_LOG_HEAD(tag,fmt), __func__, __LINE__, ##__VA_ARGS__)
|
||||
|
||||
#define LOG_I(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGI, ID, WHAT, SPEC, VAL)
|
||||
#define LOG_V(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGV, ID, WHAT, SPEC, VAL)
|
||||
#define LOG_E(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGE, ID, WHAT, SPEC, VAL)
|
||||
|
||||
#define ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "")
|
||||
#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL)
|
||||
#define EXIT_LOG_WITH_ERROR(SPEC, VAL) \
|
||||
if (VAL != 0) { \
|
||||
LOG_E(EXIT_ERROR_TAG, __func__, SPEC, VAL); \
|
||||
} else { \
|
||||
LOG_V(EXIT_TAG, __func__, SPEC, VAL); \
|
||||
}
|
||||
|
||||
|
||||
// Used for logging callflow from Android Framework
|
||||
#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "")
|
||||
// Used for logging callflow to Modem
|
||||
#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __func__, SPEC, VAL)
|
||||
// Used for logging callflow from Modem(TO_MODEM, __func__, %s, "")
|
||||
#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __func__, SPEC, VAL)
|
||||
// Used for logging callflow to Android Framework
|
||||
#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
#endif /* __PLATFORM_LIB_LOG_UTIL_H__ */
|
|
@ -0,0 +1,73 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __PLATFORM_LIB_MACROS_H__
|
||||
#define __PLATFORM_LIB_MACROS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <sys/time.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef OFF_TARGET
|
||||
#include <glib.h>
|
||||
#define strlcat g_strlcat
|
||||
#define strlcpy g_strlcpy
|
||||
#else
|
||||
#define strlcat strncat
|
||||
#define strlcpy strncpy
|
||||
#endif
|
||||
|
||||
#define TS_PRINTF(format, x...) \
|
||||
{ \
|
||||
struct timeval tv; \
|
||||
struct timezone tz; \
|
||||
int hh, mm, ss; \
|
||||
gettimeofday(&tv, &tz); \
|
||||
hh = tv.tv_sec/3600%24; \
|
||||
mm = (tv.tv_sec%3600)/60; \
|
||||
ss = tv.tv_sec%60; \
|
||||
fprintf(stdout,"%02d:%02d:%02d.%06ld]" format "\n", hh, mm, ss, tv.tv_usec,##x); \
|
||||
}
|
||||
|
||||
#define ALOGE(format, x...) TS_PRINTF("E/%s (%d): " format , LOG_TAG, getpid(), ##x)
|
||||
#define ALOGW(format, x...) TS_PRINTF("W/%s (%d): " format , LOG_TAG, getpid(), ##x)
|
||||
#define ALOGI(format, x...) TS_PRINTF("I/%s (%d): " format , LOG_TAG, getpid(), ##x)
|
||||
#define ALOGD(format, x...) TS_PRINTF("D/%s (%d): " format , LOG_TAG, getpid(), ##x)
|
||||
#define ALOGV(format, x...) TS_PRINTF("V/%s (%d): " format , LOG_TAG, getpid(), ##x)
|
||||
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /*__cplusplus */
|
||||
|
||||
#endif /* __PLATFORM_LIB_MACROS_H__ */
|
|
@ -0,0 +1,44 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __PLATFORM_LIB_PROPERTY_SERVICE_H__
|
||||
#define __PLATFORM_LIB_PROPERTY_SERVICE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifndef PROPERTY_VALUE_MAX
|
||||
#define PROPERTY_VALUE_MAX 92
|
||||
#endif
|
||||
int platform_lib_abstraction_property_get(const char *key, char *value, const char *default_value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __PLATFORM_LIB_PROPERTY_SERVICE_H__ */
|
|
@ -0,0 +1,46 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __PLATFORM_LIB_SCHED_POLICY_H__
|
||||
#define __PLATFORM_LIB_SCHED_POLICY_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
typedef enum {
|
||||
PLA_SP_BACKGROUND = 0,
|
||||
PLA_SP_FOREGROUND = 1,
|
||||
} PLASchedPolicy;
|
||||
|
||||
int platform_lib_abstraction_set_sched_policy(int tid, PLASchedPolicy policy);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __PLATFORM_LIB_SCHED_POLICY_H__ */
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __PLATFORM_LIB_TIME_H__
|
||||
#define __PLATFORM_LIB_TIME_H__
|
||||
|
||||
#include <stdint.h>
|
||||
int64_t platform_lib_abstraction_elapsed_millis_since_boot();
|
||||
|
||||
#endif /* __PLATFORM_LIB_TIME_H__ */
|
10
gps/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in
Normal file
10
gps/utils/platform_lib_abstractions/loc_pla/loc-pla.pc.in
Normal file
|
@ -0,0 +1,10 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: loc-pla
|
||||
Description: QTI GPS Location Platform Library Abstractions
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lloc_pla
|
||||
Cflags: -I${includedir}/loc-pla
|
57
gps/utils/platform_lib_abstractions/loc_pla/src/Android.mk
Normal file
57
gps/utils/platform_lib_abstractions/loc_pla/src/Android.mk
Normal file
|
@ -0,0 +1,57 @@
|
|||
ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
||||
ifneq ($(BUILD_TINY_ANDROID),true)
|
||||
#Compile this library only for builds with the latest modem image
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
## Libs
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libutils \
|
||||
libcutils \
|
||||
liblog \
|
||||
libloc_stub
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
platform_lib_android_runtime.cpp \
|
||||
platform_lib_gettid.cpp \
|
||||
platform_lib_log_util.cpp \
|
||||
platform_lib_property_service.cpp \
|
||||
platform_lib_sched_policy.cpp \
|
||||
platform_lib_time.cpp
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-fno-short-enums \
|
||||
-D_ANDROID_ \
|
||||
-std=c++11
|
||||
|
||||
|
||||
LOCAL_LDFLAGS += -Wl,--export-dynamic
|
||||
|
||||
## Includes
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/../include \
|
||||
$(TARGET_OUT_HEADERS)/gps.utils \
|
||||
$(TARGET_OUT_HEADERS)/libloc_stub
|
||||
|
||||
LOCAL_COPY_HEADERS_TO:= libloc_pla/
|
||||
LOCAL_COPY_HEADERS:= \
|
||||
../include/platform_lib_android_runtime.h \
|
||||
../include/platform_lib_gettid.h \
|
||||
../include/platform_lib_includes.h \
|
||||
../include/platform_lib_log_util.h \
|
||||
../include/platform_lib_macros.h \
|
||||
../include/platform_lib_property_service.h \
|
||||
../include/platform_lib_sched_policy.h \
|
||||
../include/platform_lib_time.h
|
||||
|
||||
LOCAL_MODULE := libloc_pla
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
endif # not BUILD_TINY_ANDROID
|
||||
endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE
|
41
gps/utils/platform_lib_abstractions/loc_pla/src/Makefile.am
Normal file
41
gps/utils/platform_lib_abstractions/loc_pla/src/Makefile.am
Normal file
|
@ -0,0 +1,41 @@
|
|||
AM_CFLAGS = \
|
||||
$(LOCSTUB_CFLAGS) \
|
||||
-I../include \
|
||||
-D__func__=__PRETTY_FUNCTION__ \
|
||||
-fno-short-enums
|
||||
|
||||
h_sources = \
|
||||
../include/platform_lib_android_runtime.h \
|
||||
../include/platform_lib_gettid.h \
|
||||
../include/platform_lib_includes.h \
|
||||
../include/platform_lib_log_util.h \
|
||||
../include/platform_lib_macros.h \
|
||||
../include/platform_lib_property_service.h \
|
||||
../include/platform_lib_sched_policy.h \
|
||||
../include/platform_lib_time.h
|
||||
|
||||
library_includedir = $(pkgincludedir)
|
||||
library_include_HEADERS = $(h_sources)
|
||||
|
||||
libloc_pla_la_SOURCES = \
|
||||
platform_lib_android_runtime.cpp \
|
||||
platform_lib_gettid.cpp \
|
||||
platform_lib_log_util.cpp \
|
||||
platform_lib_property_service.cpp \
|
||||
platform_lib_sched_policy.cpp \
|
||||
platform_lib_time.cpp
|
||||
|
||||
if USE_GLIB
|
||||
libloc_pla_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_pla_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_pla_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_pla_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_pla_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_pla_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_pla_la_LIBADD = -lstdc++ -ldl -llog $(LOCSTUB_LIBS)
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_pla.la
|
|
@ -0,0 +1,40 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "platform_lib_android_runtime.h"
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <loc_stub_android_runtime.h>
|
||||
#else
|
||||
#include <android_runtime/AndroidRuntime.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
pthread_t platform_lib_abstraction_createJavaThread(const char* name, void (*start)(void *), void* arg)
|
||||
{
|
||||
return (pthread_t)android::AndroidRuntime::createJavaThread(name, start, arg);
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "platform_lib_gettid.h"
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <loc_stub_gettid.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
pid_t platform_lib_abstraction_gettid()
|
||||
{
|
||||
return gettid();
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "platform_lib_log_util.h"
|
||||
|
||||
char * get_timestamp(char *str, unsigned long buf_size)
|
||||
{
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
int hh, mm, ss;
|
||||
gettimeofday(&tv, &tz);
|
||||
hh = tv.tv_sec/3600%24;
|
||||
mm = (tv.tv_sec%3600)/60;
|
||||
ss = tv.tv_sec%60;
|
||||
snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_usec);
|
||||
return str;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "platform_lib_property_service.h"
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <loc_stub_property_service.h>
|
||||
#else
|
||||
#include <cutils/properties.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
int platform_lib_abstraction_property_get(const char *key, char *value, const char *default_value)
|
||||
{
|
||||
return property_get(key, value, default_value);
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "platform_lib_sched_policy.h"
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <loc_stub_sched_policy.h>
|
||||
#else
|
||||
#include <cutils/sched_policy.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
int platform_lib_abstraction_set_sched_policy(int tid, PLASchedPolicy policy)
|
||||
{
|
||||
return set_sched_policy(tid, (SchedPolicy)policy);
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "platform_lib_time.h"
|
||||
|
||||
#ifdef USE_GLIB
|
||||
#include <loc_stub_time.h>
|
||||
#else
|
||||
#include <utils/SystemClock.h>
|
||||
#endif /* USE_GLIB */
|
||||
|
||||
int64_t platform_lib_abstraction_elapsed_millis_since_boot()
|
||||
{
|
||||
#ifdef USE_GLIB
|
||||
|
||||
return elapsedMillisSinceBoot();
|
||||
|
||||
#else
|
||||
|
||||
return android::elapsedRealtime();
|
||||
|
||||
#endif
|
||||
}
|
5
gps/utils/platform_lib_abstractions/loc_stub/Android.mk
Normal file
5
gps/utils/platform_lib_abstractions/loc_stub/Android.mk
Normal file
|
@ -0,0 +1,5 @@
|
|||
ifneq ($(BUILD_TINY_ANDROID),true)
|
||||
|
||||
include $(call all-subdir-makefiles)
|
||||
|
||||
endif
|
9
gps/utils/platform_lib_abstractions/loc_stub/Makefile.am
Normal file
9
gps/utils/platform_lib_abstractions/loc_stub/Makefile.am
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Makefile.am for gps loc-stub
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = loc-stub.pc
|
||||
EXTRA_DIST = $(pkgconfig_DATA)
|
67
gps/utils/platform_lib_abstractions/loc_stub/configure.ac
Normal file
67
gps/utils/platform_lib_abstractions/loc_stub/configure.ac
Normal file
|
@ -0,0 +1,67 @@
|
|||
# configure.ac -- Autoconf script for gps loc-stub
|
||||
#
|
||||
# Process this file with autoconf to produce a configure script
|
||||
|
||||
# Requires autoconf tool later than 2.61
|
||||
AC_PREREQ(2.61)
|
||||
# Initialize the gps loc-stub package version 1.0.0
|
||||
AC_INIT([loc-stub],1.0.0)
|
||||
# Does not strictly follow GNU Coding standards
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
# Disables auto rebuilding of configure, Makefile.ins
|
||||
AM_MAINTAINER_MODE
|
||||
# Verifies the --srcdir is correct by checking for the path
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
# defines some macros variable to be included by source
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_AWK
|
||||
AC_PROG_CPP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
# Checks for libraries.
|
||||
AC_ARG_WITH([hardware_include],
|
||||
AC_HELP_STRING([--with-hardware-include=@<:@dir@:>@],
|
||||
[Specify the location of the hardware headers]),
|
||||
[hardware_incdir=$withval],
|
||||
with_hardware_include=no)
|
||||
|
||||
if test "x$with_hardware_include" != "xno"; then
|
||||
CPPFLAGS="${CPPFLAGS} -I${hardware_incdir}"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([glib],
|
||||
AC_HELP_STRING([--with-glib],
|
||||
[enable glib, building HLOS systems which use glib]))
|
||||
|
||||
if (test "x${with_glib}" = "xyes"); then
|
||||
AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
|
||||
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
|
||||
AC_MSG_ERROR(GThread >= 2.16 is required))
|
||||
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
|
||||
AC_MSG_ERROR(GLib >= 2.16 is required))
|
||||
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
|
||||
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
|
||||
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
|
||||
|
||||
AC_CONFIG_FILES([ \
|
||||
Makefile \
|
||||
src/Makefile \
|
||||
loc-stub.pc
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
|
@ -0,0 +1,45 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __LOC_STUB_ANDROID_RUNTIME_H__
|
||||
#define __LOC_STUB_ANDROID_RUNTIME_H__
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
class AndroidRuntime
|
||||
{
|
||||
public:
|
||||
/** create a new thread that is visible from Java */
|
||||
static pthread_t createJavaThread(const char* name, void (*start)(void *),
|
||||
void* arg);
|
||||
};
|
||||
|
||||
}
|
||||
#endif /* __LOC_STUB_ANDROID_RUNTIME_H__ */
|
|
@ -0,0 +1,44 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __LOC_STUB_GETTID_H__
|
||||
#define __LOC_STUB_GETTID_H__
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
pid_t gettid(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LOC_STUB_GETTID_H__ */
|
|
@ -0,0 +1,42 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __LOC_STUB_PROPERTY_SERVICE_H__
|
||||
#define __LOC_STUB_PROPERTY_SERVICE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int property_get(const char *key, char *value, const char *default_value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __LOC_STUB_PROPERTY_SERVICE_H__ */
|
|
@ -0,0 +1,64 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __LOC_STUB_SCHED_POLICY_H__
|
||||
#define __LOC_STUB_SCHED_POLICY_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
SP_BACKGROUND = 0,
|
||||
SP_FOREGROUND = 1,
|
||||
} SchedPolicy;
|
||||
|
||||
/*===========================================================================
|
||||
FUNCTION set_sched_policy
|
||||
|
||||
DESCRIPTION
|
||||
Local copy of this function which bypasses android set_sched_policy
|
||||
|
||||
DEPENDENCIES
|
||||
None
|
||||
|
||||
RETURN VALUE
|
||||
0
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
int set_sched_policy(int tid, SchedPolicy policy);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __LOC_STUB_SCHED_POLICY_H__ */
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __LOC_STUB_TIME_H__
|
||||
#define __LOC_STUB_TIME_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int64_t systemTime(int clock);
|
||||
int64_t elapsedMillisSinceBoot();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __LOC_STUB_TIME_H__ */
|
10
gps/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in
Normal file
10
gps/utils/platform_lib_abstractions/loc_stub/loc-stub.pc.in
Normal file
|
@ -0,0 +1,10 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: loc-stub
|
||||
Description: QTI GPS Location Stub
|
||||
Version: @VERSION
|
||||
Libs: -L${libdir} -lloc_stub
|
||||
Cflags: -I${includedir}/loc-stub
|
51
gps/utils/platform_lib_abstractions/loc_stub/src/Android.mk
Normal file
51
gps/utils/platform_lib_abstractions/loc_stub/src/Android.mk
Normal file
|
@ -0,0 +1,51 @@
|
|||
ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
|
||||
ifneq ($(BUILD_TINY_ANDROID),true)
|
||||
#Compile this library only for builds with the latest modem image
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
## Libs
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libutils \
|
||||
libcutils \
|
||||
liblog
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
loc_stub_android_runtime.cpp \
|
||||
loc_stub_gettid.cpp \
|
||||
loc_stub_property_service.cpp \
|
||||
loc_stub_sched_policy.cpp \
|
||||
loc_stub_time.cpp
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-fno-short-enums \
|
||||
-D_ANDROID_ \
|
||||
-std=c++11
|
||||
|
||||
|
||||
LOCAL_LDFLAGS += -Wl,--export-dynamic
|
||||
|
||||
## Includes
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/../include \
|
||||
|
||||
|
||||
LOCAL_COPY_HEADERS_TO:= libloc_stub/
|
||||
LOCAL_COPY_HEADERS:= \
|
||||
../include/loc_stub_android_runtime.h \
|
||||
../include/loc_stub_gettid.h \
|
||||
../include/loc_stub_property_service.h \
|
||||
../include/loc_stub_sched_policy.h \
|
||||
../include/loc_stub_time.h
|
||||
|
||||
LOCAL_MODULE := libloc_stub
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
endif # not BUILD_TINY_ANDROID
|
||||
endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE
|
40
gps/utils/platform_lib_abstractions/loc_stub/src/Makefile.am
Normal file
40
gps/utils/platform_lib_abstractions/loc_stub/src/Makefile.am
Normal file
|
@ -0,0 +1,40 @@
|
|||
AM_CFLAGS = \
|
||||
-I../include \
|
||||
-D__func__=__PRETTY_FUNCTION__ \
|
||||
-fno-short-enums
|
||||
|
||||
libloc_stub_la_extra_h = \
|
||||
../include/utils/Log.h
|
||||
|
||||
libloc_stub_la_c_sources = \
|
||||
loc_stub_android_runtime.cpp \
|
||||
loc_stub_gettid.cpp \
|
||||
loc_stub_property_service.cpp \
|
||||
loc_stub_sched_policy.cpp \
|
||||
loc_stub_time.cpp
|
||||
|
||||
libloc_stub_la_SOURCES = $(libloc_stub_la_c_sources) $(libloc_stub_la_extra_h)
|
||||
|
||||
library_include_HEADERS = \
|
||||
../include/loc_stub_android_runtime.h \
|
||||
../include/loc_stub_gettid.h \
|
||||
../include/loc_stub_property_service.h \
|
||||
../include/loc_stub_sched_policy.h \
|
||||
../include/loc_stub_time.h
|
||||
|
||||
library_includedir = $(pkgincludedir)
|
||||
|
||||
if USE_GLIB
|
||||
libloc_stub_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_stub_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_stub_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_stub_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_stub_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_stub_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_stub_la_LIBADD = -lstdc++ -ldl -llog
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_stub.la
|
|
@ -0,0 +1,41 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "loc_stub_android_runtime.h"
|
||||
|
||||
namespace android {
|
||||
|
||||
pthread_t AndroidRuntime::createJavaThread(const char* name,
|
||||
void (*start)(void *), void* arg)
|
||||
{
|
||||
pthread_t threadId = 0;
|
||||
pthread_create(&threadId, NULL, (void *(*)(void*))start, arg);
|
||||
return threadId;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "loc_stub_gettid.h"
|
||||
#include <sys/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
// Required for off-target environment to compile properly
|
||||
pid_t gettid(void)
|
||||
{
|
||||
return syscall(SYS_gettid);
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "loc_stub_property_service.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int property_get(const char *key, char * value, const char *default_value)
|
||||
{
|
||||
/* This will disable gps interface
|
||||
value[0] = '1';
|
||||
*/
|
||||
if (strcmp(key, "ro.baseband") == 0) {
|
||||
memcpy(value, "msm", 4);
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "loc_stub_sched_policy.h"
|
||||
|
||||
/*===========================================================================
|
||||
FUNCTION set_sched_policy
|
||||
|
||||
DESCRIPTION
|
||||
Local copy of this function which bypasses android set_sched_policy
|
||||
|
||||
DEPENDENCIES
|
||||
None
|
||||
|
||||
RETURN VALUE
|
||||
0
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
int set_sched_policy(int tid, SchedPolicy policy)
|
||||
{
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/* Copyright (c) 2014, 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "loc_stub_time.h"
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
int64_t systemTime(int clock)
|
||||
{
|
||||
struct timeval t;
|
||||
t.tv_sec = t.tv_usec = 0;
|
||||
gettimeofday(&t, NULL);
|
||||
return t.tv_sec*1000000LL + t.tv_usec;
|
||||
}
|
||||
|
||||
|
||||
int64_t elapsedMillisSinceBoot()
|
||||
{
|
||||
int64_t t_us = systemTime(0);
|
||||
return (int64_t) t_us / 1000LL;
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
# GPS
|
||||
PRODUCT_PACKAGES += \
|
||||
gps.default \
|
||||
gps.msm8937 \
|
||||
gps.conf \
|
||||
libcurl
|
||||
|
||||
PRODUCT_BOOT_JARS += \
|
||||
|
|
Loading…
Reference in a new issue