diff options
| author | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-10-21 04:31:00 +0100 |
|---|---|---|
| committer | Arvin Quilao <arquilao@gmail.com> | 2015-12-17 12:19:17 +0800 |
| commit | 974a7db70d962f957fe5f27aa0a3050e63a0b483 (patch) | |
| tree | 2733552f7a722b21a01a90487e07dbdb27914600 /gps | |
| parent | fb93a8bd9eb28c0cd5bca38a55e81095956fa3d7 (diff) | |
gps: Update to LA.BR.1.2.6_rb1.2
Change-Id: Ibe9867743e014563a6ffa1dd6c0d2c4ce4ffef6e
Diffstat (limited to 'gps')
58 files changed, 4472 insertions, 1756 deletions
diff --git a/gps/CleanSpec.mk b/gps/CleanSpec.mk new file mode 100644 index 0000000..dd1849d --- /dev/null +++ b/gps/CleanSpec.mk @@ -0,0 +1,50 @@ +# Copyright (C) 2007 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# If you don't need to do a full clean build but would like to touch +# a file or delete some intermediate files, add a clean step to the end +# of the list. These steps will only be run once, if they haven't been +# run before. +# +# E.g.: +# $(call add-clean-step, touch -c external/sqlite/sqlite3.h) +# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) +# +# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with +# files that are missing or have been moved. +# +# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. +# Use $(OUT_DIR) to refer to the "out" directory. +# +# If you need to re-do something that's already mentioned, just copy +# the command and add it to the bottom of the list. E.g., if a change +# that you made last week required touching a file and a change you +# made today requires touching the same file, just copy the old +# touch step and add it to the end of the list. +# +# ************************************************ +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST +# ************************************************ + +# For example: +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) +#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) +#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) + +# ************************************************ +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST +# ************************************************ +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*) diff --git a/gps/Makefile.am b/gps/Makefile.am new file mode 100644 index 0000000..f374a5c --- /dev/null +++ b/gps/Makefile.am @@ -0,0 +1,10 @@ +# Makefile.am - Automake script for gps loc_api +# + +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = utils loc_api/libloc_api_50001 loc_api/loc_api_v02 + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = loc-api.pc +EXTRA_DIST = $(pkgconfig_DATA) diff --git a/gps/configure.ac b/gps/configure.ac new file mode 100644 index 0000000..dca18a1 --- /dev/null +++ b/gps/configure.ac @@ -0,0 +1,85 @@ +# configure.ac -- Autoconf script for gps loc_api +# +# 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) +# 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([utils/loc_cfg.cpp]) +# 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([QMIF], [qmi-framework]) +AC_SUBST([QMIF_CFLAGS]) +AC_SUBST([QMIF_LIBS]) + +AC_ARG_WITH([libhardware_includes], + AC_HELP_STRING([--with-libhardware-includes=@<:@dir@:>@], + [Specify the location of the libhardware headers]), + [libhardware_incdir=$withval], + with_libhardware_includes=no) + +if test "x$with_libhardware_includes" != "xno"; then + CPPFLAGS="${CPPFLAGS} -I${libhardware_incdir}" +fi + +AC_ARG_WITH([core_includes], + AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], + [Specify the location of the core headers]), + [core_incdir=$withval], + with_core_includes=no) + +if test "x$with_core_includes" != "xno"; then + CPPFLAGS="${CPPFLAGS} -I${core_incdir}" +fi + +AC_SUBST([CPPFLAGS]) + +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 \ + utils/Makefile \ + loc_api/libloc_api_50001/Makefile \ + loc_api/loc_api_v02/Makefile \ + loc-api.pc \ + ]) + +AC_OUTPUT diff --git a/gps/core/Android.mk b/gps/core/Android.mk index 3a23c1e..35a267f 100644 --- a/gps/core/Android.mk +++ b/gps/core/Android.mk @@ -11,6 +11,8 @@ LOCAL_MODULE_TAGS := optional ifeq ($(TARGET_DEVICE),apq8026_lw) LOCAL_CFLAGS += -DPDK_FEATURE_SET +else ifeq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET),true) +LOCAL_CFLAGS += -DPDK_FEATURE_SET endif LOCAL_SHARED_LIBRARIES := \ @@ -20,7 +22,6 @@ LOCAL_SHARED_LIBRARIES := \ libdl LOCAL_SRC_FILES += \ - MsgTask.cpp \ LocApiBase.cpp \ LocAdapterBase.cpp \ ContextBase.cpp \ @@ -32,11 +33,11 @@ LOCAL_CFLAGS += \ -D_ANDROID_ LOCAL_C_INCLUDES:= \ - $(TARGET_OUT_HEADERS)/gps.utils + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libflp LOCAL_COPY_HEADERS_TO:= libloc_core/ LOCAL_COPY_HEADERS:= \ - MsgTask.h \ LocApiBase.h \ LocAdapterBase.h \ ContextBase.h \ diff --git a/gps/core/ContextBase.h b/gps/core/ContextBase.h index 2adbedd..fe0b860 100644 --- a/gps/core/ContextBase.h +++ b/gps/core/ContextBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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 @@ -58,10 +58,14 @@ public: inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); } inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); } + inline void modemPowerVote(bool power) const { return mLBSProxy->modemPowerVote(power); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { mLBSProxy->requestUlp(adapter, capabilities); } + inline IzatDevId_t getIzatDevId() const { + return mLBSProxy->getIzatDevId(); + } inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); } }; diff --git a/gps/core/LBSProxyBase.h b/gps/core/LBSProxyBase.h index 0b7dbdf..0faf801 100644 --- a/gps/core/LBSProxyBase.h +++ b/gps/core/LBSProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, 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 @@ -53,7 +53,9 @@ public: unsigned long capabilities) const {} inline virtual bool hasAgpsExtendedCapabilities() const { return false; } inline virtual bool hasCPIExtendedCapabilities() const { return false; } + inline virtual void modemPowerVote(bool power) const {} virtual void injectFeatureConfig(ContextBase* context) const {} + inline virtual IzatDevId_t getIzatDevId() const { return 0; } }; typedef LBSProxyBase* (getLBSProxy_t)(); diff --git a/gps/core/LocAdapterBase.cpp b/gps/core/LocAdapterBase.cpp index b304653..8fdb8cb 100644 --- a/gps/core/LocAdapterBase.cpp +++ b/gps/core/LocAdapterBase.cpp @@ -72,6 +72,7 @@ void LocAdapterBase:: LocPosTechMask loc_technology_mask) { if (mLocAdapterProxyBase == NULL || !mLocAdapterProxyBase->reportPosition(location, + locationExtended, status, loc_technology_mask)) { DEFAULT_IMPL() @@ -79,7 +80,7 @@ void LocAdapterBase:: } void LocAdapterBase:: - reportSv(GpsSvStatus &svStatus, + reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) DEFAULT_IMPL() @@ -136,10 +137,6 @@ bool LocAdapterBase:: DEFAULT_IMPL(false) void LocAdapterBase:: - shutdown() -DEFAULT_IMPL() - -void LocAdapterBase:: reportGpsMeasurementData(GpsData &gpsMeasurementData) DEFAULT_IMPL() } // namespace loc_core diff --git a/gps/core/LocAdapterBase.h b/gps/core/LocAdapterBase.h index 9d5f6a8..5f4660b 100644 --- a/gps/core/LocAdapterBase.h +++ b/gps/core/LocAdapterBase.h @@ -92,7 +92,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -110,7 +110,6 @@ public: virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data); inline virtual bool isInSession() { return false; } - virtual void shutdown(); ContextBase* getContext() const { return mContext; } virtual void reportGpsMeasurementData(GpsData &gpsMeasurementData); }; diff --git a/gps/core/LocAdapterProxyBase.h b/gps/core/LocAdapterProxyBase.h index f6c22af..1ddcca4 100644 --- a/gps/core/LocAdapterProxyBase.h +++ b/gps/core/LocAdapterProxyBase.h @@ -58,6 +58,7 @@ public: inline virtual void handleEngineUpEvent() {}; inline virtual void handleEngineDownEvent() {}; inline virtual bool reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, enum loc_sess_status status, LocPosTechMask loc_technology_mask) { return false; diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp index f56694e..dcd35fe 100644 --- a/gps/core/LocApiBase.cpp +++ b/gps/core/LocApiBase.cpp @@ -253,15 +253,16 @@ void LocApiBase::reportPosition(UlpLocation &location, ); } -void LocApiBase::reportSv(GpsSvStatus &svStatus, +void LocApiBase::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { // print the SV info before delivering - LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n used" - " in fix mask: %x\n sv: prn snr elevation azimuth", + 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.used_in_fix_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, @@ -488,16 +489,23 @@ enum loc_api_adapter_err LocApiBase:: DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getWwanZppFix(GpsLocation & zppLoc) + getWwanZppFix(GpsLocation& zppLoc) DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) enum loc_api_adapter_err LocApiBase:: - getBestAvailableZppFix(GpsLocation & zppLoc) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + getBestAvailableZppFix(GpsLocation& zppLoc) +{ + memset(&zppLoc, 0, sizeof(zppLoc)); + DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +} enum loc_api_adapter_err LocApiBase:: getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask) -DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +{ + memset(&zppLoc, 0, sizeof(zppLoc)); + memset(&tech_mask, 0, sizeof(tech_mask)); + DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +} int LocApiBase:: initDataServiceClient() diff --git a/gps/core/LocApiBase.h b/gps/core/LocApiBase.h index 414769b..b1c3d30 100644 --- a/gps/core/LocApiBase.h +++ b/gps/core/LocApiBase.h @@ -113,7 +113,7 @@ public: enum loc_sess_status status, LocPosTechMask loc_technology_mask = LOC_POS_TECH_MASK_DEFAULT); - void reportSv(GpsSvStatus &svStatus, + void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); void reportStatus(GpsStatusValue status); diff --git a/gps/core/LocDualContext.cpp b/gps/core/LocDualContext.cpp index d68cb3b..578421c 100644 --- a/gps/core/LocDualContext.cpp +++ b/gps/core/LocDualContext.cpp @@ -63,34 +63,28 @@ const char* LocDualContext::mLBSLibName = "liblbs_core.so"; pthread_mutex_t LocDualContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER; -const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, - const char* name) +const MsgTask* LocDualContext::getMsgTask(LocThread::tCreate tCreator, + const char* name, bool joinable) { if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tCreator, name); + mMsgTask = new MsgTask(tCreator, name, joinable); } return mMsgTask; } -const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate, - const char* name) -{ - if (NULL == mMsgTask) { - mMsgTask = new MsgTask(tAssociate, name); - } else if (tAssociate) { - mMsgTask->associate(tAssociate); - } - return mMsgTask; +inline +const MsgTask* LocDualContext::getMsgTask(const char* name, bool joinable) { + return getMsgTask((LocThread::tCreate)NULL, name, joinable); } -ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, - const char* name) +ContextBase* LocDualContext::getLocFgContext(LocThread::tCreate tCreator, + LocMsg* firstMsg, const char* name, bool joinable) { pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); LOC_LOGD("%s:%d]: querying ContextBase with tCreator", __func__, __LINE__); if (NULL == mFgContext) { LOC_LOGD("%s:%d]: creating msgTask with tCreator", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tCreator, name); + const MsgTask* msgTask = getMsgTask(tCreator, name, joinable); mFgContext = new LocDualContext(msgTask, mFgExclMask); } @@ -100,37 +94,22 @@ ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, injectFeatureConfig(mInjectContext); } pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); - return mFgContext; -} -ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name) -{ - pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); - LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); - if (NULL == mFgContext) { - LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tAssociate, name); - mFgContext = new LocDualContext(msgTask, - mFgExclMask); - } - if(NULL == mInjectContext) { - LOC_LOGD("%s:%d]: mInjectContext is FgContext", __func__, __LINE__); - mInjectContext = mFgContext; - injectFeatureConfig(mInjectContext); + if (firstMsg) { + mFgContext->sendMsg(firstMsg); } - pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); + return mFgContext; } -ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, - const char* name) +ContextBase* LocDualContext::getLocBgContext(LocThread::tCreate tCreator, + LocMsg* firstMsg, const char* name, bool joinable) { pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); LOC_LOGD("%s:%d]: querying ContextBase with tCreator", __func__, __LINE__); if (NULL == mBgContext) { LOC_LOGD("%s:%d]: creating msgTask with tCreator", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tCreator, name); + const MsgTask* msgTask = getMsgTask(tCreator, name, joinable); mBgContext = new LocDualContext(msgTask, mBgExclMask); } @@ -140,26 +119,11 @@ ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, injectFeatureConfig(mInjectContext); } pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); - return mBgContext; -} -ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, - const char* name) -{ - pthread_mutex_lock(&LocDualContext::mGetLocContextMutex); - LOC_LOGD("%s:%d]: querying ContextBase with tAssociate", __func__, __LINE__); - if (NULL == mBgContext) { - LOC_LOGD("%s:%d]: creating msgTask with tAssociate", __func__, __LINE__); - const MsgTask* msgTask = getMsgTask(tAssociate, name); - mBgContext = new LocDualContext(msgTask, - mBgExclMask); - } - if(NULL == mInjectContext) { - LOC_LOGD("%s:%d]: mInjectContext is BgContext", __func__, __LINE__); - mInjectContext = mBgContext; - injectFeatureConfig(mInjectContext); + if (firstMsg) { + mBgContext->sendMsg(firstMsg); } - pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex); + return mBgContext; } diff --git a/gps/core/LocDualContext.h b/gps/core/LocDualContext.h index 1e96ea5..ce77a1a 100644 --- a/gps/core/LocDualContext.h +++ b/gps/core/LocDualContext.h @@ -41,10 +41,9 @@ class LocDualContext : public ContextBase { static ContextBase* mFgContext; static ContextBase* mBgContext; static ContextBase* mInjectContext; - static const MsgTask* getMsgTask(MsgTask::tCreate tCreator, - const char* name); - static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate, - const char* name); + static const MsgTask* getMsgTask(LocThread::tCreate tCreator, + const char* name, bool joinable = true); + static const MsgTask* getMsgTask(const char* name, bool joinable = true); static pthread_mutex_t mGetLocContextMutex; protected: @@ -58,14 +57,17 @@ public: static const LOC_API_ADAPTER_EVENT_MASK_T mBgExclMask; static const char* mLocationHalName; - static ContextBase* getLocFgContext(MsgTask::tCreate tCreator, - const char* name); - static ContextBase* getLocFgContext(MsgTask::tAssociate tAssociate, - const char* name); - static ContextBase* getLocBgContext(MsgTask::tCreate tCreator, - const char* name); - static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate, - const char* name); + static ContextBase* getLocFgContext(LocThread::tCreate tCreator, LocMsg* firstMsg, + const char* name, bool joinable = true); + inline static ContextBase* getLocFgContext(const char* name, bool joinable = true) { + return getLocFgContext(NULL, NULL, name, joinable); + } + static ContextBase* getLocBgContext(LocThread::tCreate tCreator, LocMsg* firstMsg, + const char* name, bool joinable = true); + inline static ContextBase* getLocBgContext(const char* name, bool joinable = true) { + return getLocBgContext(NULL, NULL, name, joinable); + } + static void injectFeatureConfig(ContextBase *context); }; diff --git a/gps/core/MsgTask.cpp b/gps/core/MsgTask.cpp deleted file mode 100644 index 5d375aa..0000000 --- a/gps/core/MsgTask.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * 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. - * - */ -#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> - -namespace loc_core { - -#define MAX_TASK_COMM_LEN 15 - -static void LocMsgDestroy(void* msg) { - delete (LocMsg*)msg; -} - -MsgTask::MsgTask(tCreate tCreator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(NULL){ - if (tCreator) { - tCreator(threadName, loopMain, - (void*)new MsgTask(mQ, mAssociator)); - } else { - createPThread(threadName); - } -} - -MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) : - mQ(msg_q_init2()), mAssociator(tAssociator){ - createPThread(threadName); -} - -inline -MsgTask::MsgTask(const void* q, tAssociate associator) : - mQ(q), mAssociator(associator){ -} - -MsgTask::~MsgTask() { - msg_q_unblock((void*)mQ); -} - -void MsgTask::associate(tAssociate tAssociator) const { - struct LocAssociateMsg : public LocMsg { - tAssociate mAssociator; - inline LocAssociateMsg(tAssociate associator) : - LocMsg(), mAssociator(associator) {} - inline virtual void proc() const { - if (mAssociator) { - LOC_LOGD("MsgTask::associate"); - mAssociator(); - } - } - }; - sendMsg(new LocAssociateMsg(tAssociator)); -} - -void MsgTask::createPThread(const char* threadName) { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - pthread_t tid; - // create the thread here, then if successful - // and a name is given, we set the thread name - if (!pthread_create(&tid, &attr, loopMain, - (void*)new MsgTask(mQ, mAssociator)) && - NULL != threadName) { - char lname[MAX_TASK_COMM_LEN+1]; - memcpy(lname, threadName, MAX_TASK_COMM_LEN); - lname[MAX_TASK_COMM_LEN] = 0; - pthread_setname_np(tid, lname); - } -} - -void MsgTask::sendMsg(const LocMsg* msg) const { - msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); -} - -void* MsgTask::loopMain(void* arg) { - MsgTask* copy = (MsgTask*)arg; - - // make sure we do not run in background scheduling group - set_sched_policy(gettid(), SP_FOREGROUND); - - if (NULL != copy->mAssociator) { - copy->mAssociator(); - } - - LocMsg* msg; - int cnt = 0; - - while (1) { - LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++); - - msq_q_err_type result = msg_q_rcv((void*)copy->mQ, (void **)&msg); - - if (eMSG_Q_SUCCESS != result) { - LOC_LOGE("%s:%d] fail receiving msg: %s\n", __func__, __LINE__, - loc_get_msg_q_status(result)); - // destroy the Q and exit - msg_q_destroy((void**)&(copy->mQ)); - delete copy; - return NULL; - } - - msg->log(); - // there is where each individual msg handling is invoked - msg->proc(); - - delete msg; - } - - delete copy; - - return NULL; -} - -} diff --git a/gps/core/UlpProxyBase.h b/gps/core/UlpProxyBase.h index b9a8224..59e265e 100644 --- a/gps/core/UlpProxyBase.h +++ b/gps/core/UlpProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, 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 @@ -30,6 +30,7 @@ #define ULP_PROXY_BASE_H #include <gps_extended.h> +#include "fused_location_extended.h" namespace loc_core { @@ -58,7 +59,7 @@ public: LocPosTechMask loc_technology_mask) { return false; } - inline virtual bool reportSv(GpsSvStatus &svStatus, + inline virtual bool reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { return false; @@ -68,14 +69,12 @@ public: } inline virtual void setAdapter(LocAdapterBase* adapter) {} inline virtual void setCapabilities(unsigned long capabilities) {} - inline virtual bool reportBatchingSession(GpsExtBatchOptions &options, + inline virtual bool reportBatchingSession(FlpExtBatchOptions &options, bool active) { return false; } - inline virtual bool reportPositions(GpsExtLocation * locations, - int32_t number_of_locations, - enum loc_sess_status status, - LocPosTechMask techMask) { + inline virtual bool reportPositions(const FlpExtLocation* locations, + int32_t number_of_locations) { return false; } }; diff --git a/gps/core/gps_extended_c.h b/gps/core/gps_extended_c.h index ff66ef5..27deb44 100644 --- a/gps/core/gps_extended_c.h +++ b/gps/core/gps_extended_c.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, 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 @@ -35,6 +35,8 @@ extern "C" { #include <ctype.h> #include <stdbool.h> +#include <stdlib.h> +#include <string.h> #include <hardware/gps.h> /** Location has valid source information. */ @@ -60,9 +62,12 @@ extern "C" { #define ULP_LOCATION_IS_FROM_ZPP 0x0004 /** Position is from a Geofence Breach Event */ #define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 -/** Positioin is from Hardware FLP */ +/** Position is from Hardware FLP */ #define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 -#define ULP_LOCATION_IS_FROM_NLP 0x0020 +/** Position is from NLP */ +#define ULP_LOCATION_IS_FROM_NLP 0x0020 +/** Position is from PIP */ +#define ULP_LOCATION_IS_FROM_PIP 0x0040 #define ULP_MIN_INTERVAL_INVALID 0xffffffff @@ -72,30 +77,6 @@ extern "C" { #define AGPS_CERTIFICATE_MAX_LENGTH 2000 #define AGPS_CERTIFICATE_MAX_SLOTS 10 -/** Batching default ID for dummy batching session*/ -#define GPS_BATCHING_DEFAULT_ID 1 - -/** This cap is used to decide the FLP session cache -size on AP. If the BATCH_SIZE in flp.conf is less than -GPS_AP_BATCHING_SIZE_CAP, FLP session cache size will -be twice the BATCH_SIZE defined in flp.conf. Otherwise, -FLP session cache size will be equal to the BATCH_SIZE.*/ -#define GPS_AP_BATCHING_SIZE_CAP 40 - -#define GPS_BATCHING_OPERATION_SUCCEESS 1 -#define GPS_BATCHING_OPERATION_FAILURE 0 - -/** GPS extended batching flags*/ -#define GPS_EXT_BATCHING_ON_FULL 0x0000001 -#define GPS_EXT_BATCHING_ON_FIX 0x0000002 - -/** Reasons of GPS reports batched locations*/ -typedef enum loc_batching_reported_type { - LOC_BATCHING_ON_FULL_IND_REPORT, - LOC_BATCHING_ON_FIX_IND_REPORT, - LOC_BATCHING_ON_QUERY_REPORT -}LocBatchingReportedType; - enum loc_registration_mask_status { LOC_REGISTRATION_MASK_ENABLED, LOC_REGISTRATION_MASK_DISABLED @@ -146,14 +127,6 @@ typedef struct { gps_request_utc_time request_utc_time_cb; } GpsExtCallbacks; -/** GPS extended batch options */ -typedef struct { - double max_power_allocation_mW; - uint32_t sources_to_use; - uint32_t flags; - int64_t period_ns; -} GpsExtBatchOptions; - /** Callback to report the xtra server url to the client. * The client should use this url when downloading xtra unless overwritten * in the gps.conf file @@ -175,7 +148,7 @@ typedef struct { AGpsExtType type; AGpsStatusValue status; uint32_t ipv4_addr; - char ipv6_addr[16]; + struct sockaddr_storage addr; char ssid[SSID_BUF_SIZE]; char password[SSID_BUF_SIZE]; } AGpsExtStatus; @@ -224,22 +197,6 @@ typedef enum loc_position_mode_type { #define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ -/** GpsLocationExtended has valid latitude and longitude. */ -#define GPS_LOCATION_EXTENDED_HAS_LAT_LONG (1U<<0) -/** GpsLocationExtended has valid altitude. */ -#define GPS_LOCATION_EXTENDED_HAS_ALTITUDE (1U<<1) -/** GpsLocationExtended has valid speed. */ -#define GPS_LOCATION_EXTENDED_HAS_SPEED (1U<<2) -/** GpsLocationExtended has valid bearing. */ -#define GPS_LOCATION_EXTENDED_HAS_BEARING (1U<<4) -/** GpsLocationExtended has valid accuracy. */ -#define GPS_LOCATION_EXTENDED_HAS_ACCURACY (1U<<8) - -/** GPS extended supports geofencing */ -#define GPS_EXTENDED_CAPABILITY_GEOFENCE 0x0000001 -/** GPS extended supports batching */ -#define GPS_EXTENDED_CAPABILITY_BATCHING 0x0000002 - /** Flags to indicate which values are valid in a GpsLocationExtended. */ typedef uint16_t GpsLocationExtendedFlags; /** GpsLocationExtended has valid pdop, hdop, vdop. */ @@ -254,6 +211,20 @@ typedef uint16_t GpsLocationExtendedFlags; #define GPS_LOCATION_EXTENDED_HAS_VERT_UNC 0x0010 /** GpsLocationExtended has valid speed uncertainty */ #define GPS_LOCATION_EXTENDED_HAS_SPEED_UNC 0x0020 +/** GpsLocationExtended has valid heading uncertainty */ +#define GPS_LOCATION_EXTENDED_HAS_BEARING_UNC 0x0040 +/** GpsLocationExtended has valid horizontal reliability */ +#define GPS_LOCATION_EXTENDED_HAS_HOR_RELIABILITY 0x0080 +/** GpsLocationExtended has valid vertical reliability */ +#define GPS_LOCATION_EXTENDED_HAS_VERT_RELIABILITY 0x0100 + +typedef enum { + LOC_RELIABILITY_NOT_SET = 0, + LOC_RELIABILITY_VERY_LOW = 1, + LOC_RELIABILITY_LOW = 2, + LOC_RELIABILITY_MEDIUM = 3, + LOC_RELIABILITY_HIGH = 4 +}LocReliability; /** Represents gps location extended. */ typedef struct { @@ -275,20 +246,54 @@ typedef struct { float vert_unc; /** speed uncertainty in m/s */ float speed_unc; + /** heading uncertainty in degrees (0 to 359.999) */ + float bearing_unc; + /** horizontal reliability. */ + LocReliability horizontal_reliability; + /** vertical reliability. */ + LocReliability vertical_reliability; } GpsLocationExtended; -typedef struct GpsExtLocation_s { +/** Represents SV status. */ +typedef struct { + /** set to sizeof(GnssSvStatus) */ size_t size; - uint16_t flags; - double latitude; - double longitude; - double altitude; - float speed; - float bearing; - float accuracy; - int64_t timestamp; - uint32_t sources_used; -} GpsExtLocation; + + /** 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; + +} GnssSvStatus; enum loc_sess_status { LOC_SESS_SUCCESS, @@ -372,7 +377,7 @@ enum loc_api_adapter_event_index { 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 - + LOC_API_ADAPTER_REQUEST_TIMEZONE, // Timezone injection request LOC_API_ADAPTER_EVENT_MAX }; @@ -401,16 +406,22 @@ enum loc_api_adapter_event_index { #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) +#define LOC_API_ADAPTER_BIT_REQUEST_TIMEZONE (1<<LOC_API_ADAPTER_REQUEST_TIMEZONE) typedef unsigned int LOC_API_ADAPTER_EVENT_MASK_T; typedef enum loc_api_adapter_msg_to_check_supported { - LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING, // Batching + LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING, // Batching 1.0 LOC_API_ADAPTER_MESSAGE_BATCHED_GENFENCE_BREACH, // Geofence Batched Breach + LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING, // DBT 2.0 + LOC_API_ADAPTER_MESSAGE_ADAPTIVE_LOCATION_BATCHING, // Batching 1.5 + LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING, // Batching 2.0 LOC_API_ADAPTER_MESSAGE_MAX } LocCheckingMessagesID; +typedef int IzatDevId_t; + typedef uint32_t LOC_GPS_LOCK_MASK; #define isGpsLockNone(lock) ((lock) == 0) #define isGpsLockMO(lock) ((lock) & ((LOC_GPS_LOCK_MASK)1)) @@ -422,4 +433,3 @@ typedef uint32_t LOC_GPS_LOCK_MASK; #endif /* __cplusplus */ #endif /* GPS_EXTENDED_C_H */ - diff --git a/gps/gps.conf b/gps/gps.conf index b79b380..5376a1d 100644 --- a/gps/gps.conf +++ b/gps/gps.conf @@ -1,8 +1,15 @@ #Uncommenting these urls would only enable #the power up auto injection and force injection(test case). -#XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin -#XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin -#XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin +#XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra2.bin +#XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin +#XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin + +#Version check for XTRA +#DISABLE = 0 +#AUTO = 1 +#XTRA2 = 2 +#XTRA3 = 3 +XTRA_VERSION_CHECK=0 # Error Estimate # _SET = 1 @@ -26,11 +33,30 @@ DEBUG_LEVEL = 3 # Intermediate position report, 1=enable, 0=disable INTERMEDIATE_POS=0 +# Below bit mask configures how GPS functionalities +# should be locked when user turns off GPS on Settings +# Set bit 0x1 if MO GPS functionalities are to be locked +# Set bit 0x2 if NI GPS functionalities are to be locked +# default - non is locked for backward compatibility +#GPS_LOCK = 0 + # supl version 1.0 SUPL_VER=0x10000 # Emergency SUPL, 1=enable, 0=disable -SUPL_ES=1 +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 + +#SUPL_MODE is a bit mask set in config.xml per carrier by default. +#If it is uncommented here, this value will over write the value from +#config.xml. +#MSA=0X2 +#MSB=0X1 +#SUPL_MODE= # GPS Capabilities bit mask # SCHEDULING = 0x01 @@ -57,6 +83,14 @@ CAPABILITIES=0x37 # C2K_HOST=c2k.pde.com or IP # C2K_PORT=1234 +# Bitmask of slots that are available +# for write/install to, where 1s indicate writable, +# and the default value is 0 where no slots +# are writable. For example, AGPS_CERT_WRITABLE_MASK +# of b1000001010 makes 3 slots available +# and the remaining 7 slots unwritable. +#AGPS_CERT_WRITABLE_MASK=0 + #################################### # LTE Positioning Profile Settings #################################### diff --git a/gps/loc-api.pc.in b/gps/loc-api.pc.in new file mode 100644 index 0000000..3b4f81b --- /dev/null +++ b/gps/loc-api.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: loc-api +Description: Qualcomm GPS Location API +Version: @VERSION@ +Libs: -L${libdir} -lgps_utils_so -lloc_adapter_so -lloc_eng_so -lgps_default_so -lloc_api +Cflags: -I${includedir}/loc-api/libloc_api_50001 -I${includedir}/loc-api/utils -I${includedir}/ -I${includedir}/loc-api diff --git a/gps/loc_api/libloc_api_50001/Android.mk b/gps/loc_api/libloc_api_50001/Android.mk index 7e5c4e5..e03aeca 100644 --- a/gps/loc_api/libloc_api_50001/Android.mk +++ b/gps/loc_api/libloc_api_50001/Android.mk @@ -41,7 +41,8 @@ LOCAL_CFLAGS += \ LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ $(TARGET_OUT_HEADERS)/libloc_core \ - $(LOCAL_PATH) + $(call project-path-for,qcom-gps)/loc_api/libloc_api_50001 \ + $(TARGET_OUT_HEADERS)/libflp LOCAL_COPY_HEADERS_TO:= libloc_eng/ LOCAL_COPY_HEADERS:= \ @@ -94,20 +95,8 @@ endif ## Includes LOCAL_C_INCLUDES:= \ $(TARGET_OUT_HEADERS)/gps.utils \ - $(TARGET_OUT_HEADERS)/libloc_core - -#ifeq ($(filter $(TARGET_DEVICE), apq8064 msm8960),) -#$(call print-vars, $(TARGET_DEVICE)) -#LOCAL_SHARED_LIBRARIES += \ -# libmdmdetect \ -# libperipheral_client -# -#LOCAL_C_INCLUDES += \ -# $(TARGET_OUT_HEADERS)/libmdmdetect/inc \ -# $(TARGET_OUT_HEADERS)/libperipheralclient/inc -#LOCAL_CFLAGS += \ -# -DMODEM_POWER_VOTE -#endif + $(TARGET_OUT_HEADERS)/libloc_core \ + $(TARGET_OUT_HEADERS)/libflp LOCAL_PRELINK_MODULE := false LOCAL_MODULE_RELATIVE_PATH := hw diff --git a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp b/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp index 2f025af..35447d4 100644 --- a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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,10 +29,17 @@ #define LOG_NDDEBUG 0 #define LOG_TAG "LocSvc_EngAdapter" +#include <sys/stat.h> +#include <errno.h> +#include <ctype.h> +#include <cutils/properties.h> #include <LocEngAdapter.h> #include "loc_eng_msg.h" #include "loc_log.h" +#define CHIPSET_SERIAL_NUMBER_MAX_LEN 16 +#define USER_AGENT_MAX_LEN 512 + using namespace loc_core; LocInternalAdapter::LocInternalAdapter(LocEngAdapter* adapter) : @@ -53,19 +60,17 @@ void LocInternalAdapter::getZppInt() { sendMsg(new LocEngGetZpp(mLocEngAdapter)); } -void LocInternalAdapter::shutdown() { - sendMsg(new LocEngShutdown(mLocEngAdapter)); -} - LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, - MsgTask::tCreate tCreator) : + LocThread::tCreate tCreator) : LocAdapterBase(mask, //Get the AFW context if VzW context has not already been intialized in //loc_ext context == NULL? LocDualContext::getLocFgContext(tCreator, - LocDualContext::mLocationHalName) + NULL, + LocDualContext::mLocationHalName, + false) :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), @@ -86,6 +91,119 @@ LocEngAdapter::~LocEngAdapter() LOC_LOGV("LocEngAdapter deleted"); } +void LocEngAdapter::setXtraUserAgent() { + struct LocSetXtraUserAgent : public LocMsg { + const ContextBase* const mContext; + inline LocSetXtraUserAgent(ContextBase* context) : + LocMsg(), mContext(context) { + } + virtual void proc() const { + char release[PROPERTY_VALUE_MAX]; + char manufacture[PROPERTY_VALUE_MAX]; + char model[PROPERTY_VALUE_MAX]; + char carrier[PROPERTY_VALUE_MAX]; + char board[PROPERTY_VALUE_MAX]; + char brand[PROPERTY_VALUE_MAX]; + char chipsetsn[CHIPSET_SERIAL_NUMBER_MAX_LEN]; + char userAgent[USER_AGENT_MAX_LEN]; + const char defVal[] = "-"; + + property_get("ro.build.version.release", release, defVal); + property_get("ro.product.manufacturer", manufacture, defVal); + property_get("ro.product.model", model, defVal); + property_get("ro.carrier", carrier, defVal); + property_get("ro.product.board", board, defVal); + property_get("ro.product.brand", brand, defVal); + getChipsetSerialNo(chipsetsn, sizeof(chipsetsn), defVal); + + snprintf(userAgent, sizeof(userAgent), "A/%s/%s/%s/%s/%s/QCX3/s%u/-/%s/-/%s/-/-/-", + release, manufacture, model, board, carrier, + mContext->getIzatDevId(), chipsetsn, brand); + + for (int i = 0; i < sizeof(userAgent) && userAgent[i]; i++) { + if (' ' == userAgent[i]) userAgent[i] = '#'; + } + + saveUserAgentString(userAgent, strlen(userAgent)); + LOC_LOGV("%s] UserAgent %s", __func__, userAgent); + } + + void saveUserAgentString(const char* data, const int len) const { + const char XTRA_FOLDER[] = "/data/misc/location/xtra"; + const char USER_AGENT_FILE[] = "/data/misc/location/xtra/useragent.txt"; + + if (data == NULL || len < 1) { + LOC_LOGE("%s:%d]: invalid input data = %p len = %d", __func__, __LINE__, data, len); + return; + } + + struct stat s; + int err = stat(XTRA_FOLDER, &s); + if (err < 0) { + if (ENOENT == errno) { + if (mkdir(XTRA_FOLDER, 0700) < 0) { + LOC_LOGE("%s:%d]: make XTRA_FOLDER failed", __func__, __LINE__); + return; + } + } else { + LOC_LOGE("%s:%d]: XTRA_FOLDER invalid", __func__, __LINE__); + return; + } + } + + FILE* file = fopen(USER_AGENT_FILE, "wt"); + if (file == NULL) { + LOC_LOGE("%s:%d]: open USER_AGENT_FILE failed", __func__, __LINE__); + return; + } + + size_t written = fwrite(data, 1, len, file); + fclose(file); + file = NULL; + + // set file permission + chmod(USER_AGENT_FILE, 0600); + + if (written != len) { + LOC_LOGE("%s:%d]: write USER_AGENT_FILE failed", __func__, __LINE__); + } + } + + void getChipsetSerialNo(char buf[], int buflen, const char def[]) const { + const char SOC_SERIAL_NUMBER[] = "/sys/devices/soc0/serial_number"; + + FILE* file = fopen(SOC_SERIAL_NUMBER, "rt"); + if (file == NULL) { + // use default upon unreadable file + strlcpy(buf, def, buflen); + + } else { + size_t size = fread(buf, 1, buflen - 1, file); + if (size == 0) { + // use default upon empty file + strlcpy(buf, def, buflen); + + } else { + buf[size] = '\0'; + } + + fclose(file); + + // remove trailing spaces + size_t len = strlen(buf); + while (--len >= 0 && isspace(buf[len])) { + buf[len] = '\0'; + } + } + + return; + } + + }; + + sendMsg(new LocSetXtraUserAgent(mContext)); +} + void LocInternalAdapter::setUlpProxy(UlpProxyBase* ulp) { struct LocSetUlpProxy : public LocMsg { LocAdapterBase* mAdapter; @@ -203,14 +321,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location, } } -void LocInternalAdapter::reportSv(GpsSvStatus &svStatus, +void LocInternalAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt){ sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, locationExtended, svExt)); } -void LocEngAdapter::reportSv(GpsSvStatus &svStatus, +void LocEngAdapter::reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt) { diff --git a/gps/loc_api/libloc_api_50001/LocEngAdapter.h b/gps/loc_api/libloc_api_50001/LocEngAdapter.h index e5d1018..a193e81 100644 --- a/gps/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/gps/loc_api/libloc_api_50001/LocEngAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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 @@ -55,7 +55,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -64,7 +64,6 @@ public: virtual void stopFixInt(); virtual void getZppInt(); virtual void setUlpProxy(UlpProxyBase* ulp); - virtual void shutdown(); }; typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); @@ -89,10 +88,11 @@ public: LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner, ContextBase* context, - MsgTask::tCreate tCreator); + LocThread::tCreate tCreator); virtual ~LocEngAdapter(); virtual void setUlpProxy(UlpProxyBase* ulp); + void setXtraUserAgent(); inline void requestUlp(unsigned long capabilities) { mContext->requestUlp(mInternalAdapter, capabilities); } @@ -269,7 +269,7 @@ public: void* locationExt, enum loc_sess_status status, LocPosTechMask loc_technology_mask); - virtual void reportSv(GpsSvStatus &svStatus, + virtual void reportSv(GnssSvStatus &svStatus, GpsLocationExtended &locationExtended, void* svExt); virtual void reportStatus(GpsStatusValue status); @@ -305,6 +305,7 @@ public: mPowerVote = powerOn ? (mPowerVote | POWER_VOTE_VALUE) : (mPowerVote & ~POWER_VOTE_VALUE); requestPowerVote(); + mContext->modemPowerVote(powerOn); } inline bool getPowerVote() const { return (mPowerVote & POWER_VOTE_VALUE) != 0 ; diff --git a/gps/loc_api/libloc_api_50001/gps.c b/gps/loc_api/libloc_api_50001/gps.c index b0669af..29f20f4 100644 --- a/gps/loc_api/libloc_api_50001/gps.c +++ b/gps/loc_api/libloc_api_50001/gps.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 The Linux Foundation. All rights reserved. +/* Copyright (c) 2011,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 @@ -30,6 +30,7 @@ #include <hardware/gps.h> #include <stdlib.h> +#include <string.h> extern const GpsInterface* get_gps_interface(); diff --git a/gps/loc_api/libloc_api_50001/loc.cpp b/gps/loc_api/libloc_api_50001/loc.cpp index 4cf4ba9..505fc94 100644 --- a/gps/loc_api/libloc_api_50001/loc.cpp +++ b/gps/loc_api/libloc_api_50001/loc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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 @@ -45,17 +45,6 @@ #include <LocDualContext.h> #include <cutils/properties.h> -#ifdef MODEM_POWER_VOTE -#include <pm-service.h> -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -#include <mdm_detect.h> -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /*MODEM_POWER_VOTE*/ - using namespace loc_core; #define LOC_PM_CLIENT_NAME "GPS" @@ -81,7 +70,6 @@ static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence re uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); static const void* loc_get_extension(const char* name); -static void loc_close_mdm_node(); // Defines the GpsInterface in gps.h static const GpsInterface sLocEngInterface = { @@ -103,6 +91,7 @@ static int loc_agps_open(const char* apn); static int loc_agps_closed(); static int loc_agps_open_failed(); static int loc_agps_set_server(AGpsType type, const char *hostname, int port); +static int loc_agps_open_with_apniptype( const char* apn, ApnIpType apnIpType); static const AGpsInterface sLocEngAGpsInterface = { @@ -111,7 +100,8 @@ static const AGpsInterface sLocEngAGpsInterface = loc_agps_open, loc_agps_closed, loc_agps_open_failed, - loc_agps_set_server + loc_agps_set_server, + loc_agps_open_with_apniptype }; static int loc_xtra_init(GpsXtraCallbacks* callbacks); @@ -134,24 +124,6 @@ static const GpsNiInterface sLocEngNiInterface = loc_ni_respond, }; -#ifdef MODEM_POWER_VOTE -typedef struct { - //MAX_NAME_LEN defined in mdm_detect.h - char modem_name[MAX_NAME_LEN]; - //MAX_PATH_LEN defined in mdm_detect.h - char powerup_node[MAX_PATH_LEN]; - //this handle is used by peripheral mgr - void *handle; - int mdm_fd; - MdmType mdm_type; - bool peripheral_mgr_supported; - bool peripheral_mgr_registered; -}s_loc_mdm_info; -static s_loc_mdm_info loc_mdm_info; -static void loc_pm_event_notifier(void *client_data, enum pm_event event); -#endif /*MODEM_POWER_VOTE*/ -// For shutting down MDM in fusion devices -static int mdm_fd = -1; static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks); static void loc_gps_measurement_close(); @@ -202,7 +174,7 @@ static const GnssConfigurationInterface sLocEngConfigInterface = static loc_eng_data_s_type loc_afw_data; static int gss_fd = -1; - +static int sGnssType = GNSS_UNKNOWN; /*=========================================================================== FUNCTION gps_get_hardware_interface @@ -254,8 +226,8 @@ extern "C" const GpsInterface* get_gps_interface() target = loc_get_target(); LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); - int gnssType = getTargetGnssType(target); - switch (gnssType) + sGnssType = getTargetGnssType(target); + switch (sGnssType) { case GNSS_GSS: case GNSS_AUTO: @@ -303,11 +275,6 @@ SIDE EFFECTS static int loc_init(GpsCallbacks* callbacks) { int retVal = -1; -#ifdef MODEM_POWER_VOTE - enum pm_event mdm_state; - static int mdm_index = -1; - int peripheral_mgr_ret = PM_RET_FAILED; -#endif /*MODEM_POWER_VOTE*/ ENTRY_LOG(); LOC_API_ADAPTER_EVENT_MASK_T event; @@ -337,7 +304,7 @@ static int loc_init(GpsCallbacks* callbacks) NULL, /* location_ext_parser */ NULL, /* sv_ext_parser */ callbacks->request_utc_time_cb, /* request_utc_time_cb */ - loc_close_mdm_node /*loc_shutdown_cb*/}; + }; gps_loc_cb = callbacks->location_cb; gps_sv_cb = callbacks->sv_status_cb; @@ -348,6 +315,7 @@ static int loc_init(GpsCallbacks* callbacks) loc_afw_data.adapter->mSupportsTimeInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); loc_afw_data.adapter->setGpsLockMsg(0); loc_afw_data.adapter->requestUlp(getCarrierCapabilities()); + loc_afw_data.adapter->setXtraUserAgent(); if(retVal) { LOC_LOGE("loc_eng_init() fail!"); @@ -359,133 +327,12 @@ static int loc_init(GpsCallbacks* callbacks) LOC_LOGD("loc_eng_init() success!"); -#ifdef MODEM_POWER_VOTE - //if index is 0 or more, then we've looked for mdm already - LOC_LOGD("%s:%d]: mdm_index: %d", __func__, __LINE__, - mdm_index); - if (mdm_index < 0) { - struct dev_info modem_info; - memset(&modem_info, 0, sizeof(struct dev_info)); - if(get_system_info(&modem_info) != RET_SUCCESS) { - LOC_LOGE("%s:%d]: Error: get_system_info returned error\n", - __func__, __LINE__); - goto err; - } - - for(mdm_index = 0; - mdm_index < modem_info.num_modems; - mdm_index++) { - if(modem_info.mdm_list[mdm_index].mdm_name) { - //Copy modem name to register with peripheral manager - strlcpy(loc_mdm_info.modem_name, - modem_info.mdm_list[mdm_index].mdm_name, - sizeof(loc_mdm_info.modem_name)); - //copy powerup node name if we need to use mdmdetect method - strlcpy(loc_mdm_info.powerup_node, - modem_info.mdm_list[mdm_index].powerup_node, - sizeof(loc_mdm_info.powerup_node)); - loc_mdm_info.mdm_type = modem_info.mdm_list[mdm_index].type; - LOC_LOGD("%s:%d]: Found modem: %s, powerup node:%s at index: %d", - __func__, __LINE__, loc_mdm_info.modem_name, loc_mdm_info.powerup_node, - mdm_index); - break; - } - } - } - - if(loc_mdm_info.peripheral_mgr_registered != true) { - peripheral_mgr_ret = pm_client_register(loc_pm_event_notifier, - &loc_mdm_info, - loc_mdm_info.modem_name, - LOC_PM_CLIENT_NAME, - &mdm_state, - &loc_mdm_info.handle); - if(peripheral_mgr_ret == PM_RET_SUCCESS) { - loc_mdm_info.peripheral_mgr_supported = true; - loc_mdm_info.peripheral_mgr_registered = true; - LOC_LOGD("%s:%d]: registered with peripheral mgr for %s", - __func__, __LINE__, loc_mdm_info.modem_name); - } - else if(peripheral_mgr_ret == PM_RET_UNSUPPORTED) { - loc_mdm_info.peripheral_mgr_registered = true; - loc_mdm_info.peripheral_mgr_supported = false; - LOC_LOGD("%s:%d]: peripheral mgr unsupported for: %s", - __func__, __LINE__, loc_mdm_info.modem_name); - } - else { - //Not setting any flags here so that we can try again the next time around - LOC_LOGE("%s:%d]: Error: pm_client_register returned: %d", - __func__, __LINE__, peripheral_mgr_ret); - } - } - - if(loc_mdm_info.peripheral_mgr_supported == false && - loc_mdm_info.peripheral_mgr_registered == true) { - //Peripheral mgr is not supported - //use legacy method to open the powerup node - LOC_LOGD("%s:%d]: powerup_node: %s", __func__, __LINE__, - loc_mdm_info.powerup_node); - loc_mdm_info.mdm_fd = open(loc_mdm_info.powerup_node, O_RDONLY); - - if (loc_mdm_info.mdm_fd < 0) { - LOC_LOGE("Error: %s open failed: %s\n", - loc_mdm_info.powerup_node, strerror(errno)); - } else { - LOC_LOGD("%s opens success!", loc_mdm_info.powerup_node); - } - } - else if(loc_mdm_info.peripheral_mgr_supported == true && - loc_mdm_info.peripheral_mgr_registered == true) { - LOC_LOGD("%s:%d]: Voting for modem power up", __func__, __LINE__); - pm_client_connect(loc_mdm_info.handle); - } - else { - LOC_LOGD("%s:%d]: Not voted for modem power up due to errors", __func__, __LINE__); - } -#endif /*MODEM_POWER_VOTE*/ err: EXIT_LOG(%d, retVal); return retVal; } /*=========================================================================== -FUNCTION loc_close_mdm_node - -DESCRIPTION - closes loc_mdm_info.mdm_fd which is the modem powerup node obtained in loc_init - -DEPENDENCIES - None - -RETURN VALUE - None - -SIDE EFFECTS - N/A - -===========================================================================*/ -static void loc_close_mdm_node() -{ - ENTRY_LOG(); -#ifdef MODEM_POWER_VOTE - if(loc_mdm_info.peripheral_mgr_supported == true) { - LOC_LOGD("%s:%d]: Voting for modem power down", __func__, __LINE__); - pm_client_disconnect(loc_mdm_info.handle); - } - else if (loc_mdm_info.mdm_fd >= 0) { - LOC_LOGD("closing the powerup node"); - close(loc_mdm_info.mdm_fd); - loc_mdm_info.mdm_fd = -1; - LOC_LOGD("finished closing the powerup node"); - } - else { - LOC_LOGD("powerup node has not been opened yet."); - } -#endif /*MODEM_POWER_VOTE*/ - EXIT_LOG(%s, VOID_RET); -} - -/*=========================================================================== FUNCTION loc_cleanup DESCRIPTION @@ -509,7 +356,6 @@ static void loc_cleanup() loc_afw_data.adapter->setGpsLockMsg(gps_conf.GPS_LOCK); loc_eng_cleanup(loc_afw_data); - loc_close_mdm_node(); gps_loc_cb = NULL; gps_sv_cb = NULL; @@ -719,7 +565,7 @@ const GpsGeofencingInterface* get_geofence_interface(void) } dlerror(); /* Clear any existing error */ get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface"); - if ((error = dlerror()) != NULL && NULL != get_gps_geofence_interface) { + if ((error = dlerror()) != NULL || NULL == get_gps_geofence_interface) { LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); goto exit; } @@ -851,6 +697,50 @@ static int loc_agps_open(const char* apn) } /*=========================================================================== +FUNCTION loc_agps_open_with_apniptype + +DESCRIPTION + This function is called when on-demand data connection opening is successful. +It should inform ARM 9 about the data open result. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_agps_open_with_apniptype(const char* apn, ApnIpType apnIpType) +{ + ENTRY_LOG(); + AGpsType agpsType = AGPS_TYPE_SUPL; + AGpsBearerType bearerType; + + switch (apnIpType) { + case APN_IP_IPV4: + bearerType = AGPS_APN_BEARER_IPV4; + break; + case APN_IP_IPV6: + bearerType = AGPS_APN_BEARER_IPV6; + break; + case APN_IP_IPV4V6: + bearerType = AGPS_APN_BEARER_IPV4V6; + break; + default: + bearerType = AGPS_APN_BEARER_INVALID; + break; + } + + int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== FUNCTION loc_agps_closed DESCRIPTION @@ -962,7 +852,10 @@ SIDE EFFECTS static int loc_xtra_init(GpsXtraCallbacks* callbacks) { ENTRY_LOG(); - int ret_val = loc_eng_xtra_init(loc_afw_data, (GpsXtraExtCallbacks*)callbacks); + GpsXtraExtCallbacks extCallbacks; + memset(&extCallbacks, 0, sizeof(extCallbacks)); + extCallbacks.download_request_cb = callbacks->download_request_cb; + int ret_val = loc_eng_xtra_init(loc_afw_data, &extCallbacks); EXIT_LOG(%d, ret_val); return ret_val; @@ -1147,6 +1040,15 @@ static void loc_configuration_update(const char* config_data, int32_t length) { ENTRY_LOG(); loc_eng_configuration_update(loc_afw_data, config_data, length); + switch (sGnssType) + { + case GNSS_GSS: + case GNSS_AUTO: + case GNSS_QCA1530: + //APQ + gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); + break; + } EXIT_LOG(%s, VOID_RET); } @@ -1173,12 +1075,3 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) EXIT_LOG(%s, VOID_RET); } -#ifdef MODEM_POWER_VOTE -static void loc_pm_event_notifier(void *client_data, enum pm_event event) -{ - ENTRY_LOG(); - LOC_LOGD("%s:%d]: event: %d", __func__, __LINE__, (int)event); - pm_client_event_acknowledge(loc_mdm_info.handle, event); - EXIT_LOG(%s, VOID_RET); -} -#endif /*MODEM_POWER_VOTE*/ diff --git a/gps/loc_api/libloc_api_50001/loc.h b/gps/loc_api/libloc_api_50001/loc.h index 6352866..e56fdcf 100644 --- a/gps/loc_api/libloc_api_50001/loc.h +++ b/gps/loc_api/libloc_api_50001/loc.h @@ -44,7 +44,6 @@ extern "C" { typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt); typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt); typedef void* (*loc_ext_parser)(void* data); -typedef void (*loc_shutdown_cb) (void); typedef struct { loc_location_cb_ext location_cb; @@ -58,7 +57,6 @@ typedef struct { loc_ext_parser location_ext_parser; loc_ext_parser sv_ext_parser; gps_request_utc_time request_utc_time_cb; - loc_shutdown_cb shutdown_cb; } LocCallbacks; #ifdef __cplusplus diff --git a/gps/loc_api/libloc_api_50001/loc_eng.cpp b/gps/loc_api/libloc_api_50001/loc_eng.cpp index 051f208..5d92e44 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng.cpp @@ -106,6 +106,10 @@ static loc_param_s_type gps_conf_table[] = {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'}, {"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'}, {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, + {"XTRA_VERSION_CHECK", &gps_conf.XTRA_VERSION_CHECK, NULL, 'n'}, + {"XTRA_SERVER_1", &gps_conf.XTRA_SERVER_1, NULL, 's'}, + {"XTRA_SERVER_2", &gps_conf.XTRA_SERVER_2, NULL, 's'}, + {"XTRA_SERVER_3", &gps_conf.XTRA_SERVER_3, NULL, 's'}, {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, }; @@ -127,12 +131,7 @@ static loc_param_s_type sap_conf_table[] = {"SENSOR_CONTROL_MODE", &sap_conf.SENSOR_CONTROL_MODE, NULL, 'n'}, {"SENSOR_USAGE", &sap_conf.SENSOR_USAGE, NULL, 'n'}, {"SENSOR_ALGORITHM_CONFIG_MASK", &sap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'}, - {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'}, - {"XTRA_VERSION_CHECK", &gps_conf.XTRA_VERSION_CHECK, NULL, 'n'}, - {"XTRA_SERVER_1", &gps_conf.XTRA_SERVER_1, NULL, 's'}, - {"XTRA_SERVER_2", &gps_conf.XTRA_SERVER_2, NULL, 's'}, - {"XTRA_SERVER_3", &gps_conf.XTRA_SERVER_3, NULL, 's'}, - {"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'} + {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'} }; static void loc_default_parameters(void) @@ -206,7 +205,6 @@ static void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) ; static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data); static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data); static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data); -static void loc_eng_handle_shutdown(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); @@ -225,7 +223,6 @@ static void* noProc(void* data) return NULL; } - /********************************************************************* * definitions of the static messages used in the file *********************************************************************/ @@ -346,28 +343,6 @@ void LocEngGetZpp::send() const { mAdapter->sendMsg(this); } - -LocEngShutdown::LocEngShutdown(LocEngAdapter* adapter) : - LocMsg(), mAdapter(adapter) -{ - locallog(); -} -inline void LocEngShutdown::proc() const -{ - loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); - LOC_LOGD("%s:%d]: Calling loc_eng_handle_shutdown", __func__, __LINE__); - loc_eng_handle_shutdown(*locEng); -} -inline void LocEngShutdown::locallog() const -{ - LOC_LOGV("LocEngShutdown"); -} -inline void LocEngShutdown::log() const -{ - locallog(); -} - -// case LOC_ENG_MSG_SET_TIME: struct LocEngSetTime : public LocMsg { LocEngAdapter* mAdapter; const GpsUtcTime mTime; @@ -816,11 +791,13 @@ void LocEngReportPosition::proc() const { locEng->adapter->setInSession(false); } + LOC_LOGV("LocEngReportPosition::proc() - generateNmea: %d, position source: %d, " + "engine_status: %d, isInSession: %d", + locEng->generateNmea, mLocation.position_source, + locEng->engine_status, locEng->adapter->isInSession()); + if (locEng->generateNmea && - mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS && - mTechMask & (LOC_POS_TECH_MASK_SATELLITE | - LOC_POS_TECH_MASK_SENSORS | - LOC_POS_TECH_MASK_HYBRID)) + locEng->adapter->isInSession()) { unsigned char generate_nmea = reported && (mStatus != LOC_SESS_FAILURE); @@ -851,7 +828,7 @@ void LocEngReportPosition::send() const { // case LOC_ENG_MSG_REPORT_SV: LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, - GpsSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExt) : LocMsg(), mAdapter(adapter), mSvStatus(sv), @@ -1775,7 +1752,6 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.sv_ext_parser = callbacks->sv_ext_parser ? callbacks->sv_ext_parser : noProc; loc_eng_data.intermediateFix = gps_conf.INTERMEDIATE_POS; - loc_eng_data.shutdown_cb = callbacks->shutdown_cb; // initial states taken care of by the memset above // loc_eng_data.engine_status -- GPS_STATUS_NONE; // loc_eng_data.fix_session_status -- GPS_STATUS_NONE; @@ -1793,7 +1769,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, loc_eng_data.adapter = new LocEngAdapter(event, &loc_eng_data, context, - (MsgTask::tCreate)callbacks->create_thread_cb); + (LocThread::tCreate)callbacks->create_thread_cb); LOC_LOGD("loc_eng_init created client, id = %p\n", loc_eng_data.adapter); @@ -1956,7 +1932,6 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) ret_val == LOC_API_ADAPTER_ERR_INTERNAL) { loc_eng_data.adapter->setInSession(TRUE); - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); } } @@ -2002,11 +1977,6 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) if (loc_eng_data.adapter->isInSession()) { ret_val = loc_eng_data.adapter->stopFix(); - if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS) - { - loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END); - } - loc_eng_data.adapter->setInSession(FALSE); } @@ -2059,14 +2029,12 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); - int gnssType = getTargetGnssType(loc_get_target()); - - // The position mode for GSS/QCA1530 can only be standalone - bool is1530 = gnssType == GNSS_QCA1530; - bool isAPQ = gnssType == GNSS_GSS; - if ((isAPQ || is1530) && params.mode != LOC_POSITION_MODE_STANDALONE) { + // The position mode for AUTO/GSS/QCA1530 can only be standalone + if (!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) && + !(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) && + (params.mode != LOC_POSITION_MODE_STANDALONE)) { params.mode = LOC_POSITION_MODE_STANDALONE; - LOC_LOGD("Position mode changed to standalone for target with GSS/qca1530."); + LOC_LOGD("Position mode changed to standalone for target with AUTO/GSS/qca1530."); } if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) @@ -2338,10 +2306,8 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_WIFI, true); - int gnssType = getTargetGnssType(loc_get_target()); - bool isAPQ = (gnssType == GNSS_GSS); - bool is1530 = (gnssType == GNSS_QCA1530); - if (!isAPQ && !is1530) { + 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, @@ -2621,29 +2587,29 @@ int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, ENTRY_LOG_CALLFLOW(); int ret_val = 0; + LOC_LOGV("save the address, type: %d, hostname: %s, port: %d", + (int) type, hostname, port); + switch (type) + { + case LOC_AGPS_SUPL_SERVER: + strlcpy(loc_eng_data.supl_host_buf, hostname, + sizeof(loc_eng_data.supl_host_buf)); + loc_eng_data.supl_port_buf = port; + loc_eng_data.supl_host_set = 1; + break; + case LOC_AGPS_CDMA_PDE_SERVER: + strlcpy(loc_eng_data.c2k_host_buf, hostname, + sizeof(loc_eng_data.c2k_host_buf)); + loc_eng_data.c2k_port_buf = port; + loc_eng_data.c2k_host_set = 1; + break; + default: + LOC_LOGE("loc_eng_set_server_proxy, unknown server type = %d", (int) type); + } + if (NULL != loc_eng_data.adapter) { ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port); - } else { - LOC_LOGW("set_server called before init. save the address, type: %d, hostname: %s, port: %d", - (int) type, hostname, port); - switch (type) - { - case LOC_AGPS_SUPL_SERVER: - strlcpy(loc_eng_data.supl_host_buf, hostname, - sizeof(loc_eng_data.supl_host_buf)); - loc_eng_data.supl_port_buf = port; - loc_eng_data.supl_host_set = 1; - break; - case LOC_AGPS_CDMA_PDE_SERVER: - strlcpy(loc_eng_data.c2k_host_buf, hostname, - sizeof(loc_eng_data.c2k_host_buf)); - loc_eng_data.c2k_port_buf = port; - loc_eng_data.c2k_host_set = 1; - break; - default: - LOC_LOGE("loc_eng_set_server_proxy, unknown server type = %d", (int) type); - } } EXIT_LOG(%d, ret_val); @@ -2887,14 +2853,11 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) loc_eng_agps_reinit(loc_eng_data); } - loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON); - // modem is back up. If we crashed in the middle of navigating, we restart. if (loc_eng_data.adapter->isInSession()) { // This sets the copy in adapter to modem - loc_eng_data.adapter->setPositionMode(NULL); loc_eng_data.adapter->setInSession(false); - loc_eng_start_handler(loc_eng_data); + loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter)); } EXIT_LOG(%s, VOID_RET); } @@ -2959,30 +2922,6 @@ int loc_eng_read_config(void) } /*=========================================================================== -FUNCTION loc_eng_handle_shutdown - -DESCRIPTION - Calls the shutdown callback function in the loc interface to close - the modem node - -DEPENDENCIES - None - -RETURN VALUE - 0: success - -SIDE EFFECTS - N/A - -===========================================================================*/ -void loc_eng_handle_shutdown(loc_eng_data_s_type &locEng) -{ - ENTRY_LOG(); - locEng.shutdown_cb(); - EXIT_LOG(%d, 0); -} - -/*=========================================================================== FUNCTION loc_eng_gps_measurement_init DESCRIPTION diff --git a/gps/loc_api/libloc_api_50001/loc_eng.h b/gps/loc_api/libloc_api_50001/loc_eng.h index 813da48..a203e6b 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng.h +++ b/gps/loc_api/libloc_api_50001/loc_eng.h @@ -137,7 +137,6 @@ typedef struct loc_eng_data_s loc_ext_parser location_ext_parser; loc_ext_parser sv_ext_parser; - loc_shutdown_cb shutdown_cb; } loc_eng_data_s_type; /* GPS.conf support */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp b/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp index d6cc136..5016b5c 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp @@ -762,11 +762,11 @@ int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const if (s == NULL) { nifRequest.ipv4_addr = INADDR_NONE; - nifRequest.ipv6_addr[0] = 0; + memset(&nifRequest.addr, 0, sizeof(nifRequest.addr)); nifRequest.ssid[0] = '\0'; nifRequest.password[0] = '\0'; } else { - s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); + s->setIPAddresses(nifRequest.addr); s->setWifiInfo(nifRequest.ssid, nifRequest.password); } diff --git a/gps/loc_api/libloc_api_50001/loc_eng_agps.h b/gps/loc_api/libloc_api_50001/loc_eng_agps.h index 055d955..2d689ce 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_agps.h +++ b/gps/loc_api/libloc_api_50001/loc_eng_agps.h @@ -276,6 +276,7 @@ struct Subscriber { inline virtual ~Subscriber() {} virtual void setIPAddresses(uint32_t &v4, char* v6) = 0; + virtual void setIPAddresses(struct sockaddr_storage& addr) = 0; inline virtual void setWifiInfo(char* ssid, char* password) { ssid[0] = 0; password[0] = 0; } @@ -316,6 +317,9 @@ struct BITSubscriber : public Subscriber { inline virtual void setIPAddresses(uint32_t &v4, char* v6) { v4 = ID; memcpy(v6, mIPv6Addr, sizeof(mIPv6Addr)); } + inline virtual void setIPAddresses(struct sockaddr_storage& addr) + { addr.ss_family = AF_INET6;/*todo: convert mIPv6Addr into addr */ } + virtual Subscriber* clone() { return new BITSubscriber(mStateMachine, ID, mIPv6Addr); @@ -340,6 +344,9 @@ struct ATLSubscriber : public Subscriber { inline virtual void setIPAddresses(uint32_t &v4, char* v6) { v4 = INADDR_NONE; v6[0] = 0; } + inline virtual void setIPAddresses(struct sockaddr_storage& addr) + { addr.ss_family = AF_INET6; } + inline virtual Subscriber* clone() { return new ATLSubscriber(ID, mStateMachine, mLocAdapter, @@ -372,6 +379,9 @@ struct WIFISubscriber : public Subscriber { inline virtual void setIPAddresses(uint32_t &v4, char* v6) {} + inline virtual void setIPAddresses(struct sockaddr_storage& addr) + { addr.ss_family = AF_INET6; } + inline virtual void setWifiInfo(char* ssid, char* password) { if (NULL != mSSID) @@ -405,6 +415,8 @@ struct DSSubscriber : public Subscriber { mIsInactive = false; } inline virtual void setIPAddresses(uint32_t &v4, char* v6) {} + inline virtual void setIPAddresses(struct sockaddr_storage& addr) + { addr.ss_family = AF_INET6; } virtual Subscriber* clone() {return new DSSubscriber(mStateMachine, ID);} virtual bool notifyRsrcStatus(Notification ¬ification); diff --git a/gps/loc_api/libloc_api_50001/loc_eng_msg.h b/gps/loc_api/libloc_api_50001/loc_eng_msg.h index e3c48fb..9c7b9bc 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_msg.h +++ b/gps/loc_api/libloc_api_50001/loc_eng_msg.h @@ -105,11 +105,11 @@ struct LocEngReportPosition : public LocMsg { struct LocEngReportSv : public LocMsg { LocAdapterBase* mAdapter; - const GpsSvStatus mSvStatus; + const GnssSvStatus mSvStatus; const GpsLocationExtended mLocationExtended; const void* mSvExt; LocEngReportSv(LocAdapterBase* adapter, - GpsSvStatus &sv, + GnssSvStatus &sv, GpsLocationExtended &locExtended, void* svExtended); virtual void proc() const; @@ -299,13 +299,6 @@ struct LocEngReportGpsMeasurement : public LocMsg { virtual void log() const; }; -struct LocEngShutdown : public LocMsg { - LocEngAdapter* mAdapter; - LocEngShutdown(LocEngAdapter* adapter); - virtual void proc() const; - void locallog() const; - virtual void log() const; -}; #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 4c6b9a3..126a97f 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -604,7 +604,7 @@ SIDE EFFECTS ===========================================================================*/ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, - const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended) + const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended) { ENTRY_LOG(); @@ -790,46 +790,24 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, }//if - if (svStatus.used_in_fix_mask == 0) - { // No sv used, so there will be no position report, so send - // blank NMEA sentences - strlcpy(sentence, "$GPGSA,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); - - strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence)); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); + // 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; - strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence)); - length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); - loc_eng_nmea_send(sentence, length, loc_eng_data_p); + // 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. + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) + { + loc_eng_data_p->pdop = locationExtended.pdop; + loc_eng_data_p->hdop = locationExtended.hdop; + loc_eng_data_p->vdop = locationExtended.vdop; } else - { // 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.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. - if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) - { - loc_eng_data_p->pdop = locationExtended.pdop; - loc_eng_data_p->hdop = locationExtended.hdop; - loc_eng_data_p->vdop = locationExtended.vdop; - } - else - { - loc_eng_data_p->pdop = 0; - loc_eng_data_p->hdop = 0; - loc_eng_data_p->vdop = 0; - } - + { + loc_eng_data_p->pdop = 0; + loc_eng_data_p->hdop = 0; + loc_eng_data_p->vdop = 0; } EXIT_LOG(%d, 0); diff --git a/gps/loc_api/libloc_api_50001/loc_eng_nmea.h b/gps/loc_api/libloc_api_50001/loc_eng_nmea.h index 40c6dbb..066943a 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng_nmea.h +++ b/gps/loc_api/libloc_api_50001/loc_eng_nmea.h @@ -31,12 +31,13 @@ #define LOC_ENG_NMEA_H #include <hardware/gps.h> +#include <gps_extended.h> #define NMEA_SENTENCE_MAX_LENGTH 200 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 GpsSvStatus &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 diff --git a/gps/loc_api/loc_api_v02/Android.mk b/gps/loc_api/loc_api_v02/Android.mk index c3cc2f3..9f5cef0 100644 --- a/gps/loc_api/loc_api_v02/Android.mk +++ b/gps/loc_api/loc_api_v02/Android.mk @@ -11,6 +11,8 @@ LOCAL_MODULE_TAGS := optional ifeq ($(TARGET_DEVICE),apq8026_lw) LOCAL_CFLAGS += -DPDK_FEATURE_SET +else ifeq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET),true) +LOCAL_CFLAGS += -DPDK_FEATURE_SET endif LOCAL_SHARED_LIBRARIES := \ @@ -58,4 +60,4 @@ LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) endif # not BUILD_TINY_ANDROID -endif # QCPATH +endif #QCPATH diff --git a/gps/loc_api/loc_api_v02/LocApiV02.cpp b/gps/loc_api/loc_api_v02/LocApiV02.cpp index 91fa061..f658ec8 100644 --- a/gps/loc_api/loc_api_v02/LocApiV02.cpp +++ b/gps/loc_api/loc_api_v02/LocApiV02.cpp @@ -74,6 +74,9 @@ using namespace loc_core; /* seconds per week*/ #define WEEK_MSECS (60*60*24*7*1000) +/* number of QMI_LOC messages that need to be checked*/ +#define NUMBER_OF_MSG_TO_BE_CHECKED (3) + /* static event callbacks that call the LocApiV02 callbacks*/ /* global event callback, call the eventCb function in loc api adapter v02 @@ -221,34 +224,96 @@ LocApiV02 :: open(LOC_API_ADAPTER_EVENT_MASK_T mask) rtv = LOC_API_ADAPTER_ERR_FAILURE; } else { uint64_t supportedMsgList = 0; - const uint32_t msgArray[LOC_API_ADAPTER_MESSAGE_MAX] = + const uint32_t msgArray[NUMBER_OF_MSG_TO_BE_CHECKED] = { // For - LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING QMI_LOC_GET_BATCH_SIZE_REQ_V02, // For - LOC_API_ADAPTER_MESSAGE_BATCHED_GENFENCE_BREACH - QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02 + QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02, + + // For - LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING + QMI_LOC_START_DBT_REQ_V02 }; // check the modem status = locClientSupportMsgCheck(clientHandle, msgArray, - LOC_API_ADAPTER_MESSAGE_MAX, + NUMBER_OF_MSG_TO_BE_CHECKED, &supportedMsgList); if (eLOC_CLIENT_SUCCESS != status) { LOC_LOGE("%s:%d]: Failed to checking QMI_LOC message supported. \n", __func__, __LINE__); - } else { - LOC_LOGV("%s:%d]: supportedMsgList is %lld. \n", - __func__, __LINE__, supportedMsgList); } + /** if batching is supported , check if the adaptive batching or + distance-based batching is supported. */ + uint32_t messageChecker = 1 << LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING; + if ((messageChecker & supportedMsgList) == messageChecker) { + locClientReqUnionType req_union; + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + qmiLocQueryAonConfigReqMsgT_v02 queryAonConfigReq; + qmiLocQueryAonConfigIndMsgT_v02 queryAonConfigInd; + + memset(&queryAonConfigReq, 0, sizeof(queryAonConfigReq)); + memset(&queryAonConfigInd, 0, sizeof(queryAonConfigInd)); + queryAonConfigReq.transactionId = LOC_API_V02_DEF_SESSION_ID; + + req_union.pQueryAonConfigReq = &queryAonConfigReq; + status = loc_sync_send_req(clientHandle, + QMI_LOC_QUERY_AON_CONFIG_REQ_V02, + req_union, + LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_QUERY_AON_CONFIG_IND_V02, + &queryAonConfigInd); + + if (status == eLOC_CLIENT_FAILURE_UNSUPPORTED) { + LOC_LOGE("%s:%d]: Query AON config is not supported.\n", __func__, __LINE__); + } else { + if (status != eLOC_CLIENT_SUCCESS || + queryAonConfigInd.status != eQMI_LOC_SUCCESS_V02) { + LOC_LOGE("%s:%d]: Query AON config failed." + " status: %s, ind status:%s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(queryAonConfigInd.status)); + } else { + LOC_LOGD("%s:%d]: Query AON config succeeded.\n", __func__, __LINE__); + if (queryAonConfigInd.aonCapability_valid) { + if (queryAonConfigInd.aonCapability | + QMI_LOC_MASK_AON_TIME_BASED_BATCHING_SUPPORTED_V02) { + LOC_LOGD("%s:%d]: LB 1.0 is supported.\n", __func__, __LINE__); + } + if (queryAonConfigInd.aonCapability | + QMI_LOC_MASK_AON_AUTO_BATCHING_SUPPORTED_V02) { + LOC_LOGD("%s:%d]: LB 1.5 is supported.\n", __func__, __LINE__); + supportedMsgList |= + (1 << LOC_API_ADAPTER_MESSAGE_ADAPTIVE_LOCATION_BATCHING); + } + if (queryAonConfigInd.aonCapability | + QMI_LOC_MASK_AON_DISTANCE_BASED_BATCHING_SUPPORTED_V02) { + LOC_LOGD("%s:%d]: LB 2.0 is supported.\n", __func__, __LINE__); + supportedMsgList |= + (1 << LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING); + } + if (queryAonConfigInd.aonCapability | + QMI_LOC_MASK_AON_DISTANCE_BASED_TRACKING_SUPPORTED_V02) { + LOC_LOGD("%s:%d]: DBT 2.0 is supported.\n", __func__, __LINE__); + } + } else { + LOC_LOGE("%s:%d]: AON capability is invalid.\n", __func__, __LINE__); + } + } + } + } + LOC_LOGV("%s:%d]: supportedMsgList is %lld. \n", + __func__, __LINE__, supportedMsgList); // save the supported message list saveSupportedMsgList(supportedMsgList); } } else if (newMask != mMask) { // it is important to cap the mask here, because not all LocApi's - // can enable the same bits, e.g. foreground and bckground. + // can enable the same bits, e.g. foreground and background. if (!registerEventMask(qmiMask)) { // we do not update mMask here, because it did not change // as the mask update has failed. @@ -364,15 +429,20 @@ enum loc_api_adapter_err LocApiV02 :: startFix(const LocPosMode& fixCriteria) req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, QMI_LOC_SET_OPERATION_MODE_IND_V02, &set_mode_ind); // NULL? - - if (status != eLOC_CLIENT_SUCCESS || - eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) + //When loc_sync_send_req status is time out, more likely the response was lost. + //startFix will continue as though it is succeeded. + if ((status != eLOC_CLIENT_SUCCESS && status != eLOC_CLIENT_FAILURE_TIMEOUT) || + eQMI_LOC_SUCCESS_V02 != set_mode_ind.status) { LOC_LOGE ("%s:%d]: set opertion mode failed status = %s, " "ind..status = %s\n", __func__, __LINE__, loc_get_v02_client_status_name(status), loc_get_v02_qmi_status_name(set_mode_ind.status)); } else { + if (status == eLOC_CLIENT_FAILURE_TIMEOUT) + { + LOC_LOGE ("%s:%d]: set operation mode timed out\n", __func__, __LINE__); + } start_msg.minInterval_valid = 1; start_msg.minInterval = fixCriteria.min_interval; @@ -722,135 +792,6 @@ enum loc_api_adapter_err LocApiV02 :: deleteAidingData(GpsAidingData f) } #ifndef PDK_FEATURE_SET - if( f & GPS_DELETE_TIME_GPS ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_TIME_V02; - } - if(f & GPS_DELETE_ALMANAC_CORR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02; - } - if(f & GPS_DELETE_FREQ_BIAS_EST ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02; - } - if ( (f & GLO_DELETE_EPHEMERIS ) || (f & GLO_DELETE_ALMANAC )) - { - /* do delete for all GLONASS SV's (65 - 96) - */ - curr_sv_len += SV_ID_RANGE; - - sv_id = GLONASS_SV_ID_OFFSET; - - delete_req.deleteSvInfoList_valid = 1; - - delete_req.deleteSvInfoList_len = curr_sv_len; - - LOC_LOGV("%s:%d]: Delete GLO SV info for index %d to %d" - "and sv id %d to %d \n", - __func__, __LINE__, curr_sv_idx, curr_sv_len - 1, - sv_id, sv_id+SV_ID_RANGE-1); - - - for( uint32_t i = curr_sv_idx; i< curr_sv_len ; i++, sv_id++ ) - { - delete_req.deleteSvInfoList[i].gnssSvId = sv_id; - - delete_req.deleteSvInfoList[i].system = eQMI_LOC_SV_SYSTEM_GLONASS_V02; - - // set ephemeris mask for all GLO SV's - if(f & GLO_DELETE_EPHEMERIS) - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - // set almanac mask for all GLO SV's - if(f & GLO_DELETE_ALMANAC) - delete_req.deleteSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - curr_sv_idx += SV_ID_RANGE; - } - - if(f & GLO_DELETE_SVDIR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVDIR_V02; - } - - if(f & GLO_DELETE_SVSTEER ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02; - } - - if(f & GLO_DELETE_ALMANAC_CORR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02; - } - - if(f & GLO_DELETE_TIME ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GLO_TIME_V02; - } - - if ( (f & BDS_DELETE_EPHEMERIS ) || (f & BDS_DELETE_ALMANAC )) - { - /*Delete BeiDou SV info*/ - - sv_id = BDS_SV_ID_OFFSET; - - delete_req.deleteBdsSvInfoList_valid = 1; - - delete_req.deleteBdsSvInfoList_len = BDS_SV_ID_RANGE; - - LOC_LOGV("%s:%d]: Delete BDS SV info for index 0 to %d" - "and sv id %d to %d \n", - __func__, __LINE__, - BDS_SV_ID_RANGE - 1, - sv_id, sv_id+BDS_SV_ID_RANGE - 1); - - for( uint32_t i = 0; i < BDS_SV_ID_RANGE; i++, sv_id++ ) - { - delete_req.deleteBdsSvInfoList[i].gnssSvId = sv_id; - - // set ephemeris mask for all BDS SV's - if(f & BDS_DELETE_EPHEMERIS) - delete_req.deleteBdsSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_EPHEMERIS_V02; - if(f & BDS_DELETE_ALMANAC) - delete_req.deleteBdsSvInfoList[i].deleteSvInfoMask |= - QMI_LOC_MASK_DELETE_ALMANAC_V02; - } - curr_sv_idx += BDS_SV_ID_RANGE; - } - - if(f & BDS_DELETE_SVDIR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_BDS_SVDIR_V02; - } - - if(f & BDS_DELETE_SVSTEER ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_BDS_SVSTEER_V02; - } - - if(f & BDS_DELETE_ALMANAC_CORR ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_BDS_ALM_CORR_V02; - } - - if(f & BDS_DELETE_TIME ) - { - delete_req.deleteGnssDataMask_valid = 1; - delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_BDS_TIME_V02; - } #endif } @@ -1771,11 +1712,19 @@ locClientEventMaskType LocApiV02 :: convertMask( if (mask & LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT) eventMask |= QMI_LOC_EVENT_MASK_GNSS_MEASUREMENT_REPORT_V02; + if(mask & LOC_API_ADAPTER_BIT_REQUEST_TIMEZONE) + eventMask |= QMI_LOC_EVENT_MASK_GET_TIME_ZONE_REQ_V02; return eventMask; } qmiLocLockEnumT_v02 LocApiV02 :: convertGpsLockMask(LOC_GPS_LOCK_MASK lockMask) { + /* GPS HAL uses power voting through GPS Lock mask. + When QCA1530 daemon is present two values are used: 101 and 103.*/ + if ( 101 == lockMask || 103 == lockMask ) + { + return (qmiLocLockEnumT_v02)lockMask; + } if (isGpsLockAll(lockMask)) return eQMI_LOC_LOCK_ALL_V02; if (isGpsLockMO(lockMask)) @@ -1872,15 +1821,10 @@ void LocApiV02 :: reportPosition ( } // Speed - if((location_report_ptr->speedHorizontal_valid == 1) && - (location_report_ptr->speedVertical_valid ==1 ) ) + if(location_report_ptr->speedHorizontal_valid == 1) { location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; - location.gpsLocation.speed = sqrt( - (location_report_ptr->speedHorizontal * - location_report_ptr->speedHorizontal) + - (location_report_ptr->speedVertical * - location_report_ptr->speedVertical) ); + location.gpsLocation.speed = location_report_ptr->speedHorizontal; } // Heading @@ -1936,12 +1880,66 @@ void LocApiV02 :: reportPosition ( locationExtended.vert_unc = location_report_ptr->vertUnc; } - if (location_report_ptr->speedUnc_valid ) + if (location_report_ptr->speedUnc_valid) { locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_SPEED_UNC; locationExtended.speed_unc = location_report_ptr->speedUnc; } - + if (location_report_ptr->headingUnc_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_BEARING_UNC; + locationExtended.bearing_unc = location_report_ptr->headingUnc; + } + if (location_report_ptr->horReliability_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_HOR_RELIABILITY; + switch(location_report_ptr->horReliability) + { + case eQMI_LOC_RELIABILITY_NOT_SET_V02 : + locationExtended.horizontal_reliability = LOC_RELIABILITY_NOT_SET; + break; + case eQMI_LOC_RELIABILITY_VERY_LOW_V02 : + locationExtended.horizontal_reliability = LOC_RELIABILITY_VERY_LOW; + break; + case eQMI_LOC_RELIABILITY_LOW_V02 : + locationExtended.horizontal_reliability = LOC_RELIABILITY_LOW; + break; + case eQMI_LOC_RELIABILITY_MEDIUM_V02 : + locationExtended.horizontal_reliability = LOC_RELIABILITY_MEDIUM; + break; + case eQMI_LOC_RELIABILITY_HIGH_V02 : + locationExtended.horizontal_reliability = LOC_RELIABILITY_HIGH; + break; + default: + locationExtended.horizontal_reliability = LOC_RELIABILITY_NOT_SET; + break; + } + } + if (location_report_ptr->vertReliability_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_VERT_RELIABILITY; + switch(location_report_ptr->vertReliability) + { + case eQMI_LOC_RELIABILITY_NOT_SET_V02 : + locationExtended.vertical_reliability = LOC_RELIABILITY_NOT_SET; + break; + case eQMI_LOC_RELIABILITY_VERY_LOW_V02 : + locationExtended.vertical_reliability = LOC_RELIABILITY_VERY_LOW; + break; + case eQMI_LOC_RELIABILITY_LOW_V02 : + locationExtended.vertical_reliability = LOC_RELIABILITY_LOW; + break; + case eQMI_LOC_RELIABILITY_MEDIUM_V02 : + locationExtended.vertical_reliability = LOC_RELIABILITY_MEDIUM; + break; + case eQMI_LOC_RELIABILITY_HIGH_V02 : + locationExtended.vertical_reliability = LOC_RELIABILITY_HIGH; + break; + default: + locationExtended.vertical_reliability = LOC_RELIABILITY_NOT_SET; + break; + } + } LocApiBase::reportPosition( location, locationExtended, (void*)location_report_ptr, @@ -1970,7 +1968,7 @@ void LocApiV02 :: reportPosition ( void LocApiV02 :: reportSv ( const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) { - GpsSvStatus SvStatus; + GnssSvStatus SvStatus; GpsLocationExtended locationExtended; int num_svs_max, i; const qmiLocSvInfoStructT_v02 *sv_info_ptr; @@ -1981,7 +1979,7 @@ void LocApiV02 :: reportSv ( gnss_report_ptr->altitudeAssumed); num_svs_max = 0; - memset (&SvStatus, 0, sizeof (GpsSvStatus)); + memset (&SvStatus, 0, sizeof (GnssSvStatus)); memset(&locationExtended, 0, sizeof (GpsLocationExtended)); locationExtended.size = sizeof(locationExtended); if(gnss_report_ptr->svList_valid == 1) @@ -2001,7 +1999,7 @@ void LocApiV02 :: reportSv ( { if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GPS_V02) { - SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvStatus); + SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvInfo); SvStatus.sv_list[SvStatus.num_svs].prn = (int)sv_info_ptr->gnssSvId; // We only have the data field to report gps eph and alm mask @@ -2025,7 +2023,7 @@ void LocApiV02 :: reportSv ( && (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) { - SvStatus.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + SvStatus.gps_used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-1)); } } // SBAS: GPS PRN: 120-151, @@ -2041,6 +2039,14 @@ void LocApiV02 :: reportSv ( // which is 65-96 else if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GLONASS_V02) { + if((sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) + && + (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) + { + SvStatus.glo_used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->gnssSvId + (65-1); } @@ -2049,6 +2055,13 @@ void LocApiV02 :: reportSv ( //which is 201-237 else if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_BDS_V02) { + if((sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02) + && + (sv_info_ptr->svStatus == eQMI_LOC_SV_STATUS_TRACK_V02)) + { + SvStatus.bds_used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-1-200)); + } SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->gnssSvId; } @@ -2108,20 +2121,28 @@ void LocApiV02 :: reportEngineState ( mpLocApiV02->registerEventMask(mpLocApiV02->mQmiMask); } mpLocApiV02->mEngineOn = mEngineOn; + + if (mEngineOn) { + // if EngineOn and not InSession, then we have already stopped + // the fix, so do not send ENGINE_ON + if (mpLocApiV02->mInSession) { + mpLocApiV02->reportStatus(GPS_STATUS_ENGINE_ON); + mpLocApiV02->reportStatus(GPS_STATUS_SESSION_BEGIN); + } + } else { + mpLocApiV02->reportStatus(GPS_STATUS_SESSION_END); + mpLocApiV02->reportStatus(GPS_STATUS_ENGINE_OFF); + } } }; if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_ON_V02) { sendMsg(new MsgUpdateEngineState(this, true)); - reportStatus(GPS_STATUS_ENGINE_ON); - reportStatus(GPS_STATUS_SESSION_BEGIN); } else if (engine_state_ptr->engineState == eQMI_LOC_ENGINE_STATE_OFF_V02) { sendMsg(new MsgUpdateEngineState(this, false)); - reportStatus(GPS_STATUS_SESSION_END); - reportStatus(GPS_STATUS_ENGINE_OFF); } else { @@ -2529,11 +2550,12 @@ void LocApiV02 :: convertGpsMeasurements (GpsMeasurement& gpsMeasurement, // time_offset_ns gpsMeasurement.time_offset_ns = 0; - // state & received_gps_tow_ns + // state & received_gps_tow_ns & received_gps_tow_uncertainty_ns uint64_t validMask = gnss_measurement_info.measurementStatus & gnss_measurement_info.validMeasStatusMask; uint64_t bitSynMask = QMI_LOC_MASK_MEAS_STATUS_BE_CONFIRM_V02 | QMI_LOC_MASK_MEAS_STATUS_SB_VALID_V02; + double gpsTowUncNs = (double)gnss_measurement_info.svTimeSpeed.svTimeUncMs * 1e6; if (validMask & QMI_LOC_MASK_MEAS_STATUS_MS_VALID_V02) { /* sub-frame decode & TOW decode */ @@ -2544,6 +2566,7 @@ void LocApiV02 :: convertGpsMeasurements (GpsMeasurement& gpsMeasurement, gpsMeasurement.received_gps_tow_ns = ((double)gnss_measurement_info.svTimeSpeed.svTimeMs + (double)gnss_measurement_info.svTimeSpeed.svTimeSubMs) * 1e6; + gpsMeasurement.received_gps_tow_uncertainty_ns = gpsTowUncNs; } else if ((validMask & bitSynMask) == bitSynMask) { /* bit sync */ @@ -2552,17 +2575,20 @@ void LocApiV02 :: convertGpsMeasurements (GpsMeasurement& gpsMeasurement, gpsMeasurement.received_gps_tow_ns = fmod(((double)gnss_measurement_info.svTimeSpeed.svTimeMs + (double)gnss_measurement_info.svTimeSpeed.svTimeSubMs), 20) * 1e6; + gpsMeasurement.received_gps_tow_uncertainty_ns = gpsTowUncNs; } else if (validMask & QMI_LOC_MASK_MEAS_STATUS_SM_VALID_V02) { /* code lock */ gpsMeasurement.state = GPS_MEASUREMENT_STATE_CODE_LOCK; gpsMeasurement.received_gps_tow_ns = (double)gnss_measurement_info.svTimeSpeed.svTimeSubMs * 1e6; + gpsMeasurement.received_gps_tow_uncertainty_ns = gpsTowUncNs; } else { /* by default */ gpsMeasurement.state = GPS_MEASUREMENT_STATE_UNKNOWN; gpsMeasurement.received_gps_tow_ns = 0; + gpsMeasurement.received_gps_tow_uncertainty_ns = 0; } // c_n0_dbhz @@ -2584,9 +2610,9 @@ void LocApiV02 :: convertGpsMeasurements (GpsMeasurement& gpsMeasurement, LOC_LOGV(" %s:%d]: GNSS measurement raw data received form modem: \n" " Input => gnssSvId | CNo " "| measurementStatus | dopplerShift |" - " dopplerShiftUnc| svTimeMs | svTimeSubMs" + " dopplerShiftUnc| svTimeMs | svTimeSubMs | svTimeUncMs" " | validMeasStatusMask | \n" - " Input => %d | %d | 0x%04x%04x | %f | %f | %u | %f | 0x%04x%04x |\n", + " Input => %d | %d | 0x%04x%04x | %f | %f | %u | %f | %f | 0x%04x%04x |\n", __func__, __LINE__, gnss_measurement_info.gnssSvId, // %d gnss_measurement_info.CNo, // %d @@ -2596,22 +2622,24 @@ void LocApiV02 :: convertGpsMeasurements (GpsMeasurement& gpsMeasurement, gnss_measurement_info.svTimeSpeed.dopplerShiftUnc, // %f gnss_measurement_info.svTimeSpeed.svTimeMs, // %u gnss_measurement_info.svTimeSpeed.svTimeSubMs, // %f + gnss_measurement_info.svTimeSpeed.svTimeUncMs, // %f (uint32_t)(gnss_measurement_info.validMeasStatusMask >> 32), // %04x Upper 32 (uint32_t)(gnss_measurement_info.validMeasStatusMask & 0xFFFFFFFF) // %04x Lower 32 ); LOC_LOGV(" %s:%d]: GNSS measurement data after conversion: \n" " Output => size | prn | time_offset_ns | state |" - " received_gps_tow_ns| c_n0_dbhz | pseudorange_rate_mps |" - " pseudorange_rate_uncertainty_mps |" + " received_gps_tow_ns| received_gps_tow_uncertainty_ns |c_n0_dbhz |" + " pseudorange_rate_mps | pseudorange_rate_uncertainty_mps |" " accumulated_delta_range_state | flags \n" - " Output => %d | %d | %f | %d | %lld | %f | %f | %f | %d | %d \n", + " Output => %d | %d | %f | %d | %lld | %lld | %f | %f | %f | %d | %d \n", __func__, __LINE__, gpsMeasurement.size, // %d gpsMeasurement.prn, // %d gpsMeasurement.time_offset_ns, // %f gpsMeasurement.state, // %d gpsMeasurement.received_gps_tow_ns, // %lld + gpsMeasurement.received_gps_tow_uncertainty_ns, // %lld gpsMeasurement.c_n0_dbhz, // %f gpsMeasurement.pseudorange_rate_mps, // %f gpsMeasurement.pseudorange_rate_uncertainty_mps, // %f @@ -2632,7 +2660,7 @@ void LocApiV02 :: convertGpsClock (GpsClock& gpsClock, // flag initiation int flags = 0; - // type & time_ns + // type & time_ns & time_uncertainty_ns if (gnss_measurement_info.systemTime_valid && gnss_measurement_info.systemTimeExt_valid) { @@ -2645,9 +2673,12 @@ void LocApiV02 :: convertGpsClock (GpsClock& gpsClock, if(systemWeek != C_GPS_WEEK_UNKNOWN && isTimeValid) { gpsClock.type = GPS_CLOCK_TYPE_GPS_TIME; - double temp = (double)(systemWeek) * (double)WEEK_MSECS + (double)systemMsec; + double temp = (double)(systemWeek) * (double)WEEK_MSECS + (double)systemMsec; gpsClock.time_ns = (double)temp*1e6 - (double)((int)(sysClkBias*1e6)); + flags |= GPS_CLOCK_HAS_TIME_UNCERTAINTY; + gpsClock.time_uncertainty_ns = (double)sysClkUncMs * 1e6; + } else { gpsClock.type = GPS_CLOCK_TYPE_UNKNOWN; } @@ -2670,10 +2701,11 @@ void LocApiV02 :: convertGpsClock (GpsClock& gpsClock, gnss_measurement_info.systemTimeExt.sourceOfTime); // %d LOC_LOGV(" %s:%d]: GNSS measurement clock after conversion: \n" - " Output => type | time_ns \n" - " Output => %d | %lld \n", __func__, __LINE__, + " Output => type | time_ns | time_uncertainty_ns\n" + " Output => %d | %lld | %f \n", __func__, __LINE__, gpsClock.type, // %d - gpsClock.time_ns); // %lld + gpsClock.time_ns, // %lld + gpsClock.time_uncertainty_ns); // %f gpsClock.flags = flags; } @@ -2889,12 +2921,27 @@ getWwanZppFix(GpsLocation &zppLoc) if (status != eLOC_CLIENT_SUCCESS || eQMI_LOC_SUCCESS_V02 != zpp_ind.status) { - LOC_LOGE ("%s:%d]: error! status = %s, zpp_ind.status = %s\n", + LOC_LOGD ("%s:%d]: getWwanZppFix may not be supported by modem" + " so will fallback to getBestAvailableZppFix" + " status = %s, zpp_ind.status = %s ", __func__, __LINE__, loc_get_v02_client_status_name(status), loc_get_v02_qmi_status_name(zpp_ind.status)); - return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + LocPosTechMask tech_mask; + loc_api_adapter_err ret; + ret = getBestAvailableZppFix(zppLoc, tech_mask); + if (ret == LOC_API_ADAPTER_ERR_SUCCESS && + tech_mask != LOC_POS_TECH_MASK_DEFAULT && + tech_mask & LOC_POS_TECH_MASK_CELLID) { + return LOC_API_ADAPTER_ERR_SUCCESS; + } else { + LOC_LOGD ("%s:%d]: getBestAvailableZppFix failed or" + " technoloy source includes GNSS that is not allowed" + " ret = %u, tech_mask = 0x%X ", + __func__, __LINE__, ret, tech_mask); + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } } LOC_LOGD("Got Zpp fix location validity (lat:%d, lon:%d, timestamp:%d accuracy:%d)", @@ -2960,6 +3007,7 @@ getBestAvailableZppFix(GpsLocation &zppLoc, LocPosTechMask &tech_mask) memset(&zpp_ind, 0, sizeof(zpp_ind)); memset(&zpp_req, 0, sizeof(zpp_req)); memset(&zppLoc, 0, sizeof(zppLoc)); + tech_mask = LOC_POS_TECH_MASK_DEFAULT; req_union.pGetBestAvailablePositionReq = &zpp_req; diff --git a/gps/loc_api/loc_api_v02/loc_api_v02_client.c b/gps/loc_api/loc_api_v02/loc_api_v02_client.c index 7535f44..e265939 100644 --- a/gps/loc_api/loc_api_v02/loc_api_v02_client.c +++ b/gps/loc_api/loc_api_v02/loc_api_v02_client.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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 @@ -236,7 +236,24 @@ static locClientEventIndTableStructT locClientEventIndTable[]= { //GNSS measurement event { QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02 , sizeof(qmiLocEventGnssSvMeasInfoIndMsgT_v02), - QMI_LOC_EVENT_MASK_GNSS_MEASUREMENT_REPORT_V02} + QMI_LOC_EVENT_MASK_GNSS_MEASUREMENT_REPORT_V02}, + + { QMI_LOC_EVENT_DBT_POSITION_REPORT_IND_V02, + sizeof(qmiLocEventDbtPositionReportIndMsgT_v02), + 0}, + + { QMI_LOC_EVENT_GEOFENCE_BATCHED_DWELL_NOTIFICATION_IND_V02, + sizeof(qmiLocEventGeofenceBatchedDwellIndMsgT_v02), + QMI_LOC_EVENT_MASK_GEOFENCE_BATCH_DWELL_NOTIFICATION_V02}, + + { QMI_LOC_EVENT_GET_TIME_ZONE_INFO_IND_V02, + sizeof(qmiLocEventGetTimeZoneReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_GET_TIME_ZONE_REQ_V02}, + + // Batching Status event + { QMI_LOC_EVENT_BATCHING_STATUS_IND_V02, + sizeof(qmiLocEventBatchingStatusIndMsgT_v02), + QMI_LOC_EVENT_MASK_BATCHING_STATUS_V02} }; /* table to relate the respInd Id with its size */ @@ -324,6 +341,14 @@ static locClientRespIndTableStructT locClientRespIndTable[]= { { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, + //Set AP cache injection Resp Ind + { QMI_LOC_INJECT_APCACHE_DATA_IND_V02, + sizeof(qmiLocInjectApCacheDataIndMsgT_v02)}, + + //Set No AP cache injection Resp Ind + { QMI_LOC_INJECT_APDONOTCACHE_DATA_IND_V02, + sizeof(qmiLocInjectApDoNotCacheDataIndMsgT_v02)}, + //Set XTRA-T Session Control Resp Ind { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, @@ -451,6 +476,10 @@ static locClientRespIndTableStructT locClientRespIndTable[]= { { QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02)}, + //Secure Get available position + { QMI_LOC_SECURE_GET_AVAILABLE_POSITION_IND_V02, + sizeof(qmiLocSecureGetAvailablePositionIndMsgT_v02)}, + //Inject motion data { QMI_LOC_INJECT_MOTION_DATA_IND_V02, sizeof(qmiLocInjectMotionDataIndMsgT_v02)}, @@ -540,7 +569,19 @@ static locClientRespIndTableStructT locClientRespIndTable[]= { sizeof(qmiLocGdtUploadEndIndMsgT_v02) }, { QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02, - sizeof(qmiLocSetGNSSConstRepConfigIndMsgT_v02)} + sizeof(qmiLocSetGNSSConstRepConfigIndMsgT_v02)}, + + { QMI_LOC_START_DBT_IND_V02, + sizeof(qmiLocStartDbtIndMsgT_v02)}, + + { QMI_LOC_STOP_DBT_IND_V02, + sizeof(qmiLocStopDbtIndMsgT_v02)}, + + { QMI_LOC_INJECT_TIME_ZONE_INFO_IND_V02, + sizeof(qmiLocInjectTimeZoneInfoIndMsgT_v02)}, + + { QMI_LOC_QUERY_AON_CONFIG_IND_V02, + sizeof(qmiLocQueryAonConfigIndMsgT_v02)} }; @@ -616,50 +657,11 @@ static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, return false; } -/** isClientRegisteredForEvent -* @brief checks the mask to identify if the client has -* registered for the specified event Id -* @param [in] eventIndId -* @param [in] eventRegMask -* @return true if client regstered for event; else false */ - -static bool isClientRegisteredForEvent( - locClientEventMaskType eventRegMask, - uint32_t eventIndId) -{ - size_t idx = 0, eventIndTableSize = 0; - - // look in the event table - eventIndTableSize = - (sizeof(locClientEventIndTable)/sizeof(locClientEventIndTableStructT)); - - for(idx=0; idx<eventIndTableSize; idx++ ) - { - if(eventIndId == locClientEventIndTable[idx].eventId) - { - LOC_LOGV("%s:%d]: eventId %d registered mask = 0x%04x%04x, " - "eventMask = 0x%04x%04x\n", __func__, __LINE__, - eventIndId,(uint32_t)(eventRegMask>>32), - (uint32_t)(eventRegMask & 0xFFFFFFFF), - (uint32_t)(locClientEventIndTable[idx].eventMask >> 32), - (uint32_t)(locClientEventIndTable[idx].eventMask & 0xFFFFFFFF)); - - return(( - eventRegMask & locClientEventIndTable[idx].eventMask)? - true:false); - } - } - LOC_LOGW("%s:%d]: eventId %d not found\n", __func__, __LINE__, - eventIndId); - return false; -} - /** checkQmiMsgsSupported @brief check the qmi service is supported or not. @param [in] pResponse pointer to the response received from QMI_LOC service. */ - static void checkQmiMsgsSupported( uint32_t* reqIdArray, int reqIdArrayLength, @@ -734,6 +736,10 @@ static locClientStatusEnumType convertQmiResponseToLocStatus( status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; break; + case QMI_ERR_NOT_SUPPORTED_V01: + status = eLOC_CLIENT_FAILURE_UNSUPPORTED; + break; + default: status = eLOC_CLIENT_FAILURE_INTERNAL; break; @@ -771,141 +777,6 @@ static locClientErrorEnumType convertQmiErrorToLocError( return locError; } -//----------------------------------------------------------------------------- - -/** locClientHandleIndication - * @brief looks at each indication and calls the appropriate - * validation handler - * @param [in] indId - * @param [in] indBuffer - * @param [in] indSize - * @return true if indication was validated; else false */ - -static bool locClientHandleIndication( - uint32_t indId, - void* indBuffer, - size_t indSize - ) -{ - bool status = false; - switch(indId) - { - // handle the event indications - //------------------------------------------------------------------------- - - // handle position report - case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: - case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: - case QMI_LOC_EVENT_NMEA_IND_V02: - case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: - case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: - case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: - case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: - case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: - case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: - case QMI_LOC_EVENT_WIFI_REQ_IND_V02: - case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: - case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: - case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: - case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: - case QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02: - case QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02: - case QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02: - case QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02: - case QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 : - case QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02: - case QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_IND_V02: - case QMI_LOC_EVENT_VEHICLE_DATA_READY_STATUS_IND_V02: - case QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02: - case QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02: - case QMI_LOC_GET_SERVICE_REVISION_IND_V02: - case QMI_LOC_GET_FIX_CRITERIA_IND_V02: - case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02: - case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02: - case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : - case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: - case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: - case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: - case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: - case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: - case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: - case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: - case QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02: - case QMI_LOC_DELETE_GEOFENCE_IND_V02: - case QMI_LOC_EDIT_GEOFENCE_IND_V02: - case QMI_LOC_QUERY_GEOFENCE_IND_V02: - case QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02: - case QMI_LOC_GET_ENGINE_LOCK_IND_V02: - case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02: - case QMI_LOC_PEDOMETER_REPORT_IND_V02: - case QMI_LOC_START_BATCHING_IND_V02: - case QMI_LOC_STOP_BATCHING_IND_V02: - case QMI_LOC_GET_BATCH_SIZE_IND_V02: - case QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02: - case QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02: - case QMI_LOC_READ_FROM_BATCH_IND_V02: - case QMI_LOC_RELEASE_BATCH_IND_V02: - case QMI_LOC_INJECT_GTP_CLIENT_DOWNLOADED_DATA_IND_V02: - case QMI_LOC_GDT_UPLOAD_BEGIN_STATUS_IND_V02: - case QMI_LOC_GDT_UPLOAD_END_IND_V02: - case QMI_LOC_EVENT_GDT_UPLOAD_BEGIN_STATUS_REQ_IND_V02: - case QMI_LOC_EVENT_GDT_UPLOAD_END_REQ_IND_V02: - case QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02: - case QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02: - case QMI_LOC_NI_USER_RESPONSE_IND_V02: - case QMI_LOC_INJECT_UTC_TIME_IND_V02: - case QMI_LOC_INJECT_POSITION_IND_V02: - case QMI_LOC_SET_ENGINE_LOCK_IND_V02: - case QMI_LOC_SET_SBAS_CONFIG_IND_V02: - case QMI_LOC_SET_NMEA_TYPES_IND_V02: - case QMI_LOC_SET_LOW_POWER_MODE_IND_V02: - case QMI_LOC_SET_SERVER_IND_V02: - case QMI_LOC_DELETE_ASSIST_DATA_IND_V02: - case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02: - case QMI_LOC_INJECT_WIFI_POSITION_IND_V02: - case QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02: - case QMI_LOC_SET_OPERATION_MODE_IND_V02: - case QMI_LOC_SET_SPI_STATUS_IND_V02: - case QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02: - case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02: - case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02: - case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02: - case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02: - case QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02: - case QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02: - case QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02: - case QMI_LOC_INJECT_MOTION_DATA_IND_V02: - case QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02: - case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02: - case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02: - case QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02: - case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02: - case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: - case QMI_LOC_INJECT_WIFI_AP_DATA_IND_V02: - case QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_IND_V02: - case QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_IND_V02: - case QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_IND_V02: - case QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02: - case QMI_LOC_SET_XTRA_VERSION_CHECK_IND_V02: - case QMI_LOC_GET_REGISTERED_EVENTS_IND_V02: - { - status = true; - break; - } - default: - LOC_LOGW("%s:%d]: unknown ind id %d\n", __func__, __LINE__, - (uint32_t)indId); - status = false; - break; - } - return status; -} - - /** locClientErrorCb * @brief handles the QCCI error events, this is called by the * QCCI infrastructure when the service is no longer @@ -1007,16 +878,6 @@ static void locClientIndCb { void *indBuffer = NULL; - // if the client did not register for this event then just drop it - if( (eventIndType == indType) && - ( (NULL == pCallbackData->eventCallback) || - (false == isClientRegisteredForEvent(pCallbackData->eventRegMask, msg_id)) ) ) - { - LOC_LOGW("%s:%d]: client is not registered for event %d\n", - __func__, __LINE__, (uint32_t)msg_id); - return; - } - // decode the indication indBuffer = malloc(indSize); @@ -1043,73 +904,64 @@ static void locClientIndCb if( rc == QMI_NO_ERR ) { - //validate indication - if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) + if(eventIndType == indType) { - if(eventIndType == indType) - { - locClientEventIndUnionType eventIndUnion; + locClientEventIndUnionType eventIndUnion; - /* copy the eventCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientEventIndCbType localEventCallback = - pCallbackData->eventCallback; + /* copy the eventCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientEventIndCbType localEventCallback = + pCallbackData->eventCallback; - // dummy event - eventIndUnion.pPositionReportEvent = + // dummy event + eventIndUnion.pPositionReportEvent = (qmiLocEventPositionReportIndMsgT_v02 *)indBuffer; - /* call the event callback - * To avoid calling the eventCallback after locClientClose - * is called, check pCallbackData->eventCallback again here - */ - if((NULL != localEventCallback) && - (NULL != pCallbackData->eventCallback)) - { - localEventCallback( - (locClientHandleType)pCallbackData, - msg_id, - eventIndUnion, - pCallbackData->pClientCookie); - } - } - else if(respIndType == indType) + /* call the event callback + * To avoid calling the eventCallback after locClientClose + * is called, check pCallbackData->eventCallback again here + */ + if((NULL != localEventCallback) && + (NULL != pCallbackData->eventCallback)) { - locClientRespIndUnionType respIndUnion; + localEventCallback( + (locClientHandleType)pCallbackData, + msg_id, + eventIndUnion, + pCallbackData->pClientCookie); + } + } + else if(respIndType == indType) + { + locClientRespIndUnionType respIndUnion; - /* copy the respCallback function pointer from the callback - * data to local variable. This is to protect against the race - * condition between open/close and indication callback. - */ - locClientRespIndCbType localRespCallback = - pCallbackData->respCallback; + /* copy the respCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and indication callback. + */ + locClientRespIndCbType localRespCallback = + pCallbackData->respCallback; - // dummy to suppress compiler warnings - respIndUnion.pDeleteAssistDataInd = + // dummy to suppress compiler warnings + respIndUnion.pDeleteAssistDataInd = (qmiLocDeleteAssistDataIndMsgT_v02 *)indBuffer; - /* call the response callback - * To avoid calling the respCallback after locClientClose - * is called, check pCallbackData->respCallback again here - */ - if((NULL != localRespCallback) && - (NULL != pCallbackData->respCallback)) - { - localRespCallback( - (locClientHandleType)pCallbackData, - msg_id, - respIndUnion, - pCallbackData->pClientCookie); - } + /* call the response callback + * To avoid calling the respCallback after locClientClose + * is called, check pCallbackData->respCallback again here + */ + if((NULL != localRespCallback) && + (NULL != pCallbackData->respCallback)) + { + localRespCallback( + (locClientHandleType)pCallbackData, + msg_id, + respIndUnion, + pCallbackData->pClientCookie); } } - else // error handling indication - { - LOC_LOGE("%s:%d]: Error handling the indication %d\n", - __func__, __LINE__, (uint32_t)msg_id); - } } else { @@ -1268,6 +1120,18 @@ static bool validateRequest( break; } + case QMI_LOC_INJECT_APCACHE_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectApCacheDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_APDONOTCACHE_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectApDoNotCacheDataReqMsgT_v02); + break; + } + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: { *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); @@ -1410,6 +1274,12 @@ static bool validateRequest( break; } + case QMI_LOC_SECURE_GET_AVAILABLE_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocSecureGetAvailablePositionReqMsgT_v02); + break; + } + case QMI_LOC_INJECT_MOTION_DATA_REQ_V02: { *pOutLen = sizeof(qmiLocInjectMotionDataReqMsgT_v02); @@ -1554,6 +1424,30 @@ static bool validateRequest( break; } + case QMI_LOC_START_DBT_REQ_V02: + { + *pOutLen = sizeof(qmiLocStartDbtReqMsgT_v02); + break; + } + + case QMI_LOC_STOP_DBT_REQ_V02: + { + *pOutLen = sizeof(qmiLocStopDbtReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_TIME_ZONE_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectTimeZoneInfoReqMsgT_v02); + break; + } + + case QMI_LOC_QUERY_AON_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocQueryAonConfigReqMsgT_v02); + break; + } + // ALL requests with no payload case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: diff --git a/gps/loc_api/loc_api_v02/loc_api_v02_client.h b/gps/loc_api/loc_api_v02/loc_api_v02_client.h index 53d9d79..5df8049 100644 --- a/gps/loc_api/loc_api_v02/loc_api_v02_client.h +++ b/gps/loc_api/loc_api_v02/loc_api_v02_client.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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 @@ -301,6 +301,27 @@ typedef union To send this request, set the reqId field in locClientSendReq() to QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ + const qmiLocInjectApCacheDataReqMsgT_v02 *pInjectApCacheDataReq; + /**< Inject APcache data into the engine + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_APCACHE_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_APCACHE_DATA_REQ_V02. */ + + const qmiLocInjectApDoNotCacheDataReqMsgT_v02 *pInjectApDoNotCacheDataReq; + /**< Inject blacklist-Apcache data into the engine + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_DONOTAPCACHE_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_DONOTAPCACHE_DATA_REQ_V02. */ + + const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; /**< Sets XTRA-T session control in the engine. @@ -560,6 +581,17 @@ typedef union To send this request, set the reqId field in locClientSendReq() to QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02. @newpagetable */ + const qmiLocSecureGetAvailablePositionReqMsgT_v02* + pSecureGetBestAvailablePositionReq; + /**< Get the best available position from location engine + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02. @newpagetable */ + const qmiLocInjectMotionDataReqMsgT_v02* pInjectMotionDataReq; /**< Inject motion data in the location engine @@ -653,6 +685,17 @@ typedef union const qmiLocSetGNSSConstRepConfigReqMsgT_v02 *pSetGNSSConstRepConfigReq; /*QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_V02*/ + const qmiLocStartDbtReqMsgT_v02 *pStartDbtReq; + /*QMI_LOC_START_DBT_REQ_V02*/ + + const qmiLocStopDbtReqMsgT_v02 *pStopDbtReq; + /*QMI_LOC_STOP_DBT_REQ_V02*/ + + const qmiLocInjectTimeZoneInfoReqMsgT_v02 *pInjectTimeZoneInfoReq; + /*QMI_LOC_INJECT_TIME_ZONE_INFO*/ + + const qmiLocQueryAonConfigReqMsgT_v02 *pQueryAonConfigReq; + /*QMI_LOC_QUERY_AON_CONFIG_REQ_V02*/ }locClientReqUnionType; @@ -869,6 +912,29 @@ typedef union The eventIndId field in the event indication callback is set to QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02. @newpagetable */ + const qmiLocEventDbtPositionReportIndMsgT_v02 *pDbtPositionReportEvent; + /**< Sent by the engine to notify the client of a distance based + tracking position report. + QMI_LOC_EVENT_DBT_POSITION_REPORT_IND_V02*/ + + const qmiLocEventDbtSessionStatusIndMsgT_v02 *pDbtSessionStatusEvent; + /**< Sent by the engine to notify the client of the status of the + DBT session. + QMI_LOC_EVENT_DBT_SESSION_STATUS_IND_V02*/ + + const qmiLocEventGeofenceBatchedDwellIndMsgT_v02 *pGeofenceBatchedDwellEvent; + /**< Sent by the engine to notify the client of the dwell time inside + or outside of a Geofence for a specified time. + QMI_LOC_EVENT_GEOFENCE_BATCHED_DWELL_NOTIFICATION_IND_V02*/ + + const qmiLocEventGetTimeZoneReqIndMsgT_v02 *pGetTimeZoneReqEvent; + /**< Sent by the engine to request injection of time zone info + QMI_LOC_EVENT_GET_TIME_ZONE_INFO_IND_V02>*/ + + const qmiLocEventBatchingStatusIndMsgT_v02* pBatchingStatusEvent; + /**< Sent by the engine to notify the control point of the batching status. + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_BATCHING_STATUS_IND_V02. */ }locClientEventIndUnionType; @@ -999,6 +1065,18 @@ typedef union The respIndId field in the response indication callback is set to QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ + const qmiLocInjectApCacheDataIndMsgT_v02 *pInjectApCacheDataInd; + /**< Response to the QMI_LOC_INJECT_APCACHE_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_APCACHE_DATA_IND_V02. */ + + const qmiLocInjectApDoNotCacheDataIndMsgT_v02 *pInjectApDoNotCacheDataInd; + /**< Response to the QMI_LOC_INJECT_DONOTAPCACHE_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_DONOTAPCACHE_DATA_IND_V02. */ + const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; /**< Response to the QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 request. @@ -1208,6 +1286,13 @@ typedef union The respIndId field in the response indication callback is set to QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02. */ + const qmiLocSecureGetAvailablePositionIndMsgT_v02* + pSecureGetBestAvailablePositionInd; + /**< Response to the QMI_LOC_SECURE_GET_AVAILABLE_POSITION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SECURE_GET_AVAILABLE_POSITION_IND_V02. */ + const qmiLocInjectMotionDataIndMsgT_v02* pInjectMotionDataInd; /**< Response to the QMI_LOC_INJECT_MOTION_DATA_REQ_V02 request. @@ -1266,10 +1351,22 @@ typedef union /*QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02*/ const qmiLocSetXtraVersionCheckIndMsgT_v02 *pSetXtraVersionCheckInd; - + /*QMI_LOC_SET_XTRA_VERSION_CHECK_IND_V02*/ + const qmiLocSetGNSSConstRepConfigIndMsgT_v02 *pSetGNSSConstRepConfigInd; /*QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02*/ + const qmiLocStartDbtIndMsgT_v02 *pStartDbtInd; + /*QMI_LOC_START_DBT_IND_V02*/ + + const qmiLocStopDbtIndMsgT_v02 *pStopDbtInd; + /*QMI_LOC_STOP_DBT_IND_V02*/ + + const qmiLocInjectTimeZoneInfoIndMsgT_v02 *pInjectTimeZoneInfoInd; + /*QMI_LOC_INJECT_TIME_ZONE_INFO_IND_V02*/ + + const qmiLocQueryAonConfigIndMsgT_v02 *pQueryAonConfigInd; + /*QMI_LOC_QUERY_AON_CONFIG_IND_V02*/ }locClientRespIndUnionType; /** @} */ /* end_addtogroup data_types */ diff --git a/gps/loc_api/loc_api_v02/loc_api_v02_log.c b/gps/loc_api/loc_api_v02/loc_api_v02_log.c index 4272722..520537a 100644 --- a/gps/loc_api/loc_api_v02/loc_api_v02_log.c +++ b/gps/loc_api/loc_api_v02/loc_api_v02_log.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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 @@ -296,7 +296,31 @@ static loc_name_val_s_type loc_v02_event_name[] = NAME_VAL(QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02), NAME_VAL(QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_V02), NAME_VAL(QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_RESP_V02), - NAME_VAL(QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02) + NAME_VAL(QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_START_DBT_REQ_V02), + NAME_VAL(QMI_LOC_START_DBT_RESP_V02), + NAME_VAL(QMI_LOC_START_DBT_IND_V02), + NAME_VAL(QMI_LOC_STOP_DBT_REQ_V02), + NAME_VAL(QMI_LOC_STOP_DBT_RESP_V02), + NAME_VAL(QMI_LOC_STOP_DBT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_DBT_POSITION_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_DBT_SESSION_STATUS_IND_V02), + NAME_VAL(QMI_LOC_SECURE_GET_AVAILABLE_POSITION_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BATCHED_DWELL_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GET_TIME_ZONE_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_ZONE_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_ZONE_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_ZONE_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_APCACHE_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_APCACHE_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_APCACHE_DATA_IND_V02), + NAME_VAL(QMI_LOC_INJECT_APDONOTCACHE_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_APDONOTCACHE_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_APDONOTCACHE_DATA_IND_V02), + NAME_VAL(QMI_LOC_EVENT_BATCHING_STATUS_IND_V02), + NAME_VAL(QMI_LOC_QUERY_AON_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_QUERY_AON_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_QUERY_AON_CONFIG_IND_V02) }; static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); diff --git a/gps/loc_api/loc_api_v02/location_service_v02.c b/gps/loc_api/loc_api_v02/location_service_v02.c index 1b27387..95526a4 100644 --- a/gps/loc_api/loc_api_v02/location_service_v02.c +++ b/gps/loc_api/loc_api_v02/location_service_v02.c @@ -29,8 +29,8 @@ *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ -/* This file was generated with Tool version 6.14.4 - It was generated on: Fri Mar 27 2015 (Spin 0) +/* This file was generated with Tool version 6.14.5 + It was generated on: Thu Jul 2 2015 (Spin 0) From IDL File: location_service_v02.idl */ #include "stdint.h" @@ -647,16 +647,6 @@ static const uint8_t qmiLocGeofenceMotionStateConfigStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; -static const uint8_t qmiLocTimeZoneStructT_data_v02[] = { - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocTimeZoneStructT_v02, dstOffset), - - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocTimeZoneStructT_v02, rawOffset), - - QMI_IDL_FLAG_END_VALUE -}; - static const uint8_t qmiLocMotionDataStructT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), @@ -846,7 +836,7 @@ static const uint8_t qmiLocVehicleSensorSampleListStructType_data_v02[] = { QMI_IDL_OFFSET8(qmiLocVehicleSensorSampleListStructType_v02, sensorData), QMI_LOC_VEHICLE_SENSOR_DATA_MAX_SAMPLES_V02, QMI_IDL_OFFSET8(qmiLocVehicleSensorSampleListStructType_v02, sensorData) - QMI_IDL_OFFSET8(qmiLocVehicleSensorSampleListStructType_v02, sensorData_len), - QMI_IDL_TYPE88(0, 47), + QMI_IDL_TYPE88(0, 46), QMI_IDL_FLAG_END_VALUE }; @@ -879,7 +869,7 @@ static const uint8_t qmiLocVehicleOdometrySampleListStructT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleListStructT_v02, odometryData), QMI_LOC_VEHICLE_SENSOR_DATA_MAX_SAMPLES_V02, QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleListStructT_v02, odometryData) - QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleListStructT_v02, odometryData_len), - QMI_IDL_TYPE88(0, 49), + QMI_IDL_TYPE88(0, 48), QMI_IDL_FLAG_END_VALUE }; @@ -1034,7 +1024,7 @@ static const uint8_t qmiLocSVMeasurementStructT_data_v02[] = { QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, svTimeSpeed), - QMI_IDL_TYPE88(0, 57), + QMI_IDL_TYPE88(0, 56), QMI_IDL_GENERIC_1_BYTE, QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, lossOfLock), @@ -1136,6 +1126,49 @@ static const uint8_t qmiLocDbtPositionStructT_data_v02[] = { QMI_IDL_FLAG_END_VALUE }; +static const uint8_t qmiLocDeleteGALSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGALSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGALSvInfoStructT_v02, deleteSvInfoMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTimeZoneStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocTimeZoneStructT_v02, dstOffset), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocTimeZoneStructT_v02, rawOffset), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocApCacheStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocApCacheStructT_v02, macAddress), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApCacheStructT_v02, xLat), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApCacheStructT_v02, yLon), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApCacheStructT_v02, mar), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocApDoNotCacheStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocApDoNotCacheStructT_v02, macAddress), + + QMI_IDL_FLAG_END_VALUE +}; + /*Message Definitions*/ static const uint8_t qmiLocGenRespMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, @@ -1707,71 +1740,6 @@ static const uint8_t qmiLocEventGeofenceProximityIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocEventGeofenceProximityIndMsgT_v02, contextId) }; -static const uint8_t qmiLocEventGeofenceBatchedDwellIndMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, dwellType), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList_valid)), - 0x10, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList), - QMI_LOC_MAX_GEOFENCE_ID_CONTINUOUS_LIST_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList_len), - QMI_IDL_TYPE88(0, 24), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList_valid)), - 0x11, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList), - QMI_LOC_MAX_GEOFENCE_ID_DISCRETE_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList_len), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofencePosition_valid)), - 0x12, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofencePosition), - QMI_IDL_TYPE88(0, 23), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, headingUnc_valid)), - 0x13, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, headingUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertUnc_valid)), - 0x14, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, speedUnc_valid)), - 0x15, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, speedUnc), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, horConfidence_valid)), - 0x16, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, horConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertConfidence_valid)), - 0x17, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertConfidence), - - QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, DOP) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, DOP_valid)), - 0x18, - QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, DOP), - QMI_IDL_TYPE88(0, 2), - - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList_valid)), - 0x19, - QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, - QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList), - QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList_len) -}; - static const uint8_t qmiLocEventGdtUploadBeginStatusReqIndMsgT_data_v02[] = { 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -2317,13 +2285,21 @@ static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteBdsSvInfoList) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteBdsSvInfoList_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteBdsSvInfoList) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteBdsSvInfoList_valid)), 0x14, QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteBdsSvInfoList), QMI_LOC_DELETE_MAX_BDS_SV_INFO_LENGTH_V02, QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteBdsSvInfoList) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteBdsSvInfoList_len), - QMI_IDL_TYPE88(0, 28) + QMI_IDL_TYPE88(0, 28), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGalSvInfoList) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGalSvInfoList_valid)), + 0x15, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGalSvInfoList), + QMI_LOC_DELETE_MAX_GAL_SV_INFO_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGalSvInfoList) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGalSvInfoList_len), + QMI_IDL_TYPE88(0, 61) }; static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { @@ -3206,10 +3182,15 @@ static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, customResponsivenessValue), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, dwellTime) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, dwellTime_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, dwellTime) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, dwellTime_valid)), 0x13, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, dwellTime) + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, dwellTime), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, dwellTypeMask) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, dwellTypeMask_valid)), + 0x14, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, dwellTypeMask) }; static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { @@ -3449,29 +3430,6 @@ static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) }; -static const uint8_t qmiLocEventGetTimeZoneReqIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocEventGetTimeZoneReqIndMsgT_v02, status) -}; - -static const uint8_t qmiLocInjectTimeZoneInfoReqMsgT_data_v02[] = { - 0x01, - QMI_IDL_GENERIC_8_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeZoneInfoReqMsgT_v02, timeUtc), - - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, - QMI_IDL_AGGREGATE, - QMI_IDL_OFFSET8(qmiLocInjectTimeZoneInfoReqMsgT_v02, timeZone), - QMI_IDL_TYPE88(0, 40) -}; - -static const uint8_t qmiLocInjectTimeZoneInfoIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, - QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocInjectTimeZoneInfoIndMsgT_v02, status) -}; - static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, QMI_IDL_GENERIC_4_BYTE, @@ -3643,7 +3601,7 @@ static const uint8_t qmiLocInjectMotionDataReqMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectMotionDataReqMsgT_v02, motion_data), - QMI_IDL_TYPE88(0, 41) + QMI_IDL_TYPE88(0, 40) }; static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { @@ -3680,7 +3638,7 @@ static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), - QMI_IDL_TYPE88(0, 42), + QMI_IDL_TYPE88(0, 41), 0x02, QMI_IDL_GENERIC_1_BYTE, @@ -3702,7 +3660,7 @@ static const uint8_t qmiLocInjectWCDMACellInfoReqMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, wcdmaCellId), - QMI_IDL_TYPE88(0, 43), + QMI_IDL_TYPE88(0, 42), 0x02, QMI_IDL_GENERIC_4_BYTE, @@ -3729,7 +3687,7 @@ static const uint8_t qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02[] = { 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, tdscdmaCellId), - QMI_IDL_TYPE88(0, 44), + QMI_IDL_TYPE88(0, 43), 0x02, QMI_IDL_GENERIC_4_BYTE, @@ -3869,16 +3827,36 @@ static const uint8_t qmiLocStartBatchingReqMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, horizontalAccuracyLevel), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, fixSessionTimeout) - QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, fixSessionTimeout_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, fixSessionTimeout) - QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, fixSessionTimeout_valid)), 0x12, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, fixSessionTimeout) + QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, fixSessionTimeout), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, minDistance) - QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, minDistance_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, minDistance), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, batchAllPos) - QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, batchAllPos_valid)), + 0x14, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, batchAllPos), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, requestId) - QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, requestId_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, requestId) }; static const uint8_t qmiLocStartBatchingIndMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartBatchingIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartBatchingIndMsgT_v02, requestId) - QMI_IDL_OFFSET8(qmiLocStartBatchingIndMsgT_v02, requestId_valid)), + 0x10, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStartBatchingIndMsgT_v02, status) + QMI_IDL_OFFSET8(qmiLocStartBatchingIndMsgT_v02, requestId) }; static const uint8_t qmiLocEventBatchFullIndMsgT_data_v02[] = { @@ -3891,7 +3869,7 @@ static const uint8_t qmiLocEventLiveBatchedPositionReportIndMsgT_data_v02[] = { QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventLiveBatchedPositionReportIndMsgT_v02, liveBatchedReport), - QMI_IDL_TYPE88(0, 45) + QMI_IDL_TYPE88(0, 44) }; static const uint8_t qmiLocReadFromBatchReqMsgT_data_v02[] = { @@ -3924,13 +3902,18 @@ static const uint8_t qmiLocReadFromBatchIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, batchedReportList), QMI_LOC_READ_FROM_BATCH_MAX_SIZE_V02, QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, batchedReportList) - QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, batchedReportList_len), - QMI_IDL_TYPE88(0, 45) + QMI_IDL_TYPE88(0, 44) }; static const uint8_t qmiLocStopBatchingReqMsgT_data_v02[] = { - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + 0x01, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStopBatchingReqMsgT_v02, transactionId) + QMI_IDL_OFFSET8(qmiLocStopBatchingReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStopBatchingReqMsgT_v02, requestId) - QMI_IDL_OFFSET8(qmiLocStopBatchingReqMsgT_v02, requestId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStopBatchingReqMsgT_v02, requestId) }; static const uint8_t qmiLocStopBatchingIndMsgT_data_v02[] = { @@ -3938,9 +3921,14 @@ static const uint8_t qmiLocStopBatchingIndMsgT_data_v02[] = { QMI_IDL_GENERIC_4_BYTE, QMI_IDL_OFFSET8(qmiLocStopBatchingIndMsgT_v02, status), - QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStopBatchingIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStopBatchingIndMsgT_v02, requestId) - QMI_IDL_OFFSET8(qmiLocStopBatchingIndMsgT_v02, requestId_valid)), + 0x10, QMI_IDL_GENERIC_4_BYTE, - QMI_IDL_OFFSET8(qmiLocStopBatchingIndMsgT_v02, transactionId) + QMI_IDL_OFFSET8(qmiLocStopBatchingIndMsgT_v02, requestId) }; static const uint8_t qmiLocReleaseBatchReqMsgT_data_v02[] = { @@ -3971,7 +3959,7 @@ static const uint8_t qmiLocInjectWifiApDataReqMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocInjectWifiApDataReqMsgT_v02, wifiApInfo), QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, QMI_IDL_OFFSET8(qmiLocInjectWifiApDataReqMsgT_v02, wifiApInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiApDataReqMsgT_v02, wifiApInfo_len), - QMI_IDL_TYPE88(0, 46) + QMI_IDL_TYPE88(0, 45) }; static const uint8_t qmiLocInjectWifiApDataIndMsgT_data_v02[] = { @@ -4038,19 +4026,19 @@ static const uint8_t qmiLocInjectVehicleSensorDataReqMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocInjectVehicleSensorDataReqMsgT_v02, accelData), - QMI_IDL_TYPE88(0, 48), + QMI_IDL_TYPE88(0, 47), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectVehicleSensorDataReqMsgT_v02, angRotationData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectVehicleSensorDataReqMsgT_v02, angRotationData_valid)), 0x11, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectVehicleSensorDataReqMsgT_v02, angRotationData), - QMI_IDL_TYPE88(0, 48), + QMI_IDL_TYPE88(0, 47), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectVehicleSensorDataReqMsgT_v02, odometryData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectVehicleSensorDataReqMsgT_v02, odometryData_valid)), 0x12, QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocInjectVehicleSensorDataReqMsgT_v02, odometryData), - QMI_IDL_TYPE88(0, 50), + QMI_IDL_TYPE88(0, 49), QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectVehicleSensorDataReqMsgT_v02, changeInTimeScales) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectVehicleSensorDataReqMsgT_v02, changeInTimeScales_valid)), 0x13, @@ -4235,67 +4223,67 @@ static const uint8_t qmiLocEventGnssSvMeasInfoIndMsgT_data_v02[] = { 0x10, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, rcvrClockFrequencyInfo), - QMI_IDL_TYPE88(0, 51), + QMI_IDL_TYPE88(0, 50), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, leapSecondInfo) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, leapSecondInfo_valid)), 0x11, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, leapSecondInfo), - QMI_IDL_TYPE88(0, 52), + QMI_IDL_TYPE88(0, 51), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gpsGloInterSystemBias) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gpsGloInterSystemBias_valid)), 0x12, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gpsGloInterSystemBias), - QMI_IDL_TYPE88(0, 53), + QMI_IDL_TYPE88(0, 52), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gpsBdsInterSystemBias) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gpsBdsInterSystemBias_valid)), 0x13, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gpsBdsInterSystemBias), - QMI_IDL_TYPE88(0, 53), + QMI_IDL_TYPE88(0, 52), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gpsGalInterSystemBias) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gpsGalInterSystemBias_valid)), 0x14, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gpsGalInterSystemBias), - QMI_IDL_TYPE88(0, 53), + QMI_IDL_TYPE88(0, 52), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, bdsGloInterSystemBias) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, bdsGloInterSystemBias_valid)), 0x15, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, bdsGloInterSystemBias), - QMI_IDL_TYPE88(0, 53), + QMI_IDL_TYPE88(0, 52), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, galGloInterSystemBias) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, galGloInterSystemBias_valid)), 0x16, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, galGloInterSystemBias), - QMI_IDL_TYPE88(0, 53), + QMI_IDL_TYPE88(0, 52), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, galBdsInterSystemBias) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, galBdsInterSystemBias_valid)), 0x17, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, galBdsInterSystemBias), - QMI_IDL_TYPE88(0, 53), + QMI_IDL_TYPE88(0, 52), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, systemTime) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, systemTime_valid)), 0x18, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, systemTime), - QMI_IDL_TYPE88(0, 54), + QMI_IDL_TYPE88(0, 53), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gloTime) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gloTime_valid)), 0x19, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, gloTime), - QMI_IDL_TYPE88(0, 55), + QMI_IDL_TYPE88(0, 54), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, systemTimeExt) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, systemTimeExt_valid)), 0x1A, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, systemTimeExt), - QMI_IDL_TYPE88(0, 56), + QMI_IDL_TYPE88(0, 55), QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, svMeasurement) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, svMeasurement_valid)), 0x1B, @@ -4303,7 +4291,7 @@ static const uint8_t qmiLocEventGnssSvMeasInfoIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, svMeasurement), QMI_LOC_SV_MEAS_LIST_MAX_SIZE_V02, QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, svMeasurement) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, svMeasurement_len), - QMI_IDL_TYPE88(0, 58) + QMI_IDL_TYPE88(0, 57) }; static const uint8_t qmiLocEventGnssSvPolyIndMsgT_data_v02[] = { @@ -4432,14 +4420,14 @@ static const uint8_t qmiLocAddGeofenceContextReqMsgT_data_v02[] = { QMI_IDL_OFFSET16ARRAY(qmiLocAddGeofenceContextReqMsgT_v02, wifiApMacAddressList), QMI_LOC_WIFI_AREA_ID_LIST_LENGTH_V02, QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wifiApMacAddressList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wifiApMacAddressList_len), - QMI_IDL_TYPE88(0, 59), + QMI_IDL_TYPE88(0, 58), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, tdsCdmaCellIDList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, tdsCdmaCellIDList_valid)), 0x13, QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, QMI_IDL_OFFSET16ARRAY(qmiLocAddGeofenceContextReqMsgT_v02, tdsCdmaCellIDList), QMI_LOC_CELL_ID_LIST_LENGTH_V02, - QMI_IDL_TYPE88(0, 44), + QMI_IDL_TYPE88(0, 43), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wcdmaCellIDList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wcdmaCellIDList_valid)), 0x14, @@ -4447,7 +4435,7 @@ static const uint8_t qmiLocAddGeofenceContextReqMsgT_data_v02[] = { QMI_IDL_OFFSET16ARRAY(qmiLocAddGeofenceContextReqMsgT_v02, wcdmaCellIDList), QMI_LOC_CELL_ID_LIST_LENGTH_V02, QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wcdmaCellIDList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wcdmaCellIDList_len), - QMI_IDL_TYPE88(0, 43), + QMI_IDL_TYPE88(0, 42), QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, gsmCellIDList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, gsmCellIDList_valid)), 0x15, @@ -4455,7 +4443,7 @@ static const uint8_t qmiLocAddGeofenceContextReqMsgT_data_v02[] = { QMI_IDL_OFFSET16ARRAY(qmiLocAddGeofenceContextReqMsgT_v02, gsmCellIDList), QMI_LOC_CELL_ID_LIST_LENGTH_V02, QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, gsmCellIDList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, gsmCellIDList_len), - QMI_IDL_TYPE88(0, 42), + QMI_IDL_TYPE88(0, 41), QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, iBeaconList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, iBeaconList_valid)), 0x16, @@ -4463,7 +4451,7 @@ static const uint8_t qmiLocAddGeofenceContextReqMsgT_data_v02[] = { QMI_IDL_OFFSET16ARRAY(qmiLocAddGeofenceContextReqMsgT_v02, iBeaconList), QMI_LOC_IBEACON_LIST_LENGTH_V02, QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, iBeaconList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, iBeaconList_len), - QMI_IDL_TYPE88(0, 60) + QMI_IDL_TYPE88(0, 59) }; static const uint8_t qmiLocAddGeofenceContextIndMsgT_data_v02[] = { @@ -4668,7 +4656,7 @@ static const uint8_t qmiLocEventDbtPositionReportIndMsgT_data_v02[] = { 0x02, QMI_IDL_AGGREGATE, QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, dbtPosition), - QMI_IDL_TYPE88(0, 61), + QMI_IDL_TYPE88(0, 60), 0x03, QMI_IDL_GENERIC_4_BYTE, @@ -4700,12 +4688,17 @@ static const uint8_t qmiLocEventDbtPositionReportIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, DOP), QMI_IDL_TYPE88(0, 2), - QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, gnssSvUsedList_valid)), + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, gnssSvUsedList_valid)), 0x15, QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_2_BYTE, QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, gnssSvUsedList), QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, - QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, gnssSvUsedList_len) + QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET8(qmiLocEventDbtPositionReportIndMsgT_v02, gnssSvUsedList_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventDbtPositionReportIndMsgT_v02, positionSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventDbtPositionReportIndMsgT_v02, positionSrc_valid)), + 0x16, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventDbtPositionReportIndMsgT_v02, positionSrc) }; static const uint8_t qmiLocEventDbtSessionStatusIndMsgT_data_v02[] = { @@ -4719,6 +4712,205 @@ static const uint8_t qmiLocEventDbtSessionStatusIndMsgT_data_v02[] = { QMI_IDL_OFFSET8(qmiLocEventDbtSessionStatusIndMsgT_v02, reqId) }; +static const uint8_t qmiLocSecureGetAvailablePositionReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionReqMsgT_v02, secureLocDataMode), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionReqMsgT_v02, qmilocSecureGetAvailablePositionRequestData), + ((QMI_LOC_SECURE_GET_AVAILABLE_POS_REQUEST_ENCRYPTED_MAX_V02) & 0xFF), ((QMI_LOC_SECURE_GET_AVAILABLE_POS_REQUEST_ENCRYPTED_MAX_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionReqMsgT_v02, qmilocSecureGetAvailablePositionRequestData) - QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionReqMsgT_v02, qmilocSecureGetAvailablePositionRequestData_len) +}; + +static const uint8_t qmiLocSecureGetAvailablePositionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionIndMsgT_v02, sessionStatus), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionIndMsgT_v02, secureLocDataMode), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionIndMsgT_v02, qmilocSecureGetAvailablePositionInd) - QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionIndMsgT_v02, qmilocSecureGetAvailablePositionInd_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionIndMsgT_v02, qmilocSecureGetAvailablePositionInd), + ((QMI_LOC_SECURE_GET_AVAILABLE_POSITION_IND_ENCRYPTED_MAX_V02) & 0xFF), ((QMI_LOC_SECURE_GET_AVAILABLE_POSITION_IND_ENCRYPTED_MAX_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionIndMsgT_v02, qmilocSecureGetAvailablePositionInd) - QMI_IDL_OFFSET8(qmiLocSecureGetAvailablePositionIndMsgT_v02, qmilocSecureGetAvailablePositionInd_len) +}; + +static const uint8_t qmiLocEventGeofenceBatchedDwellIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, dwellType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList), + QMI_LOC_MAX_GEOFENCE_ID_CONTINUOUS_LIST_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdContinuousList_len), + QMI_IDL_TYPE88(0, 24), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList), + QMI_LOC_MAX_GEOFENCE_ID_DISCRETE_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofenceIdDiscreteList_len), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofencePosition_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, geofencePosition), + QMI_IDL_TYPE88(0, 23), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, headingUnc_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertUnc_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, speedUnc_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, speedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, horConfidence_valid)), + 0x16, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertConfidence_valid)), + 0x17, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, DOP) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, DOP_valid)), + 0x18, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, DOP), + QMI_IDL_TYPE88(0, 2), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList_valid)), + 0x19, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedDwellIndMsgT_v02, gnssSvUsedList_len) +}; + +static const uint8_t qmiLocEventGetTimeZoneReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGetTimeZoneReqIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectTimeZoneInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeZoneInfoReqMsgT_v02, timeUtc), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectTimeZoneInfoReqMsgT_v02, timeZone), + QMI_IDL_TYPE88(0, 62) +}; + +static const uint8_t qmiLocInjectTimeZoneInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeZoneInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectApCacheDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectApCacheDataReqMsgT_v02, versionNumber), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectApCacheDataReqMsgT_v02, partNumber), + + 0x03, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectApCacheDataReqMsgT_v02, totalParts), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectApCacheDataReqMsgT_v02, apCacheData), + QMI_LOC_APCACHE_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLocInjectApCacheDataReqMsgT_v02, apCacheData) - QMI_IDL_OFFSET8(qmiLocInjectApCacheDataReqMsgT_v02, apCacheData_len), + QMI_IDL_TYPE88(0, 63) +}; + +static const uint8_t qmiLocInjectApCacheDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectApCacheDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectApDoNotCacheDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectApDoNotCacheDataReqMsgT_v02, versionNumber), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectApDoNotCacheDataReqMsgT_v02, partNumber), + + 0x03, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectApDoNotCacheDataReqMsgT_v02, totalParts), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectApDoNotCacheDataReqMsgT_v02, apDoNotCacheData), + QMI_LOC_APCACHE_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLocInjectApDoNotCacheDataReqMsgT_v02, apDoNotCacheData) - QMI_IDL_OFFSET8(qmiLocInjectApDoNotCacheDataReqMsgT_v02, apDoNotCacheData_len), + QMI_IDL_TYPE88(0, 64) +}; + +static const uint8_t qmiLocInjectApDoNotCacheDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectApDoNotCacheDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocEventBatchingStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventBatchingStatusIndMsgT_v02, batchingStatus) +}; + +static const uint8_t qmiLocQueryAonConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryAonConfigReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryAonConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryAonConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryAonConfigIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryAonConfigIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryAonConfigIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryAonConfigIndMsgT_v02, aonCapability) - QMI_IDL_OFFSET8(qmiLocQueryAonConfigIndMsgT_v02, aonCapability_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryAonConfigIndMsgT_v02, aonCapability) +}; + /* Type Table */ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, @@ -4761,7 +4953,6 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, {sizeof(qmiLocGeofenceMotionStateConfigStructT_v02), qmiLocGeofenceMotionStateConfigStructT_data_v02}, - {sizeof(qmiLocTimeZoneStructT_v02), qmiLocTimeZoneStructT_data_v02}, {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02}, {sizeof(qmiLocWCDMACellIdStructT_v02), qmiLocWCDMACellIdStructT_data_v02}, @@ -4782,7 +4973,11 @@ static const qmi_idl_type_table_entry loc_type_table_v02[] = { {sizeof(qmiLocSVMeasurementStructT_v02), qmiLocSVMeasurementStructT_data_v02}, {sizeof(qmiLocWifiApMacAddressStructT_v02), qmiLocWifiApMacAddressStructT_data_v02}, {sizeof(qmiLocIBeaconIdStructT_v02), qmiLocIBeaconIdStructT_data_v02}, - {sizeof(qmiLocDbtPositionStructT_v02), qmiLocDbtPositionStructT_data_v02} + {sizeof(qmiLocDbtPositionStructT_v02), qmiLocDbtPositionStructT_data_v02}, + {sizeof(qmiLocDeleteGALSvInfoStructT_v02), qmiLocDeleteGALSvInfoStructT_data_v02}, + {sizeof(qmiLocTimeZoneStructT_v02), qmiLocTimeZoneStructT_data_v02}, + {sizeof(qmiLocApCacheStructT_v02), qmiLocApCacheStructT_data_v02}, + {sizeof(qmiLocApDoNotCacheStructT_v02), qmiLocApDoNotCacheStructT_data_v02} }; /* Message Table */ @@ -4813,7 +5008,6 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, {sizeof(qmiLocEventGeofenceBatchedBreachIndMsgT_v02), qmiLocEventGeofenceBatchedBreachIndMsgT_data_v02}, {sizeof(qmiLocEventGeofenceProximityIndMsgT_v02), qmiLocEventGeofenceProximityIndMsgT_data_v02}, - {sizeof(qmiLocEventGeofenceBatchedDwellIndMsgT_v02), qmiLocEventGeofenceBatchedDwellIndMsgT_data_v02}, {sizeof(qmiLocEventGdtUploadBeginStatusReqIndMsgT_v02), qmiLocEventGdtUploadBeginStatusReqIndMsgT_data_v02}, {sizeof(qmiLocEventGdtUploadEndReqIndMsgT_v02), qmiLocEventGdtUploadEndReqIndMsgT_data_v02}, {sizeof(qmiLocGetServiceRevisionReqMsgT_v02), 0}, @@ -4920,9 +5114,6 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocGetGeofenceEngineConfigIndMsgT_v02), qmiLocGetGeofenceEngineConfigIndMsgT_data_v02}, {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, - {sizeof(qmiLocEventGetTimeZoneReqIndMsgT_v02), qmiLocEventGetTimeZoneReqIndMsgT_data_v02}, - {sizeof(qmiLocInjectTimeZoneInfoReqMsgT_v02), qmiLocInjectTimeZoneInfoReqMsgT_data_v02}, - {sizeof(qmiLocInjectTimeZoneInfoIndMsgT_v02), qmiLocInjectTimeZoneInfoIndMsgT_data_v02}, {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, @@ -4992,7 +5183,20 @@ static const qmi_idl_message_table_entry loc_message_table_v02[] = { {sizeof(qmiLocStopDbtReqMsgT_v02), qmiLocStopDbtReqMsgT_data_v02}, {sizeof(qmiLocStopDbtIndMsgT_v02), qmiLocStopDbtIndMsgT_data_v02}, {sizeof(qmiLocEventDbtPositionReportIndMsgT_v02), qmiLocEventDbtPositionReportIndMsgT_data_v02}, - {sizeof(qmiLocEventDbtSessionStatusIndMsgT_v02), qmiLocEventDbtSessionStatusIndMsgT_data_v02} + {sizeof(qmiLocEventDbtSessionStatusIndMsgT_v02), qmiLocEventDbtSessionStatusIndMsgT_data_v02}, + {sizeof(qmiLocSecureGetAvailablePositionReqMsgT_v02), qmiLocSecureGetAvailablePositionReqMsgT_data_v02}, + {sizeof(qmiLocSecureGetAvailablePositionIndMsgT_v02), qmiLocSecureGetAvailablePositionIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceBatchedDwellIndMsgT_v02), qmiLocEventGeofenceBatchedDwellIndMsgT_data_v02}, + {sizeof(qmiLocEventGetTimeZoneReqIndMsgT_v02), qmiLocEventGetTimeZoneReqIndMsgT_data_v02}, + {sizeof(qmiLocInjectTimeZoneInfoReqMsgT_v02), qmiLocInjectTimeZoneInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectTimeZoneInfoIndMsgT_v02), qmiLocInjectTimeZoneInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectApCacheDataReqMsgT_v02), qmiLocInjectApCacheDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectApCacheDataIndMsgT_v02), qmiLocInjectApCacheDataIndMsgT_data_v02}, + {sizeof(qmiLocInjectApDoNotCacheDataReqMsgT_v02), qmiLocInjectApDoNotCacheDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectApDoNotCacheDataIndMsgT_v02), qmiLocInjectApDoNotCacheDataIndMsgT_data_v02}, + {sizeof(qmiLocEventBatchingStatusIndMsgT_v02), qmiLocEventBatchingStatusIndMsgT_data_v02}, + {sizeof(qmiLocQueryAonConfigReqMsgT_v02), qmiLocQueryAonConfigReqMsgT_data_v02}, + {sizeof(qmiLocQueryAonConfigIndMsgT_v02), qmiLocQueryAonConfigIndMsgT_data_v02} }; /* Range Table */ @@ -5024,90 +5228,94 @@ static const qmi_idl_service_message_table_entry loc_service_command_messages_v0 {QMI_LOC_REG_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 2), 11}, {QMI_LOC_START_REQ_V02, QMI_IDL_TYPE16(0, 3), 117}, {QMI_LOC_STOP_REQ_V02, QMI_IDL_TYPE16(0, 4), 4}, - {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 29), 0}, - {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, QMI_IDL_TYPE16(0, 31), 0}, - {QMI_LOC_NI_USER_RESPONSE_REQ_V02, QMI_IDL_TYPE16(0, 33), 1345}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, QMI_IDL_TYPE16(0, 35), 1053}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, QMI_IDL_TYPE16(0, 37), 0}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, QMI_IDL_TYPE16(0, 39), 0}, - {QMI_LOC_INJECT_UTC_TIME_REQ_V02, QMI_IDL_TYPE16(0, 41), 18}, - {QMI_LOC_INJECT_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 43), 123}, - {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 45), 7}, - {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 47), 0}, - {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 49), 4}, - {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 51), 0}, - {QMI_LOC_SET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 53), 7}, - {QMI_LOC_GET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 55), 0}, - {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 57), 4}, - {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 59), 0}, - {QMI_LOC_SET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 61), 297}, - {QMI_LOC_GET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 63), 11}, - {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, QMI_IDL_TYPE16(0, 65), 1044}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 67), 4}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 69), 0}, - {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 71), 2353}, - {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 73), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 75), 0}, - {QMI_LOC_SET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 77), 7}, - {QMI_LOC_GET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 79), 0}, - {QMI_LOC_SET_SPI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 81), 8}, - {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 83), 2779}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, QMI_IDL_TYPE16(0, 85), 21}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 89), 11}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 87), 0}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 93), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 91), 0}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 95), 129}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 97), 57}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 99), 11}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 101), 14}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 103), 0}, - {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 105), 88}, - {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 107), 7}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 109), 42}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 111), 0}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 113), 2009}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 115), 4}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 117), 16}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 119), 7}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 121), 66}, - {QMI_LOC_DELETE_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 123), 14}, - {QMI_LOC_QUERY_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 125), 14}, - {QMI_LOC_EDIT_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 131), 32}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 136), 7}, - {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, QMI_IDL_TYPE16(0, 138), 19}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, QMI_IDL_TYPE16(0, 140), 7}, - {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 142), 30}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, QMI_IDL_TYPE16(0, 150), 1036}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, QMI_IDL_TYPE16(0, 152), 0}, - {QMI_LOC_PEDOMETER_REPORT_REQ_V02, QMI_IDL_TYPE16(0, 154), 46}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 144), 36}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 146), 33}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02, QMI_IDL_TYPE16(0, 148), 22}, - {QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 127), 224}, - {QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 129), 7}, - {QMI_LOC_GET_BATCH_SIZE_REQ_V02, QMI_IDL_TYPE16(0, 156), 14}, - {QMI_LOC_START_BATCHING_REQ_V02, QMI_IDL_TYPE16(0, 158), 21}, - {QMI_LOC_READ_FROM_BATCH_REQ_V02, QMI_IDL_TYPE16(0, 162), 14}, - {QMI_LOC_STOP_BATCHING_REQ_V02, QMI_IDL_TYPE16(0, 164), 7}, - {QMI_LOC_RELEASE_BATCH_REQ_V02, QMI_IDL_TYPE16(0, 166), 7}, - {QMI_LOC_INJECT_WIFI_AP_DATA_REQ_V02, QMI_IDL_TYPE16(0, 169), 2454}, - {QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 171), 51}, - {QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 173), 7}, - {QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 176), 3360}, - {QMI_LOC_GET_AVAILABLE_WWAN_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 178), 7}, - {QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 180), 14}, - {QMI_LOC_SET_XTRA_VERSION_CHECK_REQ_V02, QMI_IDL_TYPE16(0, 182), 7}, - {QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_V02, QMI_IDL_TYPE16(0, 184), 22}, - {QMI_LOC_ADD_GEOFENCE_CONTEXT_REQ_V02, QMI_IDL_TYPE16(0, 188), 2517}, - {QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_REQ_V02, QMI_IDL_TYPE16(0, 190), 25}, - {QMI_LOC_DELETE_GEOFENCE_CONTEXT_REQ_V02, QMI_IDL_TYPE16(0, 192), 21}, - {QMI_LOC_INJECT_GTP_CLIENT_DOWNLOADED_DATA_REQ_V02, QMI_IDL_TYPE16(0, 194), 517}, - {QMI_LOC_GDT_UPLOAD_BEGIN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 196), 21}, - {QMI_LOC_GDT_UPLOAD_END_REQ_V02, QMI_IDL_TYPE16(0, 198), 21}, - {QMI_LOC_START_DBT_REQ_V02, QMI_IDL_TYPE16(0, 200), 36}, - {QMI_LOC_STOP_DBT_REQ_V02, QMI_IDL_TYPE16(0, 202), 4}, - {QMI_LOC_INJECT_TIME_ZONE_INFO_REQ_V02, QMI_IDL_TYPE16(0, 134), 30} + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 28), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, QMI_IDL_TYPE16(0, 30), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, QMI_IDL_TYPE16(0, 32), 1345}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, QMI_IDL_TYPE16(0, 34), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, QMI_IDL_TYPE16(0, 36), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, QMI_IDL_TYPE16(0, 38), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, QMI_IDL_TYPE16(0, 40), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 42), 123}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 44), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 46), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 48), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 50), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 52), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 54), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 56), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 58), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 60), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 62), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, QMI_IDL_TYPE16(0, 64), 1156}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 66), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 68), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 70), 2353}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 72), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 74), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 76), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 78), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 80), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 82), 2779}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, QMI_IDL_TYPE16(0, 84), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 88), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 86), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 92), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 90), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 94), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 96), 57}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 98), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 100), 14}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 102), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 104), 88}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 106), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 108), 42}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 110), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 112), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 114), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 116), 16}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 118), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 120), 70}, + {QMI_LOC_DELETE_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 122), 14}, + {QMI_LOC_QUERY_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 124), 14}, + {QMI_LOC_EDIT_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 130), 32}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 132), 7}, + {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, QMI_IDL_TYPE16(0, 134), 19}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, QMI_IDL_TYPE16(0, 136), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 138), 30}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, QMI_IDL_TYPE16(0, 146), 1036}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, QMI_IDL_TYPE16(0, 148), 0}, + {QMI_LOC_PEDOMETER_REPORT_REQ_V02, QMI_IDL_TYPE16(0, 150), 46}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 140), 36}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 142), 33}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02, QMI_IDL_TYPE16(0, 144), 22}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 126), 224}, + {QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 128), 7}, + {QMI_LOC_GET_BATCH_SIZE_REQ_V02, QMI_IDL_TYPE16(0, 152), 14}, + {QMI_LOC_START_BATCHING_REQ_V02, QMI_IDL_TYPE16(0, 154), 39}, + {QMI_LOC_READ_FROM_BATCH_REQ_V02, QMI_IDL_TYPE16(0, 158), 14}, + {QMI_LOC_STOP_BATCHING_REQ_V02, QMI_IDL_TYPE16(0, 160), 14}, + {QMI_LOC_RELEASE_BATCH_REQ_V02, QMI_IDL_TYPE16(0, 162), 7}, + {QMI_LOC_INJECT_WIFI_AP_DATA_REQ_V02, QMI_IDL_TYPE16(0, 165), 2454}, + {QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 167), 51}, + {QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 169), 7}, + {QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 172), 3360}, + {QMI_LOC_GET_AVAILABLE_WWAN_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 174), 7}, + {QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 176), 14}, + {QMI_LOC_SET_XTRA_VERSION_CHECK_REQ_V02, QMI_IDL_TYPE16(0, 178), 7}, + {QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_V02, QMI_IDL_TYPE16(0, 180), 22}, + {QMI_LOC_ADD_GEOFENCE_CONTEXT_REQ_V02, QMI_IDL_TYPE16(0, 184), 2517}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_REQ_V02, QMI_IDL_TYPE16(0, 186), 25}, + {QMI_LOC_DELETE_GEOFENCE_CONTEXT_REQ_V02, QMI_IDL_TYPE16(0, 188), 21}, + {QMI_LOC_INJECT_GTP_CLIENT_DOWNLOADED_DATA_REQ_V02, QMI_IDL_TYPE16(0, 190), 517}, + {QMI_LOC_GDT_UPLOAD_BEGIN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 192), 21}, + {QMI_LOC_GDT_UPLOAD_END_REQ_V02, QMI_IDL_TYPE16(0, 194), 21}, + {QMI_LOC_START_DBT_REQ_V02, QMI_IDL_TYPE16(0, 196), 36}, + {QMI_LOC_STOP_DBT_REQ_V02, QMI_IDL_TYPE16(0, 198), 4}, + {QMI_LOC_SECURE_GET_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 202), 268}, + {QMI_LOC_INJECT_TIME_ZONE_INFO_REQ_V02, QMI_IDL_TYPE16(0, 206), 30}, + {QMI_LOC_INJECT_APCACHE_DATA_REQ_V02, QMI_IDL_TYPE16(0, 208), 1616}, + {QMI_LOC_INJECT_APDONOTCACHE_DATA_REQ_V02, QMI_IDL_TYPE16(0, 210), 656}, + {QMI_LOC_QUERY_AON_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 213), 7} }; static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { @@ -5200,7 +5408,11 @@ static const qmi_idl_service_message_table_entry loc_service_response_messages_v {QMI_LOC_GDT_UPLOAD_END_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, {QMI_LOC_START_DBT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, {QMI_LOC_STOP_DBT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, - {QMI_LOC_INJECT_TIME_ZONE_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7} + {QMI_LOC_SECURE_GET_AVAILABLE_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TIME_ZONE_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_APCACHE_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_APDONOTCACHE_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_QUERY_AON_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7} }; static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { @@ -5218,109 +5430,114 @@ static const qmi_idl_service_message_table_entry loc_service_indication_messages {QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, QMI_IDL_TYPE16(0, 16), 7}, {QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, QMI_IDL_TYPE16(0, 17), 4}, {QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, QMI_IDL_TYPE16(0, 18), 21}, - {QMI_LOC_GET_SERVICE_REVISION_IND_V02, QMI_IDL_TYPE16(0, 30), 532}, - {QMI_LOC_GET_FIX_CRITERIA_IND_V02, QMI_IDL_TYPE16(0, 32), 99}, - {QMI_LOC_NI_USER_RESPONSE_IND_V02, QMI_IDL_TYPE16(0, 34), 7}, - {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, QMI_IDL_TYPE16(0, 36), 12}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, QMI_IDL_TYPE16(0, 38), 790}, - {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, QMI_IDL_TYPE16(0, 40), 20}, - {QMI_LOC_INJECT_UTC_TIME_IND_V02, QMI_IDL_TYPE16(0, 42), 7}, - {QMI_LOC_INJECT_POSITION_IND_V02, QMI_IDL_TYPE16(0, 44), 7}, - {QMI_LOC_SET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 46), 7}, - {QMI_LOC_GET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 48), 14}, - {QMI_LOC_SET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 50), 7}, - {QMI_LOC_GET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 52), 11}, - {QMI_LOC_SET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 54), 7}, - {QMI_LOC_GET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 56), 14}, - {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 58), 7}, - {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 60), 11}, - {QMI_LOC_SET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 62), 7}, - {QMI_LOC_GET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 64), 304}, - {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, QMI_IDL_TYPE16(0, 66), 7}, - {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 68), 7}, - {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 70), 11}, - {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, QMI_IDL_TYPE16(0, 72), 7}, - {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 74), 7}, - {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, QMI_IDL_TYPE16(0, 76), 18}, - {QMI_LOC_SET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 78), 7}, - {QMI_LOC_GET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 80), 14}, - {QMI_LOC_SET_SPI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 82), 7}, - {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 84), 34}, - {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, QMI_IDL_TYPE16(0, 86), 7}, - {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 90), 7}, - {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 88), 18}, - {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 94), 7}, - {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 92), 14}, - {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 96), 7}, - {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 98), 18}, - {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 100), 64}, - {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 102), 7}, - {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 104), 21}, - {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 106), 14}, - {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 108), 95}, - {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 110), 14}, - {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 112), 49}, - {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 114), 7}, - {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 116), 7}, - {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 118), 14}, - {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 120), 23}, + {QMI_LOC_GET_SERVICE_REVISION_IND_V02, QMI_IDL_TYPE16(0, 29), 532}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, QMI_IDL_TYPE16(0, 31), 99}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, QMI_IDL_TYPE16(0, 33), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, QMI_IDL_TYPE16(0, 35), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, QMI_IDL_TYPE16(0, 37), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, QMI_IDL_TYPE16(0, 39), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, QMI_IDL_TYPE16(0, 41), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, QMI_IDL_TYPE16(0, 43), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 45), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 47), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 49), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 51), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 53), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 55), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 57), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 59), 11}, + {QMI_LOC_SET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 61), 7}, + {QMI_LOC_GET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 63), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, QMI_IDL_TYPE16(0, 65), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 67), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 69), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, QMI_IDL_TYPE16(0, 71), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 73), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, QMI_IDL_TYPE16(0, 75), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 77), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 79), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 81), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 83), 34}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, QMI_IDL_TYPE16(0, 85), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 89), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 87), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 93), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 91), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 95), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 97), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 99), 64}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 101), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 103), 21}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 105), 14}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 107), 95}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 109), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 111), 49}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 113), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 115), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 117), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 119), 23}, {QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 19), 14}, {QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, QMI_IDL_TYPE16(0, 20), 7}, {QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 21), 85}, - {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 122), 21}, - {QMI_LOC_DELETE_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 124), 21}, - {QMI_LOC_QUERY_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 126), 65}, - {QMI_LOC_EDIT_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 132), 28}, - {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 137), 391}, - {QMI_LOC_INJECT_MOTION_DATA_IND_V02, QMI_IDL_TYPE16(0, 139), 7}, - {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, QMI_IDL_TYPE16(0, 141), 82}, - {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 143), 7}, - {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, QMI_IDL_TYPE16(0, 151), 7}, - {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 153), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 121), 21}, + {QMI_LOC_DELETE_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 123), 21}, + {QMI_LOC_QUERY_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 125), 65}, + {QMI_LOC_EDIT_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 131), 28}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 133), 391}, + {QMI_LOC_INJECT_MOTION_DATA_IND_V02, QMI_IDL_TYPE16(0, 135), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, QMI_IDL_TYPE16(0, 137), 82}, + {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 139), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, QMI_IDL_TYPE16(0, 147), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 149), 7}, {QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 22), 15}, {QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 23), 4}, - {QMI_LOC_PEDOMETER_REPORT_IND_V02, QMI_IDL_TYPE16(0, 155), 7}, - {QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 145), 7}, - {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 147), 7}, - {QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, QMI_IDL_TYPE16(0, 149), 7}, - {QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 128), 14}, - {QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 130), 39}, - {QMI_LOC_GET_BATCH_SIZE_IND_V02, QMI_IDL_TYPE16(0, 157), 21}, - {QMI_LOC_START_BATCHING_IND_V02, QMI_IDL_TYPE16(0, 159), 7}, - {QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 160), 7}, - {QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 161), 90}, - {QMI_LOC_READ_FROM_BATCH_IND_V02, QMI_IDL_TYPE16(0, 163), 460}, - {QMI_LOC_STOP_BATCHING_IND_V02, QMI_IDL_TYPE16(0, 165), 14}, - {QMI_LOC_RELEASE_BATCH_IND_V02, QMI_IDL_TYPE16(0, 167), 14}, - {QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_IND_V02, QMI_IDL_TYPE16(0, 168), 0}, - {QMI_LOC_INJECT_WIFI_AP_DATA_IND_V02, QMI_IDL_TYPE16(0, 170), 7}, - {QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_IND_V02, QMI_IDL_TYPE16(0, 172), 7}, - {QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_IND_V02, QMI_IDL_TYPE16(0, 174), 7}, + {QMI_LOC_PEDOMETER_REPORT_IND_V02, QMI_IDL_TYPE16(0, 151), 7}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 141), 7}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 143), 7}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, QMI_IDL_TYPE16(0, 145), 7}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 127), 14}, + {QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 129), 39}, + {QMI_LOC_GET_BATCH_SIZE_IND_V02, QMI_IDL_TYPE16(0, 153), 21}, + {QMI_LOC_START_BATCHING_IND_V02, QMI_IDL_TYPE16(0, 155), 14}, + {QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 156), 7}, + {QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 157), 90}, + {QMI_LOC_READ_FROM_BATCH_IND_V02, QMI_IDL_TYPE16(0, 159), 460}, + {QMI_LOC_STOP_BATCHING_IND_V02, QMI_IDL_TYPE16(0, 161), 21}, + {QMI_LOC_RELEASE_BATCH_IND_V02, QMI_IDL_TYPE16(0, 163), 14}, + {QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_IND_V02, QMI_IDL_TYPE16(0, 164), 0}, + {QMI_LOC_INJECT_WIFI_AP_DATA_IND_V02, QMI_IDL_TYPE16(0, 166), 7}, + {QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_IND_V02, QMI_IDL_TYPE16(0, 168), 7}, + {QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_IND_V02, QMI_IDL_TYPE16(0, 170), 7}, {QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 24), 1254}, - {QMI_LOC_EVENT_VEHICLE_DATA_READY_STATUS_IND_V02, QMI_IDL_TYPE16(0, 175), 12}, - {QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 177), 7}, - {QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02, QMI_IDL_TYPE16(0, 179), 145}, - {QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 181), 7}, - {QMI_LOC_SET_XTRA_VERSION_CHECK_IND_V02, QMI_IDL_TYPE16(0, 183), 7}, - {QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02, QMI_IDL_TYPE16(0, 186), 1610}, - {QMI_LOC_EVENT_SV_POLYNOMIAL_REPORT_IND_V02, QMI_IDL_TYPE16(0, 187), 325}, - {QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 185), 7}, - {QMI_LOC_ADD_GEOFENCE_CONTEXT_IND_V02, QMI_IDL_TYPE16(0, 189), 28}, - {QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_IND_V02, QMI_IDL_TYPE16(0, 191), 14}, - {QMI_LOC_DELETE_GEOFENCE_CONTEXT_IND_V02, QMI_IDL_TYPE16(0, 193), 28}, + {QMI_LOC_EVENT_VEHICLE_DATA_READY_STATUS_IND_V02, QMI_IDL_TYPE16(0, 171), 12}, + {QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 173), 7}, + {QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02, QMI_IDL_TYPE16(0, 175), 145}, + {QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 177), 7}, + {QMI_LOC_SET_XTRA_VERSION_CHECK_IND_V02, QMI_IDL_TYPE16(0, 179), 7}, + {QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02, QMI_IDL_TYPE16(0, 182), 1610}, + {QMI_LOC_EVENT_SV_POLYNOMIAL_REPORT_IND_V02, QMI_IDL_TYPE16(0, 183), 325}, + {QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 181), 7}, + {QMI_LOC_ADD_GEOFENCE_CONTEXT_IND_V02, QMI_IDL_TYPE16(0, 185), 28}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_IND_V02, QMI_IDL_TYPE16(0, 187), 14}, + {QMI_LOC_DELETE_GEOFENCE_CONTEXT_IND_V02, QMI_IDL_TYPE16(0, 189), 28}, {QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 25), 21}, - {QMI_LOC_INJECT_GTP_CLIENT_DOWNLOADED_DATA_IND_V02, QMI_IDL_TYPE16(0, 195), 7}, - {QMI_LOC_GDT_UPLOAD_BEGIN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 197), 7}, - {QMI_LOC_GDT_UPLOAD_END_IND_V02, QMI_IDL_TYPE16(0, 199), 7}, - {QMI_LOC_EVENT_GDT_UPLOAD_BEGIN_STATUS_REQ_IND_V02, QMI_IDL_TYPE16(0, 27), 273}, - {QMI_LOC_EVENT_GDT_UPLOAD_END_REQ_IND_V02, QMI_IDL_TYPE16(0, 28), 21}, - {QMI_LOC_START_DBT_IND_V02, QMI_IDL_TYPE16(0, 201), 11}, - {QMI_LOC_EVENT_DBT_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 204), 276}, - {QMI_LOC_EVENT_DBT_SESSION_STATUS_IND_V02, QMI_IDL_TYPE16(0, 205), 11}, - {QMI_LOC_STOP_DBT_IND_V02, QMI_IDL_TYPE16(0, 203), 11}, - {QMI_LOC_EVENT_GEOFENCE_BATCHED_DWELL_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 26), 1247}, - {QMI_LOC_EVENT_GET_TIME_ZONE_INFO_IND_V02, QMI_IDL_TYPE16(0, 133), 7}, - {QMI_LOC_INJECT_TIME_ZONE_INFO_IND_V02, QMI_IDL_TYPE16(0, 135), 7} + {QMI_LOC_INJECT_GTP_CLIENT_DOWNLOADED_DATA_IND_V02, QMI_IDL_TYPE16(0, 191), 7}, + {QMI_LOC_GDT_UPLOAD_BEGIN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 193), 7}, + {QMI_LOC_GDT_UPLOAD_END_IND_V02, QMI_IDL_TYPE16(0, 195), 7}, + {QMI_LOC_EVENT_GDT_UPLOAD_BEGIN_STATUS_REQ_IND_V02, QMI_IDL_TYPE16(0, 26), 273}, + {QMI_LOC_EVENT_GDT_UPLOAD_END_REQ_IND_V02, QMI_IDL_TYPE16(0, 27), 21}, + {QMI_LOC_START_DBT_IND_V02, QMI_IDL_TYPE16(0, 197), 11}, + {QMI_LOC_EVENT_DBT_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 200), 283}, + {QMI_LOC_EVENT_DBT_SESSION_STATUS_IND_V02, QMI_IDL_TYPE16(0, 201), 11}, + {QMI_LOC_STOP_DBT_IND_V02, QMI_IDL_TYPE16(0, 199), 11}, + {QMI_LOC_SECURE_GET_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 203), 1043}, + {QMI_LOC_EVENT_GEOFENCE_BATCHED_DWELL_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 204), 1247}, + {QMI_LOC_EVENT_GET_TIME_ZONE_INFO_IND_V02, QMI_IDL_TYPE16(0, 205), 7}, + {QMI_LOC_INJECT_TIME_ZONE_INFO_IND_V02, QMI_IDL_TYPE16(0, 207), 7}, + {QMI_LOC_INJECT_APCACHE_DATA_IND_V02, QMI_IDL_TYPE16(0, 209), 7}, + {QMI_LOC_INJECT_APDONOTCACHE_DATA_IND_V02, QMI_IDL_TYPE16(0, 211), 7}, + {QMI_LOC_EVENT_BATCHING_STATUS_IND_V02, QMI_IDL_TYPE16(0, 212), 7}, + {QMI_LOC_QUERY_AON_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 214), 21} }; /*Service Object*/ @@ -5334,7 +5551,7 @@ struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { sizeof(loc_service_indication_messages_v02)/sizeof(qmi_idl_service_message_table_entry) }, { loc_service_command_messages_v02, loc_service_response_messages_v02, loc_service_indication_messages_v02}, &loc_qmi_idl_type_table_object_v02, - 0x28, + 0x2C, NULL }; diff --git a/gps/loc_api/loc_api_v02/location_service_v02.h b/gps/loc_api/loc_api_v02/location_service_v02.h index e6f55f0..d0ce1f4 100644 --- a/gps/loc_api/loc_api_v02/location_service_v02.h +++ b/gps/loc_api/loc_api_v02/location_service_v02.h @@ -62,8 +62,8 @@ *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ -/* This file was generated with Tool version 6.14.4 - It was generated on: Fri Mar 27 2015 (Spin 0) +/* This file was generated with Tool version 6.14.5 + It was generated on: Thu Jul 2 2015 (Spin 0) From IDL File: location_service_v02.idl */ /** @defgroup loc_qmi_consts Constant values defined in the IDL */ @@ -89,11 +89,11 @@ extern "C" { /** Major Version Number of the IDL used to generate this file */ #define LOC_V02_IDL_MAJOR_VERS 0x02 /** Revision Number of the IDL used to generate this file */ -#define LOC_V02_IDL_MINOR_VERS 0x28 +#define LOC_V02_IDL_MINOR_VERS 0x2C /** Major Version Number of the qmi_idl_compiler used to generate this file */ #define LOC_V02_IDL_TOOL_VERS 0x06 /** Maximum Defined Message ID */ -#define LOC_V02_MAX_MESSAGE_ID 0x0098 +#define LOC_V02_MAX_MESSAGE_ID 0x009D /** @} */ @@ -161,7 +161,7 @@ extern "C" { were breached at a given position. */ #define QMI_LOC_MAX_GEOFENCE_ID_DISCRETE_LIST_LENGTH_V02 80 -/** Maximum length that can be injected. */ +/** Maximum length that can be injected. */ #define QMI_LOC_MAX_GDT_PATH_LEN_V02 255 /** Maximum GNSS Measurement Engine Firmware Version String length. */ @@ -184,6 +184,9 @@ extern "C" { /** Maximum length of the Delete BDS SV Information list. */ #define QMI_LOC_DELETE_MAX_BDS_SV_INFO_LENGTH_V02 37 +/** Maximum length of the Delete GAL SV Information list. */ +#define QMI_LOC_DELETE_MAX_GAL_SV_INFO_LENGTH_V02 36 + /** MAC address length in bytes. */ #define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 @@ -258,8 +261,45 @@ extern "C" { /** IBeacon list length. */ #define QMI_LOC_IBEACON_LIST_LENGTH_V02 20 -/** Maximum length that can be injected. */ +/** Maximum length that can be injected. */ #define QMI_LOC_MAX_GTP_WWAN_CLIENT_DOWNLOADED_DATA_LEN_V02 512 + +/** Maximum buffer length of the encrypted data blob for the Secure Get Available Position request. */ +#define QMI_LOC_SECURE_GET_AVAILABLE_POS_REQUEST_ENCRYPTED_MAX_V02 256 + +/** Horizontal Uncertainty Circular + Altitude With Respect to Ellipsoid + Vertical Uncertainty + Horizontal Elliptical Uncertainty (Semi-Minor Axis) + Horizontal Elliptical Uncertainty (Semi-Major Axis) + Elliptical Horizontal Uncertainty Azimuth + Horizontal Confidence + Horizontal Elliptical Uncertainty Confidence + Horizontal Reliability + Horizontal Speed + Horizontal Speed Uncertainty + Altitude With Respect to Sea Level + Vertical Confidence + Vertical Reliability + Vertical Speed + Vertical Speed Uncertainty + Heading + Heading Uncertainty + Magnetic Deviation + Technology Used + Position Dilution of Precision + Horizontal Dilution of Precision + Vertical Dilution of Precision + GPS Week + GPS Time of Week MS + Time Source + Sensor Data Usage MASK + Position Data Aided by Sensor + SVs Used to Calculate the Fix */ +#define QMI_LOC_SECURE_GET_AVAILABLE_POSITION_IND_ENCRYPTED_MAX_V02 1024 + +/** Maximum number of APs that can be injected in a TLV. */ +#define QMI_LOC_APCACHE_DATA_MAX_SAMPLES_V02 80 /** @} */ @@ -381,10 +421,12 @@ typedef uint64_t qmiLocEventRegMaskT_v02; a Geofence is dwelled. These events are generated when a UE enters or leaves the perimeter of a Geofence and dwells inside or outside for a specified time. This dwell notification is for multiple Geofences. Dwells from multiple Geofences are all batched and - sent in the same notification . */ + sent in the same notification. */ #define QMI_LOC_EVENT_MASK_GET_TIME_ZONE_REQ_V02 ((qmiLocEventRegMaskT_v02)0x40000000ull) /**< The control point must enable this mask to receive requests for time zone information from the service. These events are generated when there is a need for time zone information in the - modem . */ + service. */ +#define QMI_LOC_EVENT_MASK_BATCHING_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x80000000ull) /**< The control point must enable this mask to receive asynchronous events related + to batching. */ /** @addtogroup loc_qmi_messages @{ */ @@ -481,10 +523,12 @@ typedef struct { a Geofence is dwelled. These events are generated when a UE enters or leaves the perimeter of a Geofence and dwells inside or outside for a specified time. This dwell notification is for multiple Geofences. Dwells from multiple Geofences are all batched and - sent in the same notification . + sent in the same notification. - QMI_LOC_EVENT_MASK_GET_TIME_ZONE_REQ (0x40000000) -- The control point must enable this mask to receive requests for time zone information from the service. These events are generated when there is a need for time zone information in the - modem . + service. + - QMI_LOC_EVENT_MASK_BATCHING_STATUS (0x80000000) -- The control point must enable this mask to receive asynchronous events related + to batching. Multiple events can be registered by ORing the individual masks and sending them in this TLV. All unused bits in this mask must be set to 0. @@ -833,6 +877,7 @@ typedef enum { GNSS time is maintained irrespective of the GNSS receiver state */ eQMI_LOC_TIME_SRC_QZSS_TOW_DECODE_V02 = 15, /**< Time is set after decoding QZSS satellites */ eQMI_LOC_TIME_SRC_BDS_TOW_DECODE_V02 = 16, /**< Time is set after decoding BDS satellites */ + eQMI_LOC_TIME_SRC_GAL_TOW_DECODE_V02 = 17, /**< Time is set after decoding GAL satellites */ QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocTimeSourceEnumT_v02; /** @@ -1132,7 +1177,8 @@ typedef struct { - eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK (14) -- Time is derived from the system clock (better known as the slow clock); GNSS time is maintained irrespective of the GNSS receiver state - eQMI_LOC_TIME_SRC_QZSS_TOW_DECODE (15) -- Time is set after decoding QZSS satellites - - eQMI_LOC_TIME_SRC_BDS_TOW_DECODE (16) -- Time is set after decoding BDS satellites */ + - eQMI_LOC_TIME_SRC_BDS_TOW_DECODE (16) -- Time is set after decoding BDS satellites + - eQMI_LOC_TIME_SRC_GAL_TOW_DECODE (17) -- Time is set after decoding GAL satellites */ /* Optional */ /* Sensor Data Usage */ @@ -1161,7 +1207,8 @@ typedef struct { - For SBAS: 33 to 64 \n - For GLONASS: 65 to 96 \n - For QZSS: 193 to 197 \n - - For BDS: 201 to 237 + - For BDS: 201 to 237 \n + - For GAL: 301 to 336 */ /* Optional */ @@ -1260,6 +1307,7 @@ typedef struct { \item For GLONASS: 1 to 32 \item For SBAS: 120 to 151 \item For BDS: 201 to 237 + \item For GAL: 301 to 336 \end{itemize1} \end{itemize1} The GPS and GLONASS SVs can be disambiguated using the system field. */ @@ -3199,7 +3247,8 @@ typedef struct { - For SBAS: 33 to 64 \n - For GLONASS: 65 to 96 \n - For QZSS: 193 to 197 \n - - For BDS: 201 to 237 + - For BDS: 201 to 237 \n + - For GAL: 301 to 336 */ }qmiLocEventGeofenceBatchedBreachIndMsgT_v02; /* Message */ /** @@ -3257,7 +3306,7 @@ typedef struct { typedef enum { QMILOCGEOFENCEDWELLTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_GEOFENCE_DWELL_TYPE_INSIDE_V02 = 1, /**< Denotes that a client dwelled inside the Geofence */ - eQMI_LOC_GEOFENCE_DWELL_TYPE_OUTSIDE_V02 = 2, /**< Denotes that a client dwelled outside of Geofence */ + eQMI_LOC_GEOFENCE_DWELL_TYPE_OUTSIDE_V02 = 2, /**< Denotes that a client dwelled outside the Geofence */ QMILOCGEOFENCEDWELLTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocGeofenceDwellTypeEnumT_v02; /** @@ -3274,11 +3323,11 @@ typedef struct { /* Mandatory */ /* Geofence Dwell Type */ qmiLocGeofenceDwellTypeEnumT_v02 dwellType; - /**< Type of breach that generated this event. + /**< Type of dwell event generated. Valid values: \n - eQMI_LOC_GEOFENCE_DWELL_TYPE_INSIDE (1) -- Denotes that a client dwelled inside the Geofence - - eQMI_LOC_GEOFENCE_DWELL_TYPE_OUTSIDE (2) -- Denotes that a client dwelled outside of Geofence + - eQMI_LOC_GEOFENCE_DWELL_TYPE_OUTSIDE (2) -- Denotes that a client dwelled outside the Geofence */ /* Optional */ @@ -3286,7 +3335,7 @@ typedef struct { uint8_t geofenceIdContinuousList_valid; /**< Must be set to true if geofenceIdContinuousList is being passed */ uint32_t geofenceIdContinuousList_len; /**< Must be set to # of elements in geofenceIdContinuousList */ qmiLocGeofenceIdContinuousStructT_v02 geofenceIdContinuousList[QMI_LOC_MAX_GEOFENCE_ID_CONTINUOUS_LIST_LENGTH_V02]; - /**< Each entry in the list contains the continuous range of Geofence IDs that were dwelled. + /**< Each entry in the list contains the continuous range of Geofence IDs in which a client dwelled. This list does not overlap with the discrete Geofence ID list. */ /* Optional */ @@ -3294,14 +3343,14 @@ typedef struct { uint8_t geofenceIdDiscreteList_valid; /**< Must be set to true if geofenceIdDiscreteList is being passed */ uint32_t geofenceIdDiscreteList_len; /**< Must be set to # of elements in geofenceIdDiscreteList */ uint32_t geofenceIdDiscreteList[QMI_LOC_MAX_GEOFENCE_ID_DISCRETE_LIST_LENGTH_V02]; - /**< This list contains the Geofence IDs that were dwelled. + /**< This list contains the Geofence IDs in which a client dwelled. This list does not overlap with the continuous Geofence ID list. */ /* Optional */ /* Geofence Position */ uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ qmiLocGeofencePositionStructT_v02 geofencePosition; - /**< The latest position calculated by the geofence engine when + /**< \n The latest position calculated by the Geofence engine when the dwell notification is sent. */ /* Optional */ @@ -4626,6 +4675,11 @@ typedef uint32_t qmiLocNmeaSentenceMaskT_v02; #define QMI_LOC_NMEA_MASK_GLGSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000080) /**< Enable GLGSV type */ #define QMI_LOC_NMEA_MASK_GNGSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000100) /**< Enable GNGSA type */ #define QMI_LOC_NMEA_MASK_GNGNS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000200) /**< Enable GNGNS type */ +#define QMI_LOC_NMEA_MASK_GARMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000400) /**< Enable GARMC type */ +#define QMI_LOC_NMEA_MASK_GAGSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000800) /**< Enable GAGSV type */ +#define QMI_LOC_NMEA_MASK_GAGSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00001000) /**< Enable GAGSA type */ +#define QMI_LOC_NMEA_MASK_GAVTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00002000) /**< Enable GAVTG type */ +#define QMI_LOC_NMEA_MASK_GAGGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00004000) /**< Enable GAGGA type */ /** @addtogroup loc_qmi_messages @{ */ @@ -4648,6 +4702,11 @@ typedef struct { - QMI_LOC_NMEA_MASK_GLGSV (0x00000080) -- Enable GLGSV type - QMI_LOC_NMEA_MASK_GNGSA (0x00000100) -- Enable GNGSA type - QMI_LOC_NMEA_MASK_GNGNS (0x00000200) -- Enable GNGNS type + - QMI_LOC_NMEA_MASK_GARMC (0x00000400) -- Enable GARMC type + - QMI_LOC_NMEA_MASK_GAGSV (0x00000800) -- Enable GAGSV type + - QMI_LOC_NMEA_MASK_GAGSA (0x00001000) -- Enable GAGSA type + - QMI_LOC_NMEA_MASK_GAVTG (0x00002000) -- Enable GAVTG type + - QMI_LOC_NMEA_MASK_GAGGA (0x00004000) -- Enable GAGGA type */ }qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ /** @@ -4740,6 +4799,11 @@ typedef struct { - QMI_LOC_NMEA_MASK_GLGSV (0x00000080) -- Enable GLGSV type - QMI_LOC_NMEA_MASK_GNGSA (0x00000100) -- Enable GNGSA type - QMI_LOC_NMEA_MASK_GNGNS (0x00000200) -- Enable GNGNS type + - QMI_LOC_NMEA_MASK_GARMC (0x00000400) -- Enable GARMC type + - QMI_LOC_NMEA_MASK_GAGSV (0x00000800) -- Enable GAGSV type + - QMI_LOC_NMEA_MASK_GAGSA (0x00001000) -- Enable GAGSA type + - QMI_LOC_NMEA_MASK_GAVTG (0x00002000) -- Enable GAVTG type + - QMI_LOC_NMEA_MASK_GAGGA (0x00004000) -- Enable GAGGA type */ }qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ /** @@ -5060,6 +5124,11 @@ typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; #define QMI_LOC_MASK_DELETE_GNSS_SV_BLACKLIST_GPS_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00800000ull) /**< Mask to delete GNSS SV blacklist GPS */ #define QMI_LOC_MASK_DELETE_GNSS_SV_BLACKLIST_GLO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x01000000ull) /**< Mask to delete GNSS SV blacklist GLO */ #define QMI_LOC_MASK_DELETE_GNSS_SV_BLACKLIST_BDS_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x02000000ull) /**< Mask to delete GNSS SV blacklist BDS */ +#define QMI_LOC_MASK_DELETE_GNSS_SV_BLACKLIST_GAL_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x04000000ull) /**< Mask to delete GNSS SV blacklist GAL */ +#define QMI_LOC_MASK_DELETE_GAL_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x08000000ull) /**< Mask to delete GAL SVDIR */ +#define QMI_LOC_MASK_DELETE_GAL_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x10000000ull) /**< Mask to delete GAL SVSTEER */ +#define QMI_LOC_MASK_DELETE_GAL_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x20000000ull) /**< Mask to delete GAL time */ +#define QMI_LOC_MASK_DELETE_GAL_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x40000000ull) /**< Mask to delete GAL almanac correlation */ typedef uint32_t qmiLocDeleteCelldbDataMaskT_v02; #define QMI_LOC_MASK_DELETE_CELLDB_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000001) /**< Mask to delete cell database position */ #define QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000002) /**< Mask to delete cell database latest GPS position */ @@ -5092,6 +5161,15 @@ typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; clock information */ #define QMI_LOC_MASK_DELETE_CLOCK_INFO_BDSWEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00010000) /**< Mask to delete the BDS week number from the clock information */ #define QMI_LOC_MASK_DELETE_CLOCK_INFO_BDS_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00020000) /**< Mask to delete the BDS RF GRP delay from the clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GALTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00040000) /**< Mask to delete a GAL time estimate from the clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GALTOGPS_TB_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00080000) /**< Mask to delete GAL-to-GPS time bias-related information from the + clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GALTOGLO_TB_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00100000) /**< Mask to delete GAL-to-GLO time bias-related information from the + clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GALTOBDS_TB_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00200000) /**< Mask to delete GAL-to-BDS time bias-related information from the + clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GALWEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00800000) /**< Mask to delete the GAL week number from the clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GAL_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x01000000) /**< Mask to delete the GAL RF GRP delay from the clock information */ typedef uint8_t qmiLocDeleteSvInfoMaskT_v02; #define QMI_LOC_MASK_DELETE_EPHEMERIS_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x01) /**< Delete ephemeris for the satellite */ #define QMI_LOC_MASK_DELETE_ALMANAC_V02 ((qmiLocDeleteSvInfoMaskT_v02)0x02) /**< Delete almanac for the satellite */ @@ -5122,7 +5200,7 @@ typedef struct { */ qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; - /**< Indicates if the ephemeris or almanac for a satellite + /**< Indicates whether the ephemeris or almanac for a satellite is to be deleted. \n Valid values: \n - 0x01 -- DELETE_EPHEMERIS \n @@ -5154,6 +5232,27 @@ typedef struct { @} */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< SV ID of the satellite whose data is to be deleted. \n + Range for GAL: 301 to 336 */ + + qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; + /**< Indicates if the ephemeris or almanac for a satellite + is to be deleted. \n + Valid values: \n + - QMI_LOC_MASK_DELETE_EPHEMERIS (0x01) -- Delete ephemeris for the satellite + - QMI_LOC_MASK_DELETE_ALMANAC (0x02) -- Delete almanac for the satellite + */ +}qmiLocDeleteGALSvInfoStructT_v02; /* Type */ +/** + @} + */ + /** @addtogroup loc_qmi_messages @{ */ @@ -5216,6 +5315,11 @@ typedef struct { - QMI_LOC_MASK_DELETE_GNSS_SV_BLACKLIST_GPS (0x00800000) -- Mask to delete GNSS SV blacklist GPS - QMI_LOC_MASK_DELETE_GNSS_SV_BLACKLIST_GLO (0x01000000) -- Mask to delete GNSS SV blacklist GLO - QMI_LOC_MASK_DELETE_GNSS_SV_BLACKLIST_BDS (0x02000000) -- Mask to delete GNSS SV blacklist BDS + - QMI_LOC_MASK_DELETE_GNSS_SV_BLACKLIST_GAL (0x04000000) -- Mask to delete GNSS SV blacklist GAL + - QMI_LOC_MASK_DELETE_GAL_SVDIR (0x08000000) -- Mask to delete GAL SVDIR + - QMI_LOC_MASK_DELETE_GAL_SVSTEER (0x10000000) -- Mask to delete GAL SVSTEER + - QMI_LOC_MASK_DELETE_GAL_TIME (0x20000000) -- Mask to delete GAL time + - QMI_LOC_MASK_DELETE_GAL_ALM_CORR (0x40000000) -- Mask to delete GAL almanac correlation */ /* Optional */ @@ -5265,6 +5369,15 @@ typedef struct { clock information - QMI_LOC_MASK_DELETE_CLOCK_INFO_BDSWEEK_NUMBER (0x00010000) -- Mask to delete the BDS week number from the clock information - QMI_LOC_MASK_DELETE_CLOCK_INFO_BDS_RF_GRP_DELAY (0x00020000) -- Mask to delete the BDS RF GRP delay from the clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GALTIME_EST (0x00040000) -- Mask to delete a GAL time estimate from the clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GALTOGPS_TB (0x00080000) -- Mask to delete GAL-to-GPS time bias-related information from the + clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GALTOGLO_TB (0x00100000) -- Mask to delete GAL-to-GLO time bias-related information from the + clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GALTOBDS_TB (0x00200000) -- Mask to delete GAL-to-BDS time bias-related information from the + clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GALWEEK_NUMBER (0x00800000) -- Mask to delete the GAL week number from the clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GAL_RF_GRP_DELAY (0x01000000) -- Mask to delete the GAL RF GRP delay from the clock information */ /* Optional */ @@ -5274,6 +5387,14 @@ typedef struct { qmiLocDeleteBDSSvInfoStructT_v02 deleteBdsSvInfoList[QMI_LOC_DELETE_MAX_BDS_SV_INFO_LENGTH_V02]; /**< \vspace{0.06in} \n List of BDS satellites for which the assistance data is to be deleted. */ + + /* Optional */ + /* Delete GAL SV Info */ + uint8_t deleteGalSvInfoList_valid; /**< Must be set to true if deleteGalSvInfoList is being passed */ + uint32_t deleteGalSvInfoList_len; /**< Must be set to # of elements in deleteGalSvInfoList */ + qmiLocDeleteGALSvInfoStructT_v02 deleteGalSvInfoList[QMI_LOC_DELETE_MAX_GAL_SV_INFO_LENGTH_V02]; + /**< \vspace{0.06in} \n List of GAL satellites for which the assistance data is to be deleted. + */ }qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ /** @} @@ -5824,10 +5945,12 @@ typedef struct { a Geofence is dwelled. These events are generated when a UE enters or leaves the perimeter of a Geofence and dwells inside or outside for a specified time. This dwell notification is for multiple Geofences. Dwells from multiple Geofences are all batched and - sent in the same notification . + sent in the same notification. - QMI_LOC_EVENT_MASK_GET_TIME_ZONE_REQ (0x40000000) -- The control point must enable this mask to receive requests for time zone information from the service. These events are generated when there is a need for time zone information in the - modem . + service. + - QMI_LOC_EVENT_MASK_BATCHING_STATUS (0x80000000) -- The control point must enable this mask to receive asynchronous events related + to batching. */ }qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ /** @@ -8543,6 +8666,11 @@ typedef enum { @} */ +typedef uint8_t qmiLocGeofenceDwellTypeMaskT_v02; +#define QMI_LOC_GEOFENCE_DWELL_TYPE_INSIDE_MASK_V02 ((qmiLocGeofenceDwellTypeMaskT_v02)0x01) /**< If this mask is set, a dwell event is reported + when a user dwells inside the Geofence for a specified time */ +#define QMI_LOC_GEOFENCE_DWELL_TYPE_OUTSIDE_MASK_V02 ((qmiLocGeofenceDwellTypeMaskT_v02)0x02) /**< If this mask is set, a dwell event is reported + when a user dwells outside the Geofence for a specified time */ /** @addtogroup loc_qmi_messages @{ */ @@ -8660,13 +8788,25 @@ typedef struct { */ /* Optional */ - /* Dwell Time of geofence */ + /* Dwell Time of Geofence */ uint8_t dwellTime_valid; /**< Must be set to true if dwellTime is being passed */ uint32_t dwellTime; - /**< Dwell time is the time spent inside the geofence in seconds. - The time a user spends in the geofence before a dwell event is sent .The max acceptable value - for dwell time is 65535 seconds. + /**< Dwell time is the time in seconds a user spends in the Geofence before a dwell + event is sent. */ + + /* Optional */ + /* Geofence Dwell Type */ + uint8_t dwellTypeMask_valid; /**< Must be set to true if dwellTypeMask is being passed */ + qmiLocGeofenceDwellTypeMaskT_v02 dwellTypeMask; + /**< Type of dwell event in which the user is interested . + + Valid values: \n + - QMI_LOC_GEOFENCE_DWELL_TYPE_INSIDE_MASK (0x01) -- If this mask is set, a dwell event is reported + when a user dwells inside the Geofence for a specified time + - QMI_LOC_GEOFENCE_DWELL_TYPE_OUTSIDE_MASK (0x02) -- If this mask is set, a dwell event is reported + when a user dwells outside the Geofence for a specified time + */ }qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ /** @} @@ -8925,7 +9065,7 @@ typedef enum { eQMI_LOC_GEOFENCE_MOTION_STATE_FIDDLE_V02 = 1, /**< Motion state Fiddle -- Handset is not in motion but is being "fiddled" with */ eQMI_LOC_GEOFENCE_MOTION_STATE_WALK_V02 = 2, /**< Motion state Walk -- User is walking with the handset */ eQMI_LOC_GEOFENCE_MOTION_STATE_RUN_V02 = 3, /**< Motion state Run -- User is running with the handset */ - eQMI_LOC_GEOFENCE_MOTION_STATE_DRIVE_V02 = 4, /**< Motion state Drive -- User is driving with the handset */ + eQMI_LOC_GEOFENCE_MOTION_STATE_DRIVE_V02 = 4, /**< Motion state Drive -- User is driving with the handset */ QMILOCGEOFENCEMOTIONSTATESENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocGeofenceMotionStatesEnumT_v02; /** @@ -9367,13 +9507,13 @@ typedef struct { /** @addtogroup loc_qmi_messages @{ */ -/** Indication Message; Requests the control point to inject time zone information. */ +/** Indication Message; Requests the control point to get time zone information. */ typedef struct { /* Mandatory */ - /* Get time zone info Status */ + /* Get Time Zone Info Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Get time zone info request. + /**< Status of the Get Time Zone Info request. Valid values: \n - eQMI_LOC_SUCCESS (0) -- Request was completed successfully \n @@ -9398,11 +9538,11 @@ typedef struct { typedef struct { uint64_t dstOffset; - /**< The offset for daylight-savings time in seconds. This will be zero if the time zone is not in Daylight Savings - Time during the specified UTC timestamp */ + /**< Offset for Daylight Savings Time in seconds. This is zero if the time zone is not in Daylight Savings + Time during the specified UTC timestamp. */ uint64_t rawOffset; - /**< the offset from UTC (in seconds) for the current location. This does not take into effect daylight savings. */ + /**< Offset from UTC (in seconds) for the current location. This does not take daylight savings into account. */ }qmiLocTimeZoneStructT_v02; /* Type */ /** @} @@ -9421,7 +9561,7 @@ typedef struct { - Units: Milliseconds */ /* Mandatory */ - /* Time Zone information */ + /* Time Zone Information */ qmiLocTimeZoneStructT_v02 timeZone; /**< The time zone information */ }qmiLocInjectTimeZoneInfoReqMsgT_v02; /* Message */ @@ -9436,9 +9576,9 @@ typedef struct { typedef struct { /* Mandatory */ - /* Edit Geofence Status */ + /* Inject Time Zone Info Status */ qmiLocStatusEnumT_v02 status; - /**< Status of the Edit Geofence request. + /**< Status of the inject time zone information. Valid values: \n - eQMI_LOC_SUCCESS (0) -- Request was completed successfully \n @@ -9761,6 +9901,7 @@ typedef struct { GNSS time is maintained irrespective of the GNSS receiver state - eQMI_LOC_TIME_SRC_QZSS_TOW_DECODE (15) -- Time is set after decoding QZSS satellites - eQMI_LOC_TIME_SRC_BDS_TOW_DECODE (16) -- Time is set after decoding BDS satellites + - eQMI_LOC_TIME_SRC_GAL_TOW_DECODE (17) -- Time is set after decoding GAL satellites */ /* Optional */ @@ -9781,8 +9922,9 @@ typedef struct { - For SBAS: 33 to 64 \n - For GLONASS: 65 to 96 \n - For QZSS: 193 to 197 \n - - For BDS: 201 to 237 - */ + - For BDS: 201 to 237 \n + - For GAL: 301 to 336 + */ }qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ /** @} @@ -10629,6 +10771,43 @@ typedef struct { - Units: Milliseconds \n - Default: 20,000 ms */ + + /* Optional */ + /* Minimum Distance */ + uint8_t minDistance_valid; /**< Must be set to true if minDistance is being passed */ + uint32_t minDistance; + /**< Specifies the minimum distance that should be traversed before a + position should be batched. + If no distance is specified then the positions shall be batched after + the minInterval period expired. If both minInterval and minDistance are + specified then the position shall be batched only after minInterval has + expired AND minDistance has been traversed. \n + - Units: Meters \n + */ + + /* Optional */ + /* Batch All Positions */ + uint8_t batchAllPos_valid; /**< Must be set to true if batchAllPos is being passed */ + uint8_t batchAllPos; + /**< True : All positions that available for free shall be batched. For example + if any other type of positioning is active ( e.g 1 Hz tracking), all the + positions computed for that use case shall also get batched. This may + result in the BATCH_FULL indication getting generated earlier. + False: Only positions that meet the time and/or distance criteria shall be batched. + + Default: False + */ + + /* Optional */ + /* Request ID */ + uint8_t requestId_valid; /**< Must be set to true if requestId is being passed */ + uint32_t requestId; + /**< Identifies the request, a batching client can start multiple batching + requests with different batching parameters, + however positions corresponding to all the requests from the same client shall + be batched in the same buffer. A request ID value of 0 is considered invalid. + Valid Values 0x01 - 0xFFFFFFFF + */ }qmiLocStartBatchingReqMsgT_v02; /* Message */ /** @} @@ -10658,6 +10837,17 @@ typedef struct { - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed \n - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ + + /* Optional */ + /* Request ID */ + uint8_t requestId_valid; /**< Must be set to true if requestId is being passed */ + uint32_t requestId; + /**< Identifies the request, a batching client can start multiple batching + requests with different batching parameters, however positions + corresponding to all the requests from the same client shall + be batched in the same buffer. + Valid Values 0x01 - 0xFFFFFFFF + */ }qmiLocStartBatchingIndMsgT_v02; /* Message */ /** @} @@ -10919,6 +11109,15 @@ typedef struct { /* Transaction ID */ uint32_t transactionId; /**< Transaction ID of the request. */ + + /* Optional */ + /* Request ID */ + uint8_t requestId_valid; /**< Must be set to true if requestId is being passed */ + uint32_t requestId; + /**< Identifies the batching request that must be stopped, + a batching client can start multiple batching requests. + Valid Values 0x01 - 0xFFFFFFFF + */ }qmiLocStopBatchingReqMsgT_v02; /* Message */ /** @} @@ -10954,6 +11153,15 @@ typedef struct { uint32_t transactionId; /**< Transaction ID that was specified in the Stop Batching request. */ + + /* Optional */ + /* Request ID */ + uint8_t requestId_valid; /**< Must be set to true if requestId is being passed */ + uint32_t requestId; + /**< Identifies the batching request that was stopped, + a batching client can start multiple batching requests. + Valid Values 0x01 - 0xFFFFFFFF + */ }qmiLocStopBatchingIndMsgT_v02; /* Message */ /** @} @@ -11844,6 +12052,7 @@ typedef struct { GNSS time is maintained irrespective of the GNSS receiver state - eQMI_LOC_TIME_SRC_QZSS_TOW_DECODE (15) -- Time is set after decoding QZSS satellites - eQMI_LOC_TIME_SRC_BDS_TOW_DECODE (16) -- Time is set after decoding BDS satellites + - eQMI_LOC_TIME_SRC_GAL_TOW_DECODE (17) -- Time is set after decoding GAL satellites */ }qmiLocGetAvailWwanPositionIndMsgT_v02; /* Message */ /** @@ -11947,6 +12156,7 @@ typedef enum { eQMI_LOC_XTRA_VERSION_CHECK_AUTO_V02 = 1, /**< XTRA file version check is required; the Location service decides the 'expected version' based on the preprovisioned XTRA version configuration */ eQMI_LOC_XTRA_VERSION_CHECK_XTRA2_V02 = 2, /**< Check the XTRA file against XTRA2 format */ eQMI_LOC_XTRA_VERSION_CHECK_XTRA3_V02 = 3, /**< Check the XTRA file against XTRA3 format */ + eQMI_LOC_XTRA_VERSION_CHECK_XTRA3_1_V02 = 4, /**< Check the XTRA file against XTRA3.1 format */ QMILOCXTRAVERSIONCHECKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ }qmiLocXtraVersionCheckEnumT_v02; /** @@ -11970,6 +12180,7 @@ typedef struct { - eQMI_LOC_XTRA_VERSION_CHECK_AUTO (1) -- XTRA file version check is required; the Location service decides the 'expected version' based on the preprovisioned XTRA version configuration - eQMI_LOC_XTRA_VERSION_CHECK_XTRA2 (2) -- Check the XTRA file against XTRA2 format - eQMI_LOC_XTRA_VERSION_CHECK_XTRA3 (3) -- Check the XTRA file against XTRA3 format + - eQMI_LOC_XTRA_VERSION_CHECK_XTRA3_1 (4) -- Check the XTRA file against XTRA3.1 format */ }qmiLocSetXtraVersionCheckReqMsgT_v02; /* Message */ /** @@ -12280,6 +12491,7 @@ typedef struct { GNSS time is maintained irrespective of the GNSS receiver state - eQMI_LOC_TIME_SRC_QZSS_TOW_DECODE (15) -- Time is set after decoding QZSS satellites - eQMI_LOC_TIME_SRC_BDS_TOW_DECODE (16) -- Time is set after decoding BDS satellites + - eQMI_LOC_TIME_SRC_GAL_TOW_DECODE (17) -- Time is set after decoding GAL satellites */ }qmiLocGnssTimeExtStructT_v02; /* Type */ /** @@ -12377,7 +12589,8 @@ typedef struct { \item For SBAS: 33 to 64 \item For GLONASS: 65 to 96. When slot-number to SV ID mapping is unknown, set as 255. \item For BDS: 201 to 237 - \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + \item For GAL: 301 to 336 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ uint8_t gloFrequency; /**< GLONASS frequency number + 7. \n @@ -12528,7 +12741,7 @@ typedef struct { typedef struct { /* Mandatory */ - /* Current Message Sequence Number */ + /* Current Message Sequence Number */ uint8_t seqNum; /**< Current message number. Used for segmentation/assembly of measurement reports. */ @@ -12673,6 +12886,7 @@ typedef struct { \item For SBAS: 33 to 64 \item For GLONASS: 65 to 96 (when the slot number to SV ID mapping is unknown, set to 255) \item For BDS: 201 to 237 + \item For GAL: 301 to 336 \vspace{-0.18in} \end{itemize1} \end{itemize1} */ /* Mandatory */ @@ -12681,7 +12895,8 @@ typedef struct { /**< Reference time for polynomial calculations. \n - GPS: Seconds in the week \n - GLO: Full seconds since Jan. 1, 1996 \n - - BDS: Full seconds since Jan. 1, 2006 + - BDS: Full seconds since Jan. 1, 2006 \n + - GAL: Calculated from 00:00 UT on Sunday, August 22, 1999 (midnight between August 21 and August 22) */ /* Mandatory */ @@ -12750,7 +12965,8 @@ typedef struct { uint16_t IODE; /**< Ephemeris reference time. \n - GPS -- Issue of data ephemeris used (unitless) \n - - GLONASS -- Tb 7-bit + - GLONASS -- Tb 7-bit \n + - Galileo -- 10-bit */ /* Optional */ @@ -13527,7 +13743,7 @@ typedef struct { typedef enum { QMILOCDBTPOSITIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ eQMI_LOC_DBT_POSITION_TYPE_ORIGIN_V02 = 1, /**< Position reported is at the origin */ - eQMI_LOC_DBT_POSITION_TYPE_TRACKING_V02 = 2, /**< Position reported is of tracking type + eQMI_LOC_DBT_POSITION_TYPE_TRACKING_V02 = 2, /**< Position reported is a tracking type where the origin location has already been reported */ QMILOCDBTPOSITIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ @@ -13588,7 +13804,7 @@ typedef struct { /* Horizontal Speed Validity Bit */ uint8_t speedHorizontal_valid; /**< Indicates whether the horizontal speed field contains valid - information. \n + information. \n - 0x01 (TRUE) -- Horizontal speed is valid \n - 0x00 (FALSE) -- Horizontal speed is invalid and is to be ignored \vspace{-0.18in} @@ -13602,7 +13818,7 @@ typedef struct { /* Altitude Validity Bit */ uint8_t altitudeWrtEllipsoid_valid; /**< Indicates whether the altitude field contains valid - information. \n + information. \n - 0x01 (TRUE) -- Altitude field is valid \n - 0x00 (FALSE) -- Altitude field is invalid and is to be ignored \vspace{-0.18in} @@ -13645,7 +13861,7 @@ typedef struct { /* Heading Validity Bit */ uint8_t heading_valid; /**< Indicates whether the heading field contains valid - information. \n + information. \n - 0x01 (TRUE) -- Heading field is valid \n - 0x00 (FALSE) -- Heading field is invalid and is to be ignored \vspace{-0.18in} @@ -13678,46 +13894,51 @@ typedef struct { /* DBT Position */ qmiLocDbtPositionStructT_v02 dbtPosition; /**< Position of the client when it has traversed the - distance specified. + specified distance. */ /* Mandatory */ - /* DBT Position */ + /* DBT Position Type */ qmiLocDbtPositionTypeEnumT_v02 positionType; - /**< Specifies if the position reported is at the - origin of the DBT session or during the tracking - duration of the session */ + /**< Specifies whether the position reported is at the + origin of the DBT session or during the tracking + duration of the session. Values: \ + + - eQMI_LOC_DBT_POSITION_TYPE_ORIGIN (1) -- Position reported is at the origin + - eQMI_LOC_DBT_POSITION_TYPE_TRACKING (2) -- Position reported is a tracking type + where the origin location has already + been reported */ /* Optional */ /* Heading Uncertainty */ uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ float headingUnc; /**< Heading uncertainty.\n - - Units: Degrees \n - - Range: 0 to 359.999 */ + - Units: Degrees \n + - Range: 0 to 359.999 */ /* Optional */ /* Speed Uncertainty */ uint8_t speedUnc_valid; /**< Must be set to true if speedUnc is being passed */ float speedUnc; /**< 3-D speed uncertainty.\n - - Units: Meters/second */ + - Units: Meters/second */ /* Optional */ /* Horizontal Confidence */ uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ uint8_t horConfidence; /**< Horizontal uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ + - Units: Percent \n + - Range: 0 to 99 */ /* Optional */ /* Vertical Confidence */ uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ uint8_t vertConfidence; /**< Vertical uncertainty confidence.\n - - Units: Percent \n - - Range: 0 to 99 */ + - Units: Percent \n + - Range: 0 to 99 */ /* Optional */ /* Dilution of Precision */ @@ -13731,15 +13952,30 @@ typedef struct { uint32_t gnssSvUsedList_len; /**< Must be set to # of elements in gnssSvUsedList */ uint16_t gnssSvUsedList[QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02]; /**< Each entry in the list contains the SV ID of a satellite - used for calculating this position report. The following - information is associated with each SV ID: \n - Range: \n - - For GPS: 1 to 32 \n - - For SBAS: 33 to 64 \n - - For GLONASS: 65 to 96 \n - - For QZSS: 193 to 197 \n - - For BDS: 201 to 237 + used for calculating this position report. The following + information is associated with each SV ID: \n + Range: \n + - For GPS: 1 to 32 \n + - For SBAS: 33 to 64 \n + - For GLONASS: 65 to 96 \n + - For QZSS: 193 to 197 \n + - For BDS: 201 to 237 */ + + /* Optional */ + /* Position Source */ + uint8_t positionSrc_valid; /**< Must be set to true if positionSrc is being passed */ + qmiLocPositionSrcEnumT_v02 positionSrc; + /**< Source from which this position was obtained. + Valid values: \n + - eQMI_LOC_POSITION_SRC_GNSS (0) -- Position source is GNSS + - eQMI_LOC_POSITION_SRC_CELLID (1) -- Position source is Cell ID + - eQMI_LOC_POSITION_SRC_ENH_CELLID (2) -- Position source is Enhanced Cell ID + - eQMI_LOC_POSITION_SRC_WIFI (3) -- Position source is Wi-Fi + - eQMI_LOC_POSITION_SRC_TERRESTRIAL (4) -- Position source is Terrestrial + - eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID (5) -- Position source is GNSS Terrestrial Hybrid + - eQMI_LOC_POSITION_SRC_OTHER (6) -- Other sources + */ }qmiLocEventDbtPositionReportIndMsgT_v02; /* Message */ /** @} @@ -13790,6 +14026,629 @@ typedef struct { @} */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPOSITIONSOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_POS_SRC_GNSS_V02 = 1, /**< Source of the position is GNSS */ + QMILOCPOSITIONSOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPositionSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPOSITIONRPTPROPAGATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_POS_REPORT_PROPAGATED_TO_CURRENT_UTC_V02 = 1, /**< Reported position is propagated to the current UTC */ + QMILOCPOSITIONRPTPROPAGATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPositionRptPropagationEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSECURELOCDATAMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SECURE_LOC_DATA_ENCRYPTED_V02 = 1, /**< Data in the indication is to be encrypted */ + eQMI_LOC_SECURE_LOC_DATA_UNENCRYPTED_V02 = 2, /**< Data in the indication is to be unencrypted */ + QMILOCSECURELOCDATAMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSecureLocDataModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSECUREGETAVAILABLEPOSPARAMETERIDENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_PARAM_TRANSACTION_ID_V02 = 1, /**< Parameter ID for the Transaction ID field. Mandatory field. + Identifies the transaction. The transaction ID is returned in the + Secured Get Available Position indication. \n + - Parameter type: uint32 + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_PARAM_NONCE_V02 = 2, /**< Parameter ID for the Nonce field. Optional field. + - Parameter type: uint64 + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_PARAM_SOURCE_V02 = 3, /**< Parameter ID for the Position Source field. Optional field. + Specifies the source of the position in which the control point is interest. + If not included, the value defaults to GNSS. \n + - Parameter type: int32 \n + Parameter valid values: \n + - eQMI_LOC_POS_SRC_GNSS (1) -- Source of the position is GNSS + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_PARAM_REPORT_DATA_SECURITY_MODE_V02 = 4, /**< Secured position report data security mode. Optional field. + If this TLV is not sent, the position report is encrypted by default. \n + - Parameter type: int32 \n + Parameter valid values: \n + - eQMI_LOC_SECURE_LOC_DATA_ENCRYPTED (1) -- Position reports are encrypted + - eQMI_LOC_SECURE_LOC_DATA_UNENCRYPTED (2) -- Position reports are not encrypted + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_PARAM_REPORT_DATA_TIME_PROPAGATION_V02 = 5, /**< Secured position report data propagation. Optional field. + If this TLV is not sent, the position report is propagated to the current UTC time by default. \n + - Parameter type: int32 \n + Parameter valid values: \n + - eQMI_LOC_POS_REPORT_PROPAGATED_TO_CURRENT_UTC (1) -- Position reports are propagated to the current UTC. \n + */ + QMILOCSECUREGETAVAILABLEPOSPARAMETERIDENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSecureGetAvailablePosParameterIDEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSECUREMESSAGEDATATYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SECURE_DATA_TYPE_BYTE_8_V02 = 1, /**< Data type: Byte (8 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_CHAR_8_V02 = 2, /**< Data type: Char (8 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_UNSIGNED_CHAR_8_V02 = 3, /**< Data type: Unsigned char (8 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_INT_8_V02 = 4, /**< Data type: Int (8 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_UNSIGNED_INT_8_V02 = 5, /**< Data type: Unsigned int (8 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_INT_16_V02 = 6, /**< Data type: Int (16 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_UNSIGNED_INT_16_V02 = 7, /**< Data type: Unsigned int (16 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_INT_32_V02 = 8, /**< Data type: Int (32 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_UNSIGNED_INT_32_V02 = 9, /**< Data type: Unsigned int (32 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_INT_64_V02 = 10, /**< Data type: Int (64 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_UNSIGNED_INT_64_V02 = 11, /**< Data type: Unsigned int (64 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_BOOL_8_V02 = 12, /**< Data type: Boolean (8 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_DOUBLE_64_V02 = 13, /**< Data type: Double (64 bits) */ + eQMI_LOC_SECURE_DATA_TYPE_FLOAT_32_V02 = 14, /**< Data type: Float (32 bits) */ + QMILOCSECUREMESSAGEDATATYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSecureMessageDataTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Data Security Mode for Encoded Data Buffer. */ + qmiLocSecureLocDataModeEnumT_v02 secureLocDataMode; + /**< Data security mode for the encoded data buffer. + + Valid values: \n + - eQMI_LOC_SECURE_LOC_DATA_ENCRYPTED (1) -- Data in the indication is to be encrypted + - eQMI_LOC_SECURE_LOC_DATA_UNENCRYPTED (2) -- Data in the indication is to be unencrypted + */ + + /* Mandatory */ + /* Encoded Data Buffer Containing Secure Get Available Position Request Parameters */ + uint32_t qmilocSecureGetAvailablePositionRequestData_len; /**< Must be set to # of elements in qmilocSecureGetAvailablePositionRequestData */ + uint8_t qmilocSecureGetAvailablePositionRequestData[QMI_LOC_SECURE_GET_AVAILABLE_POS_REQUEST_ENCRYPTED_MAX_V02]; + /**< Encoded data buffer containing the secure Get Available Position Request parameters. */ +}qmiLocSecureGetAvailablePositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSECUREGETAVAILABLEPOSITIONINDPARAMIDENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_TRANSACTION_ID_V02 = 1, /**< Parameter ID for the Transaction ID field. Mandatory field. + Transaction ID that was specified in the Secured Get Available Position request. + This parameter is always present if the status field is set to SUCCESS. \n + - Parameter type: uint32 + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_NONCE_V02 = 2, /**< Parameter ID for the Secure Session Nonce. + This echos back the Nonce received from the Secured Get Available Position Request. + Optional field. \n + - Parameter type: uint64 + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_LATITUDE_V02 = 3, /**< Parameter ID for Latitude (specified in WGS84 datum). Optional field. + \begin{itemize1} + \item Parameter type: Floating point + \item Parameter units: Degrees + \item Parameter range: -90.0 to 90.0 \begin{itemize1} + \item Positive values indicate northern latitude + \item Negative values indicate southern latitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_LONGITUDE_V02 = 4, /**< Parameter ID for Longitude (specified in WGS84 datum). Optional field. + \begin{itemize1} + \item Parameter type: Floating point + \item Parameter units: Degrees + \item Parameter range: -180.0 to 180.0 \begin{itemize1} + \item Positive values indicate eastern longitude + \item Negative values indicate western longitude + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HORIZ_UNC_CIRCULAR_V02 = 5, /**< Parameter ID for Circular Horizontal Uncertainty. Optional field. \n + - Parameter tnits: Meters \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_ALTITUDE_WRT_ELP_V02 = 6, /**< Parameter ID for altitude with respect to the WGS84 ellipsoid. Optional field. \n + - Parameter units: Meters \n + - Parameter range: -500 to 15883 \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_VERTICAL_UNC_V02 = 7, /**< Parameter ID for Vertical Uncertainty. Optional field.\n + - Parameter units: Meters \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_TIME_STAMP_UTC_V02 = 8, /**< Parameter ID for the UTC timestamp. Optional field.\n + - Parameter type: uint64 \n + - Parameter units: Milliseconds since Jan. 1, 1970 + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_TIME_UNC_V02 = 9, /**< Parameter ID for time uncertainty. Optional field.\n + - Parameter type: Float \n + - Parameter units: Milliseconds */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HORIZ_UNC_ELP_SEMIMINOR_V02 = 10, /**< Parameter ID for the Semi-Minor Axis of Horizontal Elliptical Uncertainty. Optional field.\n + - Parameter mnits: Meters \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HORIZ_UNC_ELP_SEMIMAJOR_V02 = 11, /**< Parameter ID for the Semi-Major Axis of Horizontal Elliptical Uncertainty. Optional field.\n + - Parameter units: Meters \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HORIZ_UNC_ELP_ORIENT_AZIMUTH_V02 = 12, /**< Parameter ID for the Elliptical Horizontal Uncertainty Azimuth of orientation. Optional field.\n + - Parameter units: Decimal degrees \n + - Parameter range: 0 to 180 \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HORIZ_CONFIDENCE_V02 = 13, /**< Parameter ID for Horizontal uncertainty confidence. Optional field.\n + If both elliptical and horizontal uncertainties are specified in this message, + the confidence corresponds to the elliptical uncertainty. Optional field.\n + - Parameter units: Percent \n + - Parameter range: 0 to 99 \n + - Parameter type: uint8 */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HORIZ_ELLIP_CONFIDENCE_V02 = 14, /**< Parameter ID for Horizontal Elliptical Uncertainty Confidence. Optional field.\n + If both elliptical and horizontal uncertainties are specified in this message, + the confidence corresponds to the elliptical uncertainty. Optional field.\n + - Parameter units: Percent \n + - Parameter range: 0 to 99 \n + - Parameter type: uint8 */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HORIZ_RELIABILITY_V02 = 15, /**< Parameter ID for Specifies the reliability of the horizontal position. Optional field. + - Parameter Type: int32 \n + Parameter valid values: \n + - RELIABILITY_NOT_SET = 0 \n + - RELIABILITY_VERY_LOW = 1 \n + - RELIABILITY_LOW = 2 \n + - RELIABILITY_MEDIUM = 3 \n + - RELIABILITY_HIGH = 4 + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_SPEED_HORIZ_V02 = 16, /**< Parameter ID for Horizontal Speed. Optional field.\n + - Parameter units: Meters/second \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_SPEED_HORIZ_UNC_V02 = 17, /**< Parameter ID for Horizontal Speed Uncertainty. Optional field.\n + - Parameter units: Meters/second \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_ALTITUDE_WRT_MSA_V02 = 18, /**< Parameter ID for Altitude with respect to mean sea level. Optional field.\n + - Parameter units: Meters \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_VERTICAL_CONF_V02 = 19, /**< Parameter ID for Vertical uncertainty confidence. Optional field.\n + - Parameter units: Percent \n + - Parameter range: 0 to 99 \n + - Parameter type: uint8 */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_VERT_RELIABILITY_V02 = 20, /**< Parameter ID for specifies the reliability of the vertical position. Optional field. \n + - Parameter type: int32 \n + Parameter valid values: \n + - RELIABILITY_NOT_SET = 0 \n + - RELIABILITY_VERY_LOW = 1 \n + - RELIABILITY_LOW = 2 \n + - RELIABILITY_MEDIUM = 3 \n + - RELIABILITY_HIGH = 4 + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_SPEED_VERTICAL_V02 = 21, /**< Parameter ID for Vertical Speed. Optional field.\n + - Parameter units: Meters/second \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_SPEED_VERTICAL_UNC_V02 = 22, /**< Parameter ID for Vertical Speed Uncertainty. Optional field.\n + - Parameter units: Meters/second \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HEADING_V02 = 23, /**< Parameter ID for Heading. Optional field.\n + - Parameter units: Degrees \n + - Parameter range: 0 to 359.999 \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HEADING_UNC_V02 = 24, /**< Parameter ID for Heading Uncertainty. Optional field.\n + - Parameter units: Degrees \n + - Parameter range: 0 to 359.999 \n + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_MAGNETIC_DEVIATION_V02 = 25, /**< Parameter ID for Magnetic Deviation. Optional field.\n + Difference between the bearing to true north and the bearing shown + on a magnetic compass. The deviation is positive when the magnetic + north is east of true north. + - Parameter type: Float */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_TECH_MASK_V02 = 26, /**< Parameter ID for Technology Used in computing this fix. Optional field.\n + - Parameter type: uint32 \n + Parameter valid bitmasks: \n + - QMI_LOC_POS_TECH_MASK_SATELLITE = 0x00000001, + - QMI_LOC_POS_TECH_MASK_CELLID = 0x00000002, + - QMI_LOC_POS_TECH_MASK_WIFI = 0x00000004, + - QMI_LOC_POS_TECH_MASK_SENSORS = 0x00000008, + - QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION = 0x00000010, + - QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION = 0x00000020, + - QMI_LOC_POS_TECH_MASK_AFLT = 0x00000040, + - QMI_LOC_POS_TECH_MASK_HYBRID = 0x00000080 + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_PDOP_V02 = 27, /**< Parameter ID for Position Dilution of Precision associated with this position. Optional field.\n + - Parameter type: Float + - Parameter range: 1 (highest accuracy) to 50 (lowest accuracy) + - PDOP = square root of (HDOP^2 + VDOP^2) + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_HDOP_V02 = 28, /**< Parameter ID for Horizontal Dilution of Precision associated with this position. Optional field.\n + - Parameter type: Float + - Parameter range: 1 (highest accuracy) to 50 (lowest accuracy) + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_VDOP_V02 = 29, /**< Parameter ID for Vertical Dilution of Precision associated with this position. Optional field.\n + - Parameter type: Float + - Parameter range: 1 (highest accuracy) to 50 (lowest accuracy) + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_GPS_WEEK_V02 = 30, /**< Parameter ID for the current GPS Week, as calculated from midnight, Jan. 6, 1980. Optional field.\n + - Parameter type: uint16 + - Parameter units: Weeks + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_GPS_TIMEOFWEEKMS_V02 = 31, /**< Parameter ID for amount of time into the current GPS Week. Optional field.\n + - Parameter type: uint32 + - Parameter units: Milliseconds + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_TIME_SRC_V02 = 32, /**< Parameter ID for Time Source. Optional field.\n + - Parameter type: uint32 (enum qmiLocTimeSourceEnumT) + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_SENSOR_USAGE_MASK_V02 = 33, /**< Parameter ID that specifies which sensors were used in calculating the position in the + position report. Optional field.\n + - Parameter type: uint32 \n + Parameter valid bitmasks: \n + - 0x00000001 -- SENSOR_USED_ACCEL \n + - 0x00000002 -- SENSOR_USED_GYRO + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_AIDING_IND_MASK_V02 = 34, /**< Parameter ID that specifies which which results were aided by sensors. Optional field.\n + - Parameter type: uint32 \n + Parameter valid bitmasks: \n + - 0x00000001 -- AIDED_HEADING \n + - 0x00000002 -- AIDED_SPEED \n + - 0x00000004 -- AIDED_POSITION \n + - 0x00000008 -- AIDED_VELOCITY + */ + eQMI_LOC_SECURE_GET_AVAILABLE_POS_REP_PARAM_SV_USED_V02 = 35, /**< Each entry in the list contains the SV ID of a satellite + used for calculating this position report. The following + information is associated with each SV ID. Optional field. \n + - Parameter type: uint16 \n + Parameter range: \n + - For GPS: 1 to 32 \n + - For SBAS: 33 to 64 \n + - For GLONASS: 65 to 96 \n + - For QZSS: 193 to 197 \n + - For BDS: 201 to 237 + */ + QMILOCSECUREGETAVAILABLEPOSITIONINDPARAMIDENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSecureGetAvailablePositionIndParamIDEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Session Status */ + qmiLocSessionStatusEnumT_v02 sessionStatus; + /**< Session status. + + Valid values: \n + - eQMI_LOC_SESS_STATUS_SUCCESS (0) -- Session was successful + - eQMI_LOC_SESS_STATUS_IN_PROGRESS (1) -- Session is still in progress; further position reports will be generated + until either the fix criteria specified by the client are met or the + client response timeout occurs + - eQMI_LOC_SESS_STATUS_GENERAL_FAILURE (2) -- Session failed + - eQMI_LOC_SESS_STATUS_TIMEOUT (3) -- Fix request failed because the session timed out + - eQMI_LOC_SESS_STATUS_USER_END (4) -- Fix request failed because the session was ended by the user + - eQMI_LOC_SESS_STATUS_BAD_PARAMETER (5) -- Fix request failed due to bad parameters in the request + - eQMI_LOC_SESS_STATUS_PHONE_OFFLINE (6) -- Fix request failed because the phone is offline + - eQMI_LOC_SESS_STATUS_ENGINE_LOCKED (7) -- Fix request failed because the engine is locked + */ + + /* Mandatory */ + /* Data Security Mode for Encoded Data Buffer. */ + qmiLocSecureLocDataModeEnumT_v02 secureLocDataMode; + /**< Data security mode for encoded data buffer. + + Valid values: \n + - eQMI_LOC_SECURE_LOC_DATA_ENCRYPTED (1) -- Data in the indication is to be encrypted + - eQMI_LOC_SECURE_LOC_DATA_UNENCRYPTED (2) -- Data in the indication is to be unencrypted + */ + + /* Optional */ + /* Encoded Data Buffer Containing Secured Get Available Position Report Indication */ + uint8_t qmilocSecureGetAvailablePositionInd_valid; /**< Must be set to true if qmilocSecureGetAvailablePositionInd is being passed */ + uint32_t qmilocSecureGetAvailablePositionInd_len; /**< Must be set to # of elements in qmilocSecureGetAvailablePositionInd */ + uint8_t qmilocSecureGetAvailablePositionInd[QMI_LOC_SECURE_GET_AVAILABLE_POSITION_IND_ENCRYPTED_MAX_V02]; + /**< Encoded data buffer containing the secured Get Available position report indication.*/ +}qmiLocSecureGetAvailablePositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint64_t macAddress; + /**< MAC address of AP*/ + + float xLat; + /**< AP latitude. \n + - Units: Degrees */ + + float yLon; + /**< AP longitude sensor y-axis sample. \n + - Units: Degrees */ + + float mar; + /**< Maximum antenna range. \n + - Units: Meters */ +}qmiLocApCacheStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject APs into cache of + low power WiFi engine for fix computation. */ +typedef struct { + + /* Mandatory */ + /* Version Number */ + uint8_t versionNumber; + /**< AP cache protocol version number */ + + /* Mandatory */ + /* Part Number */ + uint8_t partNumber; + /**< Multiple message part number for ordering of AP info */ + + /* Mandatory */ + /* Total Parts */ + uint8_t totalParts; + /**< Total number of parts/messages for a complete cache update */ + + /* Mandatory */ + /* AP Cache Data */ + uint32_t apCacheData_len; /**< Must be set to # of elements in apCacheData */ + qmiLocApCacheStructT_v02 apCacheData[QMI_LOC_APCACHE_DATA_MAX_SAMPLES_V02]; + /**< AP cache information. */ +}qmiLocInjectApCacheDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject APs into cache of + low power WiFi engine for fix computation. */ +typedef struct { + + /* Mandatory */ + /* Set Inject APCACHE Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the inject APCACHE data request. + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully \n + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure \n + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported \n + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters \n + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy \n + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline \n + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out \n + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested \n + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request \n + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed \n + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocInjectApCacheDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint64_t macAddress; + /**< MAC address of AP*/ +}qmiLocApDoNotCacheStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject blacked out APs into + Low Power location engine. */ +typedef struct { + + /* Mandatory */ + /* Version Number */ + uint8_t versionNumber; + /**< AP Cache protocol version number */ + + /* Mandatory */ + /* Part Number */ + uint8_t partNumber; + /**< Multiple message part number for ordering of AP information */ + + /* Mandatory */ + /* Total Parts */ + uint8_t totalParts; + /**< Total number of parts/messages for a complete cache update */ + + /* Mandatory */ + /* No APCache Data */ + uint32_t apDoNotCacheData_len; /**< Must be set to # of elements in apDoNotCacheData */ + qmiLocApDoNotCacheStructT_v02 apDoNotCacheData[QMI_LOC_APCACHE_DATA_MAX_SAMPLES_V02]; + /**< \n APDoNotCache information. */ +}qmiLocInjectApDoNotCacheDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject blacked out APs into + Low Power location engine. */ +typedef struct { + + /* Mandatory */ + /* Set Inject APDONOTCACHE Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the inject APDONOTCACHE data request. + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully \n + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure \n + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported \n + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters \n + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy \n + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline \n + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out \n + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested \n + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request \n + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed \n + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocInjectApDoNotCacheDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCBATCHINGSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_BATCH_POS_UNAVAILABLE_V02 = 1, /**< Service is unable to compute positions for batching */ + eQMI_LOC_BATCH_POS_AVAILABLE_V02 = 2, /**< Service is again able to compute positions for batching */ + QMILOCBATCHINGSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocBatchingStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of the + batching status. */ +typedef struct { + + /* Mandatory */ + /* Batching Status */ + qmiLocBatchingStatusEnumT_v02 batchingStatus; + /**< Specifies the batching status. + Valid values: \n + - eQMI_LOC_BATCH_POS_UNAVAILABLE (1) -- Service is unable to compute positions for batching + - eQMI_LOC_BATCH_POS_AVAILABLE (2) -- Service is again able to compute positions for batching + */ +}qmiLocEventBatchingStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocAonCapabilityMaskT_v02; +#define QMI_LOC_MASK_AON_AUTO_BATCHING_SUPPORTED_V02 ((qmiLocAonCapabilityMaskT_v02)0x00000001) /**< The service supports "auto" batching, the client can enable auto + batching by setting the distance parameter to 0 in the START_BATCHING request */ +#define QMI_LOC_MASK_AON_DISTANCE_BASED_BATCHING_SUPPORTED_V02 ((qmiLocAonCapabilityMaskT_v02)0x00000002) /**< The service supports distance based batching */ +#define QMI_LOC_MASK_AON_TIME_BASED_BATCHING_SUPPORTED_V02 ((qmiLocAonCapabilityMaskT_v02)0x00000004) /**< The service supports time based batching */ +#define QMI_LOC_MASK_AON_DISTANCE_BASED_TRACKING_SUPPORTED_V02 ((qmiLocAonCapabilityMaskT_v02)0x00000008) /**< The service supports distance based tracking */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the clients to get "always on" service settings. + */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The same transaction ID + is returned in the QUERY_AON_CONFIG indication. */ +}qmiLocQueryAonConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the clients to get "always on" service settings. + */ +typedef struct { + + /* Mandatory */ + /* Always On (AON) Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Query AON Config request. + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully \n + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure \n + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported \n + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters \n + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy \n + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline \n + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out \n + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested \n + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request \n + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed \n + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Identifies the transaction. It is the same transaction + ID which was passed in QUERY_AON_CONFIG request. */ + + /* Optional */ + /* Always on (AON) Capability */ + uint8_t aonCapability_valid; /**< Must be set to true if aonCapability is being passed */ + qmiLocAonCapabilityMaskT_v02 aonCapability; + /**< Always On capabilities supported by the service + - QMI_LOC_MASK_AON_AUTO_BATCHING_SUPPORTED (0x00000001) -- The service supports "auto" batching, the client can enable auto + batching by setting the distance parameter to 0 in the START_BATCHING request + - QMI_LOC_MASK_AON_DISTANCE_BASED_BATCHING_SUPPORTED (0x00000002) -- The service supports distance based batching + - QMI_LOC_MASK_AON_TIME_BASED_BATCHING_SUPPORTED (0x00000004) -- The service supports time based batching + - QMI_LOC_MASK_AON_DISTANCE_BASED_TRACKING_SUPPORTED (0x00000008) -- The service supports distance based tracking */ +}qmiLocQueryAonConfigIndMsgT_v02; /* Message */ +/** + @} + */ + /* Conditional compilation tags for message removal */ //#define REMOVE_QMI_LOC_ADD_CIRCULAR_GEOFENCE_V02 //#define REMOVE_QMI_LOC_ADD_GEOFENCE_CONTEXT_V02 @@ -13798,6 +14657,7 @@ typedef struct { //#define REMOVE_QMI_LOC_DELETE_GEOFENCE_CONTEXT_V02 //#define REMOVE_QMI_LOC_DELETE_SUPL_CERTIFICATE_V02 //#define REMOVE_QMI_LOC_EDIT_GEOFENCE_V02 +//#define REMOVE_QMI_LOC_EVENT_BATCHING_STATUS_V02 //#define REMOVE_QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_V02 //#define REMOVE_QMI_LOC_EVENT_DBT_POSITION_REPORT_V02 //#define REMOVE_QMI_LOC_EVENT_DBT_SESSION_STATUS_V02 @@ -13862,6 +14722,8 @@ typedef struct { //#define REMOVE_QMI_LOC_INFORM_CLIENT_REVISION_V02 //#define REMOVE_QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_V02 //#define REMOVE_QMI_LOC_INFORM_NI_USER_RESPONSE_V02 +//#define REMOVE_QMI_LOC_INJECT_APCACHE_DATA_V02 +//#define REMOVE_QMI_LOC_INJECT_APDONOTCACHE_DATA_V02 //#define REMOVE_QMI_LOC_INJECT_GSM_CELL_INFO_V02 //#define REMOVE_QMI_LOC_INJECT_GTP_CLIENT_DOWNLOADED_DATA_V02 //#define REMOVE_QMI_LOC_INJECT_MOTION_DATA_V02 @@ -13883,10 +14745,12 @@ typedef struct { //#define REMOVE_QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_V02 //#define REMOVE_QMI_LOC_NOTIFY_WIFI_STATUS_V02 //#define REMOVE_QMI_LOC_PEDOMETER_REPORT_V02 +//#define REMOVE_QMI_LOC_QUERY_AON_CONFIG_V02 //#define REMOVE_QMI_LOC_QUERY_GEOFENCE_V02 //#define REMOVE_QMI_LOC_READ_FROM_BATCH_V02 //#define REMOVE_QMI_LOC_REG_EVENTS_V02 //#define REMOVE_QMI_LOC_RELEASE_BATCH_V02 +//#define REMOVE_QMI_LOC_SECURE_GET_AVAILABLE_POSITION_V02 //#define REMOVE_QMI_LOC_SET_CRADLE_MOUNT_CONFIG_V02 //#define REMOVE_QMI_LOC_SET_ENGINE_LOCK_V02 //#define REMOVE_QMI_LOC_SET_EXTERNAL_POWER_CONFIG_V02 @@ -14211,11 +15075,24 @@ typedef struct { #define QMI_LOC_STOP_DBT_REQ_V02 0x0095 #define QMI_LOC_STOP_DBT_RESP_V02 0x0095 #define QMI_LOC_STOP_DBT_IND_V02 0x0095 -#define QMI_LOC_EVENT_GEOFENCE_BATCHED_DWELL_NOTIFICATION_IND_V02 0x0096 -#define QMI_LOC_EVENT_GET_TIME_ZONE_INFO_IND_V02 0x0097 -#define QMI_LOC_INJECT_TIME_ZONE_INFO_REQ_V02 0x0098 -#define QMI_LOC_INJECT_TIME_ZONE_INFO_RESP_V02 0x0098 -#define QMI_LOC_INJECT_TIME_ZONE_INFO_IND_V02 0x0098 +#define QMI_LOC_SECURE_GET_AVAILABLE_POSITION_REQ_V02 0x0096 +#define QMI_LOC_SECURE_GET_AVAILABLE_POSITION_RESP_V02 0x0096 +#define QMI_LOC_SECURE_GET_AVAILABLE_POSITION_IND_V02 0x0096 +#define QMI_LOC_EVENT_GEOFENCE_BATCHED_DWELL_NOTIFICATION_IND_V02 0x0097 +#define QMI_LOC_EVENT_GET_TIME_ZONE_INFO_IND_V02 0x0098 +#define QMI_LOC_INJECT_TIME_ZONE_INFO_REQ_V02 0x0099 +#define QMI_LOC_INJECT_TIME_ZONE_INFO_RESP_V02 0x0099 +#define QMI_LOC_INJECT_TIME_ZONE_INFO_IND_V02 0x0099 +#define QMI_LOC_INJECT_APCACHE_DATA_REQ_V02 0x009A +#define QMI_LOC_INJECT_APCACHE_DATA_RESP_V02 0x009A +#define QMI_LOC_INJECT_APCACHE_DATA_IND_V02 0x009A +#define QMI_LOC_INJECT_APDONOTCACHE_DATA_REQ_V02 0x009B +#define QMI_LOC_INJECT_APDONOTCACHE_DATA_RESP_V02 0x009B +#define QMI_LOC_INJECT_APDONOTCACHE_DATA_IND_V02 0x009B +#define QMI_LOC_EVENT_BATCHING_STATUS_IND_V02 0x009C +#define QMI_LOC_QUERY_AON_CONFIG_REQ_V02 0x009D +#define QMI_LOC_QUERY_AON_CONFIG_RESP_V02 0x009D +#define QMI_LOC_QUERY_AON_CONFIG_IND_V02 0x009D /** @} */ diff --git a/gps/utils/Android.mk b/gps/utils/Android.mk index 0f99907..103e524 100644 --- a/gps/utils/Android.mk +++ b/gps/utils/Android.mk @@ -17,13 +17,17 @@ LOCAL_SRC_FILES += \ msg_q.c \ linked_list.c \ loc_target.cpp \ - loc_timer.c \ - ../platform_lib_abstractions/elapsed_millis_since_boot.cpp \ + platform_lib_abstractions/elapsed_millis_since_boot.cpp \ + LocHeap.cpp \ + LocTimer.cpp \ + LocThread.cpp \ + MsgTask.cpp \ loc_misc_utils.cpp LOCAL_CFLAGS += \ -fno-short-enums \ - -D_ANDROID_ + -D_ANDROID_ \ + -std=c++11 ifeq ($(TARGET_BUILD_VARIANT),user) LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER @@ -33,7 +37,7 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic ## Includes LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/../platform_lib_abstractions + $(LOCAL_PATH)/platform_lib_abstractions LOCAL_COPY_HEADERS_TO:= gps.utils/ LOCAL_COPY_HEADERS:= \ @@ -42,14 +46,20 @@ LOCAL_COPY_HEADERS:= \ log_util.h \ linked_list.h \ msg_q.h \ + MsgTask.h \ + LocHeap.h \ + LocThread.h \ + LocTimer.h \ loc_target.h \ loc_timer.h \ - ../platform_lib_abstractions/platform_lib_includes.h \ - ../platform_lib_abstractions/platform_lib_time.h \ - ../platform_lib_abstractions/platform_lib_macros.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 +LOCAL_CLANG := false LOCAL_MODULE_TAGS := optional diff --git a/gps/utils/LocHeap.cpp b/gps/utils/LocHeap.cpp new file mode 100644 index 0000000..d667f14 --- /dev/null +++ b/gps/utils/LocHeap.cpp @@ -0,0 +1,354 @@ +/* Copyright (c) 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 + * 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 <LocHeap.h> + +class LocHeapNode { + friend class LocHeap; + + // size of of the subtree, excluding self, 1 if no subtree + int mSize; + LocHeapNode* mLeft; + LocHeapNode* mRight; + LocRankable* mData; +public: + inline LocHeapNode(LocRankable& data) : + mSize(1), mLeft(NULL), mRight(NULL), mData(&data) {} + ~LocHeapNode(); + + // this only swaps the data of the two nodes, so no + // detach / re-attached is necessary + void swap(LocHeapNode& node); + + LocRankable* detachData(); + + // push a node into the tree stucture, keeping sorted by rank + void push(LocHeapNode& node); + + // pop the head node out of the tree stucture. keeping sorted by rank + static LocHeapNode* pop(LocHeapNode*& top); + + // remove a specific node from the tree + // returns the pointer to the node removed, which would be either the + // same as input (if successfully removed); or NULL (if failed). + static LocHeapNode* remove(LocHeapNode*& top, LocRankable& data); + + // convenience method to compare data ranking + inline bool outRanks(LocHeapNode& node) { return mData->outRanks(*node.mData); } + inline bool outRanks(LocRankable& data) { return mData->outRanks(data); } + + // checks if mSize is correct, AND this node is the highest ranking + // of the entire subtree + bool checkNodes(); + + inline int getSize() { return mSize; } +}; + +inline +LocHeapNode::~LocHeapNode() { + if (mLeft) { + delete mLeft; + mLeft = NULL; + } + if (mRight) { + delete mRight; + mRight = NULL; + } + if (mData) { + mData = NULL; + } +} + +inline +void LocHeapNode::swap(LocHeapNode& node) { + LocRankable* tmpData = node.mData; + node.mData = mData; + mData = tmpData; +} + +inline +LocRankable* LocHeapNode::detachData() { + LocRankable* data = mData; + mData = NULL; + return data; +} + +// push keeps the tree sorted by rank, it also tries to balance the +// tree by adding the new node to the smaller of the subtrees. +// The pointer to the tree and internal links never change. If the +// mData of tree top ranks lower than that of the incoming node, +// mData will be swapped with that of the incoming node to ensure +// ranking, no restructuring the container nodes. +void LocHeapNode::push(LocHeapNode& node) { + // ensure the current node ranks higher than in the incoming one + if (node.outRanks(*this)) { + swap(node); + } + + // now drop the new node (ensured lower than *this) into a subtree + if (NULL == mLeft) { + mLeft = &node; + } else if (NULL == mRight) { + mRight = &node; + } else if (mLeft->mSize <= mRight->mSize) { + mLeft->push(node); + } else { + mRight->push(node); + } + mSize++; +} + +// pop keeps the tree sorted by rank, but it does not try to balance +// the tree. It recursively swaps with the higher ranked top of the +// subtrees. +// The return is a popped out node from leaf level, that has the data +// swapped all the way down from the top. The pinter to the tree and +// internal links will not be changed or restructured, except for the +// node that is popped out. +// If the return pointer == this, this the last node in the tree. +LocHeapNode* LocHeapNode::pop(LocHeapNode*& top) { + // we know the top has the highest ranking at this point, else + // the tree is broken. This top will be popped out. But we need + // a node from the left or right child, whichever ranks higher, + // to replace the current top. This then will need to be done + // recursively to the leaf level. So we swap the mData of the + // current top node all the way down to the leaf level. + LocHeapNode* poppedNode = top; + // top is losing a node in its subtree + top->mSize--; + if (top->mLeft || top->mRight) { + // if mLeft is NULL, mRight for sure is NOT NULL, take that; + // else if mRight is NULL, mLeft for sure is NOT, take that; + // else we take the address of whatever has higher ranking mData + LocHeapNode*& subTop = (NULL == top->mLeft) ? top->mRight : + ((NULL == top->mRight) ? top->mLeft : + (top->mLeft->outRanks(*(top->mRight)) ? top->mLeft : top->mRight)); + // swap mData, the tree top gets updated with the new data. + top->swap(*subTop); + // pop out from the subtree + poppedNode = pop(subTop); + } else { + // if the top has only single node + // detach the poppedNode from the tree + // subTop is the reference of ether mLeft or mRight + // NOT a local stack pointer. so it MUST be NULL'ed here. + top = NULL; + } + + return poppedNode; +} + +// navigating through the tree and find the node that hass the input +// data. Since this is a heap, we do recursive linear search. +// returns the pointer to the node removed, which would be either the +// same as input (if successfully removed); or NULL (if failed). +LocHeapNode* LocHeapNode::remove(LocHeapNode*& top, LocRankable& data) { + LocHeapNode* removedNode = NULL; + // this is the node, by address + if (&data == (LocRankable*)(top->mData)) { + // pop this node out + removedNode = pop(top); + } else if (!data.outRanks(*top->mData)) { + // subtrees might have this node + if (top->mLeft) { + removedNode = remove(top->mLeft, data); + } + // if we did not find in mLeft, and mRight is not empty + if (!removedNode && top->mRight) { + removedNode = remove(top->mRight, data); + } + + // top lost a node in its subtree + if (removedNode) { + top->mSize--; + } + } + + return removedNode; +} + +// checks if mSize is correct, AND this node is the highest ranking +// of the entire subtree +bool LocHeapNode::checkNodes() { + // size of the current subtree + int totalSize = mSize; + if (mLeft) { + // check the consistency of left subtree + if (mLeft->outRanks(*this) || !mLeft->checkNodes()) { + return false; + } + // subtract the size of left subtree (with subtree head) + totalSize -= mLeft->mSize; + } + + if (mRight) { + // check the consistency of right subtree + if (mRight->outRanks(*this) || !mRight->checkNodes()) { + return false; + } + // subtract the size of right subtree (with subtree head) + totalSize -= mRight->mSize; + } + + // for the tree nodes to consistent, totalSize must be 1 now + return totalSize == 1; +} + +LocHeap::~LocHeap() { + if (mTree) { + delete mTree; + } +} + +void LocHeap::push(LocRankable& node) { + LocHeapNode* heapNode = new LocHeapNode(node); + if (!mTree) { + mTree = heapNode; + } else { + mTree->push(*heapNode); + } +} + +LocRankable* LocHeap::peek() { + LocRankable* top = NULL; + if (mTree) { + top = mTree->mData; + } + return top; +} + +LocRankable* LocHeap::pop() { + LocRankable* locNode = NULL; + if (mTree) { + // mTree may become NULL after this call + LocHeapNode* heapNode = LocHeapNode::pop(mTree); + locNode = heapNode->detachData(); + delete heapNode; + } + return locNode; +} + +LocRankable* LocHeap::remove(LocRankable& rankable) { + LocRankable* locNode = NULL; + if (mTree) { + // mTree may become NULL after this call + LocHeapNode* heapNode = LocHeapNode::remove(mTree, rankable); + if (heapNode) { + locNode = heapNode->detachData(); + delete heapNode; + } + } + return locNode; +} + +#ifdef __LOC_UNIT_TEST__ +bool LocHeap::checkTree() { + return ((NULL == mTree) || mTree->checkNodes()); +} +uint32_t LocHeap::getTreeSize() { + return (NULL == mTree) ? 0 : mTree->getSize(); +} +#endif + +#ifdef __LOC_DEBUG__ + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> + +class LocHeapDebug : public LocHeap { +public: + bool checkTree() { + return ((NULL == mTree) || mTree->checkNodes()); + } + + uint32_t getTreeSize() { + return (NULL == mTree) ? 0 : (mTree->getSize()); + } +}; + +class LocHeapDebugData : public LocRankable { + const int mID; +public: + LocHeapDebugData(int id) : mID(id) {} + inline virtual int ranks(LocRankable& rankable) { + LocHeapDebugData* testData = dynamic_cast<LocHeapDebugData*>(&rankable); + return testData->mID - mID; + } +}; + +// For Linux command line testing: +// compilation: g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -I. -I../../../../vendor/qcom/proprietary/gps-internal/unit-tests/fakes_for_host -I../../../../system/core/include LocHeap.cpp +// test: valgrind --leak-check=full ./a.out 100 +int main(int argc, char** argv) { + srand(time(NULL)); + int tries = atoi(argv[1]); + int checks = tries >> 3; + LocHeapDebug heap; + int treeSize = 0; + + for (int i = 0; i < tries; i++) { + if (i % checks == 0 && !heap.checkTree()) { + printf("tree check failed before %dth op\n", i); + } + int r = rand(); + + if (r & 1) { + LocHeapDebugData* data = new LocHeapDebugData(r >> 1); + heap.push(dynamic_cast<LocRankable&>(*data)); + treeSize++; + } else { + LocRankable* rankable = heap.pop(); + if (rankable) { + delete rankable; + } + treeSize ? treeSize-- : 0; + } + + printf("%s: %d == %d\n", (r&1)?"push":"pop", treeSize, heap.getTreeSize()); + if (treeSize != heap.getTreeSize()) { + printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); + tries = i+1; + break; + } + } + + if (!heap.checkTree()) { + printf("!!!!!!!!!!tree check failed at the end after %d ops!!!!!!!\n", tries); + } else { + printf("success!\n"); + } + + for (LocRankable* data = heap.pop(); NULL != data; data = heap.pop()) { + delete data; + } + + return 0; +} + +#endif diff --git a/gps/utils/LocHeap.h b/gps/utils/LocHeap.h new file mode 100644 index 0000000..b491948 --- /dev/null +++ b/gps/utils/LocHeap.h @@ -0,0 +1,96 @@ +/* Copyright (c) 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 + * 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_HEAP__ +#define __LOC_HEAP__ + +#include <stddef.h> +#include <string.h> + +// abstract class to be implemented by client to provide a rankable class +class LocRankable { +public: + virtual inline ~LocRankable() {} + + // method to rank objects of such type for sorting purposes. + // The pointer of the input node would be stored in the heap. + // >0 if ranks higher than the input; + // ==0 if equally ranks with the input; + // <0 if ranks lower than the input + virtual int ranks(LocRankable& rankable) = 0; + + // convenient method to rank objects of such type for sorting purposes. + inline bool outRanks(LocRankable& rankable) { return ranks(rankable) > 0; } +}; + +// opaque class to provide service implementation. +class LocHeapNode; + +// a heap whose left and right children are not sorted. It is sorted only vertically, +// i.e. parent always ranks higher than children, if they exist. Ranking algorithm is +// implemented in Rankable. The reason that there is no sort between children is to +// help beter balance the tree with lower cost. When a node is pushed to the tree, +// it is guaranteed that the subtree that is smaller gets to have the new node. +class LocHeap { +protected: + LocHeapNode* mTree; +public: + inline LocHeap() : mTree(NULL) {} + ~LocHeap(); + + // push keeps the tree sorted by rank, it also tries to balance the + // tree by adding the new node to the smaller of the subtrees. + // node is reference to an obj that is managed by client, that client + // creates and destroyes. The destroy should happen after the + // node is popped out from the heap. + void push(LocRankable& node); + + // Peeks the node data on tree top, which has currently the highest ranking + // There is no change the tree structure with this operation + // Returns NULL if the tree is empty, otherwise pointer to the node data of + // the tree top. + LocRankable* peek(); + + // pop keeps the tree sorted by rank, but it does not try to balance + // the tree. + // Return - pointer to the node popped out, or NULL if heap is already empty + LocRankable* pop(); + + // navigating through the tree and find the node that ranks the same + // as the input data, then remove it from the tree. Rank is implemented + // by rankable obj. + // returns the pointer to the node removed; or NULL (if failed). + LocRankable* remove(LocRankable& rankable); + +#ifdef __LOC_UNIT_TEST__ + bool checkTree(); + uint32_t getTreeSize(); +#endif +}; + +#endif //__LOC_HEAP__ diff --git a/gps/utils/LocSharedLock.h b/gps/utils/LocSharedLock.h new file mode 100644 index 0000000..6b9e27f --- /dev/null +++ b/gps/utils/LocSharedLock.h @@ -0,0 +1,58 @@ +/* Copyright (c) 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 + * 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_SHARED_LOCK__ +#define __LOC_SHARED_LOCK__ + +#include <stddef.h> +#include <pthread.h> + +// This is a utility created for use cases such that there are more than +// one client who need to share the same lock, but it is not predictable +// which of these clients is to last to go away. This shared lock deletes +// itself when the last client calls its drop() method. To add a cient, +// this share lock's share() method has to be called, so that the obj +// can maintain an accurate client count. +class LocSharedLock { + uint32_t mRef; + pthread_mutex_t mMutex; + inline ~LocSharedLock() { pthread_mutex_destroy(&mMutex); } +public: + // first client to create this LockSharedLock + inline LocSharedLock() : mRef(1) { pthread_mutex_init(&mMutex, NULL); } + // following client(s) are to *share()* this lock created by the first client + inline LocSharedLock* share() { mRef++; return this; } + // whe a client no longer needs this shared lock, drop() shall be called. + inline void drop() { if (0 == --mRef) delete this; } + // locking the lock to enter critical section + inline void lock() { pthread_mutex_lock(&mMutex); } + // unlocking the lock to leave the critical section + inline void unlock() { pthread_mutex_unlock(&mMutex); } +}; + +#endif //__LOC_SHARED_LOCK__ diff --git a/gps/utils/LocThread.cpp b/gps/utils/LocThread.cpp new file mode 100644 index 0000000..19bf101 --- /dev/null +++ b/gps/utils/LocThread.cpp @@ -0,0 +1,264 @@ +/* Copyright (c) 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 + * 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 <LocThread.h> +#include <string.h> +#include <pthread.h> + +class LocThreadDelegate { + LocRunnable* mRunnable; + bool mJoinable; + pthread_t mThandle; + pthread_mutex_t mMutex; + int mRefCount; + ~LocThreadDelegate(); + LocThreadDelegate(LocThread::tCreate creator, const char* threadName, + LocRunnable* runnable, bool joinable); + void destroy(); +public: + static LocThreadDelegate* create(LocThread::tCreate creator, + const char* threadName, LocRunnable* runnable, bool joinable); + void stop(); + // bye() is for the parent thread to go away. if joinable, + // parent must stop the spawned thread, join, and then + // destroy(); if detached, the parent can go straight + // ahead to destroy() + inline void bye() { mJoinable ? stop() : destroy(); } + inline bool isRunning() { return (NULL != mRunnable); } + static void* threadMain(void* arg); +}; + +// it is important to note that internal members must be +// initialized to values as if pthread_create succeeds. +// This is to avoid the race condition between the threads, +// once the thread is created, some of these values will +// be check in the spawned thread, and must set correctly +// then and there. +// However, upon pthread_create failure, the data members +// must be set to indicate failure, e.g. mRunnable, and +// threashold approprietly for destroy(), e.g. mRefCount. +LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator, + const char* threadName, LocRunnable* runnable, bool joinable) : + mRunnable(runnable), mJoinable(joinable), mThandle(NULL), + mMutex(PTHREAD_MUTEX_INITIALIZER), mRefCount(2) { + + // set up thread name, if nothing is passed in + if (!threadName) { + threadName = "LocThread"; + } + + // create the thread here, then if successful + // and a name is given, we set the thread name + if (creator) { + mThandle = creator(threadName, threadMain, this); + } else if (pthread_create(&mThandle, NULL, threadMain, this)) { + // pthread_create() failed + mThandle = NULL; + } + + if (mThandle) { + // set thread name + char lname[16]; + int len = sizeof(lname) - 1; + memcpy(lname, threadName, len); + lname[len] = 0; + // set the thread name here + pthread_setname_np(mThandle, lname); + + // detach, if not joinable + if (!joinable) { + pthread_detach(mThandle); + } + } else { + // must set these values upon failure + mRunnable = NULL; + mJoinable = false; + mRefCount = 1; + } +} + +inline +LocThreadDelegate::~LocThreadDelegate() { + // at this point nothing should need done any more +} + +// factory method so that we could return NULL upon failure +LocThreadDelegate* LocThreadDelegate::create(LocThread::tCreate creator, + const char* threadName, LocRunnable* runnable, bool joinable) { + LocThreadDelegate* thread = NULL; + if (runnable) { + thread = new LocThreadDelegate(creator, threadName, runnable, joinable); + if (thread && !thread->isRunning()) { + thread->destroy(); + thread = NULL; + } + } + + return thread; +} + +// The order is importang +// NULLing mRunnalbe stops the while loop in threadMain() +// join() if mJoinble must come before destroy() call, as +// the obj must remain alive at this time so that mThandle +// remains valud. +void LocThreadDelegate::stop() { + // mRunnable and mJoinable are reset on different triggers. + // mRunnable may get nulled on the spawned thread's way out; + // or here. + // mJouinable (if ever been true) gets falsed when client + // thread triggers stop, with either a stop() + // call or the client releases thread obj handle. + if (mRunnable) { + mRunnable = NULL; + } + if (mJoinable) { + mJoinable = false; + pthread_join(mThandle, NULL); + } + // call destroy() to possibly delete the obj + destroy(); +} + +// method for clients to call to release the obj +// when it is a detached thread, the client thread +// and the spawned thread can both try to destroy() +// asynchronously. And we delete this obj when +// mRefCount becomes 0. +void LocThreadDelegate::destroy() { + // else case shouldn't happen, unless there is a + // leaking obj. But only our code here has such + // obj, so if we test our code well, else case + // will never happen + if (mRefCount > 0) { + // we need a flag on the stack + bool callDelete = false; + + // critical section between threads + pthread_mutex_lock(&mMutex); + // last destroy() call + callDelete = (1 == mRefCount--); + pthread_mutex_unlock(&mMutex); + + // upon last destroy() call we delete this obj + if (callDelete) { + delete this; + } + } +} + +void* LocThreadDelegate::threadMain(void* arg) { + LocThreadDelegate* locThread = (LocThreadDelegate*)(arg); + + if (locThread) { + LocRunnable* runnable = locThread->mRunnable; + + if (runnable) { + if (locThread->isRunning()) { + runnable->prerun(); + } + + while (locThread->isRunning() && runnable->run()); + + if (locThread->isRunning()) { + runnable->postrun(); + } + + // at this time, locThread->mRunnable may or may not be NULL + // NULL it just to be safe and clean, as we want the field + // in the released memory slot to be NULL. + locThread->mRunnable = NULL; + delete runnable; + } + locThread->destroy(); + } + + return NULL; +} + +LocThread::~LocThread() { + if (mThread) { + mThread->bye(); + mThread = NULL; + } +} + +bool LocThread::start(tCreate creator, const char* threadName, LocRunnable* runnable, bool joinable) { + bool success = false; + if (!mThread) { + mThread = LocThreadDelegate::create(creator, threadName, runnable, joinable); + // true only if thread is created successfully + success = (NULL != mThread); + } + return success; +} + +void LocThread::stop() { + if (mThread) { + mThread->stop(); + mThread = NULL; + } +} + +#ifdef __LOC_DEBUG__ + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +class LocRunnableTest1 : public LocRunnable { + int mID; +public: + LocRunnableTest1(int id) : LocRunnable(), mID(id) {} + virtual bool run() { + printf("LocRunnableTest1: %d\n", mID++); + sleep(1); + return true; + } +}; + +// on linux command line: +// compile: g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -std=c++0x -I. -I../../../../vendor/qcom/proprietary/gps-internal/unit-tests/fakes_for_host -I../../../../system/core/include -lpthread LocThread.cpp +// test detached thread: valgrind ./a.out 0 +// test joinable thread: valgrind ./a.out 1 +int main(int argc, char** argv) { + LocRunnableTest1 test(10); + + LocThread thread; + thread.start("LocThreadTest", test, atoi(argv[1])); + + sleep(10); + + thread.stop(); + + sleep(5); + + return 0; +} + +#endif diff --git a/gps/utils/LocThread.h b/gps/utils/LocThread.h new file mode 100644 index 0000000..2a65d8f --- /dev/null +++ b/gps/utils/LocThread.h @@ -0,0 +1,92 @@ +/* Copyright (c) 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 + * 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_THREAD__ +#define __LOC_THREAD__ + +#include <stddef.h> +#include <pthread.h> + +// abstract class to be implemented by client to provide a runnable class +// which gets scheduled by LocThread +class LocRunnable { +public: + inline LocRunnable() {} + inline virtual ~LocRunnable() {} + + // The method to be implemented by thread clients + // and be scheduled by LocThread + // This method will be repeated called until it returns false; or + // until thread is stopped. + virtual bool run() = 0; + + // The method to be run before thread loop (conditionally repeatedly) + // calls run() + inline virtual void prerun() {} + + // The method to be run after thread loop (conditionally repeatedly) + // calls run() + inline virtual void postrun() {} +}; + +// opaque class to provide service implementation. +class LocThreadDelegate; + +// A utility class to create a thread and run LocRunnable +// caller passes in. +class LocThread { + LocThreadDelegate* mThread; +public: + inline LocThread() : mThread(NULL) {} + virtual ~LocThread(); + + typedef pthread_t (*tCreate)(const char* name, void* (*start)(void*), void* arg); + // client starts thread with a runnable, which implements + // the logics to fun in the created thread context. + // The thread could be either joinable or detached. + // runnable is an obj managed by client. Client creates and + // frees it (but must be after stop() is called, or + // this LocThread obj is deleted). + // The obj will be deleted by LocThread if start() + // returns true. Else it is client's responsibility + // to delete the object + // Returns 0 if success; false if failure. + bool start(tCreate creator, const char* threadName, LocRunnable* runnable, bool joinable = true); + inline bool start(const char* threadName, LocRunnable* runnable, bool joinable = true) { + return start(NULL, threadName, runnable, joinable); + } + + // NOTE: if this is a joinable thread, this stop may block + // for a while until the thread is joined. + void stop(); + + // thread status check + inline bool isRunning() { return NULL != mThread; } +}; + +#endif //__LOC_THREAD__ diff --git a/gps/utils/LocTimer.cpp b/gps/utils/LocTimer.cpp new file mode 100644 index 0000000..70904b2 --- /dev/null +++ b/gps/utils/LocTimer.cpp @@ -0,0 +1,737 @@ +/* Copyright (c) 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 + * 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 <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <errno.h> +#include <loc_timer.h> +#include <sys/timerfd.h> +#include <sys/epoll.h> +#include <LocTimer.h> +#include <LocHeap.h> +#include <LocThread.h> +#include <LocSharedLock.h> +#include <MsgTask.h> + +#ifdef __HOST_UNIT_TEST__ +#define EPOLLWAKEUP 0 +#define CLOCK_BOOTTIME CLOCK_MONOTONIC +#define CLOCK_BOOTTIME_ALARM CLOCK_MONOTONIC +#endif + +/* +There are implementations of 5 classes in this file: +LocTimer, LocTimerDelegate, LocTimerContainer, LocTimerPollTask, LocTimerWrapper + +LocTimer - client front end, interface for client to start / stop timers, also + to provide a callback. +LocTimerDelegate - an internal timer entity, which also is a LocRankable obj. + Its life cycle is different than that of LocTimer. It gets + created when LocTimer::start() is called, and gets deleted + when it expires or clients calls the hosting LocTimer obj's + stop() method. When a LocTimerDelegate obj is ticking, it + stays in the corresponding LocTimerContainer. When expired + or stopped, the obj is removed from the container. Since it + is also a LocRankable obj, and LocTimerContainer also is a + heap, its ranks() implementation decides where it is placed + in the heap. +LocTimerContainer - core of the timer service. It is a container (derived from + LocHeap) for LocTimerDelegate (implements LocRankable) objs. + There are 2 of such containers, one for sw timers (or Linux + timers) one for hw timers (or Linux alarms). It adds one of + each (those that expire the soonest) to kernel via services + provided by LocTimerPollTask. All the heap management on the + LocTimerDelegate objs are done in the MsgTask context, such + that synchronization is ensured. +LocTimerPollTask - is a class that wraps timerfd and epoll POXIS APIs. It also + both implements LocRunnalbe with epoll_wait() in the run() + method. It is also a LocThread client, so as to loop the run + method. +LocTimerWrapper - a LocTimer client itself, to implement the existing C API with + APIs, loc_timer_start() and loc_timer_stop(). + +*/ + +class LocTimerPollTask; + +// This is a multi-functaional class that: +// * extends the LocHeap class for the detection of head update upon add / remove +// events. When that happens, soonest time out changes, so timerfd needs update. +// * contains the timers, and add / remove them into the heap +// * provides and maps 2 of such containers, one for timers (or mSwTimers), one +// for alarms (or mHwTimers); +// * provides a polling thread; +// * provides a MsgTask thread for synchronized add / remove / timer client callback. +class LocTimerContainer : public LocHeap { + // mutex to synchronize getters of static members + static pthread_mutex_t mMutex; + // Container of timers + static LocTimerContainer* mSwTimers; + // Container of alarms + static LocTimerContainer* mHwTimers; + // Msg task to provider msg Q, sender and reader. + static MsgTask* mMsgTask; + // Poll task to provide epoll call and threading to poll. + static LocTimerPollTask* mPollTask; + // timer / alarm fd + int mDevFd; + // ctor + LocTimerContainer(bool wakeOnExpire); + // dtor + ~LocTimerContainer(); + static MsgTask* getMsgTaskLocked(); + static LocTimerPollTask* getPollTaskLocked(); + // extend LocHeap and pop if the top outRanks input + LocTimerDelegate* popIfOutRanks(LocTimerDelegate& timer); + // update the timer POSIX calls with updated soonest timer spec + void updateSoonestTime(LocTimerDelegate* priorTop); + +public: + // factory method to control the creation of mSwTimers / mHwTimers + static LocTimerContainer* get(bool wakeOnExpire); + + LocTimerDelegate* getSoonestTimer(); + int getTimerFd(); + // add a timer / alarm obj into the container + void add(LocTimerDelegate& timer); + // remove a timer / alarm obj from the container + void remove(LocTimerDelegate& timer); + // handling of timer / alarm expiration + void expire(); +}; + +// This class implements the polling thread that epolls imer / alarm fds. +// The LocRunnable::run() contains the actual polling. The other methods +// will be run in the caller's thread context to add / remove timer / alarm +// fds the kernel, while the polling is blocked on epoll_wait() call. +// Since the design is that we have maximally 2 polls, one for all the +// timers; one for all the alarms, we will poll at most on 2 fds. But it +// is possile that all we have are only timers or alarms at one time, so we +// allow dynamically add / remove fds we poll on. The design decision of +// having 1 fd per container of timer / alarm is such that, we may not need +// to make a system call each time a timer / alarm is added / removed, unless +// that changes the "soonest" time out of that of all the timers / alarms. +class LocTimerPollTask : public LocRunnable { + // the epoll fd + const int mFd; + // the thread that calls run() method + LocThread* mThread; + friend class LocThreadDelegate; + // dtor + ~LocTimerPollTask(); +public: + // ctor + LocTimerPollTask(); + // this obj will be deleted once thread is deleted + void destroy(); + // add a container of timers. Each contain has a unique device fd, i.e. + // either timer or alarm fd, and a heap of timers / alarms. It is expected + // that container would have written to the device fd with the soonest + // time out value in the heap at the time of calling this method. So all + // this method does is to add the fd of the input container to the poll + // and also add the pointer of the container to the event data ptr, such + // when poll_wait wakes up on events, we know who is the owner of the fd. + void addPoll(LocTimerContainer& timerContainer); + // remove a fd that is assciated with a container. The expectation is that + // the atual timer would have been removed from the container. + void removePoll(LocTimerContainer& timerContainer); + // The polling thread context will call this method. This is where + // epoll_wait() is blocking and waiting for events.. + virtual bool run(); +}; + +// Internal class of timer obj. It gets born when client calls LocTimer::start(); +// and gets deleted when client calls LocTimer::stop() or when the it expire()'s. +// This class implements LocRankable::ranks() so that when an obj is added into +// the container (of LocHeap), it gets placed in sorted order. +class LocTimerDelegate : public LocRankable { + friend class LocTimerContainer; + friend class LocTimer; + LocTimer* mClient; + LocSharedLock* mLock; + struct timespec mFutureTime; + LocTimerContainer* mContainer; + // not a complete obj, just ctor for LocRankable comparisons + inline LocTimerDelegate(struct timespec& delay) + : mClient(NULL), mLock(NULL), mFutureTime(delay), mContainer(NULL) {} + inline ~LocTimerDelegate() { if (mLock) { mLock->drop(); mLock = NULL; } } +public: + LocTimerDelegate(LocTimer& client, struct timespec& futureTime, bool wakeOnExpire); + void destroyLocked(); + // LocRankable virtual method + virtual int ranks(LocRankable& rankable); + void expire(); + inline struct timespec getFutureTime() { return mFutureTime; } +}; + +/***************************LocTimerContainer methods***************************/ + +// Most of these static recources are created on demand. They however are never +// destoyed. The theory is that there are processes that link to this util lib +// but never use timer, then these resources would never need to be created. +// For those processes that do use timer, it will likely also need to every +// once in a while. It might be cheaper keeping them around. +pthread_mutex_t LocTimerContainer::mMutex = PTHREAD_MUTEX_INITIALIZER; +LocTimerContainer* LocTimerContainer::mSwTimers = NULL; +LocTimerContainer* LocTimerContainer::mHwTimers = NULL; +MsgTask* LocTimerContainer::mMsgTask = NULL; +LocTimerPollTask* LocTimerContainer::mPollTask = NULL; + +// ctor - initialize timer heaps +// A container for swTimer (timer) is created, when wakeOnExpire is true; or +// HwTimer (alarm), when wakeOnExpire is false. +LocTimerContainer::LocTimerContainer(bool wakeOnExpire) : + mDevFd(timerfd_create(wakeOnExpire ? CLOCK_BOOTTIME_ALARM : CLOCK_BOOTTIME, 0)) { + + if ((-1 == mDevFd) && (errno == EINVAL)) { + LOC_LOGW("%s: timerfd_create failure, fallback to CLOCK_MONOTONIC - %s", + __FUNCTION__, strerror(errno)); + mDevFd = timerfd_create(CLOCK_MONOTONIC, 0); + } + + if (-1 != mDevFd) { + // ensure we have the necessary resources created + LocTimerContainer::getPollTaskLocked(); + LocTimerContainer::getMsgTaskLocked(); + } else { + LOC_LOGE("%s: timerfd_create failure - %s", __FUNCTION__, strerror(errno)); + } +} + +// dtor +// we do not ever destroy the static resources. +inline +LocTimerContainer::~LocTimerContainer() { + close(mDevFd); +} + +LocTimerContainer* LocTimerContainer::get(bool wakeOnExpire) { + // get the reference of either mHwTimer or mSwTimers per wakeOnExpire + LocTimerContainer*& container = wakeOnExpire ? mHwTimers : mSwTimers; + // it is cheap to check pointer first than locking mutext unconditionally + if (!container) { + pthread_mutex_lock(&mMutex); + // let's check one more time to be safe + if (!container) { + container = new LocTimerContainer(wakeOnExpire); + // timerfd_create failure + if (-1 == container->getTimerFd()) { + delete container; + container = NULL; + } + } + pthread_mutex_unlock(&mMutex); + } + return container; +} + +MsgTask* LocTimerContainer::getMsgTaskLocked() { + // it is cheap to check pointer first than locking mutext unconditionally + if (!mMsgTask) { + mMsgTask = new MsgTask("LocTimerMsgTask", false); + } + return mMsgTask; +} + +LocTimerPollTask* LocTimerContainer::getPollTaskLocked() { + // it is cheap to check pointer first than locking mutext unconditionally + if (!mPollTask) { + mPollTask = new LocTimerPollTask(); + } + return mPollTask; +} + +inline +LocTimerDelegate* LocTimerContainer::getSoonestTimer() { + return (LocTimerDelegate*)(peek()); +} + +inline +int LocTimerContainer::getTimerFd() { + return mDevFd; +} + +void LocTimerContainer::updateSoonestTime(LocTimerDelegate* priorTop) { + LocTimerDelegate* curTop = getSoonestTimer(); + + // check if top has changed + if (curTop != priorTop) { + struct itimerspec delay = {0}; + bool toSetTime = false; + // if tree is empty now, we remove poll and disarm timer + if (!curTop) { + mPollTask->removePoll(*this); + // setting the values to disarm timer + delay.it_value.tv_sec = 0; + delay.it_value.tv_nsec = 0; + toSetTime = true; + } else if (!priorTop || curTop->outRanks(*priorTop)) { + // do this first to avoid race condition, in case settime is called + // with too small an interval + mPollTask->addPoll(*this); + delay.it_value = curTop->getFutureTime(); + toSetTime = true; + } + if (toSetTime) { + timerfd_settime(getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); + } + } +} + +// all the heap management is done in the MsgTask context. +inline +void LocTimerContainer::add(LocTimerDelegate& timer) { + struct MsgTimerPush : public LocMsg { + LocTimerContainer* mTimerContainer; + LocHeapNode* mTree; + LocTimerDelegate* mTimer; + inline MsgTimerPush(LocTimerContainer& container, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mTimer(&timer) {} + inline virtual void proc() const { + LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); + mTimerContainer->push((LocRankable&)(*mTimer)); + mTimerContainer->updateSoonestTime(priorTop); + } + }; + + mMsgTask->sendMsg(new MsgTimerPush(*this, timer)); +} + +// all the heap management is done in the MsgTask context. +void LocTimerContainer::remove(LocTimerDelegate& timer) { + struct MsgTimerRemove : public LocMsg { + LocTimerContainer* mTimerContainer; + LocTimerDelegate* mTimer; + inline MsgTimerRemove(LocTimerContainer& container, LocTimerDelegate& timer) : + LocMsg(), mTimerContainer(&container), mTimer(&timer) {} + inline virtual void proc() const { + LocTimerDelegate* priorTop = mTimerContainer->getSoonestTimer(); + + // update soonest timer only if mTimer is actually removed from + // mTimerContainer AND mTimer is not priorTop. + if (priorTop == ((LocHeap*)mTimerContainer)->remove((LocRankable&)*mTimer)) { + // if passing in NULL, we tell updateSoonestTime to update + // kernel with the current top timer interval. + mTimerContainer->updateSoonestTime(NULL); + } + // all timers are deleted here, and only here. + delete mTimer; + } + }; + + mMsgTask->sendMsg(new MsgTimerRemove(*this, timer)); +} + +// all the heap management is done in the MsgTask context. +// Upon expire, we check and continuously pop the heap until +// the top node's timeout is in the future. +void LocTimerContainer::expire() { + struct MsgTimerExpire : public LocMsg { + LocTimerContainer* mTimerContainer; + inline MsgTimerExpire(LocTimerContainer& container) : + LocMsg(), mTimerContainer(&container) {} + inline virtual void proc() const { + struct timespec now; + // get time spec of now + clock_gettime(CLOCK_BOOTTIME, &now); + LocTimerDelegate timerOfNow(now); + // pop everything in the heap that outRanks now, i.e. has time older than now + // and then call expire() on that timer. + for (LocTimerDelegate* timer = (LocTimerDelegate*)mTimerContainer->pop(); + NULL != timer; + timer = mTimerContainer->popIfOutRanks(timerOfNow)) { + // the timer delegate obj will be deleted before the return of this call + timer->expire(); + } + mTimerContainer->updateSoonestTime(NULL); + } + }; + + struct itimerspec delay = {0}; + timerfd_settime(getTimerFd(), TFD_TIMER_ABSTIME, &delay, NULL); + mPollTask->removePoll(*this); + mMsgTask->sendMsg(new MsgTimerExpire(*this)); +} + +LocTimerDelegate* LocTimerContainer::popIfOutRanks(LocTimerDelegate& timer) { + LocTimerDelegate* poppedNode = NULL; + if (mTree && !timer.outRanks(*peek())) { + poppedNode = (LocTimerDelegate*)(pop()); + } + + return poppedNode; +} + + +/***************************LocTimerPollTask methods***************************/ + +inline +LocTimerPollTask::LocTimerPollTask() + : mFd(epoll_create(2)), mThread(new LocThread()) { + // before a next call returens, a thread will be created. The run() method + // could already be running in parallel. Also, since each of the objs + // creates a thread, the container will make sure that there will be only + // one of such obj for our timer implementation. + if (!mThread->start("LocTimerPollTask", this)) { + delete mThread; + mThread = NULL; + } +} + +inline +LocTimerPollTask::~LocTimerPollTask() { + // when fs is closed, epoll_wait() should fail run() should return false + // and the spawned thread should exit. + close(mFd); +} + +void LocTimerPollTask::destroy() { + if (mThread) { + LocThread* thread = mThread; + mThread = NULL; + delete thread; + } else { + delete this; + } +} + +void LocTimerPollTask::addPoll(LocTimerContainer& timerContainer) { + struct epoll_event ev; + memset(&ev, 0, sizeof(ev)); + + ev.events = EPOLLIN | EPOLLWAKEUP; + ev.data.fd = timerContainer.getTimerFd(); + // it is important that we set this context pointer with the input + // timer container this is how we know which container should handle + // which expiration. + ev.data.ptr = &timerContainer; + + epoll_ctl(mFd, EPOLL_CTL_ADD, timerContainer.getTimerFd(), &ev); +} + +inline +void LocTimerPollTask::removePoll(LocTimerContainer& timerContainer) { + epoll_ctl(mFd, EPOLL_CTL_DEL, timerContainer.getTimerFd(), NULL); +} + +// The polling thread context will call this method. If run() method needs to +// be repetitvely called, it must return true from the previous call. +bool LocTimerPollTask::run() { + struct epoll_event ev[2]; + + // we have max 2 descriptors to poll from + int fds = epoll_wait(mFd, ev, 2, -1); + + // we pretty much want to continually poll until the fd is closed + bool rerun = (fds > 0) || (errno == EINTR); + + if (fds > 0) { + // we may have 2 events + for (int i = 0; i < fds; i++) { + // each fd has a context pointer associated with the right timer container + LocTimerContainer* container = (LocTimerContainer*)(ev[i].data.ptr); + if (container) { + container->expire(); + } else { + epoll_ctl(mFd, EPOLL_CTL_DEL, ev[i].data.fd, NULL); + } + } + } + + // if rerun is true, we are requesting to be scheduled again + return rerun; +} + +/***************************LocTimerDelegate methods***************************/ + +inline +LocTimerDelegate::LocTimerDelegate(LocTimer& client, struct timespec& futureTime, bool wakeOnExpire) + : mClient(&client), + mLock(mClient->mLock->share()), + mFutureTime(futureTime), + mContainer(LocTimerContainer::get(wakeOnExpire)) { + // adding the timer into the container + mContainer->add(*this); +} + +inline +void LocTimerDelegate::destroyLocked() { + // client handle will likely be deleted soon after this + // method returns. Nulling this handle so that expire() + // won't call the callback on the dead handle any more. + mClient = NULL; + + if (mContainer) { + LocTimerContainer* container = mContainer; + mContainer = NULL; + if (container) { + container->remove(*this); + } + } // else we do not do anything. No such *this* can be + // created and reached here with mContainer ever been + // a non NULL. So *this* must have reached the if clause + // once, and we want it reach there only once. +} + +int LocTimerDelegate::ranks(LocRankable& rankable) { + int rank = -1; + LocTimerDelegate* timer = (LocTimerDelegate*)(&rankable); + if (timer) { + // larger time ranks lower!!! + // IOW, if input obj has bigger tv_sec, this obj outRanks higher + rank = timer->mFutureTime.tv_sec - mFutureTime.tv_sec; + } + return rank; +} + +inline +void LocTimerDelegate::expire() { + // keeping a copy of client pointer to be safe + // when timeOutCallback() is called at the end of this + // method, *this* obj may be already deleted. + LocTimer* client = mClient; + // force a stop, which will lead to delete of this obj + if (client && client->stop()) { + // calling client callback with a pointer save on the stack + // only if stop() returns true, i.e. it hasn't been stopped + // already. + client->timeOutCallback(); + } +} + + +/***************************LocTimer methods***************************/ +LocTimer::LocTimer() : mTimer(NULL), mLock(new LocSharedLock()) { +} + +LocTimer::~LocTimer() { + stop(); + if (mLock) { + mLock->drop(); + mLock = NULL; + } +} + +bool LocTimer::start(unsigned int timeOutInMs, bool wakeOnExpire) { + bool success = false; + mLock->lock(); + if (!mTimer) { + struct timespec futureTime; + clock_gettime(CLOCK_BOOTTIME, &futureTime); + futureTime.tv_sec += timeOutInMs / 1000; + futureTime.tv_nsec += (timeOutInMs % 1000) * 1000000; + if (futureTime.tv_nsec >= 1000000000) { + futureTime.tv_sec += futureTime.tv_nsec / 1000000000; + futureTime.tv_nsec %= 1000000000; + } + mTimer = new LocTimerDelegate(*this, futureTime, wakeOnExpire); + // if mTimer is non 0, success should be 0; or vice versa + success = (NULL != mTimer); + } + mLock->unlock(); + return success; +} + +bool LocTimer::stop() { + bool success = false; + mLock->lock(); + if (mTimer) { + LocTimerDelegate* timer = mTimer; + mTimer = NULL; + if (timer) { + timer->destroyLocked(); + success = true; + } + } + mLock->unlock(); + return success; +} + +/***************************LocTimerWrapper methods***************************/ +////////////////////////////////////////////////////////////////////////// +// This section below wraps for the C style APIs +////////////////////////////////////////////////////////////////////////// +class LocTimerWrapper : public LocTimer { + loc_timer_callback mCb; + void* mCallerData; + LocTimerWrapper* mMe; + static pthread_mutex_t mMutex; + inline ~LocTimerWrapper() { mCb = NULL; mMe = NULL; } +public: + inline LocTimerWrapper(loc_timer_callback cb, void* callerData) : + mCb(cb), mCallerData(callerData), mMe(this) { + } + void destroy() { + pthread_mutex_lock(&mMutex); + if (NULL != mCb && this == mMe) { + delete this; + } + pthread_mutex_unlock(&mMutex); + } + virtual void timeOutCallback() { + loc_timer_callback cb = mCb; + void* callerData = mCallerData; + if (cb) { + cb(callerData, 0); + } + destroy(); + } +}; + +pthread_mutex_t LocTimerWrapper::mMutex = PTHREAD_MUTEX_INITIALIZER; + +void* loc_timer_start(uint64_t msec, loc_timer_callback cb_func, + void *caller_data, bool wake_on_expire) +{ + LocTimerWrapper* locTimerWrapper = NULL; + + if (cb_func) { + locTimerWrapper = new LocTimerWrapper(cb_func, caller_data); + + if (locTimerWrapper) { + locTimerWrapper->start(msec, wake_on_expire); + } + } + + return locTimerWrapper; +} + +void loc_timer_stop(void*& handle) +{ + if (handle) { + LocTimerWrapper* locTimerWrapper = (LocTimerWrapper*)(handle); + locTimerWrapper->destroy(); + handle = NULL; + } +} + +////////////////////////////////////////////////////////////////////////// +// This section above wraps for the C style APIs +////////////////////////////////////////////////////////////////////////// + +#ifdef __LOC_DEBUG__ + +double getDeltaSeconds(struct timespec from, struct timespec to) { + return (double)to.tv_sec + (double)to.tv_nsec / 1000000000 + - from.tv_sec - (double)from.tv_nsec / 1000000000; +} + +struct timespec getNow() { + struct timespec now; + clock_gettime(CLOCK_BOOTTIME, &now); + return now; +} + +class LocTimerTest : public LocTimer, public LocRankable { + int mTimeOut; + const struct timespec mTimeOfBirth; + inline struct timespec getTimerWrapper(int timeout) { + struct timespec now; + clock_gettime(CLOCK_BOOTTIME, &now); + now.tv_sec += timeout; + return now; + } +public: + inline LocTimerTest(int timeout) : LocTimer(), LocRankable(), + mTimeOut(timeout), mTimeOfBirth(getTimerWrapper(0)) {} + inline virtual int ranks(LocRankable& rankable) { + LocTimerTest* timer = dynamic_cast<LocTimerTest*>(&rankable); + return timer->mTimeOut - mTimeOut; + } + inline virtual void timeOutCallback() { + printf("timeOutCallback() - "); + deviation(); + } + double deviation() { + struct timespec now = getTimerWrapper(0); + double delta = getDeltaSeconds(mTimeOfBirth, now); + printf("%lf: %lf\n", delta, delta * 100 / mTimeOut); + return delta / mTimeOut; + } +}; + +// For Linux command line testing: +// compilation: +// g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -I. -I../../../../system/core/include -o LocHeap.o LocHeap.cpp +// g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -std=c++0x -I. -I../../../../system/core/include -lpthread -o LocThread.o LocThread.cpp +// g++ -D__LOC_HOST_DEBUG__ -D__LOC_DEBUG__ -g -I. -I../../../../system/core/include -o LocTimer.o LocTimer.cpp +int main(int argc, char** argv) { + struct timespec timeOfStart=getNow(); + srand(time(NULL)); + int tries = atoi(argv[1]); + int checks = tries >> 3; + LocTimerTest** timerArray = new LocTimerTest*[tries]; + memset(timerArray, NULL, tries); + + for (int i = 0; i < tries; i++) { + int r = rand() % tries; + LocTimerTest* timer = new LocTimerTest(r); + if (timerArray[r]) { + if (!timer->stop()) { + printf("%lf:\n", getDeltaSeconds(timeOfStart, getNow())); + printf("ERRER: %dth timer, id %d, not running when it should be\n", i, r); + exit(0); + } else { + printf("stop() - %d\n", r); + delete timer; + timerArray[r] = NULL; + } + } else { + if (!timer->start(r, false)) { + printf("%lf:\n", getDeltaSeconds(timeOfStart, getNow())); + printf("ERRER: %dth timer, id %d, running when it should not be\n", i, r); + exit(0); + } else { + printf("stop() - %d\n", r); + timerArray[r] = timer; + } + } + } + + for (int i = 0; i < tries; i++) { + if (timerArray[i]) { + if (!timerArray[i]->stop()) { + printf("%lf:\n", getDeltaSeconds(timeOfStart, getNow())); + printf("ERRER: %dth timer, not running when it should be\n", i); + exit(0); + } else { + printf("stop() - %d\n", i); + delete timerArray[i]; + timerArray[i] = NULL; + } + } + } + + delete[] timerArray; + + return 0; +} + +#endif diff --git a/gps/utils/LocTimer.h b/gps/utils/LocTimer.h new file mode 100644 index 0000000..c146852 --- /dev/null +++ b/gps/utils/LocTimer.h @@ -0,0 +1,74 @@ +/* Copyright (c) 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 + * 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_TIMER_CPP_H__ +#define __LOC_TIMER_CPP_H__ + +#include <stddef.h> +#include <log_util.h> + +// opaque class to provide service implementation. +class LocTimerDelegate; +class LocSharedLock; + +// LocTimer client must extend this class and implementthe callback. +// start() / stop() methods are to arm / disarm timer. +class LocTimer +{ + LocTimerDelegate* mTimer; + LocSharedLock* mLock; + // don't really want mLock to be manipulated by clients, yet LocTimer + // has to have a reference to the lock so that the delete of LocTimer + // and LocTimerDelegate can work together on their share resources. + friend class LocTimerDelegate; + +public: + LocTimer(); + virtual ~LocTimer(); + + // timeOutInMs: timeout delay in ms + // wakeOnExpire: true if to wake up CPU (if sleeping) upon timer + // expiration and notify the client. + // false if to wait until next time CPU wakes up (if + // sleeping) and then notify the client. + // return: true on success; + // false on failure, e.g. timer is already running. + bool start(uint32_t timeOutInMs, bool wakeOnExpire); + + // return: true on success; + // false on failure, e.g. timer is not running. + bool stop(); + + // LocTimer client Should implement this method. + // This method is used for timeout calling back to client. This method + // should be short enough (eg: send a message to your own thread). + virtual void timeOutCallback() = 0; +}; + +#endif //__LOC_DELAY_H__ diff --git a/gps/utils/MsgTask.cpp b/gps/utils/MsgTask.cpp new file mode 100644 index 0000000..fdb1102 --- /dev/null +++ b/gps/utils/MsgTask.cpp @@ -0,0 +1,102 @@ +/* Copyright (c) 2011-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 + * 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. + * + */ +#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> + +static void LocMsgDestroy(void* msg) { + delete (LocMsg*)msg; +} + +MsgTask::MsgTask(LocThread::tCreate tCreator, + const char* threadName, bool joinable) : + mQ(msg_q_init2()), mThread(new LocThread()) { + if (!mThread->start(tCreator, threadName, this, joinable)) { + delete mThread; + mThread = NULL; + } +} + +MsgTask::MsgTask(const char* threadName, bool joinable) : + mQ(msg_q_init2()), mThread(new LocThread()) { + if (!mThread->start(threadName, this, joinable)) { + delete mThread; + mThread = NULL; + } +} + +MsgTask::~MsgTask() { + msg_q_flush((void*)mQ); + msg_q_destroy((void**)&mQ); +} + +void MsgTask::destroy() { + msg_q_unblock((void*)mQ); + if (mThread) { + LocThread* thread = mThread; + mThread = NULL; + delete thread; + } else { + delete this; + } +} + +void MsgTask::sendMsg(const LocMsg* msg) const { + msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy); +} + +void MsgTask::prerun() { + // make sure we do not run in background scheduling group + set_sched_policy(gettid(), SP_FOREGROUND); +} + +bool MsgTask::run() { + LOC_LOGD("MsgTask::loop() listening ...\n"); + LocMsg* msg; + msq_q_err_type result = msg_q_rcv((void*)mQ, (void **)&msg); + if (eMSG_Q_SUCCESS != result) { + LOC_LOGE("%s:%d] fail receiving msg: %s\n", __func__, __LINE__, + loc_get_msg_q_status(result)); + return false; + } + + msg->log(); + // there is where each individual msg handling is invoked + msg->proc(); + + delete msg; + + return true; +} diff --git a/gps/core/MsgTask.h b/gps/utils/MsgTask.h index d50bb31..9eb1f56 100644 --- a/gps/core/MsgTask.h +++ b/gps/utils/MsgTask.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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,12 +29,7 @@ #ifndef __MSG_TASK__ #define __MSG_TASK__ -#include <stdbool.h> -#include <ctype.h> -#include <string.h> -#include <pthread.h> - -namespace loc_core { +#include <LocThread.h> struct LocMsg { inline LocMsg() {} @@ -43,25 +38,30 @@ struct LocMsg { inline virtual void log() const {} }; -class MsgTask { +class MsgTask : public LocRunnable { + const void* mQ; + LocThread* mThread; + friend class LocThreadDelegate; +protected: + virtual ~MsgTask(); public: - typedef void* (*tStart)(void*); - typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg); - typedef int (*tAssociate)(); - MsgTask(tCreate tCreator, const char* threadName); - MsgTask(tAssociate tAssociator, const char* threadName); - ~MsgTask(); + MsgTask(LocThread::tCreate tCreator, const char* threadName = NULL, bool joinable = true); + MsgTask(const char* threadName = NULL, bool joinable = true); + // this obj will be deleted once thread is deleted + void destroy(); void sendMsg(const LocMsg* msg) const; - void associate(tAssociate tAssociator) const; + // Overrides of LocRunnable methods + // This method will be repeated called until it returns false; or + // until thread is stopped. + virtual bool run(); -private: - const void* mQ; - tAssociate mAssociator; - MsgTask(const void* q, tAssociate associator); - static void* loopMain(void* copy); - void createPThread(const char* name); -}; + // The method to be run before thread loop (conditionally repeatedly) + // calls run() + virtual void prerun(); -} // namespace loc_core + // The method to be run after thread loop (conditionally repeatedly) + // calls run() + inline virtual void postrun() {} +}; #endif //__MSG_TASK__ diff --git a/gps/utils/loc_cfg.cpp b/gps/utils/loc_cfg.cpp index 7ffe6a4..5c33320 100644 --- a/gps/utils/loc_cfg.cpp +++ b/gps/utils/loc_cfg.cpp @@ -52,8 +52,8 @@ *============================================================================*/ /* Parameter data */ -static uint8_t DEBUG_LEVEL = 0xff; -static uint8_t TIMESTAMP = 0; +static uint32_t DEBUG_LEVEL = 0xff; +static uint32_t TIMESTAMP = 0; /* Parameter spec table */ static loc_param_s_type loc_param_table[] = @@ -330,24 +330,25 @@ int loc_update_conf(const char* conf_data, int32_t length, // make a copy, so we do not tokenize the original data char* conf_copy = (char*)malloc(length+1); - if(conf_copy !=NULL) + if (conf_copy != NULL) { - memcpy(conf_copy, conf_data, length); - // we hard NULL the end of string to be safe - conf_copy[length] = 0; - } + memcpy(conf_copy, conf_data, length); + // we hard NULL the end of string to be safe + conf_copy[length] = 0; + + // start with one record off + uint32_t num_params = table_length - 1; + char* saveptr = NULL; + char* input_buf = strtok_r(conf_copy, "\n", &saveptr); + ret = 0; - // start with one record off - uint32_t num_params = table_length - 1; - char* saveptr = NULL; - char* input_buf = strtok_r(conf_copy, "\n", &saveptr); - ret = 0; - - LOC_LOGD("%s:%d]: num_params: %d\n", __func__, __LINE__, num_params); - while(num_params && input_buf) { - ret++; - num_params -= loc_fill_conf_item(input_buf, config_table, table_length); - input_buf = strtok_r(NULL, "\n", &saveptr); + LOC_LOGD("%s:%d]: num_params: %d\n", __func__, __LINE__, num_params); + while(num_params && input_buf) { + ret++; + num_params -= loc_fill_conf_item(input_buf, config_table, table_length); + input_buf = strtok_r(NULL, "\n", &saveptr); + } + free(conf_copy); } } diff --git a/gps/utils/loc_log.cpp b/gps/utils/loc_log.cpp index 18182b7..5500dea 100644 --- a/gps/utils/loc_log.cpp +++ b/gps/utils/loc_log.cpp @@ -51,6 +51,7 @@ const char FROM_MODEM[] = "<---"; const char TO_AFW[] = "<==="; const char EXIT_TAG[] = "Exiting"; const char ENTRY_TAG[] = "Entering"; +const char EXIT_ERROR_TAG[] = "Exiting with error"; /* Logging Mechanism */ loc_logger_s_type loc_logger; diff --git a/gps/utils/loc_target.cpp b/gps/utils/loc_target.cpp index 08f5584..faaedf6 100644 --- a/gps/utils/loc_target.cpp +++ b/gps/utils/loc_target.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-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,6 +29,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> diff --git a/gps/utils/loc_timer.c b/gps/utils/loc_timer.c deleted file mode 100644 index 2beca5f..0000000 --- a/gps/utils/loc_timer.c +++ /dev/null @@ -1,202 +0,0 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * 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<stdio.h> -#include<stdlib.h> -#include<sys/time.h> -#include "loc_timer.h" -#include<time.h> -#include<errno.h> - -enum timer_state { - READY = 100, - WAITING, - DONE, - ABORT -}; - -typedef struct { - loc_timer_callback callback_func; - void *user_data; - unsigned int time_msec; - pthread_cond_t timer_cond; - pthread_mutex_t timer_mutex; - enum timer_state state; -}timer_data; - -static void *timer_thread(void *thread_data) -{ - int ret = -ETIMEDOUT; - struct timespec ts; - struct timeval tv; - timer_data* t = (timer_data*)thread_data; - - LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t->time_msec); - - gettimeofday(&tv, NULL); - clock_gettime(CLOCK_REALTIME, &ts); - if(t->time_msec >= 1000) { - ts.tv_sec += t->time_msec/1000; - t->time_msec = t->time_msec % 1000; - } - if(t->time_msec) - ts.tv_nsec += t->time_msec * 1000000; - if(ts.tv_nsec > 999999999) { - LOC_LOGD("%s:%d]: Large nanosecs\n", __func__, __LINE__); - ts.tv_sec += 1; - ts.tv_nsec -= 1000000000; - } - LOC_LOGD("%s:%d]: ts.tv_sec:%d; ts.tv_nsec:%d\n" - "\t Current time: %d sec; %d nsec", - __func__, __LINE__, (int)ts.tv_sec, (int)ts.tv_nsec, - (int)tv.tv_sec, (int)tv.tv_usec*1000); - - pthread_mutex_lock(&(t->timer_mutex)); - if (READY == t->state) { - t->state = WAITING; - ret = pthread_cond_timedwait(&t->timer_cond, &t->timer_mutex, &ts); - t->state = DONE; - } - pthread_mutex_unlock(&(t->timer_mutex)); - - switch (ret) { - case ETIMEDOUT: - LOC_LOGV("%s:%d]: loc_timer timed out", __func__, __LINE__); - break; - case 0: - LOC_LOGV("%s:%d]: loc_timer stopped", __func__, __LINE__); - break; - case -ETIMEDOUT: - LOC_LOGV("%s:%d]: loc_timer cancelled", __func__, __LINE__); - break; - default: - LOC_LOGE("%s:%d]: Call to pthread timedwait failed; ret=%d\n", - __func__, __LINE__, ret); - break; - } - - if(ETIMEDOUT == ret) - t->callback_func(t->user_data, ret); - - // A (should be rare) race condition is that, when the loc_time_stop is called - // and acquired mutex, we reach here. pthread_mutex_destroy will fail with - // error code EBUSY. We give it 6 tries in 5 seconds. Should be eanough time - // for loc_timer_stop to complete. With the 7th try, we also perform unlock - // prior to destroy. - { - int i; - for (i = 0; EBUSY == pthread_mutex_destroy(&t->timer_mutex) && i <= 5; i++) { - if (i < 5) { - sleep(1); - } else { - // nah, forget it, something is seriously wrong. Mutex has been - // held too long. Unlock the mutext here. - pthread_mutex_unlock(&t->timer_mutex); - } - } - } - pthread_cond_destroy(&t->timer_cond); - - free(t); - LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return NULL; -} - -void* loc_timer_start(unsigned int msec, loc_timer_callback cb_func, - void* caller_data) -{ - timer_data *t=NULL; - pthread_attr_t tattr; - pthread_t id; - LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__); - if(cb_func == NULL || msec == 0) { - LOC_LOGE("%s:%d]: Error: Wrong parameters\n", __func__, __LINE__); - goto _err; - } - t = (timer_data *)calloc(1, sizeof(timer_data)); - if(t == NULL) { - LOC_LOGE("%s:%d]: Could not allocate memory. Failing.\n", - __func__, __LINE__); - goto _err; - } - - if(pthread_cond_init(&(t->timer_cond), NULL)) { - LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__); - goto t_err; - } - if(pthread_mutex_init(&(t->timer_mutex), NULL)) { - LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); - goto cond_err; - } - - t->callback_func = cb_func; - t->user_data = caller_data; - t->time_msec = msec; - t->state = READY; - - if (pthread_attr_init(&tattr)) { - LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__); - goto mutex_err; - } - pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); - - if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) { - LOC_LOGE("%s:%d]: Could not create thread\n", __func__, __LINE__); - goto attr_err; - } - - LOC_LOGD("%s:%d]: Created thread with id: %d\n", - __func__, __LINE__, (int)id); - goto _err; - -attr_err: - pthread_attr_destroy(&tattr); -mutex_err: - pthread_mutex_destroy(&t->timer_mutex); -cond_err: - pthread_cond_destroy(&t->timer_cond); -t_err: - free(t); -_err: - LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); - return t; -} - -void loc_timer_stop(void* handle) { - timer_data* t = (timer_data*)handle; - - if (NULL != t && (READY == t->state || WAITING == t->state) && - pthread_mutex_lock(&(t->timer_mutex)) == 0) { - if (READY == t->state || WAITING == t->state) { - pthread_cond_signal(&t->timer_cond); - t->state = ABORT; - } - pthread_mutex_unlock(&(t->timer_mutex)); - } -} diff --git a/gps/utils/loc_timer.h b/gps/utils/loc_timer.h index 0034d27..2967858 100644 --- a/gps/utils/loc_timer.h +++ b/gps/utils/loc_timer.h @@ -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 @@ -33,28 +33,38 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include<pthread.h> -#include "log_util.h" +#include <stddef.h> /* - Return values: - Success = 0 - Failure = Non zero + user_data: client context pointer, passthrough. Originally received + from calling client when loc_timer_start() is called. + result: 0 if timer successfully timed out; else timer failed. */ -typedef void(*loc_timer_callback)(void *user_data, int result); +typedef void (*loc_timer_callback)(void *user_data, int32_t result); /* - Returns the handle, which can be used to stop the timer + delay_msec: timeout value for the timer. + cb_func: callback function pointer, implemented by client. + Can not be NULL. + user_data: client context pointer, passthrough. Will be + returned when loc_timer_callback() is called. + wakeOnExpire: true if to wake up CPU (if sleeping) upon timer + expiration and notify the client. + false if to wait until next time CPU wakes up (if + sleeping) and then notify the client. + Returns the handle, which can be used to stop the timer + NULL, if timer start fails (e.g. if cb_func is NULL). */ -void* loc_timer_start(unsigned int delay_msec, - loc_timer_callback, - void* user_data); +void* loc_timer_start(uint64_t delay_msec, + loc_timer_callback cb_func, + void *user_data, + bool wake_on_expire=false); /* - handle becomes invalid upon the return of the callback + handle becomes invalid upon the return of the callback */ -void loc_timer_stop(void* handle); +void loc_timer_stop(void*& handle); #ifdef __cplusplus } diff --git a/gps/utils/log_util.h b/gps/utils/log_util.h index 8ff6b5a..ffd5ca9 100644 --- a/gps/utils/log_util.h +++ b/gps/utils/log_util.h @@ -81,6 +81,8 @@ 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 @@ -157,12 +159,18 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } } \ } while(0) - #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 diff --git a/gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/gps/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp index e8cb93a..e8cb93a 100644 --- a/gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp +++ b/gps/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp diff --git a/gps/platform_lib_abstractions/platform_lib_includes.h b/gps/utils/platform_lib_abstractions/platform_lib_includes.h index 5858674..5858674 100644 --- a/gps/platform_lib_abstractions/platform_lib_includes.h +++ b/gps/utils/platform_lib_abstractions/platform_lib_includes.h diff --git a/gps/platform_lib_abstractions/platform_lib_macros.h b/gps/utils/platform_lib_abstractions/platform_lib_macros.h index bc48dd9..bc48dd9 100644 --- a/gps/platform_lib_abstractions/platform_lib_macros.h +++ b/gps/utils/platform_lib_abstractions/platform_lib_macros.h diff --git a/gps/platform_lib_abstractions/platform_lib_time.h b/gps/utils/platform_lib_abstractions/platform_lib_time.h index ce013af..ce013af 100644 --- a/gps/platform_lib_abstractions/platform_lib_time.h +++ b/gps/utils/platform_lib_abstractions/platform_lib_time.h |
