diff --git a/device_w7.mk b/device_w7.mk index 40a3c69..bfa4ee6 100644 --- a/device_w7.mk +++ b/device_w7.mk @@ -57,7 +57,6 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ device/lge/w7/prebuilt/etc/wifi/p2p_supplicant_overlay.conf:system/etc/wifi/p2p_supplicant_overlay.conf \ device/lge/w7/prebuilt/etc/wifi/wpa_supplicant_overlay.conf:system/etc/wifi/wpa_supplicant_overlay.conf \ - device/lge/w7/prebuilt/etc/permissions/com.qualcomm.location.xml:system/etc/permissions/com.qualcomm.location.xml \ device/lge/w7/prebuilt/etc/wifi/WCNSS_qcom_wlan_nv.bin:system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin \ device/lge/w7/prebuilt/etc/wifi/WCNSS_qcom_wlan_nv.bin:system/etc/wifi/WCNSS_qcom_wlan_nv.bin \ device/lge/w7/prebuilt/etc/hostapd/hostapd.accept:system/etc/hostapd/hostapd.accept \ @@ -73,18 +72,14 @@ PRODUCT_COPY_FILES += \ device/lge/w7/prebuilt/usr/keylayout/Generic-D4x5.kl:system/usr/keylayout/Generic-D4x5.kl \ device/lge/w7/prebuilt/usr/keylayout/Generic-D410.kl:system/usr/keylayout/Generic-D410.kl \ device/lge/w7/prebuilt/etc/init.zetaw.bt.sh:system/etc/init.zetaw.bt.sh \ - device/lge/w7/prebuilt/etc/init.d/090fixup:system/etc/init.d/090fixup \ - device/lge/w7/prebuilt/etc/sap.conf:system/etc/sap.conf \ - device/lge/w7/prebuilt/etc/gps.conf:system/etc/gps.conf \ + device/lge/w7/prebuilt/fixup.sh:system/bin/fixup.sh \ device/lge/w7/prebuilt/etc/msap.conf:system/etc/msap.conf \ device/lge/w7/prebuilt/etc/clatd.conf:system/etc/clatd.conf \ device/lge/w7/prebuilt/etc/sec_config:system/etc/sec_config \ - device/lge/w7/prebuilt/etc/izat.conf:system/etc/izat.conf \ device/lge/w7/prebuilt/etc/libnfc-brcm.conf:system/etc/libnfc-brcm.conf \ device/lge/w7/prebuilt/etc/nfc-nci.conf:system/etc/nfc-nci.conf \ device/lge/w7/prebuilt/etc/libnfc-nxp.conf:system/etc/libnfc-nxp.conf \ device/lge/w7/prebuilt/etc/nfcee_access.xml:system/etc/nfcee_access.xml \ - device/lge/w7/prebuilt/etc/quipc.conf:system/etc/quipc.conf \ kernel/lge/msm8226/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat:system/etc/firmware/wlan/prima/WCNSS_cfg.dat \ kernel/lge/msm8226/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini \ kernel/lge/msm8226/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini:system/etc/wifi/WCNSS_qcom_cfg.ini \ @@ -171,6 +166,17 @@ PRODUCT_PACKAGES += \ wpa_supplicant.conf \ libwcnss_qmi \ +# GPS +PRODUCT_PACKAGES += \ + gps.msm8226 + +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/gps/gps.conf:system/etc/gps.conf \ + $(LOCAL_PATH)/gps/flp.conf:system/etc/flp.conf \ + $(LOCAL_PATH)/gps/izat.conf:system/etc/izat.conf \ + $(LOCAL_PATH)/gps/quipc.conf:system/etc/quipc.conf \ + $(LOCAL_PATH)/gps/sap.conf:system/etc/sap.conf + # Charger PRODUCT_PACKAGES += charger charger_res_images diff --git a/gps/Android.mk b/gps/Android.mk new file mode 100644 index 0000000..51b1019 --- /dev/null +++ b/gps/Android.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2013 The CyanogenMod 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. +# +ifeq ($(TARGET_BOARD_PLATFORM),msm8226) + +LOC_PATH := $(call my-dir) + +include $(call first-makefiles-under,$(LOC_PATH)) + +endif 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/core/Android.mk b/gps/core/Android.mk new file mode 100644 index 0000000..4d2f388 --- /dev/null +++ b/gps/core/Android.mk @@ -0,0 +1,51 @@ +ifneq ($(BUILD_TINY_ANDROID),true) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_core +LOCAL_MODULE_OWNER := qcom + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libgps.utils \ + libdl + +LOCAL_SRC_FILES += \ + MsgTask.cpp \ + LocApiBase.cpp \ + LocAdapterBase.cpp \ + ContextBase.cpp \ + LocDualContext.cpp \ + loc_core_log.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils + +LOCAL_COPY_HEADERS_TO:= libloc_core/ +LOCAL_COPY_HEADERS:= \ + MsgTask.h \ + LocApiBase.h \ + LocAdapterBase.h \ + ContextBase.h \ + LocDualContext.h \ + LBSProxyBase.h \ + UlpProxyBase.h \ + gps_extended_c.h \ + gps_extended.h \ + loc_core_log.h \ + LocAdapterProxyBase.h + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/gps/core/ContextBase.cpp b/gps/core/ContextBase.cpp new file mode 100644 index 0000000..9f6c4aa --- /dev/null +++ b/gps/core/ContextBase.cpp @@ -0,0 +1,114 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_CtxBase" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace loc_core { + +LBSProxyBase* ContextBase::getLBSProxy(const char* libName) +{ + LBSProxyBase* proxy = NULL; + LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName); + void* lib = dlopen(libName, RTLD_NOW); + + if ((void*)NULL != lib) { + getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy"); + if (NULL != getter) { + proxy = (*getter)(); + } + } + if (NULL == proxy) { + proxy = new LBSProxyBase(); + } + LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__); + return proxy; +} + +LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) +{ + LocApiBase* locApi = NULL; + + // first if can not be MPQ + if (TARGET_MPQ != loc_get_target()) { + if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { + void *handle = NULL; + //try to see if LocApiV02 is present + if((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) { + LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__); + getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi"); + if(getter != NULL) { + LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, __LINE__); + locApi = (*getter)(mMsgTask, exMask, this); + } + } + // only RPC is the option now + else { + LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC", + __func__, __LINE__); + handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); + if (NULL != handle) { + getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi"); + if (NULL != getter) { + LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__, __LINE__); + locApi = (*getter)(mMsgTask, exMask, this); + } + } + } + } + } + + // locApi could still be NULL at this time + // we would then create a dummy one + if (NULL == locApi) { + locApi = new LocApiBase(mMsgTask, exMask, this); + } + + return locApi; +} + +ContextBase::ContextBase(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + const char* libName) : + mLBSProxy(getLBSProxy(libName)), + mMsgTask(msgTask), + mLocApi(createLocApi(exMask)), + mLocApiProxy(mLocApi->getLocApiProxy()) +{ +} + +} diff --git a/gps/core/ContextBase.h b/gps/core/ContextBase.h new file mode 100644 index 0000000..2adbedd --- /dev/null +++ b/gps/core/ContextBase.h @@ -0,0 +1,70 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef __LOC_CONTEXT_BASE__ +#define __LOC_CONTEXT_BASE__ + +#include +#include +#include +#include +#include + +namespace loc_core { + +class LocAdapterBase; + +class ContextBase { + static LBSProxyBase* getLBSProxy(const char* libName); + LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask); +protected: + const LBSProxyBase* mLBSProxy; + const MsgTask* mMsgTask; + LocApiBase* mLocApi; + LocApiProxyBase *mLocApiProxy; +public: + ContextBase(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + const char* libName); + inline virtual ~ContextBase() { delete mLocApi; delete mLBSProxy; } + + inline const MsgTask* getMsgTask() { return mMsgTask; } + inline LocApiBase* getLocApi() { return mLocApi; } + inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } + inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); } + inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); } + inline void requestUlp(LocAdapterBase* adapter, + unsigned long capabilities) { + mLBSProxy->requestUlp(adapter, capabilities); + } + inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); } +}; + +} // namespace loc_core + +#endif //__LOC_CONTEXT_BASE__ diff --git a/gps/core/LBSProxyBase.h b/gps/core/LBSProxyBase.h new file mode 100644 index 0000000..0b7dbdf --- /dev/null +++ b/gps/core/LBSProxyBase.h @@ -0,0 +1,63 @@ +/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef IZAT_PROXY_BASE_H +#define IZAT_PROXY_BASE_H +#include +#include + +namespace loc_core { + +class LocApiBase; +class LocAdapterBase; +class ContextBase; + +class LBSProxyBase { + friend class ContextBase; + inline virtual LocApiBase* + getLocApi(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase* context) const { + return NULL; + } +protected: + inline LBSProxyBase() {} +public: + inline virtual ~LBSProxyBase() {} + inline virtual void requestUlp(LocAdapterBase* adapter, + unsigned long capabilities) const {} + inline virtual bool hasAgpsExtendedCapabilities() const { return false; } + inline virtual bool hasCPIExtendedCapabilities() const { return false; } + virtual void injectFeatureConfig(ContextBase* context) const {} +}; + +typedef LBSProxyBase* (getLBSProxy_t)(); + +} // namespace loc_core + +#endif // IZAT_PROXY_BASE_H diff --git a/gps/core/LocAdapterBase.cpp b/gps/core/LocAdapterBase.cpp new file mode 100644 index 0000000..eea8edd --- /dev/null +++ b/gps/core/LocAdapterBase.cpp @@ -0,0 +1,135 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_LocAdapterBase" + +#include +#include +#include +#include +#include + +namespace loc_core { + +// This is the top level class, so the constructor will +// always gets called. Here we prepare for the default. +// But if getLocApi(targetEnumType target) is overriden, +// the right locApi should get created. +LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, + ContextBase* context, LocAdapterProxyBase *adapterProxyBase) : + mEvtMask(mask), mContext(context), + mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase), + mMsgTask(context->getMsgTask()) +{ + mLocApi->addAdapter(this); +} + +void LocAdapterBase::handleEngineUpEvent() +{ + if (mLocAdapterProxyBase) { + mLocAdapterProxyBase->handleEngineUpEvent(); + } +} + +void LocAdapterBase::handleEngineDownEvent() +{ + if (mLocAdapterProxyBase) { + mLocAdapterProxyBase->handleEngineDownEvent(); + } +} + +void LocAdapterBase:: + reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) +DEFAULT_IMPL() + +void LocAdapterBase:: + reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt) +DEFAULT_IMPL() + + +void LocAdapterBase:: + reportStatus(GpsStatusValue status) +DEFAULT_IMPL() + + +void LocAdapterBase:: + reportNmea(const char* nmea, int length) +DEFAULT_IMPL() + +bool LocAdapterBase:: + reportXtraServer(const char* url1, const char* url2, + const char* url3, const int maxlength) +DEFAULT_IMPL(false) + +bool LocAdapterBase:: + requestXtraData() +DEFAULT_IMPL(false) + +bool LocAdapterBase:: + requestTime() +DEFAULT_IMPL(false) + +bool LocAdapterBase:: + requestLocation() +DEFAULT_IMPL(false) + +bool LocAdapterBase:: + requestATL(int connHandle, AGpsType agps_type) +DEFAULT_IMPL(false) + +bool LocAdapterBase:: + releaseATL(int connHandle) +DEFAULT_IMPL(false) + +bool LocAdapterBase:: + requestSuplES(int connHandle) +DEFAULT_IMPL(false) + +bool LocAdapterBase:: + reportDataCallOpened() +DEFAULT_IMPL(false) + +bool LocAdapterBase:: + reportDataCallClosed() +DEFAULT_IMPL(false) + +bool LocAdapterBase:: + requestNiNotify(GpsNiNotification ¬ify, const void* data) +DEFAULT_IMPL(false) + +void LocAdapterBase:: + shutdown() +DEFAULT_IMPL() +} // namespace loc_core diff --git a/gps/core/LocAdapterBase.h b/gps/core/LocAdapterBase.h new file mode 100644 index 0000000..2fec312 --- /dev/null +++ b/gps/core/LocAdapterBase.h @@ -0,0 +1,119 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef LOC_API_ADAPTER_BASE_H +#define LOC_API_ADAPTER_BASE_H + +#include +#include +#include + +namespace loc_core { + +class LocAdapterProxyBase; + +class LocAdapterBase { +protected: + LOC_API_ADAPTER_EVENT_MASK_T mEvtMask; + ContextBase* mContext; + LocApiBase* mLocApi; + LocAdapterProxyBase* mLocAdapterProxyBase; + const MsgTask* mMsgTask; + + inline LocAdapterBase(const MsgTask* msgTask) : + mEvtMask(0), mContext(NULL), mLocApi(NULL), + mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {} +public: + inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); } + LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, + ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL); + inline LOC_API_ADAPTER_EVENT_MASK_T + checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const { + return mEvtMask & mask; + } + + inline LOC_API_ADAPTER_EVENT_MASK_T getEvtMask() const { + return mEvtMask; + } + + inline void sendMsg(const LocMsg* msg) const { + mMsgTask->sendMsg(msg); + } + + inline void sendMsg(const LocMsg* msg) { + mMsgTask->sendMsg(msg); + } + + inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled) + { + mEvtMask = + isEnabled == LOC_REGISTRATION_MASK_ENABLED ? (mEvtMask|event):(mEvtMask&~event); + + mLocApi->updateEvtMask(); + } + + // This will be overridden by the individual adapters + // if necessary. + inline virtual void setUlpProxy(UlpProxyBase* ulp) {} + virtual void handleEngineUpEvent(); + virtual void handleEngineDownEvent(); + inline virtual void setPositionModeInt(LocPosMode& posMode) {} + virtual void startFixInt() {} + virtual void stopFixInt() {} + virtual void getZppInt() {} + virtual void reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask); + virtual void reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); + virtual void reportStatus(GpsStatusValue status); + virtual void reportNmea(const char* nmea, int length); + virtual bool reportXtraServer(const char* url1, const char* url2, + const char* url3, const int maxlength); + virtual bool requestXtraData(); + virtual bool requestTime(); + virtual bool requestLocation(); + virtual bool requestATL(int connHandle, AGpsType agps_type); + virtual bool releaseATL(int connHandle); + virtual bool requestSuplES(int connHandle); + virtual bool reportDataCallOpened(); + virtual bool reportDataCallClosed(); + virtual bool requestNiNotify(GpsNiNotification ¬ify, + const void* data); + inline virtual bool isInSession() { return false; } + virtual void shutdown(); + ContextBase* getContext() const { return mContext; } +}; + +} // namespace loc_core + +#endif //LOC_API_ADAPTER_BASE_H diff --git a/gps/core/LocAdapterProxyBase.h b/gps/core/LocAdapterProxyBase.h new file mode 100644 index 0000000..df5a48b --- /dev/null +++ b/gps/core/LocAdapterProxyBase.h @@ -0,0 +1,64 @@ +/* Copyright (c) 2014 The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef LOC_ADAPTER_PROXY_BASE_H +#define LOC_ADAPTER_PROXY_BASE_H + +#include +#include + +namespace loc_core { + +class LocAdapterProxyBase { +private: + LocAdapterBase *mLocAdapterBase; +protected: + inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, + ContextBase* context): + mLocAdapterBase(new LocAdapterBase(mask, context, this)) { + } + inline virtual ~LocAdapterProxyBase() { + delete mLocAdapterBase; + } + ContextBase* getContext() const { + return mLocAdapterBase->getContext(); + } + inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, + loc_registration_mask_status isEnabled) { + mLocAdapterBase->updateEvtMask(event,isEnabled); + } + +public: + inline virtual void handleEngineUpEvent() {}; + inline virtual void handleEngineDownEvent() {}; +}; + +} // namespace loc_core + +#endif //LOC_ADAPTER_PROXY_BASE_H diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp new file mode 100644 index 0000000..43332dc --- /dev/null +++ b/gps/core/LocApiBase.cpp @@ -0,0 +1,505 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_LocApiBase" + +#include +#include +#include +#include +#include + +namespace loc_core { + +#define TO_ALL_LOCADAPTERS(call) TO_ALL_ADAPTERS(mLocAdapters, (call)) +#define TO_1ST_HANDLING_LOCADAPTERS(call) TO_1ST_HANDLING_ADAPTER(mLocAdapters, (call)) + +int hexcode(char *hexstring, int string_size, + const char *data, int data_size) +{ + int i; + for (i = 0; i < data_size; i++) + { + char ch = data[i]; + if (i*2 + 3 <= string_size) + { + snprintf(&hexstring[i*2], 3, "%02X", ch); + } + else { + break; + } + } + return i; +} + +int decodeAddress(char *addr_string, int string_size, + const char *data, int data_size) +{ + const char addr_prefix = 0x91; + int i, idxOutput = 0; + + if (!data || !addr_string) { return 0; } + + if (data[0] != addr_prefix) + { + LOC_LOGW("decodeAddress: address prefix is not 0x%x but 0x%x", addr_prefix, data[0]); + addr_string[0] = '\0'; + return 0; // prefix not correct + } + + for (i = 1; i < data_size; i++) + { + unsigned char ch = data[i], low = ch & 0x0F, hi = ch >> 4; + if (low <= 9 && idxOutput < string_size - 1) { addr_string[idxOutput++] = low + '0'; } + if (hi <= 9 && idxOutput < string_size - 1) { addr_string[idxOutput++] = hi + '0'; } + } + + addr_string[idxOutput] = '\0'; // Terminates the string + + return idxOutput; +} + +struct LocSsrMsg : public LocMsg { + LocApiBase* mLocApi; + inline LocSsrMsg(LocApiBase* locApi) : + LocMsg(), mLocApi(locApi) + { + locallog(); + } + inline virtual void proc() const { + mLocApi->close(); + mLocApi->open(mLocApi->getEvtMask()); + } + inline void locallog() { + LOC_LOGV("LocSsrMsg"); + } + inline virtual void log() { + locallog(); + } +}; + +struct LocOpenMsg : public LocMsg { + LocApiBase* mLocApi; + LOC_API_ADAPTER_EVENT_MASK_T mMask; + inline LocOpenMsg(LocApiBase* locApi, + LOC_API_ADAPTER_EVENT_MASK_T mask) : + LocMsg(), mLocApi(locApi), mMask(mask) + { + locallog(); + } + inline virtual void proc() const { + mLocApi->open(mMask); + } + inline void locallog() { + LOC_LOGV("%s:%d]: LocOpen Mask: %x\n", + __func__, __LINE__, mMask); + } + inline virtual void log() { + locallog(); + } +}; + +LocApiBase::LocApiBase(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T excludedMask, + ContextBase* context) : + mExcludedMask(excludedMask), mMsgTask(msgTask), + mMask(0), mSupportedMsg(0), mContext(context) +{ + memset(mLocAdapters, 0, sizeof(mLocAdapters)); +} + +LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask() +{ + LOC_API_ADAPTER_EVENT_MASK_T mask = 0; + + TO_ALL_LOCADAPTERS(mask |= mLocAdapters[i]->getEvtMask()); + + return mask & ~mExcludedMask; +} + +bool LocApiBase::isInSession() +{ + bool inSession = false; + + for (int i = 0; + !inSession && i < MAX_ADAPTERS && NULL != mLocAdapters[i]; + i++) { + inSession = mLocAdapters[i]->isInSession(); + } + + return inSession; +} + +void LocApiBase::addAdapter(LocAdapterBase* adapter) +{ + for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) { + if (mLocAdapters[i] == NULL) { + mLocAdapters[i] = adapter; + mMsgTask->sendMsg(new LocOpenMsg(this, + (adapter->getEvtMask()))); + break; + } + } +} + +void LocApiBase::removeAdapter(LocAdapterBase* adapter) +{ + for (int i = 0; + i < MAX_ADAPTERS && NULL != mLocAdapters[i]; + i++) { + if (mLocAdapters[i] == adapter) { + mLocAdapters[i] = NULL; + + // shift the rest of the adapters up so that the pointers + // in the array do not have holes. This should be more + // performant, because the array maintenance is much much + // less frequent than event handlings, which need to linear + // search all the adapters + int j = i; + while (++i < MAX_ADAPTERS && mLocAdapters[i] != NULL); + + // i would be MAX_ADAPTERS or point to a NULL + i--; + // i now should point to a none NULL adapter within valid + // range although i could be equal to j, but it won't hurt. + // No need to check it, as it gains nothing. + mLocAdapters[j] = mLocAdapters[i]; + // this makes sure that we exit the for loop + mLocAdapters[i] = NULL; + + // if we have an empty list of adapters + if (0 == i) { + close(); + } else { + // else we need to remove the bit + mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); + } + } + } +} + +void LocApiBase::updateEvtMask() +{ + mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask())); +} + +void LocApiBase::handleEngineUpEvent() +{ + // This will take care of renegotiating the loc handle + mMsgTask->sendMsg(new LocSsrMsg(this)); + + LocDualContext::injectFeatureConfig(mContext); + + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineUpEvent()); +} + +void LocApiBase::handleEngineDownEvent() +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineDownEvent()); +} + +void LocApiBase::reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS( + mLocAdapters[i]->reportPosition(location, + locationExtended, + locationExt, + status, + loc_technology_mask) + ); +} + +void LocApiBase::reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS( + mLocAdapters[i]->reportSv(svStatus, + locationExtended, + svExt) + ); +} + +void LocApiBase::reportStatus(GpsStatusValue status) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportStatus(status)); +} + +void LocApiBase::reportNmea(const char* nmea, int length) +{ + // loop through adapters, and deliver to all adapters. + TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportNmea(nmea, length)); +} + +void LocApiBase::reportXtraServer(const char* url1, const char* url2, + const char* url3, const int maxlength) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportXtraServer(url1, url2, url3, maxlength)); + +} + +void LocApiBase::requestXtraData() +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestXtraData()); +} + +void LocApiBase::requestTime() +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestTime()); +} + +void LocApiBase::requestLocation() +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation()); +} + +void LocApiBase::requestATL(int connHandle, AGpsType agps_type) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type)); +} + +void LocApiBase::releaseATL(int connHandle) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle)); +} + +void LocApiBase::requestSuplES(int connHandle) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestSuplES(connHandle)); +} + +void LocApiBase::reportDataCallOpened() +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallOpened()); +} + +void LocApiBase::reportDataCallClosed() +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallClosed()); +} + +void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data) +{ + // loop through adapters, and deliver to the first handling adapter. + TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data)); +} + +void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList) +{ + mSupportedMsg = supportedMsgList; +} + +void* LocApiBase :: getSibling() + DEFAULT_IMPL(NULL) + +LocApiProxyBase* LocApiBase :: getLocApiProxy() + DEFAULT_IMPL(NULL) + +enum loc_api_adapter_err LocApiBase:: + open(LOC_API_ADAPTER_EVENT_MASK_T mask) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + close() +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + startFix(const LocPosMode& posMode) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + stopFix() +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + deleteAidingData(GpsAidingData f) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + enableData(int enable) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setAPN(char* apn, int len) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + injectPosition(double latitude, double longitude, float accuracy) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setXtraData(char* data, int length) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + requestXtraServer() +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + atlOpenStatus(int handle, int is_succ, char* apn, + AGpsBearerType bear, AGpsType agpsType) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + atlCloseStatus(int handle, int is_succ) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setPositionMode(const LocPosMode& posMode) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setServer(const char* url, int len) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setServer(unsigned int ip, int port, + LocServerType type) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + informNiResponse(GpsUserResponseType userResponse, + const void* passThroughData) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setSUPLVersion(uint32_t version) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setLPPConfig(uint32_t profile) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setSensorControlConfig(int sensorUsage, + int sensorProvider) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, + float gyroBiasVarianceRandomWalk, + bool accelBiasVarianceRandomWalk_valid, + float accelBiasVarianceRandomWalk, + bool angleBiasVarianceRandomWalk_valid, + float angleBiasVarianceRandomWalk, + bool rateBiasVarianceRandomWalk_valid, + float rateBiasVarianceRandomWalk, + bool velocityBiasVarianceRandomWalk_valid, + float velocityBiasVarianceRandomWalk) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, + int accelBatchesPerSec, + int gyroSamplesPerBatch, + int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, + int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, + int gyroBatchesPerSecHigh, + int algorithmConfig) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setExtPowerConfig(int isBatteryCharging) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + setAGLONASSProtocol(unsigned long aGlonassProtocol) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +enum loc_api_adapter_err LocApiBase:: + 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) + +enum loc_api_adapter_err LocApiBase:: + getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) + +int LocApiBase:: + initDataServiceClient() +DEFAULT_IMPL(-1) + +int LocApiBase:: + openAndStartDataCall() +DEFAULT_IMPL(-1) + +void LocApiBase:: + stopDataCall() +DEFAULT_IMPL() + +void LocApiBase:: + closeDataCall() +DEFAULT_IMPL() + +int LocApiBase:: + setGpsLock(LOC_GPS_LOCK_MASK lock) +DEFAULT_IMPL(-1) + +void LocApiBase:: + installAGpsCert(const DerEncodedCertificate* pData, + size_t length, + uint32_t slotBitMask) +DEFAULT_IMPL() + +int LocApiBase:: + getGpsLock() +DEFAULT_IMPL(-1) + +enum loc_api_adapter_err LocApiBase:: + setXtraVersionCheck(enum xtra_version_check check) +DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS) +} // namespace loc_core diff --git a/gps/core/LocApiBase.h b/gps/core/LocApiBase.h new file mode 100644 index 0000000..f68cf73 --- /dev/null +++ b/gps/core/LocApiBase.h @@ -0,0 +1,249 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef LOC_API_BASE_H +#define LOC_API_BASE_H + +#include +#include +#include +#include +#include + +namespace loc_core { +class ContextBase; + +int hexcode(char *hexstring, int string_size, + const char *data, int data_size); +int decodeAddress(char *addr_string, int string_size, + const char *data, int data_size); + +#define MAX_ADAPTERS 10 + +#define TO_ALL_ADAPTERS(adapters, call) \ + for (int i = 0; i < MAX_ADAPTERS && NULL != (adapters)[i]; i++) { \ + call; \ + } + +#define TO_1ST_HANDLING_ADAPTER(adapters, call) \ + for (int i = 0; i sendMsg(msg); + } + + void addAdapter(LocAdapterBase* adapter); + void removeAdapter(LocAdapterBase* adapter); + + // upward calls + void handleEngineUpEvent(); + void handleEngineDownEvent(); + void reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask = + LOC_POS_TECH_MASK_DEFAULT); + void reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); + void reportStatus(GpsStatusValue status); + void reportNmea(const char* nmea, int length); + void reportXtraServer(const char* url1, const char* url2, + const char* url3, const int maxlength); + void requestXtraData(); + void requestTime(); + void requestLocation(); + void requestATL(int connHandle, AGpsType agps_type); + void releaseATL(int connHandle); + void requestSuplES(int connHandle); + void reportDataCallOpened(); + void reportDataCallClosed(); + void requestNiNotify(GpsNiNotification ¬ify, const void* data); + void saveSupportedMsgList(uint64_t supportedMsgList); + + // downward calls + // All below functions are to be defined by adapter specific modules: + // RPC, QMI, etc. The default implementation is empty. + + virtual void* getSibling(); + virtual LocApiProxyBase* getLocApiProxy(); + virtual enum loc_api_adapter_err + startFix(const LocPosMode& posMode); + virtual enum loc_api_adapter_err + stopFix(); + virtual enum loc_api_adapter_err + deleteAidingData(GpsAidingData f); + virtual enum loc_api_adapter_err + enableData(int enable); + virtual enum loc_api_adapter_err + setAPN(char* apn, int len); + virtual enum loc_api_adapter_err + injectPosition(double latitude, double longitude, float accuracy); + virtual enum loc_api_adapter_err + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty); + virtual enum loc_api_adapter_err + setXtraData(char* data, int length); + virtual enum loc_api_adapter_err + requestXtraServer(); + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType); + virtual enum loc_api_adapter_err + atlCloseStatus(int handle, int is_succ); + virtual enum loc_api_adapter_err + setPositionMode(const LocPosMode& posMode); + virtual enum loc_api_adapter_err + setServer(const char* url, int len); + virtual enum loc_api_adapter_err + setServer(unsigned int ip, int port, + LocServerType type); + virtual enum loc_api_adapter_err + informNiResponse(GpsUserResponseType userResponse, const void* passThroughData); + virtual enum loc_api_adapter_err + setSUPLVersion(uint32_t version); + virtual enum loc_api_adapter_err + setLPPConfig(uint32_t profile); + virtual enum loc_api_adapter_err + setSensorControlConfig(int sensorUsage, int sensorProvider); + virtual enum loc_api_adapter_err + setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, + float gyroBiasVarianceRandomWalk, + bool accelBiasVarianceRandomWalk_valid, + float accelBiasVarianceRandomWalk, + bool angleBiasVarianceRandomWalk_valid, + float angleBiasVarianceRandomWalk, + bool rateBiasVarianceRandomWalk_valid, + float rateBiasVarianceRandomWalk, + bool velocityBiasVarianceRandomWalk_valid, + float velocityBiasVarianceRandomWalk); + virtual enum loc_api_adapter_err + setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, + int accelBatchesPerSec, + int gyroSamplesPerBatch, + int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, + int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, + int gyroBatchesPerSecHigh, + int algorithmConfig); + virtual enum loc_api_adapter_err + setExtPowerConfig(int isBatteryCharging); + virtual enum loc_api_adapter_err + setAGLONASSProtocol(unsigned long aGlonassProtocol); + virtual enum loc_api_adapter_err + getWwanZppFix(GpsLocation & zppLoc); + virtual enum loc_api_adapter_err + getBestAvailableZppFix(GpsLocation & zppLoc); + virtual enum loc_api_adapter_err + getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); + virtual int initDataServiceClient(); + virtual int openAndStartDataCall(); + virtual void stopDataCall(); + virtual void closeDataCall(); + virtual void installAGpsCert(const DerEncodedCertificate* pData, + size_t length, + uint32_t slotBitMask); + inline virtual void setInSession(bool inSession) {} + inline bool isMessageSupported (LocCheckingMessagesID msgID) const { + if (msgID > (sizeof(mSupportedMsg) << 3)) { + return false; + } else { + uint32_t messageChecker = 1 << msgID; + return (messageChecker & mSupportedMsg) == messageChecker; + } + } + void updateEvtMask(); + + /*Values for lock + 1 = Do not lock any position sessions + 2 = Lock MI position sessions + 3 = Lock MT position sessions + 4 = Lock all position sessions + */ + virtual int setGpsLock(LOC_GPS_LOCK_MASK lock); + /* + Returns + Current value of GPS Lock on success + -1 on failure + */ + virtual int getGpsLock(void); + virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check); +}; + +typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase *context); + +} // namespace loc_core + +#endif //LOC_API_BASE_H diff --git a/gps/core/LocDualContext.cpp b/gps/core/LocDualContext.cpp new file mode 100644 index 0000000..ab15110 --- /dev/null +++ b/gps/core/LocDualContext.cpp @@ -0,0 +1,164 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_DualCtx" + +#include +#include +#include +#include +#include +#include + +namespace loc_core { + +// nothing exclude for foreground +const LOC_API_ADAPTER_EVENT_MASK_T +LocDualContext::mFgExclMask = 0; +// excluded events for background clients +const LOC_API_ADAPTER_EVENT_MASK_T +LocDualContext::mBgExclMask = + (LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | + LOC_API_ADAPTER_BIT_SATELLITE_REPORT | + LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | + LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT | + LOC_API_ADAPTER_BIT_IOCTL_REPORT | + LOC_API_ADAPTER_BIT_STATUS_REPORT | + LOC_API_ADAPTER_BIT_GEOFENCE_GEN_ALERT); + +const MsgTask* LocDualContext::mMsgTask = NULL; +ContextBase* LocDualContext::mFgContext = NULL; +ContextBase* LocDualContext::mBgContext = NULL; +ContextBase* LocDualContext::mInjectContext = NULL; +// the name must be shorter than 15 chars +const char* LocDualContext::mLocationHalName = "Loc_hal_worker"; +const char* LocDualContext::mLBSLibName = "liblbs_core.so"; + +const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator, + const char* name) +{ + if (NULL == mMsgTask) { + mMsgTask = new MsgTask(tCreator, name); + } + 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; +} + +ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator, + const char* name) +{ + if (NULL == mFgContext) { + const MsgTask* msgTask = getMsgTask(tCreator, name); + mFgContext = new LocDualContext(msgTask, + mFgExclMask); + } + if(NULL == mInjectContext) { + mInjectContext = mFgContext; + injectFeatureConfig(mInjectContext); + } + return mFgContext; +} + +ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate, + const char* name) +{ + if (NULL == mFgContext) { + 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); + } + return mFgContext; + +} + +ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator, + const char* name) +{ + if (NULL == mBgContext) { + const MsgTask* msgTask = getMsgTask(tCreator, name); + mBgContext = new LocDualContext(msgTask, + mBgExclMask); + } + if(NULL == mInjectContext) { + LOC_LOGD("%s:%d]: mInjectContext is BgContext", __func__, __LINE__); + mInjectContext = mBgContext; + injectFeatureConfig(mInjectContext); + } + return mBgContext; +} + +ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate, + const char* name) +{ + if (NULL == mBgContext) { + 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); + } + return mBgContext; +} + +void LocDualContext :: injectFeatureConfig(ContextBase *curContext) +{ + LOC_LOGD("%s:%d]: Enter", __func__, __LINE__); + if(curContext == mInjectContext) { + LOC_LOGD("%s:%d]: Calling LBSProxy (%p) to inject feature config", + __func__, __LINE__, ((LocDualContext *)mInjectContext)->mLBSProxy); + ((LocDualContext *)mInjectContext)->mLBSProxy->injectFeatureConfig(curContext); + } + LOC_LOGD("%s:%d]: Exit", __func__, __LINE__); +} + +LocDualContext::LocDualContext(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask) : + ContextBase(msgTask, exMask, mLBSLibName) +{ +} + +} diff --git a/gps/core/LocDualContext.h b/gps/core/LocDualContext.h new file mode 100644 index 0000000..cdc4df3 --- /dev/null +++ b/gps/core/LocDualContext.h @@ -0,0 +1,73 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef __LOC_ENG_CONTEXT__ +#define __LOC_ENG_CONTEXT__ + +#include +#include +#include +#include + +namespace loc_core { + +class LocDualContext : public ContextBase { + static const MsgTask* mMsgTask; + 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); + +protected: + LocDualContext(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask); + inline virtual ~LocDualContext() {} + +public: + static const char* mLBSLibName; + static const LOC_API_ADAPTER_EVENT_MASK_T mFgExclMask; + 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 void injectFeatureConfig(ContextBase *context); +}; + +} + +#endif //__LOC_ENG_CONTEXT__ diff --git a/gps/core/MsgTask.cpp b/gps/core/MsgTask.cpp new file mode 100644 index 0000000..5d375aa --- /dev/null +++ b/gps/core/MsgTask.cpp @@ -0,0 +1,147 @@ +/* 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 +#include +#include +#include +#include +#include + +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/MsgTask.h b/gps/core/MsgTask.h new file mode 100644 index 0000000..d50bb31 --- /dev/null +++ b/gps/core/MsgTask.h @@ -0,0 +1,67 @@ +/* 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. + * + */ +#ifndef __MSG_TASK__ +#define __MSG_TASK__ + +#include +#include +#include +#include + +namespace loc_core { + +struct LocMsg { + inline LocMsg() {} + inline virtual ~LocMsg() {} + virtual void proc() const = 0; + inline virtual void log() const {} +}; + +class 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(); + void sendMsg(const LocMsg* msg) const; + void associate(tAssociate tAssociator) const; + +private: + const void* mQ; + tAssociate mAssociator; + MsgTask(const void* q, tAssociate associator); + static void* loopMain(void* copy); + void createPThread(const char* name); +}; + +} // namespace loc_core + +#endif //__MSG_TASK__ diff --git a/gps/core/UlpProxyBase.h b/gps/core/UlpProxyBase.h new file mode 100644 index 0000000..b9a8224 --- /dev/null +++ b/gps/core/UlpProxyBase.h @@ -0,0 +1,85 @@ +/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef ULP_PROXY_BASE_H +#define ULP_PROXY_BASE_H + +#include + +namespace loc_core { + +class LocAdapterBase; + +class UlpProxyBase { +public: + LocPosMode mPosMode; + bool mFixSet; + inline UlpProxyBase() { + mPosMode.mode = LOC_POSITION_MODE_INVALID; + mFixSet = false; + } + inline virtual ~UlpProxyBase() {} + inline virtual bool sendStartFix() { mFixSet = true; return false; } + inline virtual bool sendStopFix() { mFixSet = false; return false; } + inline virtual bool sendFixMode(LocPosMode ¶ms) { + mPosMode = params; + return false; + } + + inline virtual bool reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) { + return false; + } + inline virtual bool reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt) { + return false; + } + inline virtual bool reportStatus(GpsStatusValue status) { + return false; + } + inline virtual void setAdapter(LocAdapterBase* adapter) {} + inline virtual void setCapabilities(unsigned long capabilities) {} + inline virtual bool reportBatchingSession(GpsExtBatchOptions &options, + bool active) { + return false; + } + inline virtual bool reportPositions(GpsExtLocation * locations, + int32_t number_of_locations, + enum loc_sess_status status, + LocPosTechMask techMask) { + return false; + } +}; + +} // namespace loc_core + +#endif // ULP_PROXY_BASE_H diff --git a/gps/core/gps_extended.h b/gps/core/gps_extended.h new file mode 100644 index 0000000..88b0415 --- /dev/null +++ b/gps/core/gps_extended.h @@ -0,0 +1,92 @@ +/* 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. + */ + +#ifndef GPS_EXTENDED_H +#define GPS_EXTENDED_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +struct LocPosMode +{ + LocPositionMode mode; + GpsPositionRecurrence recurrence; + uint32_t min_interval; + uint32_t preferred_accuracy; + uint32_t preferred_time; + char credentials[14]; + char provider[8]; + LocPosMode(LocPositionMode m, GpsPositionRecurrence recr, + uint32_t gap, uint32_t accu, uint32_t time, + const char* cred, const char* prov) : + mode(m), recurrence(recr), + min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap), + preferred_accuracy(accu), preferred_time(time) { + memset(credentials, 0, sizeof(credentials)); + memset(provider, 0, sizeof(provider)); + if (NULL != cred) { + memcpy(credentials, cred, sizeof(credentials)-1); + } + if (NULL != prov) { + memcpy(provider, prov, sizeof(provider)-1); + } + } + + inline LocPosMode() : + mode(LOC_POSITION_MODE_MS_BASED), + recurrence(GPS_POSITION_RECURRENCE_PERIODIC), + min_interval(MIN_POSSIBLE_FIX_INTERVAL), + preferred_accuracy(50), preferred_time(120000) { + memset(credentials, 0, sizeof(credentials)); + memset(provider, 0, sizeof(provider)); + } + + inline bool equals(const LocPosMode &anotherMode) const + { + return anotherMode.mode == mode && + anotherMode.recurrence == recurrence && + anotherMode.min_interval == min_interval && + anotherMode.preferred_accuracy == preferred_accuracy && + anotherMode.preferred_time == preferred_time && + !strncmp(anotherMode.credentials, credentials, sizeof(credentials)-1) && + !strncmp(anotherMode.provider, provider, sizeof(provider)-1); + } + + void logv() const; +}; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* GPS_EXTENDED_H */ + diff --git a/gps/core/gps_extended_c.h b/gps/core/gps_extended_c.h new file mode 100644 index 0000000..a1ffd85 --- /dev/null +++ b/gps/core/gps_extended_c.h @@ -0,0 +1,394 @@ +/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef GPS_EXTENDED_C_H +#define GPS_EXTENDED_C_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include + +/** Location has valid source information. */ +#define LOCATION_HAS_SOURCE_INFO 0x0020 +/** GpsLocation has valid "is indoor?" flag */ +#define GPS_LOCATION_HAS_IS_INDOOR 0x0040 +/** GpsLocation has valid floor number */ +#define GPS_LOCATION_HAS_FLOOR_NUMBER 0x0080 +/** GpsLocation has valid map URL*/ +#define GPS_LOCATION_HAS_MAP_URL 0x0100 +/** GpsLocation has valid map index */ +#define GPS_LOCATION_HAS_MAP_INDEX 0x0200 + +/** Sizes for indoor fields */ +#define GPS_LOCATION_MAP_URL_SIZE 400 +#define GPS_LOCATION_MAP_INDEX_SIZE 16 + +/** Position source is ULP */ +#define ULP_LOCATION_IS_FROM_HYBRID 0x0001 +/** Position source is GNSS only */ +#define ULP_LOCATION_IS_FROM_GNSS 0x0002 +/** Position source is ZPP only */ +#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 */ +#define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 + +#define ULP_MIN_INTERVAL_INVALID 0xffffffff + +/*Emergency SUPL*/ +#define GPS_NI_TYPE_EMERGENCY_SUPL 4 + +#define AGPS_CERTIFICATE_MAX_LENGTH 2000 +#define AGPS_CERTIFICATE_MAX_SLOTS 10 + +enum loc_registration_mask_status { + LOC_REGISTRATION_MASK_ENABLED, + LOC_REGISTRATION_MASK_DISABLED +}; + +typedef struct { + /** set to sizeof(UlpLocation) */ + size_t size; + GpsLocation gpsLocation; + /* Provider indicator for HYBRID or GPS */ + uint16_t position_source; + /*allows HAL to pass additional information related to the location */ + int rawDataSize; /* in # of bytes */ + void * rawData; + bool is_indoor; + float floor_number; + char map_url[GPS_LOCATION_MAP_URL_SIZE]; + unsigned char map_index[GPS_LOCATION_MAP_INDEX_SIZE]; +} UlpLocation; + +/** AGPS type */ +typedef int16_t AGpsExtType; +#define AGPS_TYPE_INVALID -1 +#define AGPS_TYPE_ANY 0 +#define AGPS_TYPE_SUPL 1 +#define AGPS_TYPE_C2K 2 +#define AGPS_TYPE_WWAN_ANY 3 +#define AGPS_TYPE_WIFI 4 +#define AGPS_TYPE_SUPL_ES 5 + +/** SSID length */ +#define SSID_BUF_SIZE (32+1) + +typedef int16_t AGpsBearerType; +#define AGPS_APN_BEARER_INVALID -1 +#define AGPS_APN_BEARER_IPV4 0 +#define AGPS_APN_BEARER_IPV6 1 +#define AGPS_APN_BEARER_IPV4V6 2 + +/** GPS extended callback structure. */ +typedef struct { + /** set to sizeof(GpsCallbacks) */ + size_t size; + gps_set_capabilities set_capabilities_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + gps_create_thread create_thread_cb; + 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 + */ +typedef void (* report_xtra_server)(const char*, const char*, const char*); + +/** Callback structure for the XTRA interface. */ +typedef struct { + gps_xtra_download_request download_request_cb; + gps_create_thread create_thread_cb; + report_xtra_server report_xtra_server_cb; +} GpsXtraExtCallbacks; + +/** Represents the status of AGPS. */ +typedef struct { + /** set to sizeof(AGpsExtStatus) */ + size_t size; + + AGpsExtType type; + AGpsStatusValue status; + uint32_t ipv4_addr; + char ipv6_addr[16]; + char ssid[SSID_BUF_SIZE]; + char password[SSID_BUF_SIZE]; +} AGpsExtStatus; + +/** Callback with AGPS status information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* agps_status_extended)(AGpsExtStatus* status); + +/** Callback structure for the AGPS interface. */ +typedef struct { + agps_status_extended status_cb; + gps_create_thread create_thread_cb; +} AGpsExtCallbacks; + + +/** GPS NI callback structure. */ +typedef struct +{ + /** + * Sends the notification request from HAL to GPSLocationProvider. + */ + gps_ni_notify_callback notify_cb; + gps_create_thread create_thread_cb; +} GpsNiExtCallbacks; + +typedef enum loc_server_type { + LOC_AGPS_CDMA_PDE_SERVER, + LOC_AGPS_CUSTOM_PDE_SERVER, + LOC_AGPS_MPC_SERVER, + LOC_AGPS_SUPL_SERVER +} LocServerType; + +typedef enum loc_position_mode_type { + LOC_POSITION_MODE_INVALID = -1, + LOC_POSITION_MODE_STANDALONE = 0, + LOC_POSITION_MODE_MS_BASED, + LOC_POSITION_MODE_MS_ASSISTED, + LOC_POSITION_MODE_RESERVED_1, + LOC_POSITION_MODE_RESERVED_2, + LOC_POSITION_MODE_RESERVED_3, + LOC_POSITION_MODE_RESERVED_4, + LOC_POSITION_MODE_RESERVED_5 + +} LocPositionMode; + +#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. */ +#define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001 +/** GpsLocationExtended has valid altitude mean sea level. */ +#define GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL 0x0002 +/** UlpLocation has valid magnetic deviation. */ +#define GPS_LOCATION_EXTENDED_HAS_MAG_DEV 0x0004 +/** UlpLocation has valid mode indicator. */ +#define GPS_LOCATION_EXTENDED_HAS_MODE_IND 0x0008 +/** GpsLocationExtended has valid vertical uncertainty */ +#define GPS_LOCATION_EXTENDED_HAS_VERT_UNC 0x0010 +/** GpsLocationExtended has valid speed uncertainty */ +#define GPS_LOCATION_EXTENDED_HAS_SPEED_UNC 0x0020 + +/** Represents gps location extended. */ +typedef struct { + /** set to sizeof(GpsLocationExtended) */ + size_t size; + /** Contains GpsLocationExtendedFlags bits. */ + uint16_t flags; + /** Contains the Altitude wrt mean sea level */ + float altitudeMeanSeaLevel; + /** Contains Position Dilusion of Precision. */ + float pdop; + /** Contains Horizontal Dilusion of Precision. */ + float hdop; + /** Contains Vertical Dilusion of Precision. */ + float vdop; + /** Contains Magnetic Deviation. */ + float magneticDeviation; + /** vertical uncertainty in meters */ + float vert_unc; + /** speed uncertainty in m/s */ + float speed_unc; +} GpsLocationExtended; + +typedef struct GpsExtLocation_s { + 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; + +enum loc_sess_status { + LOC_SESS_SUCCESS, + LOC_SESS_INTERMEDIATE, + LOC_SESS_FAILURE +}; + +typedef uint32_t LocPosTechMask; +#define LOC_POS_TECH_MASK_DEFAULT ((LocPosTechMask)0x00000000) +#define LOC_POS_TECH_MASK_SATELLITE ((LocPosTechMask)0x00000001) +#define LOC_POS_TECH_MASK_CELLID ((LocPosTechMask)0x00000002) +#define LOC_POS_TECH_MASK_WIFI ((LocPosTechMask)0x00000004) +#define LOC_POS_TECH_MASK_SENSORS ((LocPosTechMask)0x00000008) +#define LOC_POS_TECH_MASK_REFERENCE_LOCATION ((LocPosTechMask)0x00000010) +#define LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION ((LocPosTechMask)0x00000020) +#define LOC_POS_TECH_MASK_AFLT ((LocPosTechMask)0x00000040) +#define LOC_POS_TECH_MASK_HYBRID ((LocPosTechMask)0x00000080) + +typedef enum { + LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0, + LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM, + LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU, + LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, + LOC_ENG_IF_REQUEST_SENDER_ID_MODEM, + LOC_ENG_IF_REQUEST_SENDER_ID_UNKNOWN +} loc_if_req_sender_id_e_type; + + +#define smaller_of(a, b) (((a) > (b)) ? (b) : (a)) +#define MAX_APN_LEN 100 + +// This will be overridden by the individual adapters +// if necessary. +#define DEFAULT_IMPL(rtv) \ +{ \ + LOC_LOGD("%s: default implementation invoked", __func__); \ + return rtv; \ +} + +enum loc_api_adapter_err { + LOC_API_ADAPTER_ERR_SUCCESS = 0, + LOC_API_ADAPTER_ERR_GENERAL_FAILURE = 1, + LOC_API_ADAPTER_ERR_UNSUPPORTED = 2, + LOC_API_ADAPTER_ERR_INVALID_HANDLE = 4, + LOC_API_ADAPTER_ERR_INVALID_PARAMETER = 5, + LOC_API_ADAPTER_ERR_ENGINE_BUSY = 6, + LOC_API_ADAPTER_ERR_PHONE_OFFLINE = 7, + LOC_API_ADAPTER_ERR_TIMEOUT = 8, + LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT = 9, + LOC_API_ADAPTER_ERR_INTERNAL = 10, + + /* equating engine down to phone offline, as they are the same errror */ + LOC_API_ADAPTER_ERR_ENGINE_DOWN = LOC_API_ADAPTER_ERR_PHONE_OFFLINE, + LOC_API_ADAPTER_ERR_FAILURE = 101, + LOC_API_ADAPTER_ERR_UNKNOWN +}; + +enum loc_api_adapter_event_index { + LOC_API_ADAPTER_REPORT_POSITION = 0, // Position report comes in loc_parsed_position_s_type + LOC_API_ADAPTER_REPORT_SATELLITE, // Satellite in view report + LOC_API_ADAPTER_REPORT_NMEA_1HZ, // NMEA report at 1HZ rate + LOC_API_ADAPTER_REPORT_NMEA_POSITION, // NMEA report at position report rate + LOC_API_ADAPTER_REQUEST_NI_NOTIFY_VERIFY, // NI notification/verification request + LOC_API_ADAPTER_REQUEST_ASSISTANCE_DATA, // Assistance data, eg: time, predicted orbits request + LOC_API_ADAPTER_REQUEST_LOCATION_SERVER, // Request for location server + LOC_API_ADAPTER_REPORT_IOCTL, // Callback report for loc_ioctl + LOC_API_ADAPTER_REPORT_STATUS, // Misc status report: eg, engine state + LOC_API_ADAPTER_REQUEST_WIFI, // + LOC_API_ADAPTER_SENSOR_STATUS, // + LOC_API_ADAPTER_REQUEST_TIME_SYNC, // + LOC_API_ADAPTER_REPORT_SPI, // + LOC_API_ADAPTER_REPORT_NI_GEOFENCE, // + LOC_API_ADAPTER_GEOFENCE_GEN_ALERT, // + LOC_API_ADAPTER_REPORT_GENFENCE_BREACH, // + LOC_API_ADAPTER_PEDOMETER_CTRL, // + LOC_API_ADAPTER_MOTION_CTRL, // + LOC_API_ADAPTER_REQUEST_WIFI_AP_DATA, // Wifi ap data + LOC_API_ADAPTER_BATCH_FULL, // Batching on full + LOC_API_ADAPTER_BATCHED_POSITION_REPORT, // Batching on fix + LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_REPORT, // + + LOC_API_ADAPTER_EVENT_MAX +}; + +#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1< +#include +#include + +void LocPosMode::logv() const +{ + LOC_LOGV ("Position mode: %s\n Position recurrence: %s\n " + "min interval: %d\n preferred accuracy: %d\n " + "preferred time: %d\n credentials: %s provider: %s", + loc_get_position_mode_name(mode), + loc_get_position_recurrence_name(recurrence), + min_interval, + preferred_accuracy, + preferred_time, + credentials, + provider); +} + +/* GPS status names */ +static loc_name_val_s_type gps_status_name[] = +{ + NAME_VAL( GPS_STATUS_NONE ), + NAME_VAL( GPS_STATUS_SESSION_BEGIN ), + NAME_VAL( GPS_STATUS_SESSION_END ), + NAME_VAL( GPS_STATUS_ENGINE_ON ), + NAME_VAL( GPS_STATUS_ENGINE_OFF ), +}; +static int gps_status_num = sizeof(gps_status_name) / sizeof(loc_name_val_s_type); + +/* Find Android GPS status name */ +const char* loc_get_gps_status_name(GpsStatusValue gps_status) +{ + return loc_get_name_from_val(gps_status_name, gps_status_num, + (long) gps_status); +} + + + +static loc_name_val_s_type loc_eng_position_modes[] = +{ + NAME_VAL( LOC_POSITION_MODE_STANDALONE ), + NAME_VAL( LOC_POSITION_MODE_MS_BASED ), + NAME_VAL( LOC_POSITION_MODE_MS_ASSISTED ), + NAME_VAL( LOC_POSITION_MODE_RESERVED_1 ), + NAME_VAL( LOC_POSITION_MODE_RESERVED_2 ), + NAME_VAL( LOC_POSITION_MODE_RESERVED_3 ), + NAME_VAL( LOC_POSITION_MODE_RESERVED_4 ), + NAME_VAL( LOC_POSITION_MODE_RESERVED_5 ) +}; +static int loc_eng_position_mode_num = sizeof(loc_eng_position_modes) / sizeof(loc_name_val_s_type); + +const char* loc_get_position_mode_name(GpsPositionMode mode) +{ + return loc_get_name_from_val(loc_eng_position_modes, loc_eng_position_mode_num, (long) mode); +} + + + +static loc_name_val_s_type loc_eng_position_recurrences[] = +{ + NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ), + NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE ) +}; +static int loc_eng_position_recurrence_num = sizeof(loc_eng_position_recurrences) / sizeof(loc_name_val_s_type); + +const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur) +{ + return loc_get_name_from_val(loc_eng_position_recurrences, loc_eng_position_recurrence_num, (long) recur); +} + + + +static loc_name_val_s_type loc_eng_aiding_data_bits[] = +{ + NAME_VAL( GPS_DELETE_EPHEMERIS ), + NAME_VAL( GPS_DELETE_ALMANAC ), + NAME_VAL( GPS_DELETE_POSITION ), + NAME_VAL( GPS_DELETE_TIME ), + NAME_VAL( GPS_DELETE_IONO ), + NAME_VAL( GPS_DELETE_UTC ), + NAME_VAL( GPS_DELETE_HEALTH ), + NAME_VAL( GPS_DELETE_SVDIR ), + NAME_VAL( GPS_DELETE_SVSTEER ), + NAME_VAL( GPS_DELETE_SADATA ), + NAME_VAL( GPS_DELETE_RTI ), + NAME_VAL( GPS_DELETE_CELLDB_INFO ), +#ifndef PDK_FEATURE_SET + NAME_VAL( GPS_DELETE_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ), + NAME_VAL( GLO_DELETE_EPHEMERIS ), + NAME_VAL( GLO_DELETE_ALMANAC ), + NAME_VAL( GLO_DELETE_SVDIR ), + NAME_VAL( GLO_DELETE_SVSTEER ), + NAME_VAL( GLO_DELETE_ALMANAC_CORR ), + NAME_VAL( GPS_DELETE_TIME_GPS ), + NAME_VAL( GLO_DELETE_TIME ), + NAME_VAL( BDS_DELETE_SVDIR ), + NAME_VAL( BDS_DELETE_SVSTEER ), + NAME_VAL( BDS_DELETE_TIME ), + NAME_VAL( BDS_DELETE_ALMANAC_CORR ), + NAME_VAL( BDS_DELETE_EPHEMERIS ), + NAME_VAL( BDS_DELETE_ALMANAC ), +#endif + NAME_VAL( GPS_DELETE_ALL) +}; +static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type); + +const char* loc_get_aiding_data_mask_names(GpsAidingData data) +{ + return NULL; +} + + +static loc_name_val_s_type loc_eng_agps_types[] = +{ + NAME_VAL( AGPS_TYPE_INVALID ), + NAME_VAL( AGPS_TYPE_ANY ), + NAME_VAL( AGPS_TYPE_SUPL ), + NAME_VAL( AGPS_TYPE_C2K ), + NAME_VAL( AGPS_TYPE_WWAN_ANY ) +}; +static int loc_eng_agps_type_num = sizeof(loc_eng_agps_types) / sizeof(loc_name_val_s_type); + +const char* loc_get_agps_type_name(AGpsType type) +{ + return loc_get_name_from_val(loc_eng_agps_types, loc_eng_agps_type_num, (long) type); +} + + +static loc_name_val_s_type loc_eng_ni_types[] = +{ + NAME_VAL( GPS_NI_TYPE_VOICE ), + NAME_VAL( GPS_NI_TYPE_UMTS_SUPL ), + NAME_VAL( GPS_NI_TYPE_UMTS_CTRL_PLANE ), + NAME_VAL( GPS_NI_TYPE_EMERGENCY_SUPL ) +}; +static int loc_eng_ni_type_num = sizeof(loc_eng_ni_types) / sizeof(loc_name_val_s_type); + +const char* loc_get_ni_type_name(GpsNiType type) +{ + return loc_get_name_from_val(loc_eng_ni_types, loc_eng_ni_type_num, (long) type); +} + + +static loc_name_val_s_type loc_eng_ni_responses[] = +{ + NAME_VAL( GPS_NI_RESPONSE_ACCEPT ), + NAME_VAL( GPS_NI_RESPONSE_DENY ), + NAME_VAL( GPS_NI_RESPONSE_DENY ) +}; +static int loc_eng_ni_reponse_num = sizeof(loc_eng_ni_responses) / sizeof(loc_name_val_s_type); + +const char* loc_get_ni_response_name(GpsUserResponseType response) +{ + return loc_get_name_from_val(loc_eng_ni_responses, loc_eng_ni_reponse_num, (long) response); +} + + +static loc_name_val_s_type loc_eng_ni_encodings[] = +{ + NAME_VAL( GPS_ENC_NONE ), + NAME_VAL( GPS_ENC_SUPL_GSM_DEFAULT ), + NAME_VAL( GPS_ENC_SUPL_UTF8 ), + NAME_VAL( GPS_ENC_SUPL_UCS2 ), + NAME_VAL( GPS_ENC_UNKNOWN ) +}; +static int loc_eng_ni_encoding_num = sizeof(loc_eng_ni_encodings) / sizeof(loc_name_val_s_type); + +const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding) +{ + return loc_get_name_from_val(loc_eng_ni_encodings, loc_eng_ni_encoding_num, (long) encoding); +} + +static loc_name_val_s_type loc_eng_agps_bears[] = +{ + NAME_VAL( AGPS_APN_BEARER_INVALID ), + NAME_VAL( AGPS_APN_BEARER_IPV4 ), + NAME_VAL( AGPS_APN_BEARER_IPV6 ), + NAME_VAL( AGPS_APN_BEARER_IPV4V6 ) +}; +static int loc_eng_agps_bears_num = sizeof(loc_eng_agps_bears) / sizeof(loc_name_val_s_type); + +const char* loc_get_agps_bear_name(AGpsBearerType bearer) +{ + return loc_get_name_from_val(loc_eng_agps_bears, loc_eng_agps_bears_num, (long) bearer); +} + +static loc_name_val_s_type loc_eng_server_types[] = +{ + NAME_VAL( LOC_AGPS_CDMA_PDE_SERVER ), + NAME_VAL( LOC_AGPS_CUSTOM_PDE_SERVER ), + NAME_VAL( LOC_AGPS_MPC_SERVER ), + NAME_VAL( LOC_AGPS_SUPL_SERVER ) +}; +static int loc_eng_server_types_num = sizeof(loc_eng_server_types) / sizeof(loc_name_val_s_type); + +const char* loc_get_server_type_name(LocServerType type) +{ + return loc_get_name_from_val(loc_eng_server_types, loc_eng_server_types_num, (long) type); +} + +static loc_name_val_s_type loc_eng_position_sess_status_types[] = +{ + NAME_VAL( LOC_SESS_SUCCESS ), + NAME_VAL( LOC_SESS_INTERMEDIATE ), + NAME_VAL( LOC_SESS_FAILURE ) +}; +static int loc_eng_position_sess_status_num = sizeof(loc_eng_position_sess_status_types) / sizeof(loc_name_val_s_type); + +const char* loc_get_position_sess_status_name(enum loc_sess_status status) +{ + return loc_get_name_from_val(loc_eng_position_sess_status_types, loc_eng_position_sess_status_num, (long) status); +} + +static loc_name_val_s_type loc_eng_agps_status_names[] = +{ + NAME_VAL( GPS_REQUEST_AGPS_DATA_CONN ), + NAME_VAL( GPS_RELEASE_AGPS_DATA_CONN ), + NAME_VAL( GPS_AGPS_DATA_CONNECTED ), + NAME_VAL( GPS_AGPS_DATA_CONN_DONE ), + NAME_VAL( GPS_AGPS_DATA_CONN_FAILED ) +}; +static int loc_eng_agps_status_num = sizeof(loc_eng_agps_status_names) / sizeof(loc_name_val_s_type); + +const char* loc_get_agps_status_name(AGpsStatusValue status) +{ + return loc_get_name_from_val(loc_eng_agps_status_names, loc_eng_agps_status_num, (long) status); +} diff --git a/gps/core/loc_core_log.h b/gps/core/loc_core_log.h new file mode 100644 index 0000000..8a1825a --- /dev/null +++ b/gps/core/loc_core_log.h @@ -0,0 +1,58 @@ +/* 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. + * + */ + +#ifndef LOC_CORE_LOG_H +#define LOC_CORE_LOG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include + +const char* loc_get_gps_status_name(GpsStatusValue gps_status); +const char* loc_get_position_mode_name(GpsPositionMode mode); +const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur); +const char* loc_get_aiding_data_mask_names(GpsAidingData data); +const char* loc_get_agps_type_name(AGpsType type); +const char* loc_get_ni_type_name(GpsNiType type); +const char* loc_get_ni_response_name(GpsUserResponseType response); +const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding); +const char* loc_get_agps_bear_name(AGpsBearerType bear); +const char* loc_get_server_type_name(LocServerType type); +const char* loc_get_position_sess_status_name(enum loc_sess_status status); +const char* loc_get_agps_status_name(AGpsStatusValue status); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_CORE_LOG_H */ diff --git a/gps/flp.conf b/gps/flp.conf new file mode 100644 index 0000000..7d6002f --- /dev/null +++ b/gps/flp.conf @@ -0,0 +1,60 @@ +################################### +##### FLP settings ##### +################################### + +################################### +# FLP BATCHING SIZE +################################### +# The number of batched locations +# requested to modem. The desired number +# defined below may not be satisfied, as +# the modem can only return the number +# of batched locations that can be allocated, +# which is limited by memory. The default +# batch size defined as 20 as below. +BATCH_SIZE=20 + +################################### +# FLP BATCHING SESSION TIMEOUT +################################### +# Duration with which batch session timeout +# happens in milliseconds. If not specified +# or set to zero, batching session timeout +# defaults to 20 seconds by the modem. +# BATCH_SESSION_TIMEOUT=20000 + +################################### +# FLP CAPABILITIES BIT MASK +################################### +# GEOFENCE = 0x01 +# BATCHING = 0x02 +# default = GEOFENCE | BATCHING +CAPABILITIES=0x03 + +################################### +# FLP BATCHING ACCURACY +################################### +# Set to one of the defined values below +# to define the accuracy of batching. +# If not specified, accuracy defaults +# to LOW. +# FLP BATCHING ACCURACY values: +# Low accuracy = 0 +# Medium accuracy = 1 +# High accuracy = 2 +ACCURACY=0 + +################################### +# FLP GEOFENCE RESPONSIVENESS +################################### +# If set to one of the defined values below, +# it will override the responsiveness for +# FLP geofence, which implements the fused +# location API. If not set to a value defined +# below, which is default, it will not +# override the responsivness. +# FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE Values: +# 1: LOW responsiveness +# 2: MEDIUM responsiveness +# 3: HIGH responsiveness +FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE = 0 diff --git a/gps/gps.conf b/gps/gps.conf new file mode 100644 index 0000000..ae8b7fd --- /dev/null +++ b/gps/gps.conf @@ -0,0 +1,74 @@ +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 + +# Error Estimate +# _SET = 1 +# _CLEAR = 0 +ERR_ESTIMATE=0 + +NTP_SERVER=time.izatcloud.net + +# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info +# 4 - Debug, 5 - Verbose +# If DEBUG_LEVEL is commented, Android's logging levels will be used +DEBUG_LEVEL = 2 + +# Intermediate position report, 1=enable, 0=disable +INTERMEDIATE_POS=0 + +# supl version 1.0 +SUPL_VER=0x10000 + +# Emergency SUPL, 1=enable, 0=disable +SUPL_ES=1 + +# GPS Capabilities bit mask +# SCHEDULING = 0x01 +# MSB = 0x02 +# MSA = 0x04 +# ON_DEMAND_TIME = 0x10 +# GEOFENCE = 0x20 +# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE +CAPABILITIES=0x37 + +# Accuracy threshold for intermediate positions +# less accurate positions are ignored, 0 for passing all positions +# ACCURACY_THRES=5000 + +################################ +##### AGPS server settings ##### +################################ + +# FOR SUPL SUPPORT, set the following +# SUPL_HOST=supl.host.com or IP +# SUPL_PORT=1234 + +# FOR C2K PDE SUPPORT, set the following +# C2K_HOST=c2k.pde.com or IP +# C2K_PORT=1234 + +#################################### +# LTE Positioning Profile Settings +#################################### +# 0: Enable RRLP on LTE(Default) +# 1: Enable LPP_User_Plane on LTE +# 2: Enable LPP_Control_Plane +# 3: Enable both LPP_User_Plane and LPP_Control_Plane +LPP_PROFILE = 0 + +################################ +# EXTRA SETTINGS +################################ +# NMEA provider (1=Modem Processor, 0=Application Processor) +NMEA_PROVIDER=0 +# Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE) +SGLTE_TARGET=0 + +################################################## +# Select Positioning Protocol on A-GLONASS system +################################################## +# 0x1: RRC CPlane +# 0x2: RRLP UPlane +# 0x4: LLP Uplane +A_GLONASS_POS_PROTOCOL_SELECT = 0 \ No newline at end of file diff --git a/gps/izat.conf b/gps/izat.conf new file mode 100644 index 0000000..3972f84 --- /dev/null +++ b/gps/izat.conf @@ -0,0 +1,170 @@ +######################################## +# NLP/WIFI positioning options bit mask +######################################## +# Enable NLP fixes for WIPER/ODCPI feature => WIPER = 0x1 +# Enable free wifi scan injections for GEOFENCE => FREE_WIFI = 0x2 +# Enable SUPL2 MLD wifi => SUPL_WIFI = 0x4 +# Enable Attached Wifi AP info injection for GEOFENCE => FREE_AP_INFO = 0x8 +# default = WIPER | FREE_WIFI | SUPL_WIFI | FREE_AP_INFO +NLP_WIFI_LISTENER_MODE = 15 + +################################################## +# Select WIFI Wait Timeout value in seconds for SUPL +################################################## +WIFI_WAIT_TIMEOUT_SELECT = 0 + +################################ +# NLP Settings +################################ +# NLP_MODE 1: GNP Only, 2: QNP Only, 3: Combo +# NLP_TOLERANCE_TIME_FIRST: Time in ms used in Combo mode +# to determine how much Tolerance for first position +# NLP_TOLERANCE_TIME_AFTER: Time in ms used in Combo mode +# to determine how much Tolerance for positions after first +# NLP_THRESHOLD: Sets how many failures needed before +# switching preferred NLP in Combo mode +# NLP_ACCURACY_MULTIPLE: Determines how far off the accuracy +# must be, in multiples, between two NLP location reports to +# be considered much worse accuracy. Used in switching logic +NLP_MODE = 3 +NLP_TOLERANCE_TIME_FIRST = 5000 +NLP_TOLERANCE_TIME_AFTER = 20000 +NLP_THRESHOLD = 3 +NLP_ACCURACY_MULTIPLE = 2 + +# Threshold period for ZPP triggers +ZPP_TRIGGER_THRESHOLD=10000 + +################################### +# GEOFENCE SERVICES +################################### +# If set to one of the defined values below, it will override +# the responsiveness for geofence services, which implements +# the Proximity Alert API. If not set to a value defined below, +# which is default, it will not override the responsivness. +# The geofence HAL API is unaffected by this value. +# GEOFENCE_SERVICES_RESPONSIVENESS_OVERRIDE Values: +# 1: LOW responsiveness +# 2: MEDIUM responsiveness +# 3: HIGH responsiveness +GEOFENCE_SERVICES_RESPONSIVENESS_OVERRIDE = 0 + +##################################### +# IZAT PREMIUM FEATURE SETTINGS +##################################### +#Possible states of a feature: +#DISABLED +#BASIC +#PREMIUM + +#GTP_CELL_PROC valid options: +# AP +# MODEM +GTP_CELL_PROC=MODEM + +#GTP_CELL valid modes: +# DISABLED +# BASIC +GTP_CELL=BASIC + +#GTP_WIFI valid modes: +# DISABLED +# BASIC +GTP_WIFI=BASIC + +#SAP valid modes: +# DISABLED +# BASIC +# PREMIUM +SAP=BASIC + +#PIP valid modes: +# DISABLED +# PREMIUM +PIP=DISABLED + +##################################### +# Location process launcher settings +##################################### + +#Values for PROCESS_STATE: +# ENABLED +# DISABLED + +#FEATURE MASKS: +# GTP-WIFI 0X03 +# GTP-CELL 0X0c +# PIP 0x30 +# SAP 0Xc0 + +#Values for PLATFORMS can be: +#1. Any valid values obtained from ro.board.platform separated by single space. For example: msm8960 msm8226 +#2. all -> for All platforms + +#Values for BASEBAND can be: +#1. Any valid values obtained from ro.baseband separated by single space. For example: sglte sglte2 +#2. all -> for all basebands + +PROCESS_NAME=/system/bin/gpsone_daemon +PROCESS_STATE=ENABLED +PROCESS_GROUPS=inet net_raw +PREMIUM_FEATURE=0 +IZAT_FEATURE_MASK=0 +PLATFORMS=msm7630_fusion +BASEBAND=svlte2a sglte sglte2 + +PROCESS_NAME=/system/bin/location-mq +PROCESS_STATE=ENABLED +PROCESS_GROUPS=gps +PREMIUM_FEATURE=1 +IZAT_FEATURE_MASK=0x3f +PLATFORMS=all +BASEBAND=all + +PROCESS_NAME=/system/bin/lowi-server +PROCESS_STATE=ENABLED +PROCESS_GROUPS=gps net_admin wifi inet qcom_diag net_raw +PREMIUM_FEATURE=1 +IZAT_FEATURE_MASK=0x33 +PLATFORMS=all +BASEBAND=all + +PROCESS_NAME=/system/bin/quipc_igsn +PROCESS_STATE=ENABLED +PROCESS_GROUPS=inet gps qcom_diag +PREMIUM_FEATURE=1 +IZAT_FEATURE_MASK=0x30 +PLATFORMS=all +BASEBAND=all + +PROCESS_NAME=/system/bin/quipc_main +PROCESS_STATE=ENABLED +PROCESS_GROUPS=gps net_admin wifi inet qcom_diag +PREMIUM_FEATURE=1 +IZAT_FEATURE_MASK=0x30 +PLATFORMS=all +BASEBAND=all + +PROCESS_NAME=/system/bin/xtwifi-inet-agent +PROCESS_STATE=ENABLED +PROCESS_GROUPS=inet gps +PREMIUM_FEATURE=1 +IZAT_FEATURE_MASK=0x0f +PLATFORMS=all +BASEBAND=all + +PROCESS_NAME=/system/bin/xtwifi-client +PROCESS_STATE=ENABLED +PROCESS_GROUPS=net_admin wifi inet gps +PREMIUM_FEATURE=1 +IZAT_FEATURE_MASK=0x0f +PLATFORMS=all +BASEBAND=all + +PROCESS_NAME=/system/bin/gsiff_daemon +PROCESS_STATE=ENABLED +PROCESS_GROUPS=gps net_raw misc qcom_oncrpc +PREMIUM_FEATURE=1 +IZAT_FEATURE_MASK=0xf0 +PLATFORMS=all +BASEBAND=all diff --git a/gps/libloc_api_50001/Android.mk b/gps/libloc_api_50001/Android.mk new file mode 100644 index 0000000..496527b --- /dev/null +++ b/gps/libloc_api_50001/Android.mk @@ -0,0 +1,119 @@ +ifneq ($(BUILD_TINY_ANDROID),true) +#Compile this library only for builds with the latest modem image + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_eng +LOCAL_MODULE_OWNER := qcom + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libdl \ + liblog \ + libloc_core \ + libgps.utils + +LOCAL_SRC_FILES += \ + loc_eng.cpp \ + loc_eng_agps.cpp \ + loc_eng_xtra.cpp \ + loc_eng_ni.cpp \ + loc_eng_log.cpp \ + loc_eng_nmea.cpp \ + LocEngAdapter.cpp + +LOCAL_SRC_FILES += \ + loc_eng_dmn_conn.cpp \ + loc_eng_dmn_conn_handler.cpp \ + loc_eng_dmn_conn_thread_helper.c \ + loc_eng_dmn_conn_glue_msg.c \ + loc_eng_dmn_conn_glue_pipe.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libloc_core \ + device/lge/w7/gps/libloc_api_50001 + +LOCAL_COPY_HEADERS_TO:= libloc_eng/ +LOCAL_COPY_HEADERS:= \ + LocEngAdapter.h \ + loc.h \ + loc_eng.h \ + loc_eng_xtra.h \ + loc_eng_ni.h \ + loc_eng_agps.h \ + loc_eng_msg.h \ + loc_eng_log.h + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_MODULE := gps.msm8226 +LOCAL_MODULE_OWNER := qcom + +LOCAL_MODULE_TAGS := optional + +## Libs + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + liblog \ + libloc_eng \ + libloc_core \ + libgps.utils \ + libdl + +ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false) +endif + +LOCAL_SRC_FILES += \ + loc.cpp \ + gps.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ \ + +ifeq ($(TARGET_USES_QCOM_BSP), true) +LOCAL_CFLAGS += -DTARGET_USES_QCOM_BSP +endif + +## Includes +LOCAL_C_INCLUDES:= \ + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libloc_core + +ifneq ($(QCPATH),) +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 +endif + +LOCAL_PRELINK_MODULE := false +LOCAL_MODULE_RELATIVE_PATH := hw + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/gps/libloc_api_50001/LocEngAdapter.cpp b/gps/libloc_api_50001/LocEngAdapter.cpp new file mode 100644 index 0000000..0ac3df4 --- /dev/null +++ b/gps/libloc_api_50001/LocEngAdapter.cpp @@ -0,0 +1,389 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_EngAdapter" + +#include +#include "loc_eng_msg.h" +#include "loc_log.h" + +using namespace loc_core; + +LocInternalAdapter::LocInternalAdapter(LocEngAdapter* adapter) : + LocAdapterBase(adapter->getMsgTask()), + mLocEngAdapter(adapter) +{ +} +void LocInternalAdapter::setPositionModeInt(LocPosMode& posMode) { + sendMsg(new LocEngPositionMode(mLocEngAdapter, posMode)); +} +void LocInternalAdapter::startFixInt() { + sendMsg(new LocEngStartFix(mLocEngAdapter)); +} +void LocInternalAdapter::stopFixInt() { + sendMsg(new LocEngStopFix(mLocEngAdapter)); +} +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) : + LocAdapterBase(mask, + //Get the AFW context if VzW context has not already been intialized in + //loc_ext + context == NULL? + LocDualContext::getLocFgContext(tCreator, + LocDualContext::mLocationHalName) + :context), + mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), + mUlp(new UlpProxyBase()), mNavigating(false), + mSupportsAgpsRequests(false), + mSupportsPositionInjection(false), + mSupportsTimeInjection(false), + mPowerVote(0) +{ + memset(&mFixCriteria, 0, sizeof(mFixCriteria)); + mFixCriteria.mode = LOC_POSITION_MODE_INVALID; + LOC_LOGD("LocEngAdapter created"); +} + +inline +LocEngAdapter::~LocEngAdapter() +{ + delete mInternalAdapter; + LOC_LOGV("LocEngAdapter deleted"); +} + +void LocInternalAdapter::setUlpProxy(UlpProxyBase* ulp) { + struct LocSetUlpProxy : public LocMsg { + LocAdapterBase* mAdapter; + UlpProxyBase* mUlp; + inline LocSetUlpProxy(LocAdapterBase* adapter, UlpProxyBase* ulp) : + LocMsg(), mAdapter(adapter), mUlp(ulp) { + } + virtual void proc() const { + LOC_LOGV("%s] ulp %p adapter %p", __func__, + mUlp, mAdapter); + mAdapter->setUlpProxy(mUlp); + } + }; + + sendMsg(new LocSetUlpProxy(mLocEngAdapter, ulp)); +} + +void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp) +{ + if (ulp == mUlp) { + //This takes care of the case when double initalization happens + //and we get the same object back for UlpProxyBase . Do nothing + return; + } + + LOC_LOGV("%s] %p", __func__, ulp); + if (NULL == ulp) { + LOC_LOGE("%s:%d]: ulp pointer is NULL", __func__, __LINE__); + ulp = new UlpProxyBase(); + } + + if (LOC_POSITION_MODE_INVALID != mUlp->mPosMode.mode) { + // need to send this mode and start msg to ULP + ulp->sendFixMode(mUlp->mPosMode); + } + + if(mUlp->mFixSet) { + ulp->sendStartFix(); + } + + delete mUlp; + mUlp = ulp; +} + +int LocEngAdapter::setGpsLockMsg(LOC_GPS_LOCK_MASK lockMask) +{ + struct LocEngAdapterGpsLock : public LocMsg { + LocEngAdapter* mAdapter; + LOC_GPS_LOCK_MASK mLockMask; + inline LocEngAdapterGpsLock(LocEngAdapter* adapter, LOC_GPS_LOCK_MASK lockMask) : + LocMsg(), mAdapter(adapter), mLockMask(lockMask) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setGpsLock(mLockMask); + } + inline void locallog() const { + LOC_LOGV("LocEngAdapterGpsLock - mLockMask: %x", mLockMask); + } + inline virtual void log() const { + locallog(); + } + }; + sendMsg(new LocEngAdapterGpsLock(this, lockMask)); + return 0; +} + +void LocEngAdapter::requestPowerVote() +{ + if (getPowerVoteRight()) { + /* Power voting without engine lock: + * 101: vote down, 102-104 - vote up + * These codes are used not to confuse with actual engine lock + * functionality, that can't be used in SSR scenario, as it + * conflicts with initialization sequence. + */ + bool powerUp = getPowerVote(); + LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d", (int)powerUp); + setGpsLock(powerUp ? 103 : 101); + } +} + +void LocInternalAdapter::reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) +{ + sendMsg(new LocEngReportPosition(mLocEngAdapter, + location, + locationExtended, + locationExt, + status, + loc_technology_mask)); +} + + +void LocEngAdapter::reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask) +{ + if (! mUlp->reportPosition(location, + locationExtended, + locationExt, + status, + loc_technology_mask )) { + mInternalAdapter->reportPosition(location, + locationExtended, + locationExt, + status, + loc_technology_mask); + } +} + +void LocInternalAdapter::reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt){ + sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus, + locationExtended, svExt)); +} + +void LocEngAdapter::reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt) +{ + + // We want to send SV info to ULP to help it in determining GNSS + // signal strength ULP will forward the SV reports to HAL without + // any modifications + if (! mUlp->reportSv(svStatus, locationExtended, svExt)) { + mInternalAdapter->reportSv(svStatus, locationExtended, svExt); + } +} + +void LocEngAdapter::setInSession(bool inSession) +{ + mNavigating = inSession; + mLocApi->setInSession(inSession); + if (!mNavigating) { + mFixCriteria.mode = LOC_POSITION_MODE_INVALID; + } +} + +void LocInternalAdapter::reportStatus(GpsStatusValue status) +{ + sendMsg(new LocEngReportStatus(mLocEngAdapter, status)); +} + +void LocEngAdapter::reportStatus(GpsStatusValue status) +{ + if (!mUlp->reportStatus(status)) { + mInternalAdapter->reportStatus(status); + } +} + +inline +void LocEngAdapter::reportNmea(const char* nmea, int length) +{ + sendMsg(new LocEngReportNmea(mOwner, nmea, length)); +} + +inline +bool LocEngAdapter::reportXtraServer(const char* url1, + const char* url2, + const char* url3, + const int maxlength) +{ + if (mSupportsAgpsRequests) { + sendMsg(new LocEngReportXtraServer(mOwner, url1, + url2, url3, maxlength)); + } + return mSupportsAgpsRequests; +} + +inline +bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) +{ + if (mSupportsAgpsRequests) { + sendMsg(new LocEngRequestATL(mOwner, + connHandle, agps_type)); + } + return mSupportsAgpsRequests; +} + +inline +bool LocEngAdapter::releaseATL(int connHandle) +{ + if (mSupportsAgpsRequests) { + sendMsg(new LocEngReleaseATL(mOwner, connHandle)); + } + return mSupportsAgpsRequests; +} + +inline +bool LocEngAdapter::requestXtraData() +{ + if (mSupportsAgpsRequests) { + sendMsg(new LocEngRequestXtra(mOwner)); + } + return mSupportsAgpsRequests; +} + +inline +bool LocEngAdapter::requestTime() +{ + if (mSupportsAgpsRequests) { + sendMsg(new LocEngRequestTime(mOwner)); + } + return mSupportsAgpsRequests; +} + +inline +bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) +{ + if (mSupportsAgpsRequests) { + notif.size = sizeof(notif); + notif.timeout = LOC_NI_NO_RESPONSE_TIME; + + sendMsg(new LocEngRequestNi(mOwner, notif, data)); + } + return mSupportsAgpsRequests; +} + +inline +bool LocEngAdapter::requestSuplES(int connHandle) +{ + if (mSupportsAgpsRequests) + sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); + return mSupportsAgpsRequests; +} + +inline +bool LocEngAdapter::reportDataCallOpened() +{ + if(mSupportsAgpsRequests) + sendMsg(new LocEngSuplEsOpened(mOwner)); + return mSupportsAgpsRequests; +} + +inline +bool LocEngAdapter::reportDataCallClosed() +{ + if(mSupportsAgpsRequests) + sendMsg(new LocEngSuplEsClosed(mOwner)); + return mSupportsAgpsRequests; +} + +inline +void LocEngAdapter::handleEngineDownEvent() +{ + sendMsg(new LocEngDown(mOwner)); +} + +inline +void LocEngAdapter::handleEngineUpEvent() +{ + sendMsg(new LocEngUp(mOwner)); +} + +enum loc_api_adapter_err LocEngAdapter::setTime(GpsUtcTime time, + int64_t timeReference, + int uncertainty) +{ + loc_api_adapter_err result = LOC_API_ADAPTER_ERR_SUCCESS; + + LOC_LOGD("%s:%d]: mSupportsTimeInjection is %d", + __func__, __LINE__, mSupportsTimeInjection); + + if (mSupportsTimeInjection) { + LOC_LOGD("%s:%d]: Injecting time", __func__, __LINE__); + result = mLocApi->setTime(time, timeReference, uncertainty); + } else { + mSupportsTimeInjection = true; + } + return result; +} + +enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check) +{ + enum loc_api_adapter_err ret; + ENTRY_LOG(); + enum xtra_version_check eCheck; + switch (check) { + case 0: + eCheck = DISABLED; + case 1: + eCheck = AUTO; + case 2: + eCheck = XTRA2; + case 3: + eCheck = XTRA3; + defaul: + eCheck = DISABLED; + } + ret = mLocApi->setXtraVersionCheck(eCheck); + EXIT_LOG(%d, ret); + return ret; +} diff --git a/gps/libloc_api_50001/LocEngAdapter.h b/gps/libloc_api_50001/LocEngAdapter.h new file mode 100644 index 0000000..b857d19 --- /dev/null +++ b/gps/libloc_api_50001/LocEngAdapter.h @@ -0,0 +1,339 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef LOC_API_ENG_ADAPTER_H +#define LOC_API_ENG_ADAPTER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_URL_LEN 256 + +using namespace loc_core; + +class LocEngAdapter; + +class LocInternalAdapter : public LocAdapterBase { + LocEngAdapter* mLocEngAdapter; +public: + LocInternalAdapter(LocEngAdapter* adapter); + + virtual void reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask); + virtual void reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); + virtual void reportStatus(GpsStatusValue status); + virtual void setPositionModeInt(LocPosMode& posMode); + virtual void startFixInt(); + 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); + +class LocEngAdapter : public LocAdapterBase { + void* mOwner; + LocInternalAdapter* mInternalAdapter; + UlpProxyBase* mUlp; + LocPosMode mFixCriteria; + bool mNavigating; + // mPowerVote is encoded as + // mPowerVote & 0x20 -- powerVoteRight + // mPowerVote & 0x10 -- power On / Off + unsigned int mPowerVote; + static const unsigned int POWER_VOTE_RIGHT = 0x20; + static const unsigned int POWER_VOTE_VALUE = 0x10; + +public: + bool mSupportsAgpsRequests; + bool mSupportsPositionInjection; + bool mSupportsTimeInjection; + + LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, + void* owner, ContextBase* context, + MsgTask::tCreate tCreator); + virtual ~LocEngAdapter(); + + virtual void setUlpProxy(UlpProxyBase* ulp); + inline void requestUlp(unsigned long capabilities) { + mContext->requestUlp(mInternalAdapter, capabilities); + } + inline LocInternalAdapter* getInternalAdapter() { return mInternalAdapter; } + inline UlpProxyBase* getUlpProxy() { return mUlp; } + inline void* getOwner() { return mOwner; } + inline bool hasAgpsExtendedCapabilities() { + return mContext->hasAgpsExtendedCapabilities(); + } + inline bool hasCPIExtendedCapabilities() { + return mContext->hasCPIExtendedCapabilities(); + } + inline const MsgTask* getMsgTask() { return mMsgTask; } + + inline enum loc_api_adapter_err + startFix() + { + return mLocApi->startFix(mFixCriteria); + } + inline enum loc_api_adapter_err + stopFix() + { + return mLocApi->stopFix(); + } + inline enum loc_api_adapter_err + deleteAidingData(GpsAidingData f) + { + return mLocApi->deleteAidingData(f); + } + inline enum loc_api_adapter_err + enableData(int enable) + { + return mLocApi->enableData(enable); + } + inline enum loc_api_adapter_err + setAPN(char* apn, int len) + { + return mLocApi->setAPN(apn, len); + } + inline enum loc_api_adapter_err + injectPosition(double latitude, double longitude, float accuracy) + { + return mLocApi->injectPosition(latitude, longitude, accuracy); + } + inline enum loc_api_adapter_err + setXtraData(char* data, int length) + { + return mLocApi->setXtraData(data, length); + } + inline enum loc_api_adapter_err + requestXtraServer() + { + return mLocApi->requestXtraServer(); + } + inline enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType) + { + return mLocApi->atlOpenStatus(handle, is_succ, apn, bearer, agpsType); + } + inline enum loc_api_adapter_err + atlCloseStatus(int handle, int is_succ) + { + return mLocApi->atlCloseStatus(handle, is_succ); + } + inline enum loc_api_adapter_err + setPositionMode(const LocPosMode *posMode) + { + if (NULL != posMode) { + mFixCriteria = *posMode; + } + return mLocApi->setPositionMode(mFixCriteria); + } + inline enum loc_api_adapter_err + setServer(const char* url, int len) + { + return mLocApi->setServer(url, len); + } + inline enum loc_api_adapter_err + setServer(unsigned int ip, int port, + LocServerType type) + { + return mLocApi->setServer(ip, port, type); + } + inline enum loc_api_adapter_err + informNiResponse(GpsUserResponseType userResponse, const void* passThroughData) + { + return mLocApi->informNiResponse(userResponse, passThroughData); + } + inline enum loc_api_adapter_err + setSUPLVersion(uint32_t version) + { + return mLocApi->setSUPLVersion(version); + } + inline enum loc_api_adapter_err + setLPPConfig(uint32_t profile) + { + return mLocApi->setLPPConfig(profile); + } + inline enum loc_api_adapter_err + setSensorControlConfig(int sensorUsage, int sensorProvider) + { + return mLocApi->setSensorControlConfig(sensorUsage, sensorProvider); + } + inline enum loc_api_adapter_err + setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, + bool accelBiasVarianceRandomWalk_valid, float accelBiasVarianceRandomWalk, + bool angleBiasVarianceRandomWalk_valid, float angleBiasVarianceRandomWalk, + bool rateBiasVarianceRandomWalk_valid, float rateBiasVarianceRandomWalk, + bool velocityBiasVarianceRandomWalk_valid, float velocityBiasVarianceRandomWalk) + { + return mLocApi->setSensorProperties(gyroBiasVarianceRandomWalk_valid, gyroBiasVarianceRandomWalk, + accelBiasVarianceRandomWalk_valid, accelBiasVarianceRandomWalk, + angleBiasVarianceRandomWalk_valid, angleBiasVarianceRandomWalk, + rateBiasVarianceRandomWalk_valid, rateBiasVarianceRandomWalk, + velocityBiasVarianceRandomWalk_valid, velocityBiasVarianceRandomWalk); + } + inline virtual enum loc_api_adapter_err + setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig) + { + return mLocApi->setSensorPerfControlConfig(controlMode, accelSamplesPerBatch, accelBatchesPerSec, + gyroSamplesPerBatch, gyroBatchesPerSec, + accelSamplesPerBatchHigh, accelBatchesPerSecHigh, + gyroSamplesPerBatchHigh, gyroBatchesPerSecHigh, + algorithmConfig); + } + inline virtual enum loc_api_adapter_err + setExtPowerConfig(int isBatteryCharging) + { + return mLocApi->setExtPowerConfig(isBatteryCharging); + } + inline virtual enum loc_api_adapter_err + setAGLONASSProtocol(unsigned long aGlonassProtocol) + { + return mLocApi->setAGLONASSProtocol(aGlonassProtocol); + } + inline virtual int initDataServiceClient() + { + return mLocApi->initDataServiceClient(); + } + inline virtual int openAndStartDataCall() + { + return mLocApi->openAndStartDataCall(); + } + inline virtual void stopDataCall() + { + mLocApi->stopDataCall(); + } + inline virtual void closeDataCall() + { + mLocApi->closeDataCall(); + } + inline enum loc_api_adapter_err + getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask) + { + return mLocApi->getBestAvailableZppFix(zppLoc, tech_mask); + } + enum loc_api_adapter_err setTime(GpsUtcTime time, + int64_t timeReference, + int uncertainty); + enum loc_api_adapter_err setXtraVersionCheck(int check); + inline virtual void installAGpsCert(const DerEncodedCertificate* pData, + size_t length, + uint32_t slotBitMask) + { + mLocApi->installAGpsCert(pData, length, slotBitMask); + } + virtual void handleEngineDownEvent(); + virtual void handleEngineUpEvent(); + virtual void reportPosition(UlpLocation &location, + GpsLocationExtended &locationExtended, + void* locationExt, + enum loc_sess_status status, + LocPosTechMask loc_technology_mask); + virtual void reportSv(GpsSvStatus &svStatus, + GpsLocationExtended &locationExtended, + void* svExt); + virtual void reportStatus(GpsStatusValue status); + virtual void reportNmea(const char* nmea, int length); + virtual bool reportXtraServer(const char* url1, const char* url2, + const char* url3, const int maxlength); + virtual bool requestXtraData(); + virtual bool requestTime(); + virtual bool requestATL(int connHandle, AGpsType agps_type); + virtual bool releaseATL(int connHandle); + virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data); + virtual bool requestSuplES(int connHandle); + virtual bool reportDataCallOpened(); + virtual bool reportDataCallClosed(); + + inline const LocPosMode& getPositionMode() const + {return mFixCriteria;} + inline virtual bool isInSession() + { return mNavigating; } + void setInSession(bool inSession); + + // Permit/prohibit power voting + inline void setPowerVoteRight(bool powerVoteRight) { + mPowerVote = powerVoteRight ? (mPowerVote | POWER_VOTE_RIGHT) : + (mPowerVote & ~POWER_VOTE_RIGHT); + } + inline bool getPowerVoteRight() const { + return (mPowerVote & POWER_VOTE_RIGHT) != 0 ; + } + // Set the power voting up/down and do actual operation if permitted + inline void setPowerVote(bool powerOn) { + mPowerVote = powerOn ? (mPowerVote | POWER_VOTE_VALUE) : + (mPowerVote & ~POWER_VOTE_VALUE); + requestPowerVote(); + } + inline bool getPowerVote() const { + return (mPowerVote & POWER_VOTE_VALUE) != 0 ; + } + // Do power voting according to last settings if permitted + void requestPowerVote(); + + /*Values for lock + 1 = Do not lock any position sessions + 2 = Lock MI position sessions + 3 = Lock MT position sessions + 4 = Lock all position sessions + */ + inline int setGpsLock(LOC_GPS_LOCK_MASK lock) + { + return mLocApi->setGpsLock(lock); + } + + int setGpsLockMsg(LOC_GPS_LOCK_MASK lock); + + /* + Returns + Current value of GPS lock on success + -1 on failure + */ + inline int getGpsLock() + { + return mLocApi->getGpsLock(); + } + +}; + +#endif //LOC_API_ENG_ADAPTER_H diff --git a/gps/libloc_api_50001/Makefile.am b/gps/libloc_api_50001/Makefile.am new file mode 100644 index 0000000..2374357 --- /dev/null +++ b/gps/libloc_api_50001/Makefile.am @@ -0,0 +1,76 @@ +AM_CFLAGS = \ + -I../../utils \ + -I../../platform_lib_abstractions \ + -fno-short-enums \ + -DFEATURE_GNSS_BIT_API + +libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp + +if USE_GLIB +libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libloc_adapter_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libloc_adapter_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS) +libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 +libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif +libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la + + +libloc_eng_so_la_SOURCES = \ + loc_eng.cpp \ + loc_eng_agps.cpp \ + loc_eng_xtra.cpp \ + loc_eng_ni.cpp \ + loc_eng_log.cpp \ + loc_eng_dmn_conn.cpp \ + loc_eng_dmn_conn_handler.cpp \ + loc_eng_dmn_conn_thread_helper.c \ + loc_eng_dmn_conn_glue_msg.c \ + loc_eng_dmn_conn_glue_pipe.c + + +if USE_GLIB +libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libloc_eng_so_la_CFLAGS = $(AM_CFLAGS) +libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 +libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la + + +libgps_default_so_la_SOURCES = \ + loc.cpp \ + gps.c + +if USE_GLIB +libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libgps_default_so_la_CFLAGS = $(AM_CFLAGS) +libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 +libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la + +library_include_HEADERS = \ + LocEngAdapter.h \ + loc.h \ + loc_eng.h \ + loc_eng_xtra.h \ + loc_eng_ni.h \ + loc_eng_agps.h \ + loc_eng_msg.h \ + loc_eng_log.h + +library_includedir = $(pkgincludedir)/libloc_api_50001 + +#Create and Install libraries +lib_LTLIBRARIES = libloc_adapter_so.la libloc_eng_so.la libgps_default_so.la diff --git a/gps/libloc_api_50001/gps.c b/gps/libloc_api_50001/gps.c new file mode 100644 index 0000000..b0669af --- /dev/null +++ b/gps/libloc_api_50001/gps.c @@ -0,0 +1,72 @@ +/* Copyright (c) 2011 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 + +#include + +extern const GpsInterface* get_gps_interface(); + +const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev) +{ + return get_gps_interface(); +} + +static int open_gps(const struct hw_module_t* module, char const* name, + struct hw_device_t** device) +{ + struct gps_device_t *dev = (struct gps_device_t *) malloc(sizeof(struct gps_device_t)); + + if(dev == NULL) + return -1; + + memset(dev, 0, sizeof(*dev)); + + dev->common.tag = HARDWARE_DEVICE_TAG; + dev->common.version = 0; + dev->common.module = (struct hw_module_t*)module; + dev->get_gps_interface = gps__get_gps_interface; + + *device = (struct hw_device_t*)dev; + return 0; +} + +static struct hw_module_methods_t gps_module_methods = { + .open = open_gps +}; + +struct hw_module_t HAL_MODULE_INFO_SYM = { + .tag = HARDWARE_MODULE_TAG, + .module_api_version = 1, + .hal_api_version = 0, + .id = GPS_HARDWARE_MODULE_ID, + .name = "loc_api GPS Module", + .author = "Qualcomm USA, Inc.", + .methods = &gps_module_methods, +}; diff --git a/gps/libloc_api_50001/loc.cpp b/gps/libloc_api_50001/loc.cpp new file mode 100644 index 0000000..4f0eb3b --- /dev/null +++ b/gps/libloc_api_50001/loc.cpp @@ -0,0 +1,1118 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_afw" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef MODEM_POWER_VOTE +#include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +#include +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /*MODEM_POWER_VOTE*/ + +using namespace loc_core; + +#define LOC_PM_CLIENT_NAME "GPS" + +//Globals defns +static gps_location_callback gps_loc_cb = NULL; +static gps_sv_status_callback gps_sv_cb = NULL; + +static void local_loc_cb(UlpLocation* location, void* locExt); +static void local_sv_cb(GpsSvStatus* sv_status, void* svExt); + +static const GpsGeofencingInterface* get_geofence_interface(void); + +// Function declarations for sLocEngInterface +static int loc_init(GpsCallbacks* callbacks); +static int loc_start(); +static int loc_stop(); +static void loc_cleanup(); +static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty); +static int loc_inject_location(double latitude, double longitude, float accuracy); +static void loc_delete_aiding_data(GpsAidingData f); +static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence, + 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 = +{ + sizeof(GpsInterface), + loc_init, + loc_start, + loc_stop, + loc_cleanup, + loc_inject_time, + loc_inject_location, + loc_delete_aiding_data, + loc_set_position_mode, + loc_get_extension +}; + +// Function declarations for sLocEngAGpsInterface +static void loc_agps_init(AGpsCallbacks* callbacks); +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 const AGpsInterface sLocEngAGpsInterface = +{ + sizeof(AGpsInterface), + loc_agps_init, + loc_agps_open, + loc_agps_closed, + loc_agps_open_failed, + loc_agps_set_server +}; + +static int loc_xtra_init(GpsXtraCallbacks* callbacks); +static int loc_xtra_inject_data(char* data, int length); + +static const GpsXtraInterface sLocEngXTRAInterface = +{ + sizeof(GpsXtraInterface), + loc_xtra_init, + loc_xtra_inject_data +}; + +static void loc_ni_init(GpsNiCallbacks *callbacks); +static void loc_ni_respond(int notif_id, GpsUserResponseType user_response); + +static const GpsNiInterface sLocEngNiInterface = +{ + sizeof(GpsNiInterface), + loc_ni_init, + 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*/ + +static void loc_agps_ril_init( AGpsRilCallbacks* callbacks ); +static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct); +static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid); +static void loc_agps_ril_ni_message(uint8_t *msg, size_t len); +static void loc_agps_ril_update_network_state(int connected, int type, int roaming, const char* extra_info); +static void loc_agps_ril_update_network_availability(int avaiable, const char* apn); + +static const AGpsRilInterface sLocEngAGpsRilInterface = +{ + sizeof(AGpsRilInterface), + loc_agps_ril_init, + loc_agps_ril_set_ref_location, + loc_agps_ril_set_set_id, + loc_agps_ril_ni_message, + loc_agps_ril_update_network_state, + loc_agps_ril_update_network_availability +}; + +static int loc_agps_install_certificates(const DerEncodedCertificate* certificates, + size_t length); +static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints, + size_t length); + +static const SuplCertificateInterface sLocEngAGpsCertInterface = +{ + sizeof(SuplCertificateInterface), + loc_agps_install_certificates, + loc_agps_revoke_certificates +}; + +static void loc_configuration_update(const char* config_data, int32_t length); + +static const GnssConfigurationInterface sLocEngConfigInterface = +{ + sizeof(GnssConfigurationInterface), + loc_configuration_update +}; + +static loc_eng_data_s_type loc_afw_data; +static int gss_fd = -1; + +/*=========================================================================== +FUNCTION gps_get_hardware_interface + +DESCRIPTION + Returns the GPS hardware interaface based on LOC API + if GPS is enabled. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +const GpsInterface* gps_get_hardware_interface () +{ + ENTRY_LOG_CALLFLOW(); + const GpsInterface* ret_val; + + char propBuf[PROPERTY_VALUE_MAX]; + + loc_eng_read_config(); + + // check to see if GPS should be disabled + property_get("gps.disable", propBuf, ""); + if (propBuf[0] == '1') + { + LOC_LOGD("gps_get_interface returning NULL because gps.disable=1\n"); + ret_val = NULL; + } else { + ret_val = &sLocEngInterface; + } + + loc_eng_read_config(); + + EXIT_LOG(%p, ret_val); + return ret_val; +} + +// for gps.c +extern "C" const GpsInterface* get_gps_interface() +{ + unsigned int target = TARGET_DEFAULT; + loc_eng_read_config(); + + target = loc_get_target(); + LOC_LOGD("Target name check returned %s", loc_get_target_name(target)); + + int gnssType = getTargetGnssType(target); + switch (gnssType) + { + case GNSS_GSS: + //APQ8064 + gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); + gss_fd = open("/dev/gss", O_RDONLY); + if (gss_fd < 0) { + LOC_LOGE("GSS open failed: %s\n", strerror(errno)); + } + else { + LOC_LOGD("GSS open success! CAPABILITIES %0lx\n", + gps_conf.CAPABILITIES); + } + break; + case GNSS_NONE: + //MPQ8064 + LOC_LOGE("No GPS HW on this target. Not returning interface."); + return NULL; + case GNSS_QCA1530: + // qca1530 chip is present + gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB); + LOC_LOGD("qca1530 present: CAPABILITIES %0lx\n", gps_conf.CAPABILITIES); + break; + } + return &sLocEngInterface; +} + +/*=========================================================================== +FUNCTION loc_init + +DESCRIPTION + Initialize the location engine, this include setting up global datas + and registers location engien with loc api service. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/Ax + +===========================================================================*/ +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; + + if (NULL == callbacks) { + LOC_LOGE("loc_init failed. cb = NULL\n"); + EXIT_LOG(%d, retVal); + return retVal; + } + + event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT | + LOC_API_ADAPTER_BIT_SATELLITE_REPORT | + LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST | + LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST | + LOC_API_ADAPTER_BIT_IOCTL_REPORT | + LOC_API_ADAPTER_BIT_STATUS_REPORT | + LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT | + LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST; + + LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */ + callbacks->status_cb, /* status_cb */ + local_sv_cb, /* sv_status_cb */ + callbacks->nmea_cb, /* nmea_cb */ + callbacks->set_capabilities_cb, /* set_capabilities_cb */ + callbacks->acquire_wakelock_cb, /* acquire_wakelock_cb */ + callbacks->release_wakelock_cb, /* release_wakelock_cb */ + callbacks->create_thread_cb, /* create_thread_cb */ + 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; + + retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); + loc_afw_data.adapter->mSupportsAgpsRequests = !loc_afw_data.adapter->hasAgpsExtendedCapabilities(); + loc_afw_data.adapter->mSupportsPositionInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); + loc_afw_data.adapter->mSupportsTimeInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); + loc_afw_data.adapter->setGpsLockMsg(0); + loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); + + if(retVal) { + LOC_LOGE("loc_eng_init() fail!"); + goto err; + } + + loc_afw_data.adapter->setPowerVoteRight(loc_get_target() == TARGET_QCA1530); + loc_afw_data.adapter->setPowerVote(true); + + 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 + Cleans location engine. The location client handle will be released. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_cleanup() +{ + ENTRY_LOG(); + + loc_afw_data.adapter->setPowerVote(false); + 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; + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_start + +DESCRIPTION + Starts the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_start() +{ + ENTRY_LOG(); + int ret_val = loc_eng_start(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_stop + +DESCRIPTION + Stops the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_stop() +{ + ENTRY_LOG(); + int ret_val = -1; + ret_val = loc_eng_stop(loc_afw_data); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_set_position_mode + +DESCRIPTION + Sets the mode and fix frequency for the tracking session. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_set_position_mode(GpsPositionMode mode, + GpsPositionRecurrence recurrence, + uint32_t min_interval, + uint32_t preferred_accuracy, + uint32_t preferred_time) +{ + ENTRY_LOG(); + int ret_val = -1; + LocPositionMode locMode; + switch (mode) { + case GPS_POSITION_MODE_MS_BASED: + locMode = LOC_POSITION_MODE_MS_BASED; + break; + case GPS_POSITION_MODE_MS_ASSISTED: + locMode = LOC_POSITION_MODE_MS_ASSISTED; + break; + default: + locMode = LOC_POSITION_MODE_STANDALONE; + break; + } + + LocPosMode params(locMode, recurrence, min_interval, + preferred_accuracy, preferred_time, NULL, NULL); + ret_val = loc_eng_set_position_mode(loc_afw_data, params); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_inject_time + +DESCRIPTION + This is used by Java native function to do time injection. + +DEPENDENCIES + None + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty) +{ + ENTRY_LOG(); + int ret_val = 0; + + ret_val = loc_eng_inject_time(loc_afw_data, time, + timeReference, uncertainty); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + + +/*=========================================================================== +FUNCTION loc_inject_location + +DESCRIPTION + This is used by Java native function to do location injection. + +DEPENDENCIES + None + +RETURN VALUE + 0 : Successful + error code : Failure + +SIDE EFFECTS + N/A +===========================================================================*/ +static int loc_inject_location(double latitude, double longitude, float accuracy) +{ + ENTRY_LOG(); + + int ret_val = 0; + ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + + +/*=========================================================================== +FUNCTION loc_delete_aiding_data + +DESCRIPTION + This is used by Java native function to delete the aiding data. The function + updates the global variable for the aiding data to be deleted. If the GPS + engine is off, the aiding data will be deleted. Otherwise, the actual action + will happen when gps engine is turned off. + +DEPENDENCIES + Assumes the aiding data type specified in GpsAidingData matches with + LOC API specification. + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_delete_aiding_data(GpsAidingData f) +{ + ENTRY_LOG(); + loc_eng_delete_aiding_data(loc_afw_data, f); + + EXIT_LOG(%s, VOID_RET); +} + +const GpsGeofencingInterface* get_geofence_interface(void) +{ + ENTRY_LOG(); + void *handle; + const char *error; + typedef const GpsGeofencingInterface* (*get_gps_geofence_interface_function) (void); + get_gps_geofence_interface_function get_gps_geofence_interface; + static const GpsGeofencingInterface* geofence_interface = NULL; + + dlerror(); /* Clear any existing error */ + + handle = dlopen ("libgeofence.so", RTLD_NOW); + + if (!handle) + { + if ((error = dlerror()) != NULL) { + LOC_LOGE ("%s, dlopen for libgeofence.so failed, error = %s\n", __func__, error); + } + goto exit; + } + 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) { + LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error); + goto exit; + } + + geofence_interface = get_gps_geofence_interface(); + +exit: + EXIT_LOG(%d, geofence_interface == NULL); + return geofence_interface; +} +/*=========================================================================== +FUNCTION loc_get_extension + +DESCRIPTION + Get the gps extension to support XTRA. + +DEPENDENCIES + N/A + +RETURN VALUE + The GPS extension interface. + +SIDE EFFECTS + N/A + +===========================================================================*/ +const void* loc_get_extension(const char* name) +{ + ENTRY_LOG(); + const void* ret_val = NULL; + + LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name); + if (strcmp(name, GPS_XTRA_INTERFACE) == 0) + { + ret_val = &sLocEngXTRAInterface; + } + else if (strcmp(name, AGPS_INTERFACE) == 0) + { + ret_val = &sLocEngAGpsInterface; + } + else if (strcmp(name, GPS_NI_INTERFACE) == 0) + { + ret_val = &sLocEngNiInterface; + } + else if (strcmp(name, AGPS_RIL_INTERFACE) == 0) + { + char baseband[PROPERTY_VALUE_MAX]; + property_get("ro.baseband", baseband, "msm"); + if (strcmp(baseband, "csfb") == 0) + { + ret_val = &sLocEngAGpsRilInterface; + } + } + else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0) + { + if ((gps_conf.CAPABILITIES | GPS_CAPABILITY_GEOFENCING) == gps_conf.CAPABILITIES ){ + ret_val = get_geofence_interface(); + } + } + else if (strcmp(name, SUPL_CERTIFICATE_INTERFACE) == 0) + { + ret_val = &sLocEngAGpsCertInterface; + } + else if (strcmp(name, GNSS_CONFIGURATION_INTERFACE) == 0) + { + ret_val = &sLocEngConfigInterface; + } + else + { + LOC_LOGE ("get_extension: Invalid interface passed in\n"); + } + EXIT_LOG(%p, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_agps_init + +DESCRIPTION + Initialize the AGps interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_agps_init(AGpsCallbacks* callbacks) +{ + ENTRY_LOG(); + loc_eng_agps_init(loc_afw_data, (AGpsExtCallbacks*)callbacks); + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_agps_open + +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(const char* apn) +{ + ENTRY_LOG(); + AGpsType agpsType = AGPS_TYPE_SUPL; + AGpsBearerType bearerType = AGPS_APN_BEARER_IPV4; + 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 + This function is called when on-demand data connection closing is done. +It should inform ARM 9 about the data close result. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_agps_closed() +{ + ENTRY_LOG(); + AGpsType agpsType = AGPS_TYPE_SUPL; + int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_agps_open_failed + +DESCRIPTION + This function is called when on-demand data connection opening has failed. +It should inform ARM 9 about the data open result. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_agps_open_failed() +{ + ENTRY_LOG(); + AGpsType agpsType = AGPS_TYPE_SUPL; + int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_agps_set_server + +DESCRIPTION + If loc_eng_set_server is called before loc_eng_init, it doesn't work. This + proxy buffers server settings and calls loc_eng_set_server when the client is + open. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_agps_set_server(AGpsType type, const char* hostname, int port) +{ + ENTRY_LOG(); + LocServerType serverType; + switch (type) { + case AGPS_TYPE_SUPL: + serverType = LOC_AGPS_SUPL_SERVER; + break; + case AGPS_TYPE_C2K: + serverType = LOC_AGPS_CDMA_PDE_SERVER; + break; + default: + serverType = LOC_AGPS_SUPL_SERVER; + } + int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTIONf571 + loc_xtra_init + +DESCRIPTION + Initialize XTRA module. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_xtra_init(GpsXtraCallbacks* callbacks) +{ + ENTRY_LOG(); + int ret_val = loc_eng_xtra_init(loc_afw_data, (GpsXtraExtCallbacks*)callbacks); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + + +/*=========================================================================== +FUNCTION loc_xtra_inject_data + +DESCRIPTION + Initialize XTRA module. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_xtra_inject_data(char* data, int length) +{ + ENTRY_LOG(); + int ret_val = -1; + if( (data != NULL) && ((unsigned int)length <= XTRA_DATA_MAX_SIZE)) + ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length); + else + LOC_LOGE("%s, Could not inject XTRA data. Buffer address: %p, length: %d", + __func__, data, length); + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_ni_init + +DESCRIPTION + This function initializes the NI interface + +DEPENDENCIES + NONE + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_ni_init(GpsNiCallbacks *callbacks) +{ + ENTRY_LOG(); + loc_eng_ni_init(loc_afw_data,(GpsNiExtCallbacks*) callbacks); + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_ni_respond + +DESCRIPTION + This function sends an NI respond to the modem processor + +DEPENDENCIES + NONE + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_ni_respond(int notif_id, GpsUserResponseType user_response) +{ + ENTRY_LOG(); + loc_eng_ni_respond(loc_afw_data, notif_id, user_response); + EXIT_LOG(%s, VOID_RET); +} + +// Below stub functions are members of sLocEngAGpsRilInterface +static void loc_agps_ril_init( AGpsRilCallbacks* callbacks ) {} +static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct) {} +static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid) {} +static void loc_agps_ril_ni_message(uint8_t *msg, size_t len) {} +static void loc_agps_ril_update_network_state(int connected, int type, int roaming, const char* extra_info) {} + +/*=========================================================================== +FUNCTION loc_agps_ril_update_network_availability + +DESCRIPTION + Sets data call allow vs disallow flag to modem + This is the only member of sLocEngAGpsRilInterface implemented. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_agps_ril_update_network_availability(int available, const char* apn) +{ + ENTRY_LOG(); + loc_eng_agps_ril_update_network_availability(loc_afw_data, available, apn); + EXIT_LOG(%s, VOID_RET); +} + +static int loc_agps_install_certificates(const DerEncodedCertificate* certificates, + size_t length) +{ + ENTRY_LOG(); + int ret_val = loc_eng_agps_install_certificates(loc_afw_data, certificates, length); + EXIT_LOG(%d, ret_val); + return ret_val; +} +static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints, + size_t length) +{ + ENTRY_LOG(); + LOC_LOGE("%s:%d]: agps_revoke_certificates not supported"); + int ret_val = AGPS_CERTIFICATE_ERROR_GENERIC; + EXIT_LOG(%d, ret_val); + return ret_val; +} + +static void loc_configuration_update(const char* config_data, int32_t length) +{ + ENTRY_LOG(); + loc_eng_configuration_update(loc_afw_data, config_data, length); + EXIT_LOG(%s, VOID_RET); +} + +static void local_loc_cb(UlpLocation* location, void* locExt) +{ + ENTRY_LOG(); + if (NULL != location) { + CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source); + + if (NULL != gps_loc_cb) { + gps_loc_cb(&location->gpsLocation); + } + } + EXIT_LOG(%s, VOID_RET); +} + +static void local_sv_cb(GpsSvStatus* sv_status, void* svExt) +{ + ENTRY_LOG(); + if (NULL != gps_sv_cb) { + CALLBACK_LOG_CALLFLOW("sv_status_cb -", %d, sv_status->num_svs); + gps_sv_cb(sv_status); + } + 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/libloc_api_50001/loc.h b/gps/libloc_api_50001/loc.h new file mode 100644 index 0000000..6352866 --- /dev/null +++ b/gps/libloc_api_50001/loc.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2011,2014 The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __LOC_H__ +#define __LOC_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include +#include + +#define XTRA_DATA_MAX_SIZE 100000 /*bytes*/ + +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; + gps_status_callback status_cb; + loc_sv_status_cb_ext sv_status_cb; + gps_nmea_callback nmea_cb; + gps_set_capabilities set_capabilities_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + gps_create_thread create_thread_cb; + 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 +} +#endif /* __cplusplus */ + +#endif //__LOC_H__ diff --git a/gps/libloc_api_50001/loc_eng.cpp b/gps/libloc_api_50001/loc_eng.cpp new file mode 100644 index 0000000..c74299e --- /dev/null +++ b/gps/libloc_api_50001/loc_eng.cpp @@ -0,0 +1,2846 @@ +/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * 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_eng" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* struct sockaddr_in */ +#include +#include +#include +#include +#include +#include + +#include +#ifndef USE_GLIB +#include +#include +#endif /* USE_GLIB */ + +#ifdef USE_GLIB +#include +#include +#endif /* USE_GLIB */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "log_util.h" +#include "platform_lib_includes.h" +#include "loc_core_log.h" +#include "loc_eng_log.h" + +#define SUCCESS TRUE +#define FAILURE FALSE + +#ifndef GPS_CONF_FILE +#define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent +#endif + +#ifndef SAP_CONF_FILE +#define SAP_CONF_FILE "/etc/sap.conf" +#endif + +#define XTRA1_GPSONEXTRA "xtra1.gpsonextra.net" + +using namespace loc_core; + +boolean configAlreadyRead = false; +unsigned int agpsStatus = 0; +loc_gps_cfg_s_type gps_conf; +loc_sap_cfg_s_type sap_conf; + +/* Parameter spec table */ +static loc_param_s_type gps_conf_table[] = +{ + {"GPS_LOCK", &gps_conf.GPS_LOCK, NULL, 'n'}, + {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, + {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'}, + {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'}, + {"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'}, + {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'}, + {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'}, + {"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'}, + {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'}, + {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, +}; + +static loc_param_s_type sap_conf_table[] = +{ + {"GYRO_BIAS_RANDOM_WALK", &sap_conf.GYRO_BIAS_RANDOM_WALK, &sap_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'}, + {"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, + {"SENSOR_ACCEL_BATCHES_PER_SEC", &sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'}, + {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'}, + {"SENSOR_GYRO_BATCHES_PER_SEC", &sap_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'}, + {"SENSOR_GYRO_SAMPLES_PER_BATCH", &sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'}, + {"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'}, + {"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, + {"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'}, + {"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'}, + {"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'} +}; + +static void loc_default_parameters(void) +{ + /*Defaults for gps.conf*/ + gps_conf.INTERMEDIATE_POS = 0; + gps_conf.ACCURACY_THRES = 0; + gps_conf.NMEA_PROVIDER = 0; + gps_conf.GPS_LOCK = 0; + gps_conf.SUPL_VER = 0x10000; + gps_conf.CAPABILITIES = 0x7; + /* LTE Positioning Profile configuration is disable by default*/ + gps_conf.LPP_PROFILE = 0; + /*By default no positioning protocol is selected on A-GLONASS system*/ + gps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0; + /*XTRA version check is disabled by default*/ + gps_conf.XTRA_VERSION_CHECK=0; + /*Use emergency PDN by default*/ + gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1; + + /*Defaults for sap.conf*/ + sap_conf.GYRO_BIAS_RANDOM_WALK = 0; + sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2; + sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5; + sap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2; + sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5; + sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4; + sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25; + sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4; + sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25; + sap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */ + sap_conf.SENSOR_USAGE = 0; /* Enabled */ + sap_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/ + /* Values MUST be set by OEMs in configuration for sensor-assisted + navigation to work. There are NO default values */ + sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0; + sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0; + sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0; + sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0; + sap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0; + sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0; + /* default provider is SSC */ + sap_conf.SENSOR_PROVIDER = 1; + + /* None of the 10 slots for agps certificates are writable by default */ + gps_conf.AGPS_CERT_WRITABLE_MASK = 0; +} + +// 2nd half of init(), singled out for +// modem restart to use. +static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data); +static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data); + +static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, + LocServerType type, const char *hostname, int port); +// Internal functions +static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, + GpsStatusValue status); +static void loc_eng_report_status(loc_eng_data_s_type &loc_eng_data, + GpsStatusValue status); +static void loc_eng_process_conn_request(loc_eng_data_s_type &loc_eng_data, + int connHandle, AGpsType agps_type); +static void loc_eng_agps_close_status(loc_eng_data_s_type &loc_eng_data, int is_succ); +static void loc_eng_handle_engine_down(loc_eng_data_s_type &loc_eng_data) ; +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); +static int dataCallCb(void *cb_data); +static void update_aiding_data_for_deletion(loc_eng_data_s_type& loc_eng_data) { + if (loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON && + loc_eng_data.aiding_data_for_deletion != 0) + { + loc_eng_data.adapter->deleteAidingData(loc_eng_data.aiding_data_for_deletion); + loc_eng_data.aiding_data_for_deletion = 0; + } +} + +static void* noProc(void* data) +{ + return NULL; +} + + +/********************************************************************* + * definitions of the static messages used in the file + *********************************************************************/ +// case LOC_ENG_MSG_REQUEST_NI: +LocEngRequestNi::LocEngRequestNi(void* locEng, + GpsNiNotification ¬if, + const void* data) : + LocMsg(), mLocEng(locEng), mNotify(notif), mPayload(data) { + locallog(); +} +void LocEngRequestNi::proc() const { + loc_eng_ni_request_handler(*((loc_eng_data_s_type*)mLocEng), + &mNotify, mPayload); +} +void LocEngRequestNi::locallog() const +{ + LOC_LOGV("id: %d\n type: %s\n flags: %d\n time out: %d\n " + "default response: %s\n requestor id encoding: %s\n" + " text encoding: %s\n passThroughData: %p", + mNotify.notification_id, + loc_get_ni_type_name(mNotify.ni_type), + mNotify.notify_flags, + mNotify.timeout, + loc_get_ni_response_name(mNotify.default_response), + loc_get_ni_encoding_name(mNotify.requestor_id_encoding), + loc_get_ni_encoding_name(mNotify.text_encoding), + mPayload); +} +inline void LocEngRequestNi::log() const { + locallog(); +} + +// case LOC_ENG_MSG_INFORM_NI_RESPONSE: +// in loc_eng_ni.cpp + +// case LOC_ENG_MSG_START_FIX: +LocEngStartFix::LocEngStartFix(LocEngAdapter* adapter) : + LocMsg(), mAdapter(adapter) +{ + locallog(); +} +inline void LocEngStartFix::proc() const +{ + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); + loc_eng_start_handler(*locEng); +} +inline void LocEngStartFix::locallog() const +{ + LOC_LOGV("LocEngStartFix"); +} +inline void LocEngStartFix::log() const +{ + locallog(); +} +void LocEngStartFix::send() const { + mAdapter->sendMsg(this); +} + +// case LOC_ENG_MSG_STOP_FIX: +LocEngStopFix::LocEngStopFix(LocEngAdapter* adapter) : + LocMsg(), mAdapter(adapter) +{ + locallog(); +} +inline void LocEngStopFix::proc() const +{ + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); + loc_eng_stop_handler(*locEng); +} +inline void LocEngStopFix::locallog() const +{ + LOC_LOGV("LocEngStopFix"); +} +inline void LocEngStopFix::log() const +{ + locallog(); +} +void LocEngStopFix::send() const { + mAdapter->sendMsg(this); +} + +// case LOC_ENG_MSG_SET_POSITION_MODE: +LocEngPositionMode::LocEngPositionMode(LocEngAdapter* adapter, + LocPosMode &mode) : + LocMsg(), mAdapter(adapter), mPosMode(mode) +{ + mPosMode.logv(); +} +inline void LocEngPositionMode::proc() const { + mAdapter->setPositionMode(&mPosMode); +} +inline void LocEngPositionMode::log() const { + mPosMode.logv(); +} +void LocEngPositionMode::send() const { + mAdapter->sendMsg(this); +} + +LocEngGetZpp::LocEngGetZpp(LocEngAdapter* adapter) : + LocMsg(), mAdapter(adapter) +{ + locallog(); +} +inline void LocEngGetZpp::proc() const +{ + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner(); + loc_eng_get_zpp_handler(*locEng); +} +inline void LocEngGetZpp::locallog() const +{ + LOC_LOGV("LocEngGetZpp"); +} +inline void LocEngGetZpp::log() const +{ + locallog(); +} +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; + const int64_t mTimeReference; + const int mUncertainty; + inline LocEngSetTime(LocEngAdapter* adapter, + GpsUtcTime t, int64_t tf, int unc) : + LocMsg(), mAdapter(adapter), + mTime(t), mTimeReference(tf), mUncertainty(unc) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setTime(mTime, mTimeReference, mUncertainty); + } + inline void locallog() const { + LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d", + mTime, mTimeReference, mUncertainty); + } + inline virtual void log() const { + locallog(); + } +}; + + // case LOC_ENG_MSG_INJECT_LOCATION: +struct LocEngInjectLocation : public LocMsg { + LocEngAdapter* mAdapter; + const double mLatitude; + const double mLongitude; + const float mAccuracy; + inline LocEngInjectLocation(LocEngAdapter* adapter, + double lat, double lon, float accur) : + LocMsg(), mAdapter(adapter), + mLatitude(lat), mLongitude(lon), mAccuracy(accur) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->injectPosition(mLatitude, mLongitude, mAccuracy); + } + inline void locallog() const { + LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f", + mLatitude, mLongitude, mAccuracy); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_SET_SERVER_IPV4: +struct LocEngSetServerIpv4 : public LocMsg { + LocEngAdapter* mAdapter; + const unsigned int mNlAddr; + const int mPort; + const LocServerType mServerType; + inline LocEngSetServerIpv4(LocEngAdapter* adapter, + unsigned int ip, + int port, + LocServerType type) : + LocMsg(), mAdapter(adapter), + mNlAddr(ip), mPort(port), mServerType(type) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setServer(mNlAddr, mPort, mServerType); + } + inline void locallog() const { + LOC_LOGV("LocEngSetServerIpv4 - addr: %x, port: %d, type: %s", + mNlAddr, mPort, loc_get_server_type_name(mServerType)); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_SET_SERVER_URL: +struct LocEngSetServerUrl : public LocMsg { + LocEngAdapter* mAdapter; + const int mLen; + char* mUrl; + inline LocEngSetServerUrl(LocEngAdapter* adapter, + char* urlString, + int url_len) : + LocMsg(), mAdapter(adapter), + mLen(url_len), mUrl(new char[mLen+1]) + { + memcpy((void*)mUrl, (void*)urlString, url_len); + mUrl[mLen] = 0; + locallog(); + } + inline ~LocEngSetServerUrl() + { + delete[] mUrl; + } + inline virtual void proc() const { + mAdapter->setServer(mUrl, mLen); + } + inline void locallog() const { + LOC_LOGV("LocEngSetServerUrl - url: %s", mUrl); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_A_GLONASS_PROTOCOL: +struct LocEngAGlonassProtocol : public LocMsg { + LocEngAdapter* mAdapter; + const unsigned long mAGlonassProtocl; + inline LocEngAGlonassProtocol(LocEngAdapter* adapter, + unsigned long protocol) : + LocMsg(), mAdapter(adapter), mAGlonassProtocl(protocol) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setAGLONASSProtocol(mAGlonassProtocl); + } + inline void locallog() const { + LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_SUPL_VERSION: +struct LocEngSuplVer : public LocMsg { + LocEngAdapter* mAdapter; + const int mSuplVer; + inline LocEngSuplVer(LocEngAdapter* adapter, + int suplVer) : + LocMsg(), mAdapter(adapter), mSuplVer(suplVer) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setSUPLVersion(mSuplVer); + } + inline void locallog() const { + LOC_LOGV("SUPL Version: %d", mSuplVer); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_LPP_CONFIG: +struct LocEngLppConfig : public LocMsg { + LocEngAdapter* mAdapter; + const int mLppConfig; + inline LocEngLppConfig(LocEngAdapter* adapter, + int lppConfig) : + LocMsg(), mAdapter(adapter), mLppConfig(lppConfig) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setLPPConfig(mLppConfig); + } + inline void locallog() const { + LOC_LOGV("LocEngLppConfig - profile: %d", mLppConfig); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG: +struct LocEngSensorControlConfig : public LocMsg { + LocEngAdapter* mAdapter; + const int mSensorsDisabled; + const int mSensorProvider; + inline LocEngSensorControlConfig(LocEngAdapter* adapter, + int sensorsDisabled, int sensorProvider) : + LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled), + mSensorProvider(sensorProvider) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setSensorControlConfig(mSensorsDisabled, mSensorProvider); + } + inline void locallog() const { + LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d, Sensor Provider: %d", + mSensorsDisabled, mSensorProvider); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_SET_SENSOR_PROPERTIES: +struct LocEngSensorProperties : public LocMsg { + LocEngAdapter* mAdapter; + const bool mGyroBiasVarianceRandomWalkValid; + const float mGyroBiasVarianceRandomWalk; + const bool mAccelRandomWalkValid; + const float mAccelRandomWalk; + const bool mAngleRandomWalkValid; + const float mAngleRandomWalk; + const bool mRateRandomWalkValid; + const float mRateRandomWalk; + const bool mVelocityRandomWalkValid; + const float mVelocityRandomWalk; + inline LocEngSensorProperties(LocEngAdapter* adapter, + bool gyroBiasRandomWalk_valid, + float gyroBiasRandomWalk, + bool accelRandomWalk_valid, + float accelRandomWalk, + bool angleRandomWalk_valid, + float angleRandomWalk, + bool rateRandomWalk_valid, + float rateRandomWalk, + bool velocityRandomWalk_valid, + float velocityRandomWalk) : + LocMsg(), mAdapter(adapter), + mGyroBiasVarianceRandomWalkValid(gyroBiasRandomWalk_valid), + mGyroBiasVarianceRandomWalk(gyroBiasRandomWalk), + mAccelRandomWalkValid(accelRandomWalk_valid), + mAccelRandomWalk(accelRandomWalk), + mAngleRandomWalkValid(angleRandomWalk_valid), + mAngleRandomWalk(angleRandomWalk), + mRateRandomWalkValid(rateRandomWalk_valid), + mRateRandomWalk(rateRandomWalk), + mVelocityRandomWalkValid(velocityRandomWalk_valid), + mVelocityRandomWalk(velocityRandomWalk) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setSensorProperties(mGyroBiasVarianceRandomWalkValid, + mGyroBiasVarianceRandomWalk, + mAccelRandomWalkValid, + mAccelRandomWalk, + mAngleRandomWalkValid, + mAngleRandomWalk, + mRateRandomWalkValid, + mRateRandomWalk, + mVelocityRandomWalkValid, + mVelocityRandomWalk); + } + inline void locallog() const { + LOC_LOGV("Sensor properties validity, Gyro Random walk: %d " + "Accel Random Walk: %d " + "Angle Random Walk: %d Rate Random Walk: %d " + "Velocity Random Walk: %d\n" + "Sensor properties, Gyro Random walk: %f " + "Accel Random Walk: %f " + "Angle Random Walk: %f Rate Random Walk: %f " + "Velocity Random Walk: %f", + mGyroBiasVarianceRandomWalkValid, + mAccelRandomWalkValid, + mAngleRandomWalkValid, + mRateRandomWalkValid, + mVelocityRandomWalkValid, + mGyroBiasVarianceRandomWalk, + mAccelRandomWalk, + mAngleRandomWalk, + mRateRandomWalk, + mVelocityRandomWalk + ); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG: +struct LocEngSensorPerfControlConfig : public LocMsg { + LocEngAdapter* mAdapter; + const int mControlMode; + const int mAccelSamplesPerBatch; + const int mAccelBatchesPerSec; + const int mGyroSamplesPerBatch; + const int mGyroBatchesPerSec; + const int mAccelSamplesPerBatchHigh; + const int mAccelBatchesPerSecHigh; + const int mGyroSamplesPerBatchHigh; + const int mGyroBatchesPerSecHigh; + const int mAlgorithmConfig; + inline LocEngSensorPerfControlConfig(LocEngAdapter* adapter, + int controlMode, + int accelSamplesPerBatch, + int accelBatchesPerSec, + int gyroSamplesPerBatch, + int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, + int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, + int gyroBatchesPerSecHigh, + int algorithmConfig) : + LocMsg(), mAdapter(adapter), + mControlMode(controlMode), + mAccelSamplesPerBatch(accelSamplesPerBatch), + mAccelBatchesPerSec(accelBatchesPerSec), + mGyroSamplesPerBatch(gyroSamplesPerBatch), + mGyroBatchesPerSec(gyroBatchesPerSec), + mAccelSamplesPerBatchHigh(accelSamplesPerBatchHigh), + mAccelBatchesPerSecHigh(accelBatchesPerSecHigh), + mGyroSamplesPerBatchHigh(gyroSamplesPerBatchHigh), + mGyroBatchesPerSecHigh(gyroBatchesPerSecHigh), + mAlgorithmConfig(algorithmConfig) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setSensorPerfControlConfig(mControlMode, + mAccelSamplesPerBatch, + mAccelBatchesPerSec, + mGyroSamplesPerBatch, + mGyroBatchesPerSec, + mAccelSamplesPerBatchHigh, + mAccelBatchesPerSecHigh, + mGyroSamplesPerBatchHigh, + mGyroBatchesPerSecHigh, + mAlgorithmConfig); + } + inline void locallog() const { + LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) " + "accel(#smp,#batches) (%u,%u) " + "gyro(#smp,#batches) (%u,%u), " + "accel_high(#smp,#batches) (%u,%u) " + "gyro_high(#smp,#batches) (%u,%u), " + "algorithmConfig(%u)\n", + mControlMode, + mAccelSamplesPerBatch, mAccelBatchesPerSec, + mGyroSamplesPerBatch, mGyroBatchesPerSec, + mAccelSamplesPerBatchHigh, mAccelBatchesPerSecHigh, + mGyroSamplesPerBatchHigh, mGyroBatchesPerSecHigh, + mAlgorithmConfig); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_EXT_POWER_CONFIG: +struct LocEngExtPowerConfig : public LocMsg { + LocEngAdapter* mAdapter; + const int mIsBatteryCharging; + inline LocEngExtPowerConfig(LocEngAdapter* adapter, + int isBatteryCharging) : + LocMsg(), mAdapter(adapter), + mIsBatteryCharging(isBatteryCharging) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->setExtPowerConfig(mIsBatteryCharging); + } + inline void locallog() const { + LOC_LOGV("LocEngExtPowerConfig - isBatteryCharging: %d", + mIsBatteryCharging); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_REPORT_POSITION: +LocEngReportPosition::LocEngReportPosition(LocAdapterBase* adapter, + UlpLocation &loc, + GpsLocationExtended &locExtended, + void* locExt, + enum loc_sess_status st, + LocPosTechMask technology) : + LocMsg(), mAdapter(adapter), mLocation(loc), + mLocationExtended(locExtended), + mLocationExt(((loc_eng_data_s_type*) + ((LocEngAdapter*) + (mAdapter))->getOwner())->location_ext_parser(locExt)), + mStatus(st), mTechMask(technology) +{ + locallog(); +} +void LocEngReportPosition::proc() const { + LocEngAdapter* adapter = (LocEngAdapter*)mAdapter; + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)adapter->getOwner(); + + if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION) { + bool reported = false; + if (locEng->location_cb != NULL) { + if (LOC_SESS_FAILURE == mStatus) { + // in case we want to handle the failure case + locEng->location_cb(NULL, NULL); + reported = true; + } + // what's in the else if is... (line by line) + // 1. this is a final fix; and + // 1.1 it is a Satellite fix; or + // 1.2 it is a sensor fix + // 2. (must be intermediate fix... implicit) + // 2.1 we accepte intermediate; and + // 2.2 it is NOT the case that + // 2.2.1 there is inaccuracy; and + // 2.2.2 we care about inaccuracy; and + // 2.2.3 the inaccuracy exceeds our tolerance + else if ((LOC_SESS_SUCCESS == mStatus && + ((LOC_POS_TECH_MASK_SATELLITE | + LOC_POS_TECH_MASK_SENSORS | + LOC_POS_TECH_MASK_HYBRID) & + mTechMask)) || + (LOC_SESS_INTERMEDIATE == locEng->intermediateFix && + !((mLocation.gpsLocation.flags & + GPS_LOCATION_HAS_ACCURACY) && + (gps_conf.ACCURACY_THRES != 0) && + (mLocation.gpsLocation.accuracy > + gps_conf.ACCURACY_THRES)))) { + locEng->location_cb((UlpLocation*)&(mLocation), + (void*)mLocationExt); + reported = true; + } + } + + // if we have reported this fix + if (reported && + // and if this is a singleshot + GPS_POSITION_RECURRENCE_SINGLE == + locEng->adapter->getPositionMode().recurrence) { + if (LOC_SESS_INTERMEDIATE == mStatus) { + // modem could be still working for a final fix, + // although we no longer need it. So stopFix(). + locEng->adapter->stopFix(); + } + // turn off the session flag. + locEng->adapter->setInSession(false); + } + + 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)) + { + unsigned char generate_nmea = reported && + (mStatus != LOC_SESS_FAILURE); + loc_eng_nmea_generate_pos(locEng, mLocation, mLocationExtended, + generate_nmea); + } + + // Free the allocated memory for rawData + UlpLocation* gp = (UlpLocation*)&(mLocation); + if (gp != NULL && gp->rawData != NULL) + { + delete (char*)gp->rawData; + gp->rawData = NULL; + gp->rawDataSize = 0; + } + } +} +void LocEngReportPosition::locallog() const { + LOC_LOGV("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n " + "altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n " + "timestamp: %lld\n rawDataSize: %d\n rawData: %p\n Session" + " status: %d\n Technology mask: %u", + mLocation.gpsLocation.flags, mLocation.position_source, + mLocation.gpsLocation.latitude, mLocation.gpsLocation.longitude, + mLocation.gpsLocation.altitude, mLocation.gpsLocation.speed, + mLocation.gpsLocation.bearing, mLocation.gpsLocation.accuracy, + mLocation.gpsLocation.timestamp, mLocation.rawDataSize, + mLocation.rawData, mStatus, mTechMask); +} +void LocEngReportPosition::log() const { + locallog(); +} +void LocEngReportPosition::send() const { + mAdapter->sendMsg(this); +} + + +// case LOC_ENG_MSG_REPORT_SV: +LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter, + GpsSvStatus &sv, + GpsLocationExtended &locExtended, + void* svExt) : + LocMsg(), mAdapter(adapter), mSvStatus(sv), + mLocationExtended(locExtended), + mSvExt(((loc_eng_data_s_type*) + ((LocEngAdapter*) + (mAdapter))->getOwner())->sv_ext_parser(svExt)) +{ + locallog(); +} +void LocEngReportSv::proc() const { + LocEngAdapter* adapter = (LocEngAdapter*)mAdapter; + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)adapter->getOwner(); + + if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + if (locEng->sv_status_cb != NULL) { + locEng->sv_status_cb((GpsSvStatus*)&(mSvStatus), + (void*)mSvExt); + } + + if (locEng->generateNmea) + { + loc_eng_nmea_generate_sv(locEng, mSvStatus, mLocationExtended); + } + } +} +void LocEngReportSv::locallog() const { + LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n " + "used in fix mask: %x\n sv: prn snr " + "elevation azimuth", + mSvStatus.num_svs, mSvStatus.ephemeris_mask, + mSvStatus.almanac_mask, mSvStatus.used_in_fix_mask); + for (int i = 0; i < mSvStatus.num_svs && i < GPS_MAX_SVS; i++) { + LOC_LOGV(" %d: %d %f %f %f\n ", + i, + mSvStatus.sv_list[i].prn, + mSvStatus.sv_list[i].snr, + mSvStatus.sv_list[i].elevation, + mSvStatus.sv_list[i].azimuth); + } +} +inline void LocEngReportSv::log() const { + locallog(); +} +void LocEngReportSv::send() const { + mAdapter->sendMsg(this); +} + +// case LOC_ENG_MSG_REPORT_STATUS: +LocEngReportStatus::LocEngReportStatus(LocAdapterBase* adapter, + GpsStatusValue engineStatus) : + LocMsg(), mAdapter(adapter), mStatus(engineStatus) +{ + locallog(); +} +inline void LocEngReportStatus::proc() const +{ + LocEngAdapter* adapter = (LocEngAdapter*)mAdapter; + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)adapter->getOwner(); + + loc_eng_report_status(*locEng, mStatus); + update_aiding_data_for_deletion(*locEng); +} +inline void LocEngReportStatus::locallog() const { + LOC_LOGV("LocEngReportStatus"); +} +inline void LocEngReportStatus::log() const { + locallog(); +} + +// case LOC_ENG_MSG_REPORT_NMEA: +LocEngReportNmea::LocEngReportNmea(void* locEng, + const char* data, int len) : + LocMsg(), mLocEng(locEng), mNmea(new char[len]), mLen(len) +{ + memcpy((void*)mNmea, (void*)data, len); + locallog(); +} +void LocEngReportNmea::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng; + + struct timeval tv; + gettimeofday(&tv, (struct timezone *) NULL); + int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + CALLBACK_LOG_CALLFLOW("nmea_cb", %d, mLen); + + if (locEng->nmea_cb != NULL) + locEng->nmea_cb(now, mNmea, mLen); +} +inline void LocEngReportNmea::locallog() const { + LOC_LOGV("LocEngReportNmea"); +} +inline void LocEngReportNmea::log() const { + locallog(); +} + +// case LOC_ENG_MSG_REPORT_XTRA_SERVER: +LocEngReportXtraServer::LocEngReportXtraServer(void* locEng, + const char *url1, + const char *url2, + const char *url3, + const int maxlength) : + LocMsg(), mLocEng(locEng), mMaxLen(maxlength), + mServers(new char[3*(mMaxLen+1)]) +{ + char * cptr = mServers; + memset(mServers, 0, 3*(mMaxLen+1)); + + // Override modem URLs with uncommented gps.conf urls + if( gps_conf.XTRA_SERVER_1[0] != '\0' ) { + url1 = &gps_conf.XTRA_SERVER_1[0]; + } + if( gps_conf.XTRA_SERVER_2[0] != '\0' ) { + url2 = &gps_conf.XTRA_SERVER_2[0]; + } + if( gps_conf.XTRA_SERVER_3[0] != '\0' ) { + url3 = &gps_conf.XTRA_SERVER_3[0]; + } + // copy non xtra1.gpsonextra.net URLs into the forwarding buffer. + if( NULL == strcasestr(url1, XTRA1_GPSONEXTRA) ) { + strlcpy(cptr, url1, mMaxLen + 1); + cptr += mMaxLen + 1; + } + if( NULL == strcasestr(url2, XTRA1_GPSONEXTRA) ) { + strlcpy(cptr, url2, mMaxLen + 1); + cptr += mMaxLen + 1; + } + if( NULL == strcasestr(url3, XTRA1_GPSONEXTRA) ) { + strlcpy(cptr, url3, mMaxLen + 1); + } + locallog(); +} + +void LocEngReportXtraServer::proc() const { + loc_eng_xtra_data_s_type* locEngXtra = + &(((loc_eng_data_s_type*)mLocEng)->xtra_module_data); + + if (locEngXtra->report_xtra_server_cb != NULL) { + CALLBACK_LOG_CALLFLOW("report_xtra_server_cb", %s, mServers); + locEngXtra->report_xtra_server_cb(mServers, + &(mServers[mMaxLen+1]), + &(mServers[(mMaxLen+1)<<1])); + } else { + LOC_LOGE("Callback function for request xtra is NULL"); + } +} +inline void LocEngReportXtraServer::locallog() const { + LOC_LOGV("LocEngReportXtraServers: server1: %s\n server2: %s\n" + " server3: %s\n", + mServers, &mServers[mMaxLen+1], &mServers[(mMaxLen+1)<<1]); +} +inline void LocEngReportXtraServer::log() const { + locallog(); +} + +// case LOC_ENG_MSG_REQUEST_BIT: +// case LOC_ENG_MSG_RELEASE_BIT: +LocEngReqRelBIT::LocEngReqRelBIT(void* locEng, AGpsExtType type, + int ipv4, char* ipv6, bool isReq) : + LocMsg(), mLocEng(locEng), mType(type), mIPv4Addr(ipv4), + mIPv6Addr(ipv6 ? new char[16] : NULL), mIsReq(isReq) { + if (NULL != ipv6) + memcpy(mIPv6Addr, ipv6, 16); + locallog(); +} +inline LocEngReqRelBIT::~LocEngReqRelBIT() { + if (mIPv6Addr) { + delete[] mIPv6Addr; + } +} +void LocEngReqRelBIT::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + BITSubscriber s(getAgpsStateMachine(*locEng, mType), + mIPv4Addr, mIPv6Addr); + AgpsStateMachine* sm = (AgpsStateMachine*)s.mStateMachine; + + if (mIsReq) { + sm->subscribeRsrc((Subscriber*)&s); + } else { + sm->unsubscribeRsrc((Subscriber*)&s); + } +} +inline void LocEngReqRelBIT::locallog() const { + LOC_LOGV("LocEngRequestBIT - ipv4: %d.%d.%d.%d, ipv6: %s", + (unsigned char)mIPv4Addr, + (unsigned char)(mIPv4Addr>>8), + (unsigned char)(mIPv4Addr>>16), + (unsigned char)(mIPv4Addr>>24), + NULL != mIPv6Addr ? mIPv6Addr : ""); +} +inline void LocEngReqRelBIT::log() const { + locallog(); +} +void LocEngReqRelBIT::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->sendMsg(this); +} + +// case LOC_ENG_MSG_RELEASE_BIT: +struct LocEngReleaseBIT : public LocMsg { + const BITSubscriber mSubscriber; + inline LocEngReleaseBIT(const AgpsStateMachine* stateMachine, + unsigned int ipv4, char* ipv6) : + LocMsg(), + mSubscriber(stateMachine, ipv4, ipv6) + { + locallog(); + } + inline virtual void proc() const + { + AgpsStateMachine* sm = (AgpsStateMachine*)mSubscriber.mStateMachine; + sm->unsubscribeRsrc((Subscriber*)&mSubscriber); + } + inline void locallog() const { + LOC_LOGV("LocEngReleaseBIT - ipv4: %d.%d.%d.%d, ipv6: %s", + (unsigned char)(mSubscriber.ID>>24), + (unsigned char)(mSubscriber.ID>>16), + (unsigned char)(mSubscriber.ID>>8), + (unsigned char)mSubscriber.ID, + NULL != mSubscriber.mIPv6Addr ? mSubscriber.mIPv6Addr : ""); + } + virtual void log() const { + locallog(); + } +}; + +// LocEngSuplEsOpened +LocEngSuplEsOpened::LocEngSuplEsOpened(void* locEng) : + LocMsg(), mLocEng(locEng) { + locallog(); +} +void LocEngSuplEsOpened::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + if (locEng->ds_nif) { + AgpsStateMachine* sm = locEng->ds_nif; + sm->onRsrcEvent(RSRC_GRANTED); + } +} +void LocEngSuplEsOpened::locallog() const { + LOC_LOGV("LocEngSuplEsOpened"); +} +void LocEngSuplEsOpened::log() const { + locallog(); +} + +// LocEngSuplEsClosed +LocEngSuplEsClosed::LocEngSuplEsClosed(void* locEng) : + LocMsg(), mLocEng(locEng) { + locallog(); +} +void LocEngSuplEsClosed::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + if (locEng->ds_nif) { + AgpsStateMachine* sm = locEng->ds_nif; + sm->onRsrcEvent(RSRC_RELEASED); + } +} +void LocEngSuplEsClosed::locallog() const { + LOC_LOGV("LocEngSuplEsClosed"); +} +void LocEngSuplEsClosed::log() const { + locallog(); +} + + +// case LOC_ENG_MSG_REQUEST_SUPL_ES: +LocEngRequestSuplEs::LocEngRequestSuplEs(void* locEng, int id) : + LocMsg(), mLocEng(locEng), mID(id) { + locallog(); +} +void LocEngRequestSuplEs::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + if (locEng->ds_nif) { + AgpsStateMachine* sm = locEng->ds_nif; + DSSubscriber s(sm, mID); + sm->subscribeRsrc((Subscriber*)&s); + } + else if (locEng->agnss_nif) { + AgpsStateMachine *sm = locEng->agnss_nif; + ATLSubscriber s(mID, + sm, + locEng->adapter, + false); + sm->subscribeRsrc((Subscriber*)&s); + LOC_LOGD("%s:%d]: Using regular ATL for SUPL ES", __func__, __LINE__); + } + else { + locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, -1); + } +} +inline void LocEngRequestSuplEs::locallog() const { + LOC_LOGV("LocEngRequestSuplEs"); +} +inline void LocEngRequestSuplEs::log() const { + locallog(); +} + +// case LOC_ENG_MSG_REQUEST_ATL: +LocEngRequestATL::LocEngRequestATL(void* locEng, int id, + AGpsExtType agps_type) : + LocMsg(), mLocEng(locEng), mID(id), mType(agps_type) { + locallog(); +} +void LocEngRequestATL::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + AgpsStateMachine* sm = (AgpsStateMachine*) + getAgpsStateMachine(*locEng, mType); + if (sm) { + ATLSubscriber s(mID, + sm, + locEng->adapter, + AGPS_TYPE_INVALID == mType); + sm->subscribeRsrc((Subscriber*)&s); + } else { + locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, mType); + } +} +inline void LocEngRequestATL::locallog() const { + LOC_LOGV("LocEngRequestATL"); +} +inline void LocEngRequestATL::log() const { + locallog(); +} + +// case LOC_ENG_MSG_RELEASE_ATL: +LocEngReleaseATL::LocEngReleaseATL(void* locEng, int id) : + LocMsg(), mLocEng(locEng), mID(id) { + locallog(); +} +void LocEngReleaseATL::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + + if (locEng->agnss_nif) { + ATLSubscriber s1(mID, locEng->agnss_nif, locEng->adapter, false); + if (locEng->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) { + LOC_LOGD("%s:%d]: Unsubscribed from agnss_nif", + __func__, __LINE__); + return; + } + } + + if (locEng->internet_nif) { + ATLSubscriber s2(mID, locEng->internet_nif, locEng->adapter, false); + if (locEng->internet_nif->unsubscribeRsrc((Subscriber*)&s2)) { + LOC_LOGD("%s:%d]: Unsubscribed from internet_nif", + __func__, __LINE__); + return; + } + } + + if (locEng->ds_nif) { + DSSubscriber s3(locEng->ds_nif, mID); + if (locEng->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { + LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", + __func__, __LINE__); + return; + } + } + + LOC_LOGW("%s:%d]: Could not release ATL. " + "No subscribers found\n", + __func__, __LINE__); + locEng->adapter->atlCloseStatus(mID, 0); +} +inline void LocEngReleaseATL::locallog() const { + LOC_LOGV("LocEngReleaseATL"); +} +inline void LocEngReleaseATL::log() const { + locallog(); +} + +// case LOC_ENG_MSG_REQUEST_WIFI: +// case LOC_ENG_MSG_RELEASE_WIFI: +LocEngReqRelWifi::LocEngReqRelWifi(void* locEng, AGpsExtType type, + loc_if_req_sender_id_e_type sender_id, + char* s, char* p, bool isReq) : + LocMsg(), mLocEng(locEng), mType(type), mSenderId(sender_id), + mSSID(NULL == s ? NULL : new char[SSID_BUF_SIZE]), + mPassword(NULL == p ? NULL : new char[SSID_BUF_SIZE]), + mIsReq(isReq) { + if (NULL != s) + strlcpy(mSSID, s, SSID_BUF_SIZE); + if (NULL != p) + strlcpy(mPassword, p, SSID_BUF_SIZE); + locallog(); +} +LocEngReqRelWifi::~LocEngReqRelWifi() { + if (NULL != mSSID) { + delete[] mSSID; + } + if (NULL != mPassword) { + delete[] mPassword; + } +} +void LocEngReqRelWifi::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + if (locEng->wifi_nif) { + WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId); + if (mIsReq) { + locEng->wifi_nif->subscribeRsrc((Subscriber*)&s); + } else { + locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s); + } + } else { + locEng->adapter->atlOpenStatus(mSenderId, 0, NULL, -1, mType); + } +} +inline void LocEngReqRelWifi::locallog() const { + LOC_LOGV("%s - senderId: %d, ssid: %s, password: %s", + mIsReq ? "LocEngRequestWifi" : "LocEngReleaseWifi", + mSenderId, + NULL != mSSID ? mSSID : "", + NULL != mPassword ? mPassword : ""); +} +inline void LocEngReqRelWifi::log() const { + locallog(); +} +void LocEngReqRelWifi::send() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + locEng->adapter->sendMsg(this); +} + +// case LOC_ENG_MSG_REQUEST_XTRA_DATA: +LocEngRequestXtra::LocEngRequestXtra(void* locEng) : + mLocEng(locEng) { + locallog(); +} +void LocEngRequestXtra::proc() const +{ + loc_eng_xtra_data_s_type* locEngXtra = + &(((loc_eng_data_s_type*)mLocEng)->xtra_module_data); + + if (locEngXtra->download_request_cb != NULL) { + CALLBACK_LOG_CALLFLOW("download_request_cb", %p, mLocEng); + locEngXtra->download_request_cb(); + } else { + LOC_LOGE("Callback function for request xtra is NULL"); + } +} +inline void LocEngRequestXtra::locallog() const { + LOC_LOGV("LocEngReqXtra"); +} +inline void LocEngRequestXtra::log() const { + locallog(); +} + +// case LOC_ENG_MSG_REQUEST_TIME: +LocEngRequestTime::LocEngRequestTime(void* locEng) : + LocMsg(), mLocEng(locEng) +{ + locallog(); +} +void LocEngRequestTime::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + if (gps_conf.CAPABILITIES & GPS_CAPABILITY_ON_DEMAND_TIME) { + if (locEng->request_utc_time_cb != NULL) { + locEng->request_utc_time_cb(); + } else { + LOC_LOGE("Callback function for request time is NULL"); + } + } +} +inline void LocEngRequestTime::locallog() const { + LOC_LOGV("LocEngReqTime"); +} +inline void LocEngRequestTime::log() const { + locallog(); +} + +// case LOC_ENG_MSG_DELETE_AIDING_DATA: +struct LocEngDelAidData : public LocMsg { + loc_eng_data_s_type* mLocEng; + const GpsAidingData mType; + inline LocEngDelAidData(loc_eng_data_s_type* locEng, + GpsAidingData f) : + LocMsg(), mLocEng(locEng), mType(f) + { + locallog(); + } + inline virtual void proc() const { + mLocEng->aiding_data_for_deletion = mType; + update_aiding_data_for_deletion(*mLocEng); + } + inline void locallog() const { + LOC_LOGV("aiding data msak %d", mType); + } + virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_ENABLE_DATA: +struct LocEngEnableData : public LocMsg { + LocEngAdapter* mAdapter; + const int mEnable; + char* mAPN; + const int mLen; + inline LocEngEnableData(LocEngAdapter* adapter, + const char* name, int len, int enable) : + LocMsg(), mAdapter(adapter), + mEnable(enable), mAPN(NULL), mLen(len) + { + if (NULL != name) { + mAPN = new char[len+1]; + memcpy((void*)mAPN, (void*)name, len); + mAPN[len] = 0; + } + locallog(); + } + inline ~LocEngEnableData() { + if (NULL != mAPN) { + delete[] mAPN; + } + } + inline virtual void proc() const { + mAdapter->enableData(mEnable); + if (NULL != mAPN) { + mAdapter->setAPN(mAPN, mLen); + } + } + inline void locallog() const { + LOC_LOGV("apn: %s\n enable: %d", + (NULL == mAPN) ? "NULL" : mAPN, mEnable); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_INJECT_XTRA_DATA: +// loc_eng_xtra.cpp + +// case LOC_ENG_MSG_LOC_INIT: +struct LocEngInit : public LocMsg { + loc_eng_data_s_type* mLocEng; + inline LocEngInit(loc_eng_data_s_type* locEng) : + LocMsg(), mLocEng(locEng) + { + locallog(); + } + inline virtual void proc() const { + loc_eng_reinit(*mLocEng); + } + inline void locallog() const + { + LOC_LOGV("LocEngInit"); + } + inline virtual void log() const + { + locallog(); + } +}; + +// case LOC_ENG_MSG_REQUEST_XTRA_SERVER: +// loc_eng_xtra.cpp + +// case LOC_ENG_MSG_ATL_OPEN_SUCCESS: +struct LocEngAtlOpenSuccess : public LocMsg { + AgpsStateMachine* mStateMachine; + const int mLen; + char* mAPN; + const AGpsBearerType mBearerType; + inline LocEngAtlOpenSuccess(AgpsStateMachine* statemachine, + const char* name, + int len, + AGpsBearerType btype) : + LocMsg(), + mStateMachine(statemachine), mLen(len), + mAPN(new char[len+1]), mBearerType(btype) + { + memcpy((void*)mAPN, (void*)name, len); + mAPN[len] = 0; + locallog(); + } + inline ~LocEngAtlOpenSuccess() + { + delete[] mAPN; + } + inline virtual void proc() const { + mStateMachine->setBearer(mBearerType); + mStateMachine->setAPN(mAPN, mLen); + mStateMachine->onRsrcEvent(RSRC_GRANTED); + } + inline void locallog() const { + LOC_LOGV("LocEngAtlOpenSuccess agps type: %s\n apn: %s\n" + " bearer type: %s", + loc_get_agps_type_name(mStateMachine->getType()), + mAPN, + loc_get_agps_bear_name(mBearerType)); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_ATL_CLOSED: +struct LocEngAtlClosed : public LocMsg { + AgpsStateMachine* mStateMachine; + inline LocEngAtlClosed(AgpsStateMachine* statemachine) : + LocMsg(), mStateMachine(statemachine) { + locallog(); + } + inline virtual void proc() const { + mStateMachine->onRsrcEvent(RSRC_RELEASED); + } + inline void locallog() const { + LOC_LOGV("LocEngAtlClosed"); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_ATL_OPEN_FAILED: +struct LocEngAtlOpenFailed : public LocMsg { + AgpsStateMachine* mStateMachine; + inline LocEngAtlOpenFailed(AgpsStateMachine* statemachine) : + LocMsg(), mStateMachine(statemachine) { + locallog(); + } + inline virtual void proc() const { + mStateMachine->onRsrcEvent(RSRC_DENIED); + } + inline void locallog() const { + LOC_LOGV("LocEngAtlOpenFailed"); + } + inline virtual void log() const { + locallog(); + } +}; + +// case LOC_ENG_MSG_ENGINE_DOWN: +LocEngDown::LocEngDown(void* locEng) : + LocMsg(), mLocEng(locEng) { + locallog(); +} +inline void LocEngDown::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + loc_eng_handle_engine_down(*locEng); +} +inline void LocEngDown::locallog() const { + LOC_LOGV("LocEngDown"); +} +inline void LocEngDown::log() const { + locallog(); +} + +// case LOC_ENG_MSG_ENGINE_UP: +LocEngUp::LocEngUp(void* locEng) : + LocMsg(), mLocEng(locEng) { + locallog(); +} +inline void LocEngUp::proc() const { + loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng; + loc_eng_handle_engine_up(*locEng); +} +inline void LocEngUp::locallog() const { + LOC_LOGV("LocEngUp"); +} +inline void LocEngUp::log() const { + locallog(); +} + +struct LocEngDataClientInit : public LocMsg { + loc_eng_data_s_type* mLocEng; + inline LocEngDataClientInit(loc_eng_data_s_type* locEng) : + LocMsg(), mLocEng(locEng) { + locallog(); + } + virtual void proc() const { + loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng; + if(!locEng->adapter->initDataServiceClient()) { + locEng->ds_nif = new DSStateMachine(servicerTypeExt, + (void *)dataCallCb, + locEng->adapter); + } + } + void locallog() const { + LOC_LOGV("LocEngDataClientInit\n"); + } + virtual void log() const { + locallog(); + } +}; + +struct LocEngInstallAGpsCert : public LocMsg { + LocEngAdapter* mpAdapter; + const size_t mNumberOfCerts; + const uint32_t mSlotBitMask; + DerEncodedCertificate* mpData; + inline LocEngInstallAGpsCert(LocEngAdapter* adapter, + const DerEncodedCertificate* pData, + size_t numberOfCerts, + uint32_t slotBitMask) : + LocMsg(), mpAdapter(adapter), + mNumberOfCerts(numberOfCerts), mSlotBitMask(slotBitMask), + mpData(new DerEncodedCertificate[mNumberOfCerts]) + { + for (int i=0; i < mNumberOfCerts; i++) { + mpData[i].data = new u_char[pData[i].length]; + if (mpData[i].data) { + memcpy(mpData[i].data, (void*)pData[i].data, pData[i].length); + mpData[i].length = pData[i].length; + } else { + LOC_LOGE("malloc failed for cert#%d", i); + break; + } + } + locallog(); + } + inline ~LocEngInstallAGpsCert() + { + for (int i=0; i < mNumberOfCerts; i++) { + if (mpData[i].data) { + delete[] mpData[i].data; + } + } + delete[] mpData; + } + inline virtual void proc() const { + mpAdapter->installAGpsCert(mpData, mNumberOfCerts, mSlotBitMask); + } + inline void locallog() const { + LOC_LOGV("LocEngInstallAGpsCert - certs=%u mask=%u", + mNumberOfCerts, mSlotBitMask); + } + inline virtual void log() const { + locallog(); + } +}; + +/********************************************************************* + * Initialization checking macros + *********************************************************************/ +#define STATE_CHECK(ctx, x, ret) \ + if (!(ctx)) \ + { \ + /* Not intialized, abort */\ + LOC_LOGE("%s: log_eng state error: %s", __func__, x); \ + EXIT_LOG(%s, x); \ + ret; \ + } +#define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret) + +/*=========================================================================== +FUNCTION loc_eng_init + +DESCRIPTION + Initialize the location engine, this include setting up global datas + and registers location engien with loc api service. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks, + LOC_API_ADAPTER_EVENT_MASK_T event, ContextBase* context) + +{ + int ret_val = 0; + + ENTRY_LOG_CALLFLOW(); + if (NULL == callbacks || 0 == event) { + LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event); + ret_val = -1; + EXIT_LOG(%d, ret_val); + return ret_val; + } + + STATE_CHECK((NULL == loc_eng_data.adapter), + "instance already initialized", return 0); + + memset(&loc_eng_data, 0, sizeof (loc_eng_data)); + + if (NULL != callbacks->set_capabilities_cb) { + callbacks->set_capabilities_cb(gps_conf.CAPABILITIES); + } + + // Save callbacks + loc_eng_data.location_cb = callbacks->location_cb; + loc_eng_data.sv_status_cb = callbacks->sv_status_cb; + loc_eng_data.status_cb = callbacks->status_cb; + loc_eng_data.nmea_cb = callbacks->nmea_cb; + loc_eng_data.set_capabilities_cb = callbacks->set_capabilities_cb; + loc_eng_data.acquire_wakelock_cb = callbacks->acquire_wakelock_cb; + loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb; + loc_eng_data.request_utc_time_cb = callbacks->request_utc_time_cb; + loc_eng_data.location_ext_parser = callbacks->location_ext_parser ? + callbacks->location_ext_parser : noProc; + 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; + // loc_eng_data.mute_session_state -- LOC_MUTE_SESS_NONE; + + if ((event & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) && (gps_conf.NMEA_PROVIDER == NMEA_PROVIDER_AP)) + { + event = event ^ LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; // unregister for modem NMEA report + loc_eng_data.generateNmea = true; + } + else + { + loc_eng_data.generateNmea = false; + } + + loc_eng_data.adapter = + new LocEngAdapter(event, &loc_eng_data, context, + (MsgTask::tCreate)callbacks->create_thread_cb); + + LOC_LOGD("loc_eng_init created client, id = %p\n", + loc_eng_data.adapter); + loc_eng_data.adapter->sendMsg(new LocEngInit(&loc_eng_data)); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; + LocEngAdapter* adapter = loc_eng_data.adapter; + + adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); + adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); + adapter->sendMsg(new LocEngSensorControlConfig(adapter, sap_conf.SENSOR_USAGE, + sap_conf.SENSOR_PROVIDER)); + adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + + /* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */ + if( sap_conf.GYRO_BIAS_RANDOM_WALK_VALID || + sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || + sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { + adapter->sendMsg(new LocEngSensorProperties(adapter, + sap_conf.GYRO_BIAS_RANDOM_WALK_VALID, + sap_conf.GYRO_BIAS_RANDOM_WALK, + sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, + sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, + sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, + sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, + sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY)); + } + + adapter->sendMsg(new LocEngSensorPerfControlConfig(adapter, + sap_conf.SENSOR_CONTROL_MODE, + sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, + sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, + sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, + sap_conf.SENSOR_GYRO_BATCHES_PER_SEC, + sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, + sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, + sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, + sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, + sap_conf.SENSOR_ALGORITHM_CONFIG_MASK)); + + adapter->sendMsg(new LocEngEnableData(adapter, NULL, 0, (agpsStatus ? 1:0))); + + loc_eng_xtra_version_check(loc_eng_data, gps_conf.XTRA_VERSION_CHECK); + + LOC_LOGD("loc_eng_reinit reinit() successful"); + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_cleanup + +DESCRIPTION + Cleans location engine. The location client handle will be released. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter, return); + + // XTRA has no state, so we are fine with it. + + // we need to check and clear NI +#if 0 + // we need to check and clear ATL + if (NULL != loc_eng_data.agnss_nif) { + delete loc_eng_data.agnss_nif; + loc_eng_data.agnss_nif = NULL; + } + if (NULL != loc_eng_data.internet_nif) { + delete loc_eng_data.internet_nif; + loc_eng_data.internet_nif = NULL; + } +#endif + if (loc_eng_data.adapter->isInSession()) + { + LOC_LOGD("loc_eng_cleanup: fix not stopped. stop it now."); + loc_eng_stop(loc_eng_data); + } + +#if 0 // can't afford to actually clean up, for many reason. + + LOC_LOGD("loc_eng_init: client opened. close it now."); + delete loc_eng_data.adapter; + loc_eng_data.adapter = NULL; + + loc_eng_dmn_conn_loc_api_server_unblock(); + loc_eng_dmn_conn_loc_api_server_join(); + +#endif + + EXIT_LOG(%s, VOID_RET); +} + + +/*=========================================================================== +FUNCTION loc_eng_start + +DESCRIPTION + Starts the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_start(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter, return -1); + + if(! loc_eng_data.adapter->getUlpProxy()->sendStartFix()) + { + loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter)); + } + + EXIT_LOG(%d, 0); + return 0; +} + +static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; + + if (!loc_eng_data.adapter->isInSession()) { + ret_val = loc_eng_data.adapter->startFix(); + + if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS || + ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN || + ret_val == LOC_API_ADAPTER_ERR_PHONE_OFFLINE || + ret_val == LOC_API_ADAPTER_ERR_INTERNAL) + { + loc_eng_data.adapter->setInSession(TRUE); + loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN); + } + } + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_stop_wrapper + +DESCRIPTION + Stops the tracking session + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_stop(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter, return -1); + + if(! loc_eng_data.adapter->getUlpProxy()->sendStopFix()) + { + loc_eng_data.adapter->sendMsg(new LocEngStopFix(loc_eng_data.adapter)); + } + + EXIT_LOG(%d, 0); + return 0; +} + +static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; + + 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); + } + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_mute_one_session + +DESCRIPTION + Mutes one session + +DEPENDENCIES + None + +RETURN VALUE + 0: Success + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + loc_eng_data.mute_session_state = LOC_MUTE_SESS_WAIT; + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_set_position_mode + +DESCRIPTION + Sets the mode and fix frequency for the tracking session. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, + LocPosMode ¶ms) +{ + 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) { + params.mode = LOC_POSITION_MODE_STANDALONE; + LOC_LOGD("Position mode changed to standalone for target with GSS/qca1530."); + } + + if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params)) + { + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngPositionMode(adapter, params)); + } + + EXIT_LOG(%d, 0); + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_inject_time + +DESCRIPTION + This is used by Java native function to do time injection. + +DEPENDENCIES + None + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time, + int64_t timeReference, int uncertainty) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter, return -1); + LocEngAdapter* adapter = loc_eng_data.adapter; + + adapter->sendMsg(new LocEngSetTime(adapter, time, timeReference, + uncertainty)); + + EXIT_LOG(%d, 0); + return 0; +} + + +/*=========================================================================== +FUNCTION loc_eng_inject_location + +DESCRIPTION + This is used by Java native function to do location injection. + +DEPENDENCIES + None + +RETURN VALUE + 0 : Successful + error code : Failure + +SIDE EFFECTS + N/A +===========================================================================*/ +int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude, + double longitude, float accuracy) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter, return -1); + LocEngAdapter* adapter = loc_eng_data.adapter; + if(adapter->mSupportsPositionInjection) + { + adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, + accuracy)); + } + + EXIT_LOG(%d, 0); + return 0; +} + + +/*=========================================================================== +FUNCTION loc_eng_delete_aiding_data + +DESCRIPTION + This is used by Java native function to delete the aiding data. The function + updates the global variable for the aiding data to be deleted. If the GPS + engine is off, the aiding data will be deleted. Otherwise, the actual action + will happen when gps engine is turned off. + +DEPENDENCIES + Assumes the aiding data type specified in GpsAidingData matches with + LOC API specification. + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData f) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter, return); + + loc_eng_data.adapter->sendMsg(new LocEngDelAidData(&loc_eng_data, f)); + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== + +FUNCTION loc_inform_gps_state + +DESCRIPTION + Informs the GPS Provider about the GPS status + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusValue status) +{ + ENTRY_LOG(); + + if (loc_eng_data.status_cb) + { + GpsStatus gs = { sizeof(gs),status }; + CALLBACK_LOG_CALLFLOW("status_cb", %s, + loc_get_gps_status_name(gs.status)); + loc_eng_data.status_cb(&gs); + } + + EXIT_LOG(%s, VOID_RET); +} + +static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + int ret_val = LOC_API_ADAPTER_ERR_SUCCESS; + UlpLocation location; + LocPosTechMask tech_mask = LOC_POS_TECH_MASK_DEFAULT; + GpsLocationExtended locationExtended; + memset(&locationExtended, 0, sizeof (GpsLocationExtended)); + locationExtended.size = sizeof(locationExtended); + + ret_val = loc_eng_data.adapter->getZpp(location.gpsLocation, tech_mask); + //Mark the location source as from ZPP + location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; + location.position_source = ULP_LOCATION_IS_FROM_ZPP; + + loc_eng_data.adapter->getUlpProxy()->reportPosition(location, + locationExtended, + NULL, + LOC_SESS_SUCCESS, + tech_mask); + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/* + Callback function passed to Data Services State Machine + This becomes part of the state machine's servicer and + is used to send requests to the data services client +*/ +static int dataCallCb(void *cb_data) +{ + LOC_LOGD("Enter dataCallCb\n"); + int ret=0; + if(cb_data != NULL) { + dsCbData *cbData = (dsCbData *)cb_data; + LocEngAdapter *locAdapter = (LocEngAdapter *)cbData->mAdapter; + if(cbData->action == GPS_REQUEST_AGPS_DATA_CONN) { + LOC_LOGD("dataCallCb GPS_REQUEST_AGPS_DATA_CONN\n"); + ret = locAdapter->openAndStartDataCall(); + } + else if(cbData->action == GPS_RELEASE_AGPS_DATA_CONN) { + LOC_LOGD("dataCallCb GPS_RELEASE_AGPS_DATA_CONN\n"); + locAdapter->stopDataCall(); + } + } + else { + LOC_LOGE("NULL argument received. Failing.\n"); + ret = -1; + goto err; + } + +err: + LOC_LOGD("Exit dataCallCb ret = %d\n", ret); + return ret; +} + +/*=========================================================================== +FUNCTION loc_eng_agps_reinit + +DESCRIPTION + 2nd half of loc_eng_agps_init(), singled out for modem restart to use. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + + // Set server addresses which came before init + if (loc_eng_data.supl_host_set) + { + loc_eng_set_server(loc_eng_data, LOC_AGPS_SUPL_SERVER, + loc_eng_data.supl_host_buf, + loc_eng_data.supl_port_buf); + } + + if (loc_eng_data.c2k_host_set) + { + loc_eng_set_server(loc_eng_data, LOC_AGPS_CDMA_PDE_SERVER, + loc_eng_data.c2k_host_buf, + loc_eng_data.c2k_port_buf); + } + EXIT_LOG(%s, VOID_RET); +} +/*=========================================================================== +FUNCTION loc_eng_agps_init + +DESCRIPTION + Initialize the AGps interface. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* callbacks) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter, return); + STATE_CHECK((NULL == loc_eng_data.agps_status_cb), + "agps instance already initialized", + return); + if (callbacks == NULL) { + LOC_LOGE("loc_eng_agps_init: bad parameters cb %p", callbacks); + EXIT_LOG(%s, VOID_RET); + return; + } + LocEngAdapter* adapter = loc_eng_data.adapter; + loc_eng_data.agps_status_cb = callbacks->status_cb; + + loc_eng_data.internet_nif = new AgpsStateMachine(servicerTypeAgps, + (void *)loc_eng_data.agps_status_cb, + AGPS_TYPE_WWAN_ANY, + false); + loc_eng_data.wifi_nif = new AgpsStateMachine(servicerTypeAgps, + (void *)loc_eng_data.agps_status_cb, + AGPS_TYPE_WIFI, + true); + + int gnssType = getTargetGnssType(loc_get_target()); + bool isAPQ = (gnssType == GNSS_GSS); + bool is1530 = (gnssType == GNSS_QCA1530); + if (!isAPQ && !is1530) { + loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps, + (void *)loc_eng_data.agps_status_cb, + AGPS_TYPE_SUPL, + false); + + if (adapter->mSupportsAgpsRequests) { + if(gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) { + loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); + } + loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb, + NULL, NULL, &loc_eng_data); + } + loc_eng_agps_reinit(loc_eng_data); + } + + EXIT_LOG(%s, VOID_RET); +} + +static void deleteAidingData(loc_eng_data_s_type &logEng) { + if (logEng.engine_status != GPS_STATUS_ENGINE_ON && + logEng.aiding_data_for_deletion != 0) { + logEng.adapter->deleteAidingData(logEng.aiding_data_for_deletion); + logEng.aiding_data_for_deletion = 0; + } +} + +static AgpsStateMachine* +getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) { + AgpsStateMachine* stateMachine; + switch (agpsType) { + case AGPS_TYPE_WIFI: { + stateMachine = locEng.wifi_nif; + break; + } + case AGPS_TYPE_INVALID: + case AGPS_TYPE_SUPL: { + stateMachine = locEng.agnss_nif; + break; + } + case AGPS_TYPE_SUPL_ES: { + locEng.ds_nif ? + stateMachine = locEng.ds_nif: + stateMachine = locEng.agnss_nif; + break; + } + default: + stateMachine = locEng.internet_nif; + } + return stateMachine; +} + +/*=========================================================================== +FUNCTION loc_eng_agps_open + +DESCRIPTION + This function is called when on-demand data connection opening is successful. +It should inform engine about the data open result. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, + const char* apn, AGpsBearerType bearerType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, + return -1); + + if (apn == NULL) + { + LOC_LOGE("APN Name NULL\n"); + return 0; + } + + LOC_LOGD("loc_eng_agps_open APN name = [%s]", apn); + + int apn_len = smaller_of(strlen (apn), MAX_APN_LEN); + AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); + + loc_eng_data.adapter->sendMsg( + new LocEngAtlOpenSuccess(sm, apn, apn_len, bearerType)); + + EXIT_LOG(%d, 0); + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_agps_closed + +DESCRIPTION + This function is called when on-demand data connection closing is done. +It should inform engine about the data close result. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, + return -1); + + AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); + loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(sm)); + + EXIT_LOG(%d, 0); + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_agps_open_failed + +DESCRIPTION + This function is called when on-demand data connection opening has failed. +It should inform engine about the data open result. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType) +{ + ENTRY_LOG_CALLFLOW(); + INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb, + return -1); + + AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType); + loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(sm)); + + EXIT_LOG(%d, 0); + return 0; +} + +/*=========================================================================== + +FUNCTION resolve_in_addr + +DESCRIPTION + Translates a hostname to in_addr struct + +DEPENDENCIES + n/a + +RETURN VALUE + TRUE if successful + +SIDE EFFECTS + n/a + +===========================================================================*/ +static boolean resolve_in_addr(const char *host_addr, struct in_addr *in_addr_ptr) +{ + ENTRY_LOG(); + boolean ret_val = TRUE; + + struct hostent *hp; + hp = gethostbyname(host_addr); + if (hp != NULL) /* DNS OK */ + { + memcpy(in_addr_ptr, hp->h_addr_list[0], hp->h_length); + } + else + { + /* Try IP representation */ + if (inet_aton(host_addr, in_addr_ptr) == 0) + { + /* IP not valid */ + LOC_LOGE("DNS query on '%s' failed\n", host_addr); + ret_val = FALSE; + } + } + + EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_set_server + +DESCRIPTION + This is used to set the default AGPS server. Server address is obtained + from gps.conf. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data, + LocServerType type, const char* hostname, int port) +{ + ENTRY_LOG(); + int ret = 0; + LocEngAdapter* adapter = loc_eng_data.adapter; + + if (LOC_AGPS_SUPL_SERVER == type) { + char url[MAX_URL_LEN]; + unsigned int len = 0; + const char nohost[] = "NONE"; + if (hostname == NULL || + strncasecmp(nohost, hostname, sizeof(nohost)) == 0) { + url[0] = NULL; + } else { + len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port); + } + + if (sizeof(url) > len) { + adapter->sendMsg(new LocEngSetServerUrl(adapter, url, len)); + } + } else if (LOC_AGPS_CDMA_PDE_SERVER == type || + LOC_AGPS_CUSTOM_PDE_SERVER == type || + LOC_AGPS_MPC_SERVER == type) { + struct in_addr addr; + if (!resolve_in_addr(hostname, &addr)) + { + LOC_LOGE("loc_eng_set_server, hostname %s cannot be resolved.\n", hostname); + ret = -2; + } else { + unsigned int ip = htonl(addr.s_addr); + adapter->sendMsg(new LocEngSetServerIpv4(adapter, ip, port, type)); + } + } else { + LOC_LOGE("loc_eng_set_server, type %d cannot be resolved.\n", type); + } + + EXIT_LOG(%d, ret); + return ret; +} + +/*=========================================================================== +FUNCTION loc_eng_set_server_proxy + +DESCRIPTION + If loc_eng_set_server is called before loc_eng_init, it doesn't work. This + proxy buffers server settings and calls loc_eng_set_server when the client is + open. + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, + LocServerType type, + const char* hostname, int port) +{ + ENTRY_LOG_CALLFLOW(); + int ret_val = 0; + + 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); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_agps_ril_update_network_availability + +DESCRIPTION + Sets data call allow vs disallow flag to modem + This is the only member of sLocEngAGpsRilInterface implemented. + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, + int available, const char* apn) +{ + ENTRY_LOG_CALLFLOW(); + + //This is to store the status of data availability over the network. + //If GPS is not enabled, the INIT_CHECK will fail and the modem will + //not be updated with the network's availability. Since the data status + //can change before GPS is enabled the, storing the status will enable + //us to inform the modem after GPS is enabled + agpsStatus = available; + + INIT_CHECK(loc_eng_data.adapter, return); + if (apn != NULL) + { + LOC_LOGD("loc_eng_agps_ril_update_network_availability: APN Name = [%s]\n", apn); + int apn_len = smaller_of(strlen (apn), MAX_APN_LEN); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngEnableData(adapter, apn, apn_len, available)); + } + EXIT_LOG(%s, VOID_RET); +} + +int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data, + const DerEncodedCertificate* certificates, + size_t numberOfCerts) +{ + ENTRY_LOG_CALLFLOW(); + int ret_val = AGPS_CERTIFICATE_OPERATION_SUCCESS; + + uint32_t slotBitMask = gps_conf.AGPS_CERT_WRITABLE_MASK; + uint32_t slotCount = 0; + for (uint32_t slotBitMaskCounter=slotBitMask; slotBitMaskCounter; slotCount++) { + slotBitMaskCounter &= slotBitMaskCounter - 1; + } + LOC_LOGD("SlotBitMask=%u SlotCount=%u NumberOfCerts=%u", + slotBitMask, slotCount, numberOfCerts); + + LocEngAdapter* adapter = loc_eng_data.adapter; + + if (numberOfCerts == 0) { + LOC_LOGE("No certs to install, since numberOfCerts is zero"); + ret_val = AGPS_CERTIFICATE_OPERATION_SUCCESS; + } else if (!adapter) { + LOC_LOGE("adapter is null!"); + ret_val = AGPS_CERTIFICATE_ERROR_GENERIC; + } else if (slotCount < numberOfCerts) { + LOC_LOGE("Not enough cert slots (%u) to install %u certs!", + slotCount, numberOfCerts); + ret_val = AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES; + } else { + for (int i=0; i < numberOfCerts; ++i) + { + if (certificates[i].length > AGPS_CERTIFICATE_MAX_LENGTH) { + LOC_LOGE("cert#(%u) length of %u is too big! greater than %u", + certificates[i].length, AGPS_CERTIFICATE_MAX_LENGTH); + ret_val = AGPS_CERTIFICATE_ERROR_GENERIC; + break; + } + } + + if (ret_val == AGPS_CERTIFICATE_OPERATION_SUCCESS) { + adapter->sendMsg(new LocEngInstallAGpsCert(adapter, + certificates, + numberOfCerts, + slotBitMask)); + } + } + + EXIT_LOG(%d, ret_val); + return ret_val; +} + +void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, + const char* config_data, int32_t length) +{ + ENTRY_LOG_CALLFLOW(); + + if (config_data && length > 0) { + loc_gps_cfg_s_type gps_conf_old = gps_conf; + UTIL_UPDATE_CONF(config_data, length, gps_conf_table); + LocEngAdapter* adapter = loc_eng_data.adapter; + + // it is possible that HAL is not init'ed at this time + if (adapter) { + if (gps_conf_old.SUPL_VER != gps_conf.SUPL_VER) { + adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER)); + } + if (gps_conf_old.LPP_PROFILE != gps_conf.LPP_PROFILE) { + adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE)); + } + if (gps_conf_old.A_GLONASS_POS_PROTOCOL_SELECT != gps_conf.A_GLONASS_POS_PROTOCOL_SELECT) { + adapter->sendMsg(new LocEngAGlonassProtocol(adapter, + gps_conf.A_GLONASS_POS_PROTOCOL_SELECT)); + } + if (NULL != loc_eng_data.set_capabilities_cb) { + gps_conf.CAPABILITIES &= gps_conf_old.CAPABILITIES; + if (gps_conf.CAPABILITIES != gps_conf_old.CAPABILITIES) { + loc_eng_data.set_capabilities_cb(gps_conf.CAPABILITIES); + } + } + } + + gps_conf.CAPABILITIES = gps_conf_old.CAPABILITIES; + } + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_report_status + +DESCRIPTION + Reports GPS engine state to Java layer. + +DEPENDENCIES + N/A + +RETURN VALUE + N/A + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusValue status) +{ + ENTRY_LOG(); + // Switch from WAIT to MUTE, for "engine on" or "session begin" event + if (status == GPS_STATUS_SESSION_BEGIN || status == GPS_STATUS_ENGINE_ON) + { + if (loc_eng_data.mute_session_state == LOC_MUTE_SESS_WAIT) + { + LOC_LOGD("loc_eng_report_status: mute_session_state changed from WAIT to IN SESSION"); + loc_eng_data.mute_session_state = LOC_MUTE_SESS_IN_SESSION; + } + } + + // Switch off MUTE session + if (loc_eng_data.mute_session_state == LOC_MUTE_SESS_IN_SESSION && + (status == GPS_STATUS_SESSION_END || status == GPS_STATUS_ENGINE_OFF)) + { + LOC_LOGD("loc_eng_report_status: mute_session_state changed from IN SESSION to NONE"); + loc_eng_data.mute_session_state = LOC_MUTE_SESS_NONE; + } + + // Session End is not reported during Android navigating state + boolean navigating = loc_eng_data.adapter->isInSession(); + if (status != GPS_STATUS_NONE && + !(status == GPS_STATUS_SESSION_END && navigating) && + !(status == GPS_STATUS_SESSION_BEGIN && !navigating)) + { + if (loc_eng_data.mute_session_state != LOC_MUTE_SESS_IN_SESSION) + { + // Inform GpsLocationProvider about mNavigating status + loc_inform_gps_status(loc_eng_data, status); + } + else { + LOC_LOGD("loc_eng_report_status: muting the status report."); + } + } + + // Only keeps ENGINE ON/OFF in engine_status + if (status == GPS_STATUS_ENGINE_ON || status == GPS_STATUS_ENGINE_OFF) + { + loc_eng_data.engine_status = status; + } + + // Only keeps SESSION BEGIN/END in fix_session_status + if (status == GPS_STATUS_SESSION_BEGIN || status == GPS_STATUS_SESSION_END) + { + loc_eng_data.fix_session_status = status; + } + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_handle_engine_down + loc_eng_handle_engine_up + +DESCRIPTION + Calls this function when it is detected that modem restart is happening. + Either we detected the modem is down or received modem up event. + This must be called from the deferred thread to avoid race condition. + +DEPENDENCIES + None + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_handle_engine_down(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + loc_eng_ni_reset_on_engine_restart(loc_eng_data); + loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_OFF); + EXIT_LOG(%s, VOID_RET); +} + +void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + loc_eng_reinit(loc_eng_data); + + loc_eng_data.adapter->requestPowerVote(); + + if (loc_eng_data.agps_status_cb != NULL) { + if (loc_eng_data.agnss_nif) + loc_eng_data.agnss_nif->dropAllSubscribers(); + if (loc_eng_data.internet_nif) + loc_eng_data.internet_nif->dropAllSubscribers(); + + 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); + } + EXIT_LOG(%s, VOID_RET); +} + +#ifdef USE_GLIB +/*=========================================================================== +FUNCTION set_sched_policy + +DESCRIPTION + Local copy of this function which bypasses android set_sched_policy + +DEPENDENCIES + None + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int set_sched_policy(int tid, SchedPolicy policy) +{ + return 0; +} +#endif /* USE_GLIB */ + +/*=========================================================================== +FUNCTION loc_eng_read_config + +DESCRIPTION + Initiates the reading of the gps config file stored in /etc dir + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_read_config(void) +{ + ENTRY_LOG_CALLFLOW(); + if(configAlreadyRead == false) + { + // Initialize our defaults before reading of configuration file overwrites them. + loc_default_parameters(); + // We only want to parse the conf file once. This is a good place to ensure that. + // In fact one day the conf file should go into context. + UTIL_READ_CONF(GPS_CONF_FILE, gps_conf_table); + UTIL_READ_CONF(SAP_CONF_FILE, sap_conf_table); + configAlreadyRead = true; + } else { + LOC_LOGV("GPS Config file has already been read\n"); + } + + EXIT_LOG(%d, 0); + return 0; +} + +/*=========================================================================== +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); +} diff --git a/gps/libloc_api_50001/loc_eng.h b/gps/libloc_api_50001/loc_eng.h new file mode 100644 index 0000000..da18546 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng.h @@ -0,0 +1,263 @@ +/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * 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_ENG_H +#define LOC_ENG_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +// Uncomment to keep all LOG messages (LOGD, LOGI, LOGV, etc.) +#define MAX_NUM_ATL_CONNECTIONS 2 + +// Define boolean type to be used by libgps on loc api module +typedef unsigned char boolean; + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// The data connection minimal open time +#define DATA_OPEN_MIN_TIME 1 /* sec */ + +// The system sees GPS engine turns off after inactive for this period of time +#define GPS_AUTO_OFF_TIME 2 /* secs */ +#define SUCCESS TRUE +#define FAILURE FALSE +#define INVALID_ATL_CONNECTION_HANDLE -1 + +#define MAX_XTRA_SERVER_URL_LENGTH 256 + +enum loc_nmea_provider_e_type { + NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA + NMEA_PROVIDER_MP // Modem Processor Provider of NMEA +}; + +enum loc_mute_session_e_type { + LOC_MUTE_SESS_NONE = 0, + LOC_MUTE_SESS_WAIT, + LOC_MUTE_SESS_IN_SESSION +}; + +// Module data +typedef struct loc_eng_data_s +{ + LocEngAdapter *adapter; + loc_location_cb_ext location_cb; + gps_status_callback status_cb; + loc_sv_status_cb_ext sv_status_cb; + agps_status_extended agps_status_cb; + gps_nmea_callback nmea_cb; + gps_ni_notify_callback ni_notify_cb; + gps_set_capabilities set_capabilities_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + gps_request_utc_time request_utc_time_cb; + boolean intermediateFix; + AGpsStatusValue agps_status; + loc_eng_xtra_data_s_type xtra_module_data; + loc_eng_ni_data_s_type loc_eng_ni_data; + + // AGPS state machines + AgpsStateMachine* agnss_nif; + AgpsStateMachine* internet_nif; + AgpsStateMachine* wifi_nif; + //State machine for Data Services + AgpsStateMachine* ds_nif; + + // GPS engine status + GpsStatusValue engine_status; + GpsStatusValue fix_session_status; + + // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off + GpsAidingData aiding_data_for_deletion; + + // For muting session broadcast + loc_mute_session_e_type mute_session_state; + + // For nmea generation + boolean generateNmea; + uint32_t sv_used_mask; + float hdop; + float pdop; + float vdop; + + // Address buffers, for addressing setting before init + int supl_host_set; + char supl_host_buf[101]; + int supl_port_buf; + int c2k_host_set; + char c2k_host_buf[101]; + int c2k_port_buf; + int mpc_host_set; + char mpc_host_buf[101]; + int mpc_port_buf; + + 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 */ +/* NOTE: the implementaiton of the parser casts number + fields to 32 bit. To ensure all 'n' fields working, + they must all be 32 bit fields. */ +typedef struct loc_gps_cfg_s +{ + uint32_t INTERMEDIATE_POS; + uint32_t ACCURACY_THRES; + uint32_t SUPL_VER; + uint32_t CAPABILITIES; + uint32_t LPP_PROFILE; + uint32_t XTRA_VERSION_CHECK; + char XTRA_SERVER_1[MAX_XTRA_SERVER_URL_LENGTH]; + char XTRA_SERVER_2[MAX_XTRA_SERVER_URL_LENGTH]; + char XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH]; + uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL; + uint32_t NMEA_PROVIDER; + uint8_t GPS_LOCK; + uint32_t A_GLONASS_POS_PROTOCOL_SELECT; + uint32_t AGPS_CERT_WRITABLE_MASK; +} loc_gps_cfg_s_type; + +/* NOTE: the implementaiton of the parser casts number + fields to 32 bit. To ensure all 'n' fields working, + they must all be 32 bit fields. */ +/* Meanwhile, *_valid fields are 8 bit fields, and 'f' + fields are double. Rigid as they are, it is the + the status quo, until the parsing mechanism is + change, that is. */ +typedef struct +{ + uint8_t GYRO_BIAS_RANDOM_WALK_VALID; + double GYRO_BIAS_RANDOM_WALK; + uint32_t SENSOR_ACCEL_BATCHES_PER_SEC; + uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH; + uint32_t SENSOR_GYRO_BATCHES_PER_SEC; + uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH; + uint32_t SENSOR_ACCEL_BATCHES_PER_SEC_HIGH; + uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH; + uint32_t SENSOR_GYRO_BATCHES_PER_SEC_HIGH; + uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH; + uint32_t SENSOR_CONTROL_MODE; + uint32_t SENSOR_USAGE; + uint32_t SENSOR_ALGORITHM_CONFIG_MASK; + uint8_t ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID; + double ACCEL_RANDOM_WALK_SPECTRAL_DENSITY; + uint8_t ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID; + double ANGLE_RANDOM_WALK_SPECTRAL_DENSITY; + uint8_t RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID; + double RATE_RANDOM_WALK_SPECTRAL_DENSITY; + uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID; + double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY; + uint32_t SENSOR_PROVIDER; +} loc_sap_cfg_s_type; + +extern loc_gps_cfg_s_type gps_conf; +extern loc_sap_cfg_s_type sap_conf; + +//loc_eng functions +int loc_eng_init(loc_eng_data_s_type &loc_eng_data, + LocCallbacks* callbacks, + LOC_API_ADAPTER_EVENT_MASK_T event, + ContextBase* context); +int loc_eng_start(loc_eng_data_s_type &loc_eng_data); +int loc_eng_stop(loc_eng_data_s_type &loc_eng_data); +void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data); +int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, + GpsUtcTime time, int64_t timeReference, + int uncertainty); +int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, + double latitude, double longitude, + float accuracy); +void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, + GpsAidingData f); +int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data, + LocPosMode ¶ms); +const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data, + const char* name); +int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data, + LocServerType type, const char *hostname, int port); +void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data); +int loc_eng_read_config(void); + +//loc_eng_agps functions +void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, + AGpsExtCallbacks* callbacks); +int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType, + const char* apn, AGpsBearerType bearerType); +int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType); +int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType); +void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data, + int avaiable, const char* apn); +int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data, + const DerEncodedCertificate* certificates, + size_t length); + +//loc_eng_xtra functions +int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, + GpsXtraExtCallbacks* callbacks); +int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, + char* data, int length); +int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data); +void loc_eng_xtra_version_check(loc_eng_data_s_type &loc_eng_data, int check); + +//loc_eng_ni functions +extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, + GpsNiExtCallbacks *callbacks); +extern void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, + int notif_id, GpsUserResponseType user_response); +extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, + const GpsNiNotification *notif, + const void* passThrough); +extern void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data); + +void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data, + const char* config_data, int32_t length); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif // LOC_ENG_H diff --git a/gps/libloc_api_50001/loc_eng_agps.cpp b/gps/libloc_api_50001/loc_eng_agps.cpp new file mode 100644 index 0000000..d6cc136 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_agps.cpp @@ -0,0 +1,970 @@ +/* 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_eng" + +#include +#include +#include +#include +#include +#include +#include + +//====================================================================== +// C callbacks +//====================================================================== + +// This is given to linked_list_add as the dealloc callback +// data -- an instance of Subscriber +static void deleteObj(void* data) +{ + delete (Subscriber*)data; +} + +// This is given to linked_list_search() as the comparison callback +// when the state manchine needs to process for particular subscriber +// fromCaller -- caller provides this obj +// fromList -- linked_list_search() function take this one from list +static bool hasSubscriber(void* fromCaller, void* fromList) +{ + Notification* notification = (Notification*)fromCaller; + Subscriber* s1 = (Subscriber*)fromList; + + return s1->forMe(*notification); +} + +// This is gvien to linked_list_search() to notify subscriber objs +// when the state machine needs to inform all subscribers of resource +// status changes, e.g. when resource is GRANTED. +// fromCaller -- caller provides this ptr to a Notification obj. +// fromList -- linked_list_search() function take this one from list +static bool notifySubscriber(void* fromCaller, void* fromList) +{ + Notification* notification = (Notification*)fromCaller; + Subscriber* s1 = (Subscriber*)fromList; + + // we notify every subscriber indiscriminatively + // each subscriber decides if this notification is interesting. + return s1->notifyRsrcStatus(*notification) && + // if we do not want to delete the subscriber from the + // the list, we must set this to false so this function + // returns false + notification->postNotifyDelete; +} + +//====================================================================== +// Notification +//====================================================================== +const int Notification::BROADCAST_ALL = 0x80000000; +const int Notification::BROADCAST_ACTIVE = 0x80000001; +const int Notification::BROADCAST_INACTIVE = 0x80000002; +const unsigned char DSStateMachine::MAX_START_DATA_CALL_RETRIES = 4; +const unsigned int DSStateMachine::DATA_CALL_RETRY_DELAY_MSEC = 500; +//====================================================================== +// Subscriber: BITSubscriber / ATLSubscriber / WIFISubscriber +//====================================================================== +bool Subscriber::forMe(Notification ¬ification) +{ + if (NULL != notification.rcver) { + return equals(notification.rcver); + } else { + return Notification::BROADCAST_ALL == notification.groupID || + (Notification::BROADCAST_ACTIVE == notification.groupID && + !isInactive()) || + (Notification::BROADCAST_INACTIVE == notification.groupID && + isInactive()); + } +} +bool BITSubscriber::equals(const Subscriber *s) const +{ + BITSubscriber* bitS = (BITSubscriber*)s; + + return (ID == bitS->ID && + (INADDR_NONE != (unsigned int)ID || + 0 == strncmp(mIPv6Addr, bitS->mIPv6Addr, sizeof(mIPv6Addr)))); +} + +bool BITSubscriber::notifyRsrcStatus(Notification ¬ification) +{ + bool notify = forMe(notification); + + if (notify) { + switch(notification.rsrcStatus) + { + case RSRC_UNSUBSCRIBE: + case RSRC_RELEASED: + loc_eng_dmn_conn_loc_api_server_data_conn( + LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, + GPSONE_LOC_API_IF_RELEASE_SUCCESS); + break; + case RSRC_DENIED: + loc_eng_dmn_conn_loc_api_server_data_conn( + LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, + GPSONE_LOC_API_IF_FAILURE); + break; + case RSRC_GRANTED: + loc_eng_dmn_conn_loc_api_server_data_conn( + LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, + GPSONE_LOC_API_IF_REQUEST_SUCCESS); + break; + default: + notify = false; + } + } + + return notify; +} + +bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification) +{ + bool notify = forMe(notification); + + if (notify) { + switch(notification.rsrcStatus) + { + case RSRC_UNSUBSCRIBE: + case RSRC_RELEASED: + ((LocEngAdapter*)mLocAdapter)->atlCloseStatus(ID, 1); + break; + case RSRC_DENIED: + { + AGpsExtType type = mBackwardCompatibleMode ? + AGPS_TYPE_INVALID : mStateMachine->getType(); + ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 0, + (char*)mStateMachine->getAPN(), + mStateMachine->getBearer(), + type); + } + break; + case RSRC_GRANTED: + { + AGpsExtType type = mBackwardCompatibleMode ? + AGPS_TYPE_INVALID : mStateMachine->getType(); + ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 1, + (char*)mStateMachine->getAPN(), + mStateMachine->getBearer(), + type); + } + break; + default: + notify = false; + } + } + + return notify; +} + +bool WIFISubscriber::notifyRsrcStatus(Notification ¬ification) +{ + bool notify = forMe(notification); + + if (notify) { + switch(notification.rsrcStatus) + { + case RSRC_UNSUBSCRIBE: + break; + case RSRC_RELEASED: + loc_eng_dmn_conn_loc_api_server_data_conn( + senderId, + GPSONE_LOC_API_IF_RELEASE_SUCCESS); + break; + case RSRC_DENIED: + loc_eng_dmn_conn_loc_api_server_data_conn( + senderId, + GPSONE_LOC_API_IF_FAILURE); + break; + case RSRC_GRANTED: + loc_eng_dmn_conn_loc_api_server_data_conn( + senderId, + GPSONE_LOC_API_IF_REQUEST_SUCCESS); + break; + default: + notify = false; + } + } + + return notify; +} +bool DSSubscriber::notifyRsrcStatus(Notification ¬ification) +{ + bool notify = forMe(notification); + LOC_LOGD("DSSubscriber::notifyRsrcStatus. notify:%d \n",(int)(notify)); + if(notify) { + switch(notification.rsrcStatus) { + case RSRC_UNSUBSCRIBE: + case RSRC_RELEASED: + case RSRC_DENIED: + case RSRC_GRANTED: + ((DSStateMachine *)mStateMachine)->informStatus(notification.rsrcStatus, ID); + break; + default: + notify = false; + } + } + return notify; +} +void DSSubscriber :: setInactive() +{ + mIsInactive = true; + ((DSStateMachine *)mStateMachine)->informStatus(RSRC_UNSUBSCRIBE, ID); +} +//====================================================================== +// AgpsState: AgpsReleasedState / AgpsPendingState / AgpsAcquiredState +//====================================================================== + +// AgpsReleasedState +class AgpsReleasedState : public AgpsState +{ + friend class AgpsStateMachine; + + inline AgpsReleasedState(AgpsStateMachine* stateMachine) : + AgpsState(stateMachine) + { mReleasedState = this; } + + inline ~AgpsReleasedState() {} +public: + virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data); + inline virtual char* whoami() {return (char*)"AgpsReleasedState";} +}; + +AgpsState* AgpsReleasedState::onRsrcEvent(AgpsRsrcStatus event, void* data) +{ + LOC_LOGD("AgpsReleasedState::onRsrcEvent; event:%d\n", (int)event); + if (mStateMachine->hasSubscribers()) { + LOC_LOGE("Error: %s subscriber list not empty!!!", whoami()); + // I don't know how to recover from it. I am adding this rather + // for debugging purpose. + } + + AgpsState* nextState = this; + switch (event) + { + case RSRC_SUBSCRIBE: + { + // no notification until we get RSRC_GRANTED + // but we need to add subscriber to the list + mStateMachine->addSubscriber((Subscriber*)data); + // request from connecivity service for NIF + //The if condition is added so that if the data call setup fails + //for DS State Machine, we want to retry in released state. + //for AGps State Machine, sendRsrcRequest() will always return success + if(!mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN)) { + // move the state to PENDING + nextState = mPendingState; + } + } + break; + + case RSRC_UNSUBSCRIBE: + { + // the list should really be empty, nothing to remove. + // but we might as well just tell the client it is + // unsubscribed. False tolerance, right? + Subscriber* subscriber = (Subscriber*) data; + Notification notification(subscriber, event, false); + subscriber->notifyRsrcStatus(notification); + } + // break; + case RSRC_GRANTED: + case RSRC_RELEASED: + case RSRC_DENIED: + default: + LOC_LOGW("%s: unrecognized event %d", whoami(), event); + // no state change. + break; + } + + LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d", + whoami(), nextState->whoami(), event); + return nextState; +} + +// AgpsPendingState +class AgpsPendingState : public AgpsState +{ + friend class AgpsStateMachine; + + inline AgpsPendingState(AgpsStateMachine* stateMachine) : + AgpsState(stateMachine) + { mPendingState = this; } + + inline ~AgpsPendingState() {} +public: + virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data); + inline virtual char* whoami() {return (char*)"AgpsPendingState";} +}; + +AgpsState* AgpsPendingState::onRsrcEvent(AgpsRsrcStatus event, void* data) +{ + AgpsState* nextState = this;; + LOC_LOGD("AgpsPendingState::onRsrcEvent; event:%d\n", (int)event); + switch (event) + { + case RSRC_SUBSCRIBE: + { + // already requested for NIF resource, + // do nothing until we get RSRC_GRANTED indication + // but we need to add subscriber to the list + mStateMachine->addSubscriber((Subscriber*)data); + // no state change. + } + break; + + case RSRC_UNSUBSCRIBE: + { + Subscriber* subscriber = (Subscriber*) data; + if (subscriber->waitForCloseComplete()) { + subscriber->setInactive(); + } else { + // auto notify this subscriber of the unsubscribe + Notification notification(subscriber, event, true); + mStateMachine->notifySubscribers(notification); + } + + // now check if there is any subscribers left + if (!mStateMachine->hasSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasedState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } else if (!mStateMachine->hasActiveSubscribers()) { + // only inactive subscribers, move to RELEASING state + nextState = mReleasingState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } + } + break; + + case RSRC_GRANTED: + { + nextState = mAcquiredState; + Notification notification(Notification::BROADCAST_ACTIVE, event, false); + // notify all subscribers NIF resource GRANTED + // by setting false, we keep subscribers on the linked list + mStateMachine->notifySubscribers(notification); + } + break; + + case RSRC_RELEASED: + // no state change. + // we are expecting either GRANTED or DENIED. Handling RELEASED + // may like break our state machine in race conditions. + break; + + case RSRC_DENIED: + { + nextState = mReleasedState; + Notification notification(Notification::BROADCAST_ALL, event, true); + // notify all subscribers NIF resource RELEASED or DENIED + // by setting true, we remove subscribers from the linked list + mStateMachine->notifySubscribers(notification); + } + break; + + default: + LOC_LOGE("%s: unrecognized event %d", whoami(), event); + // no state change. + } + + LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d", + whoami(), nextState->whoami(), event); + return nextState; +} + + +class AgpsAcquiredState : public AgpsState +{ + friend class AgpsStateMachine; + + inline AgpsAcquiredState(AgpsStateMachine* stateMachine) : + AgpsState(stateMachine) + { mAcquiredState = this; } + + inline ~AgpsAcquiredState() {} +public: + virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data); + inline virtual char* whoami() { return (char*)"AgpsAcquiredState"; } +}; + + +AgpsState* AgpsAcquiredState::onRsrcEvent(AgpsRsrcStatus event, void* data) +{ + AgpsState* nextState = this; + LOC_LOGD("AgpsAcquiredState::onRsrcEvent; event:%d\n", (int)event); + switch (event) + { + case RSRC_SUBSCRIBE: + { + // we already have the NIF resource, simply notify subscriber + Subscriber* subscriber = (Subscriber*) data; + // we have rsrc in hand, so grant it right away + Notification notification(subscriber, RSRC_GRANTED, false); + subscriber->notifyRsrcStatus(notification); + // add subscriber to the list + mStateMachine->addSubscriber(subscriber); + // no state change. + } + break; + + case RSRC_UNSUBSCRIBE: + { + Subscriber* subscriber = (Subscriber*) data; + if (subscriber->waitForCloseComplete()) { + subscriber->setInactive(); + } else { + // auto notify this subscriber of the unsubscribe + Notification notification(subscriber, event, true); + mStateMachine->notifySubscribers(notification); + } + + // now check if there is any subscribers left + if (!mStateMachine->hasSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasedState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } else if (!mStateMachine->hasActiveSubscribers()) { + // only inactive subscribers, move to RELEASING state + nextState = mReleasingState; + + // tell connecivity service we can release NIF + mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN); + } + } + break; + + case RSRC_GRANTED: + LOC_LOGW("%s: %d, RSRC_GRANTED already received", whoami(), event); + // no state change. + break; + + case RSRC_RELEASED: + { + LOC_LOGW("%s: %d, a force rsrc release", whoami(), event); + nextState = mReleasedState; + Notification notification(Notification::BROADCAST_ALL, event, true); + // by setting true, we remove subscribers from the linked list + mStateMachine->notifySubscribers(notification); + } + break; + + case RSRC_DENIED: + // no state change. + // we are expecting RELEASED. Handling DENIED + // may like break our state machine in race conditions. + break; + + default: + LOC_LOGE("%s: unrecognized event %d", whoami(), event); + // no state change. + } + + LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d", + whoami(), nextState->whoami(), event); + return nextState; +} + +// AgpsPendingState +class AgpsReleasingState : public AgpsState +{ + friend class AgpsStateMachine; + + inline AgpsReleasingState(AgpsStateMachine* stateMachine) : + AgpsState(stateMachine) + { mReleasingState = this; } + + inline ~AgpsReleasingState() {} +public: + virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data); + inline virtual char* whoami() {return (char*)"AgpsReleasingState";} +}; + +AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data) +{ + AgpsState* nextState = this;; + LOC_LOGD("AgpsReleasingState::onRsrcEvent; event:%d\n", (int)event); + + switch (event) + { + case RSRC_SUBSCRIBE: + { + // already requested for NIF resource, + // do nothing until we get RSRC_GRANTED indication + // but we need to add subscriber to the list + mStateMachine->addSubscriber((Subscriber*)data); + // no state change. + } + break; + + case RSRC_UNSUBSCRIBE: + { + Subscriber* subscriber = (Subscriber*) data; + if (subscriber->waitForCloseComplete()) { + subscriber->setInactive(); + } else { + // auto notify this subscriber of the unsubscribe + Notification notification(subscriber, event, true); + mStateMachine->notifySubscribers(notification); + } + + // now check if there is any subscribers left + if (!mStateMachine->hasSubscribers()) { + // no more subscribers, move to RELEASED state + nextState = mReleasedState; + } + } + break; + + case RSRC_DENIED: + // A race condition subscriber unsubscribes before AFW denies resource. + case RSRC_RELEASED: + { + nextState = mAcquiredState; + Notification notification(Notification::BROADCAST_INACTIVE, event, true); + // notify all subscribers that are active NIF resource RELEASE + // by setting false, we keep subscribers on the linked list + mStateMachine->notifySubscribers(notification); + + if (mStateMachine->hasActiveSubscribers()) { + nextState = mPendingState; + // request from connecivity service for NIF + mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN); + } else { + nextState = mReleasedState; + } + } + break; + + case RSRC_GRANTED: + default: + LOC_LOGE("%s: unrecognized event %d", whoami(), event); + // no state change. + } + + LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d", + whoami(), nextState->whoami(), event); + return nextState; +} +//====================================================================== +//Servicer +//====================================================================== +Servicer* Servicer :: getServicer(servicerType type, void *cb_func) +{ + LOC_LOGD(" Enter getServicer type:%d\n", (int)type); + switch(type) { + case servicerTypeNoCbParam: + return (new Servicer(cb_func)); + case servicerTypeExt: + return (new ExtServicer(cb_func)); + case servicerTypeAgps: + return (new AGpsServicer(cb_func)); + default: + return NULL; + } +} + +int Servicer :: requestRsrc(void *cb_data) +{ + callback(); + return 0; +} + +int ExtServicer :: requestRsrc(void *cb_data) +{ + int ret=-1; + LOC_LOGD("Enter ExtServicer :: requestRsrc\n"); + ret = callbackExt(cb_data); + LOC_LOGD("Exit ExtServicer :: requestRsrc\n"); + return(ret); +} + +int AGpsServicer :: requestRsrc(void *cb_data) +{ + callbackAGps((AGpsStatus *)cb_data); + return 0; +} + +//====================================================================== +// AgpsStateMachine +//====================================================================== + +AgpsStateMachine::AgpsStateMachine(servicerType servType, + void *cb_func, + AGpsExtType type, + bool enforceSingleSubscriber) : + mStatePtr(new AgpsReleasedState(this)),mType(type), + mAPN(NULL), + mAPNLen(0), + mBearer(AGPS_APN_BEARER_INVALID), + mEnforceSingleSubscriber(enforceSingleSubscriber), + mServicer(Servicer :: getServicer(servType, (void *)cb_func)) +{ + linked_list_init(&mSubscribers); + + // setting up mReleasedState + mStatePtr->mPendingState = new AgpsPendingState(this); + mStatePtr->mAcquiredState = new AgpsAcquiredState(this); + mStatePtr->mReleasingState = new AgpsReleasingState(this); + + // setting up mAcquiredState + mStatePtr->mAcquiredState->mReleasedState = mStatePtr; + mStatePtr->mAcquiredState->mPendingState = mStatePtr->mPendingState; + mStatePtr->mAcquiredState->mReleasingState = mStatePtr->mReleasingState; + + // setting up mPendingState + mStatePtr->mPendingState->mAcquiredState = mStatePtr->mAcquiredState; + mStatePtr->mPendingState->mReleasedState = mStatePtr; + mStatePtr->mPendingState->mReleasingState = mStatePtr->mReleasingState; + + // setting up mReleasingState + mStatePtr->mReleasingState->mReleasedState = mStatePtr; + mStatePtr->mReleasingState->mPendingState = mStatePtr->mPendingState; + mStatePtr->mReleasingState->mAcquiredState = mStatePtr->mAcquiredState; +} + +AgpsStateMachine::~AgpsStateMachine() +{ + dropAllSubscribers(); + + // free the 3 states. We must read out all 3 pointers first. + // Otherwise we run the risk of getting pointers from already + // freed memory. + AgpsState* acquiredState = mStatePtr->mAcquiredState; + AgpsState* releasedState = mStatePtr->mReleasedState; + AgpsState* pendindState = mStatePtr->mPendingState; + AgpsState* releasingState = mStatePtr->mReleasingState; + + delete acquiredState; + delete releasedState; + delete pendindState; + delete releasingState; + delete mServicer; + linked_list_destroy(&mSubscribers); + + if (NULL != mAPN) { + delete[] mAPN; + mAPN = NULL; + } +} + +void AgpsStateMachine::setAPN(const char* apn, unsigned int len) +{ + if (NULL != mAPN) { + delete mAPN; + } + + if (NULL != apn) { + mAPN = new char[len+1]; + memcpy(mAPN, apn, len); + mAPN[len] = NULL; + + mAPNLen = len; + } else { + mAPN = NULL; + mAPNLen = 0; + } +} + +void AgpsStateMachine::onRsrcEvent(AgpsRsrcStatus event) +{ + switch (event) + { + case RSRC_GRANTED: + case RSRC_RELEASED: + case RSRC_DENIED: + mStatePtr = mStatePtr->onRsrcEvent(event, NULL); + break; + default: + LOC_LOGW("AgpsStateMachine: unrecognized event %d", event); + break; + } +} + +void AgpsStateMachine::notifySubscribers(Notification& notification) const +{ + if (notification.postNotifyDelete) { + // just any non NULL value to get started + Subscriber* s = (Subscriber*)~0; + while (NULL != s) { + s = NULL; + // if the last param sets to true, _search will delete + // the node from the list for us. But the problem is + // once that is done, _search returns, leaving the + // rest of the list unprocessed. So we need a loop. + linked_list_search(mSubscribers, (void**)&s, notifySubscriber, + (void*)¬ification, true); + delete s; + } + } else { + // no loop needed if it the last param sets to false, which + // mean nothing gets deleted from the list. + linked_list_search(mSubscribers, NULL, notifySubscriber, + (void*)¬ification, false); + } +} + +void AgpsStateMachine::addSubscriber(Subscriber* subscriber) const +{ + Subscriber* s = NULL; + Notification notification((const Subscriber*)subscriber); + linked_list_search(mSubscribers, (void**)&s, + hasSubscriber, (void*)¬ification, false); + + if (NULL == s) { + linked_list_add(mSubscribers, subscriber->clone(), deleteObj); + } +} + +int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const +{ + Subscriber* s = NULL; + Notification notification(Notification::BROADCAST_ACTIVE); + linked_list_search(mSubscribers, (void**)&s, hasSubscriber, + (void*)¬ification, false); + + if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) { + AGpsExtStatus nifRequest; + nifRequest.size = sizeof(nifRequest); + nifRequest.type = mType; + nifRequest.status = action; + + if (s == NULL) { + nifRequest.ipv4_addr = INADDR_NONE; + nifRequest.ipv6_addr[0] = 0; + nifRequest.ssid[0] = '\0'; + nifRequest.password[0] = '\0'; + } else { + s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr); + s->setWifiInfo(nifRequest.ssid, nifRequest.password); + } + + CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action)); + mServicer->requestRsrc((void *)&nifRequest); + } + return 0; +} + +void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber) +{ + if (mEnforceSingleSubscriber && hasSubscribers()) { + Notification notification(Notification::BROADCAST_ALL, RSRC_DENIED, true); + notifySubscriber(¬ification, subscriber); + } else { + mStatePtr = mStatePtr->onRsrcEvent(RSRC_SUBSCRIBE, (void*)subscriber); + } +} + +bool AgpsStateMachine::unsubscribeRsrc(Subscriber *subscriber) +{ + Subscriber* s = NULL; + Notification notification((const Subscriber*)subscriber); + linked_list_search(mSubscribers, (void**)&s, + hasSubscriber, (void*)¬ification, false); + + if (NULL != s) { + mStatePtr = mStatePtr->onRsrcEvent(RSRC_UNSUBSCRIBE, (void*)s); + return true; + } + return false; +} + +bool AgpsStateMachine::hasActiveSubscribers() const +{ + Subscriber* s = NULL; + Notification notification(Notification::BROADCAST_ACTIVE); + linked_list_search(mSubscribers, (void**)&s, + hasSubscriber, (void*)¬ification, false); + return NULL != s; +} + +//====================================================================== +// DSStateMachine +//====================================================================== +void delay_callback(void *callbackData, int result) +{ + if(callbackData) { + DSStateMachine *DSSMInstance = (DSStateMachine *)callbackData; + DSSMInstance->retryCallback(); + } + else { + LOC_LOGE(" NULL argument received. Failing.\n"); + goto err; + } +err: + return; +} + +DSStateMachine :: DSStateMachine(servicerType type, void *cb_func, + LocEngAdapter* adapterHandle): + AgpsStateMachine(type, cb_func, AGPS_TYPE_INVALID,false), + mLocAdapter(adapterHandle) +{ + LOC_LOGD("%s:%d]: New DSStateMachine\n", __func__, __LINE__); + mRetries = 0; +} + +void DSStateMachine :: retryCallback(void) +{ + DSSubscriber *subscriber = NULL; + Notification notification(Notification::BROADCAST_ACTIVE); + linked_list_search(mSubscribers, (void**)&subscriber, hasSubscriber, + (void*)¬ification, false); + if(subscriber) + mLocAdapter->requestSuplES(subscriber->ID); + else + LOC_LOGE("DSStateMachine :: retryCallback: No subscriber found." \ + "Cannot retry data call\n"); + return; +} + +int DSStateMachine :: sendRsrcRequest(AGpsStatusValue action) const +{ + DSSubscriber* s = NULL; + dsCbData cbData; + int ret=-1; + int connHandle=-1; + LOC_LOGD("Enter DSStateMachine :: sendRsrcRequest\n"); + Notification notification(Notification::BROADCAST_ACTIVE); + linked_list_search(mSubscribers, (void**)&s, hasSubscriber, + (void*)¬ification, false); + if(s) { + connHandle = s->ID; + LOC_LOGD("DSStateMachine :: sendRsrcRequest - subscriber found\n"); + } + else + LOC_LOGD("DSStateMachine :: sendRsrcRequest - No subscriber found\n"); + + cbData.action = action; + cbData.mAdapter = mLocAdapter; + ret = mServicer->requestRsrc((void *)&cbData); + //Only the request to start data call returns a success/failure + //The request to stop data call will always succeed + //Hence, the below block will only be executed when the + //request to start the data call fails + switch(ret) { + case LOC_API_ADAPTER_ERR_ENGINE_BUSY: + LOC_LOGD("DSStateMachine :: sendRsrcRequest - Failure returned: %d\n",ret); + ((DSStateMachine *)this)->incRetries(); + if(mRetries > MAX_START_DATA_CALL_RETRIES) { + LOC_LOGE(" Failed to start Data call. Fallback to normal ATL SUPL\n"); + informStatus(RSRC_DENIED, connHandle); + } + else { + if(loc_timer_start(DATA_CALL_RETRY_DELAY_MSEC, delay_callback, (void *)this)) { + LOC_LOGE("Error: Could not start delay thread\n"); + ret = -1; + goto err; + } + } + break; + case LOC_API_ADAPTER_ERR_UNSUPPORTED: + LOC_LOGE("No profile found for emergency call. Fallback to normal SUPL ATL\n"); + informStatus(RSRC_DENIED, connHandle); + break; + case LOC_API_ADAPTER_ERR_SUCCESS: + LOC_LOGD("%s:%d]: Request to start data call sent\n", __func__, __LINE__); + break; + case -1: + //One of the ways this case can be encountered is if the callback function + //receives a null argument, it just exits with -1 error + LOC_LOGE("Error: Something went wrong somewhere. Falling back to normal SUPL ATL\n"); + informStatus(RSRC_DENIED, connHandle); + break; + default: + LOC_LOGE("%s:%d]: Unrecognized return value\n", __func__, __LINE__); + } +err: + LOC_LOGD("EXIT DSStateMachine :: sendRsrcRequest; ret = %d\n", ret); + return ret; +} + +void DSStateMachine :: onRsrcEvent(AgpsRsrcStatus event) +{ + void* currState = (void *)mStatePtr; + LOC_LOGD("Enter DSStateMachine :: onRsrcEvent. event = %d\n", (int)event); + switch (event) + { + case RSRC_GRANTED: + LOC_LOGD("DSStateMachine :: onRsrcEvent RSRC_GRANTED\n"); + mStatePtr = mStatePtr->onRsrcEvent(event, NULL); + break; + case RSRC_RELEASED: + LOC_LOGD("DSStateMachine :: onRsrcEvent RSRC_RELEASED\n"); + mStatePtr = mStatePtr->onRsrcEvent(event, NULL); + //To handle the case where we get a RSRC_RELEASED in + //pending state, we translate that to a RSRC_DENIED state + //since the callback from DSI is either RSRC_GRANTED or RSRC_RELEASED + //for when the call is connected or disconnected respectively. + if((void *)mStatePtr != currState) + break; + else { + event = RSRC_DENIED; + LOC_LOGE(" Switching event to RSRC_DENIED\n"); + } + case RSRC_DENIED: + mStatePtr = mStatePtr->onRsrcEvent(event, NULL); + break; + default: + LOC_LOGW("AgpsStateMachine: unrecognized event %d", event); + break; + } + LOC_LOGD("Exit DSStateMachine :: onRsrcEvent. event = %d\n", (int)event); +} + +void DSStateMachine :: informStatus(AgpsRsrcStatus status, int ID) const +{ + LOC_LOGD("DSStateMachine :: informStatus. Status=%d\n",(int)status); + switch(status) { + case RSRC_UNSUBSCRIBE: + mLocAdapter->atlCloseStatus(ID, 1); + break; + case RSRC_RELEASED: + mLocAdapter->closeDataCall(); + break; + case RSRC_DENIED: + ((DSStateMachine *)this)->mRetries = 0; + mLocAdapter->requestATL(ID, AGPS_TYPE_SUPL); + break; + case RSRC_GRANTED: + mLocAdapter->atlOpenStatus(ID, 1, + NULL, + AGPS_APN_BEARER_INVALID, + AGPS_TYPE_INVALID); + break; + default: + LOC_LOGW("DSStateMachine :: informStatus - unknown status"); + } + return; +} diff --git a/gps/libloc_api_50001/loc_eng_agps.h b/gps/libloc_api_50001/loc_eng_agps.h new file mode 100644 index 0000000..055d955 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_agps.h @@ -0,0 +1,419 @@ +/* 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. + * + */ + +#ifndef __LOC_ENG_AGPS_H__ +#define __LOC_ENG_AGPS_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// forward declaration +class AgpsStateMachine; +class Subscriber; + +// NIF resource events +typedef enum { + RSRC_SUBSCRIBE, + RSRC_UNSUBSCRIBE, + RSRC_GRANTED, + RSRC_RELEASED, + RSRC_DENIED, + RSRC_STATUS_MAX +} AgpsRsrcStatus; + +typedef enum { + servicerTypeNoCbParam, + servicerTypeAgps, + servicerTypeExt +}servicerType; + +//DS Callback struct +typedef struct { + LocEngAdapter *mAdapter; + AGpsStatusValue action; +}dsCbData; + +// information bundle for subscribers +struct Notification { + // goes to every subscriber + static const int BROADCAST_ALL; + // goes to every ACTIVE subscriber + static const int BROADCAST_ACTIVE; + // goes to every INACTIVE subscriber + static const int BROADCAST_INACTIVE; + + // go to a specific subscriber + const Subscriber* rcver; + // broadcast + const int groupID; + // the new resource status event + const AgpsRsrcStatus rsrcStatus; + // should the subscriber be deleted after the notification + const bool postNotifyDelete; + + // convenient constructor + inline Notification(const int broadcast, + const AgpsRsrcStatus status, + const bool deleteAfterwards) : + rcver(NULL), groupID(broadcast), rsrcStatus(status), + postNotifyDelete(deleteAfterwards) {} + + // convenient constructor + inline Notification(const Subscriber* subscriber, + const AgpsRsrcStatus status, + const bool deleteAfterwards) : + rcver(subscriber), groupID(-1), rsrcStatus(status), + postNotifyDelete(deleteAfterwards) {} + + // convenient constructor + inline Notification(const int broadcast) : + rcver(NULL), groupID(broadcast), rsrcStatus(RSRC_STATUS_MAX), + postNotifyDelete(false) {} + + // convenient constructor + inline Notification(const Subscriber* subscriber) : + rcver(subscriber), groupID(-1), rsrcStatus(RSRC_STATUS_MAX), + postNotifyDelete(false) {} +}; + +class AgpsState { + // allows AgpsStateMachine to access private data + // no class members are public. We don't want + // anyone but state machine to use state. + friend class AgpsStateMachine; + friend class DSStateMachine; + // state transitions are done here. + // Each state implements its own transitions (of course). + inline virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data) = 0; + +protected: + // handle back to state machine + const AgpsStateMachine* mStateMachine; + // each state has pointers to all 3 states + // one of which is to itself. + AgpsState* mReleasedState; + AgpsState* mAcquiredState; + AgpsState* mPendingState; + AgpsState* mReleasingState; + + inline AgpsState(const AgpsStateMachine *stateMachine) : + mStateMachine(stateMachine), + mReleasedState(NULL), + mAcquiredState(NULL), + mPendingState(NULL), + mReleasingState(NULL) {} + virtual ~AgpsState() {} + +public: + // for logging purpose + inline virtual char* whoami() = 0; +}; + +class Servicer { + void (*callback)(void); +public: + static Servicer* getServicer(servicerType type, void *cb_func); + virtual int requestRsrc(void *cb_data); + Servicer() {} + Servicer(void *cb_func) + { callback = (void(*)(void))(cb_func); } + virtual ~Servicer(){} + inline virtual char *whoami() {return (char*)"Servicer";} +}; + +class ExtServicer : public Servicer { + int (*callbackExt)(void *cb_data); +public: + int requestRsrc(void *cb_data); + ExtServicer() {} + ExtServicer(void *cb_func) + { callbackExt = (int(*)(void *))(cb_func); } + virtual ~ExtServicer(){} + inline virtual char *whoami() {return (char*)"ExtServicer";} +}; + +class AGpsServicer : public Servicer { + void (*callbackAGps)(AGpsStatus* status); +public: + int requestRsrc(void *cb_data); + AGpsServicer() {} + AGpsServicer(void *cb_func) + { callbackAGps = (void(*)(AGpsStatus *))(cb_func); } + virtual ~AGpsServicer(){} + inline virtual char *whoami() {return (char*)"AGpsServicer";} +}; + +class AgpsStateMachine { +protected: + // a linked list of subscribers. + void* mSubscribers; + //handle to whoever provides the service + Servicer *mServicer; + // allows AgpsState to access private data + // each state is really internal data to the + // state machine, so it should be able to + // access anything within the state machine. + friend class AgpsState; + // pointer to the current state. + AgpsState* mStatePtr; +private: + // NIF type: AGNSS or INTERNET. + const AGpsExtType mType; + // apn to the NIF. Each state machine tracks + // resource state of a particular NIF. For each + // NIF, there is also an active APN. + char* mAPN; + // for convenience, we don't do strlen each time. + unsigned int mAPNLen; + // bear + AGpsBearerType mBearer; + // ipv4 address for routing + bool mEnforceSingleSubscriber; + +public: + AgpsStateMachine(servicerType servType, void *cb_func, + AGpsExtType type, bool enforceSingleSubscriber); + virtual ~AgpsStateMachine(); + + // self explanatory methods below + void setAPN(const char* apn, unsigned int len); + inline const char* getAPN() const { return (const char*)mAPN; } + inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } + inline AGpsBearerType getBearer() const { return mBearer; } + inline AGpsExtType getType() const { return (AGpsExtType)mType; } + + // someone, a ATL client or BIT, is asking for NIF + void subscribeRsrc(Subscriber *subscriber); + + // someone, a ATL client or BIT, is done with NIF + bool unsubscribeRsrc(Subscriber *subscriber); + + // add a subscriber in the linked list, if not already there. + void addSubscriber(Subscriber* subscriber) const; + + virtual void onRsrcEvent(AgpsRsrcStatus event); + + // put the data together and send the FW + virtual int sendRsrcRequest(AGpsStatusValue action) const; + + //if list is empty, linked_list_empty returns 1 + //else if list is not empty, returns 0 + //so hasSubscribers() returns 1 if list is not empty + //and returns 0 if list is empty + inline bool hasSubscribers() const + { return !linked_list_empty(mSubscribers); } + + bool hasActiveSubscribers() const; + + inline void dropAllSubscribers() const + { linked_list_flush(mSubscribers); } + + // private. Only a state gets to call this. + void notifySubscribers(Notification& notification) const; + +}; + +class DSStateMachine : public AgpsStateMachine { + static const unsigned char MAX_START_DATA_CALL_RETRIES; + static const unsigned int DATA_CALL_RETRY_DELAY_MSEC; + LocEngAdapter* mLocAdapter; + unsigned char mRetries; +public: + DSStateMachine(servicerType type, + void *cb_func, + LocEngAdapter* adapterHandle); + int sendRsrcRequest(AGpsStatusValue action) const; + void onRsrcEvent(AgpsRsrcStatus event); + void retryCallback(); + void informStatus(AgpsRsrcStatus status, int ID) const; + inline void incRetries() {mRetries++;} + inline virtual char *whoami() {return (char*)"DSStateMachine";} +}; + +// each subscriber is a AGPS client. In the case of ATL, there could be +// multiple clients from modem. In the case of BIT, there is only one +// cilent from BIT daemon. +struct Subscriber { + const uint32_t ID; + const AgpsStateMachine* mStateMachine; + inline Subscriber(const int id, + const AgpsStateMachine* stateMachine) : + ID(id), mStateMachine(stateMachine) {} + inline virtual ~Subscriber() {} + + virtual void setIPAddresses(uint32_t &v4, char* v6) = 0; + inline virtual void setWifiInfo(char* ssid, char* password) + { ssid[0] = 0; password[0] = 0; } + + inline virtual bool equals(const Subscriber *s) const + { return ID == s->ID; } + + // notifies a subscriber a new NIF resource status, usually + // either GRANTE, DENIED, or RELEASED + virtual bool notifyRsrcStatus(Notification ¬ification) = 0; + + virtual bool waitForCloseComplete() { return false; } + virtual void setInactive() {} + virtual bool isInactive() { return false; } + + virtual Subscriber* clone() = 0; + // checks if this notification is for me, i.e. + // either has my id, or has a broadcast id. + bool forMe(Notification ¬ification); +}; + +// BITSubscriber, created with requests from BIT daemon +struct BITSubscriber : public Subscriber { + char mIPv6Addr[16]; + + inline BITSubscriber(const AgpsStateMachine* stateMachine, + unsigned int ipv4, char* ipv6) : + Subscriber(ipv4, stateMachine) + { + if (NULL == ipv6) { + mIPv6Addr[0] = 0; + } else { + memcpy(mIPv6Addr, ipv6, sizeof(mIPv6Addr)); + } + } + + virtual bool notifyRsrcStatus(Notification ¬ification); + + inline virtual void setIPAddresses(uint32_t &v4, char* v6) + { v4 = ID; memcpy(v6, mIPv6Addr, sizeof(mIPv6Addr)); } + + virtual Subscriber* clone() + { + return new BITSubscriber(mStateMachine, ID, mIPv6Addr); + } + + virtual bool equals(const Subscriber *s) const; + inline virtual ~BITSubscriber(){} +}; + +// ATLSubscriber, created with requests from ATL +struct ATLSubscriber : public Subscriber { + const LocEngAdapter* mLocAdapter; + const bool mBackwardCompatibleMode; + inline ATLSubscriber(const int id, + const AgpsStateMachine* stateMachine, + const LocEngAdapter* adapter, + const bool compatibleMode) : + Subscriber(id, stateMachine), mLocAdapter(adapter), + mBackwardCompatibleMode(compatibleMode){} + virtual bool notifyRsrcStatus(Notification ¬ification); + + inline virtual void setIPAddresses(uint32_t &v4, char* v6) + { v4 = INADDR_NONE; v6[0] = 0; } + + inline virtual Subscriber* clone() + { + return new ATLSubscriber(ID, mStateMachine, mLocAdapter, + mBackwardCompatibleMode); + } + inline virtual ~ATLSubscriber(){} +}; + +// WIFISubscriber, created with requests from MSAPM or QuIPC +struct WIFISubscriber : public Subscriber { + char * mSSID; + char * mPassword; + loc_if_req_sender_id_e_type senderId; + bool mIsInactive; + inline WIFISubscriber(const AgpsStateMachine* stateMachine, + char * ssid, char * password, loc_if_req_sender_id_e_type sender_id) : + Subscriber(sender_id, stateMachine), + mSSID(NULL == ssid ? NULL : new char[SSID_BUF_SIZE]), + mPassword(NULL == password ? NULL : new char[SSID_BUF_SIZE]), + senderId(sender_id) + { + if (NULL != mSSID) + strlcpy(mSSID, ssid, SSID_BUF_SIZE); + if (NULL != mPassword) + strlcpy(mPassword, password, SSID_BUF_SIZE); + mIsInactive = false; + } + + virtual bool notifyRsrcStatus(Notification ¬ification); + + inline virtual void setIPAddresses(uint32_t &v4, char* v6) {} + + inline virtual void setWifiInfo(char* ssid, char* password) + { + if (NULL != mSSID) + strlcpy(ssid, mSSID, SSID_BUF_SIZE); + else + ssid[0] = '\0'; + if (NULL != mPassword) + strlcpy(password, mPassword, SSID_BUF_SIZE); + else + password[0] = '\0'; + } + + inline virtual bool waitForCloseComplete() { return true; } + + inline virtual void setInactive() { mIsInactive = true; } + inline virtual bool isInactive() { return mIsInactive; } + + virtual Subscriber* clone() + { + return new WIFISubscriber(mStateMachine, mSSID, mPassword, senderId); + } + inline virtual ~WIFISubscriber(){} +}; + +struct DSSubscriber : public Subscriber { + bool mIsInactive; + inline DSSubscriber(const AgpsStateMachine *stateMachine, + const int id) : + Subscriber(id, stateMachine) + { + mIsInactive = false; + } + inline virtual void setIPAddresses(uint32_t &v4, char* v6) {} + virtual Subscriber* clone() + {return new DSSubscriber(mStateMachine, ID);} + virtual bool notifyRsrcStatus(Notification ¬ification); + inline virtual bool waitForCloseComplete() { return true; } + virtual void setInactive(); + inline virtual bool isInactive() + { return mIsInactive; } + inline virtual ~DSSubscriber(){} + inline virtual char *whoami() {return (char*)"DSSubscriber";} +}; + +#endif //__LOC_ENG_AGPS_H__ diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn.cpp b/gps/libloc_api_50001/loc_eng_dmn_conn.cpp new file mode 100644 index 0000000..c257dff --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn.cpp @@ -0,0 +1,270 @@ +/* Copyright (c) 2011-2012, 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#include "log_util.h" +#include "platform_lib_includes.h" +#include "loc_eng_dmn_conn_glue_msg.h" +#include "loc_eng_dmn_conn_handler.h" +#include "loc_eng_dmn_conn.h" +#include "loc_eng_msg.h" + +static int loc_api_server_msgqid; +static int loc_api_resp_msgqid; +static int quipc_msgqid; +static int msapm_msgqid; +static int msapu_msgqid; + +static const char * global_loc_api_q_path = GPSONE_LOC_API_Q_PATH; +static const char * global_loc_api_resp_q_path = GPSONE_LOC_API_RESP_Q_PATH; +static const char * global_quipc_ctrl_q_path = QUIPC_CTRL_Q_PATH; +static const char * global_msapm_ctrl_q_path = MSAPM_CTRL_Q_PATH; +static const char * global_msapu_ctrl_q_path = MSAPU_CTRL_Q_PATH; + +static int loc_api_server_proc_init(void *context) +{ + loc_api_server_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_q_path, O_RDWR); + //change mode/group for the global_loc_api_q_path pipe + int result = chmod (global_loc_api_q_path, 0660); + if (result != 0) + { + LOC_LOGE("failed to change mode for %s, error = %s\n", global_loc_api_q_path, strerror(errno)); + } + + struct group * gps_group = getgrnam("gps"); + if (gps_group != NULL) + { + result = chown (global_loc_api_q_path, -1, gps_group->gr_gid); + if (result != 0) + { + LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n", + global_loc_api_q_path, gps_group->gr_gid, result, strerror(errno)); + } + } + else + { + LOC_LOGE("getgrnam for gps failed, error code = %d\n", errno); + } + + loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_q_path, O_RDWR); + + //change mode/group for the global_loc_api_resp_q_path pipe + result = chmod (global_loc_api_resp_q_path, 0660); + if (result != 0) + { + LOC_LOGE("failed to change mode for %s, error = %s\n", global_loc_api_resp_q_path, strerror(errno)); + } + + if (gps_group != NULL) + { + result = chown (global_loc_api_resp_q_path, -1, gps_group->gr_gid); + if (result != 0) + { + LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n", + global_loc_api_resp_q_path, + gps_group->gr_gid, result, strerror(errno)); + } + } + + quipc_msgqid = loc_eng_dmn_conn_glue_msgget(global_quipc_ctrl_q_path, O_RDWR); + msapm_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapm_ctrl_q_path , O_RDWR); + msapu_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapu_ctrl_q_path , O_RDWR); + + LOC_LOGD("%s:%d] loc_api_server_msgqid = %d\n", __func__, __LINE__, loc_api_server_msgqid); + return 0; +} + +static int loc_api_server_proc_pre(void *context) +{ + return 0; +} + +static int loc_api_server_proc(void *context) +{ + int length, sz; + int result = 0; + static int cnt = 0; + struct ctrl_msgbuf * p_cmsgbuf; + struct ctrl_msgbuf cmsg_resp; + + sz = sizeof(struct ctrl_msgbuf) + 256; + p_cmsgbuf = (struct ctrl_msgbuf *) malloc(sz); + + if (!p_cmsgbuf) { + LOC_LOGE("%s:%d] Out of memory\n", __func__, __LINE__); + return -1; + } + + cnt ++; + LOC_LOGD("%s:%d] %d listening on %s...\n", __func__, __LINE__, cnt, (char *) context); + length = loc_eng_dmn_conn_glue_msgrcv(loc_api_server_msgqid, p_cmsgbuf, sz); + if (length <= 0) { + free(p_cmsgbuf); + LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__); + usleep(1000); + return -1; + } + + LOC_LOGD("%s:%d] received ctrl_type = %d\n", __func__, __LINE__, p_cmsgbuf->ctrl_type); + switch(p_cmsgbuf->ctrl_type) { + case GPSONE_LOC_API_IF_REQUEST: + result = loc_eng_dmn_conn_loc_api_server_if_request_handler(p_cmsgbuf, length); + break; + + case GPSONE_LOC_API_IF_RELEASE: + result = loc_eng_dmn_conn_loc_api_server_if_release_handler(p_cmsgbuf, length); + break; + + case GPSONE_UNBLOCK: + LOC_LOGD("%s:%d] GPSONE_UNBLOCK\n", __func__, __LINE__); + break; + + default: + LOC_LOGE("%s:%d] unsupported ctrl_type = %d\n", + __func__, __LINE__, p_cmsgbuf->ctrl_type); + break; + } + + free(p_cmsgbuf); + return 0; +} + +static int loc_api_server_proc_post(void *context) +{ + LOC_LOGD("%s:%d]\n", __func__, __LINE__); + loc_eng_dmn_conn_glue_msgremove( global_loc_api_q_path, loc_api_server_msgqid); + loc_eng_dmn_conn_glue_msgremove( global_loc_api_resp_q_path, loc_api_resp_msgqid); + loc_eng_dmn_conn_glue_msgremove( global_quipc_ctrl_q_path, quipc_msgqid); + loc_eng_dmn_conn_glue_msgremove( global_msapm_ctrl_q_path, msapm_msgqid); + loc_eng_dmn_conn_glue_msgremove( global_msapu_ctrl_q_path, msapu_msgqid); + return 0; +} + +static int loc_eng_dmn_conn_unblock_proc(void) +{ + struct ctrl_msgbuf cmsgbuf; + cmsgbuf.ctrl_type = GPSONE_UNBLOCK; + LOC_LOGD("%s:%d]\n", __func__, __LINE__); + loc_eng_dmn_conn_glue_msgsnd(loc_api_server_msgqid, & cmsgbuf, sizeof(cmsgbuf)); + return 0; +} + +static struct loc_eng_dmn_conn_thelper thelper; + +int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread_cb, + const char * loc_api_q_path, const char * resp_q_path, void *agps_handle) +{ + int result; + + loc_api_handle = agps_handle; + + if (loc_api_q_path) global_loc_api_q_path = loc_api_q_path; + if (resp_q_path) global_loc_api_resp_q_path = resp_q_path; + + result = loc_eng_dmn_conn_launch_thelper( &thelper, + loc_api_server_proc_init, + loc_api_server_proc_pre, + loc_api_server_proc, + loc_api_server_proc_post, + create_thread_cb, + (char *) global_loc_api_q_path); + if (result != 0) { + LOC_LOGE("%s:%d]\n", __func__, __LINE__); + return -1; + } + return 0; +} + +int loc_eng_dmn_conn_loc_api_server_unblock(void) +{ + loc_eng_dmn_conn_unblock_thelper(&thelper); + loc_eng_dmn_conn_unblock_proc(); + return 0; +} + +int loc_eng_dmn_conn_loc_api_server_join(void) +{ + loc_eng_dmn_conn_join_thelper(&thelper); + return 0; +} + +int loc_eng_dmn_conn_loc_api_server_data_conn(int sender_id, int status) { + struct ctrl_msgbuf cmsgbuf; + LOC_LOGD("%s:%d] quipc_msgqid = %d\n", __func__, __LINE__, quipc_msgqid); + cmsgbuf.ctrl_type = GPSONE_LOC_API_RESPONSE; + cmsgbuf.cmsg.cmsg_response.result = status; + switch (sender_id) { + case LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC: { + LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC", __func__, __LINE__); + if (loc_eng_dmn_conn_glue_msgsnd(quipc_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) { + LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__); + return -1; + } + break; + } + case LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM: { + LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM", __func__, __LINE__); + if (loc_eng_dmn_conn_glue_msgsnd(msapm_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) { + LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__); + return -1; + } + break; + } + case LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU: { + LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU", __func__, __LINE__); + if (loc_eng_dmn_conn_glue_msgsnd(msapu_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) { + LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__); + return -1; + } + break; + } + case LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON: { + LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON", __func__, __LINE__); + if (loc_eng_dmn_conn_glue_msgsnd(loc_api_resp_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) { + LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__); + return -1; + } + break; + } + default: { + LOC_LOGD("%s:%d] invalid sender ID!", __func__, __LINE__); + } + } + return 0; +} + diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn.h b/gps/libloc_api_50001/loc_eng_dmn_conn.h new file mode 100644 index 0000000..1d8c142 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn.h @@ -0,0 +1,59 @@ +/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * 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_ENG_DATA_SERVER_H +#define LOC_ENG_DATA_SERVER_H + +#include "loc_eng_dmn_conn_thread_helper.h" + +#ifdef _ANDROID_ + +#define GPSONE_LOC_API_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_q" +#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_resp_q" +#define QUIPC_CTRL_Q_PATH "/data/misc/location/gpsone_d/quipc_ctrl_q" +#define MSAPM_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapm_ctrl_q" +#define MSAPU_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapu_ctrl_q" + +#else + +#define GPSONE_LOC_API_Q_PATH "/tmp/gpsone_loc_api_q" +#define GPSONE_LOC_API_RESP_Q_PATH "/tmp/gpsone_loc_api_resp_q" +#define QUIPC_CTRL_Q_PATH "/tmp/quipc_ctrl_q" +#define MSAPM_CTRL_Q_PATH "/tmp/msapm_ctrl_q" +#define MSAPU_CTRL_Q_PATH "/tmp/msapu_ctrl_q" + +#endif + +int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread_cb, + const char * loc_api_q_path, const char * ctrl_q_path, void *agps_handle); +int loc_eng_dmn_conn_loc_api_server_unblock(void); +int loc_eng_dmn_conn_loc_api_server_join(void); +int loc_eng_dmn_conn_loc_api_server_data_conn(int, int); + +#endif /* LOC_ENG_DATA_SERVER_H */ + diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/gps/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c new file mode 100644 index 0000000..a1076ff --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c @@ -0,0 +1,223 @@ +/* Copyright (c) 2011, 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 +#include + +#include + +#include "log_util.h" +#include "platform_lib_includes.h" +#include "loc_eng_dmn_conn_glue_msg.h" +#include "loc_eng_dmn_conn_handler.h" + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_msgget + +DESCRIPTION + This function get a message queue + + q_path - name path of the message queue + mode - + +DEPENDENCIES + None + +RETURN VALUE + message queue id + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_msgget(const char * q_path, int mode) +{ + int msgqid; + msgqid = loc_eng_dmn_conn_glue_pipeget(q_path, mode); + return msgqid; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_msgremove + +DESCRIPTION + remove a message queue + + q_path - name path of the message queue + msgqid - message queue id + +DEPENDENCIES + None + +RETURN VALUE + 0: success or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_msgremove(const char * q_path, int msgqid) +{ + int result; + result = loc_eng_dmn_conn_glue_piperemove(q_path, msgqid); + return result; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_msgsnd + +DESCRIPTION + Send a message + + msgqid - message queue id + msgp - pointer to the message to be sent + msgsz - size of the message + +DEPENDENCIES + None + +RETURN VALUE + number of bytes sent out or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_msgsnd(int msgqid, const void * msgp, size_t msgsz) +{ + int result; + struct ctrl_msgbuf *pmsg = (struct ctrl_msgbuf *) msgp; + pmsg->msgsz = msgsz; + + result = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, msgsz); + if (result != (int) msgsz) { + LOC_LOGE("%s:%d] pipe broken %d, msgsz = %d\n", __func__, __LINE__, result, (int) msgsz); + return -1; + } + + return result; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_msgrcv + +DESCRIPTION + receive a message + + msgqid - message queue id + msgp - pointer to the buffer to hold the message + msgsz - size of the buffer + +DEPENDENCIES + None + +RETURN VALUE + number of bytes received or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_msgrcv(int msgqid, void *msgp, size_t msgbufsz) +{ + int result; + struct ctrl_msgbuf *pmsg = (struct ctrl_msgbuf *) msgp; + + result = loc_eng_dmn_conn_glue_piperead(msgqid, &(pmsg->msgsz), sizeof(pmsg->msgsz)); + if (result != sizeof(pmsg->msgsz)) { + LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result); + return -1; + } + + if (msgbufsz < pmsg->msgsz) { + LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgbufsz, (int) pmsg->msgsz); + return -1; + } + + result = loc_eng_dmn_conn_glue_piperead(msgqid, (uint8_t *) msgp + sizeof(pmsg->msgsz), pmsg->msgsz - sizeof(pmsg->msgsz)); + if (result != (int) (pmsg->msgsz - sizeof(pmsg->msgsz))) { + LOC_LOGE("%s:%d] pipe broken %d, msgsz = %d\n", __func__, __LINE__, result, (int) pmsg->msgsz); + return -1; + } + + return pmsg->msgsz; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_msgunblock + +DESCRIPTION + unblock a message queue + + msgqid - message queue id + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_msgunblock(int msgqid) +{ + return loc_eng_dmn_conn_glue_pipeunblock(msgqid); +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_msgflush + +DESCRIPTION + flush out the message in a queue + + msgqid - message queue id + +DEPENDENCIES + None + +RETURN VALUE + number of bytes that are flushed out. + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_msgflush(int msgqid) +{ + int length; + char buf[128]; + + do { + length = loc_eng_dmn_conn_glue_piperead(msgqid, buf, 128); + LOC_LOGD("%s:%d] %s\n", __func__, __LINE__, buf); + } while(length); + return length; +} + diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/gps/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h new file mode 100644 index 0000000..d685c87 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2011, 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_ENG_DMN_CONN_GLUE_MSG_H +#define LOC_ENG_DMN_CONN_GLUE_MSG_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +#include +#include "loc_eng_dmn_conn_glue_pipe.h" + +int loc_eng_dmn_conn_glue_msgget(const char * q_path, int mode); +int loc_eng_dmn_conn_glue_msgremove(const char * q_path, int msgqid); +int loc_eng_dmn_conn_glue_msgsnd(int msgqid, const void * msgp, size_t msgsz); +int loc_eng_dmn_conn_glue_msgrcv(int msgqid, void *msgp, size_t msgsz); +int loc_eng_dmn_conn_glue_msgflush(int msgqid); +int loc_eng_dmn_conn_glue_msgunblock(int msgqid); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LOC_ENG_DMN_CONN_GLUE_MSG_H */ diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/gps/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c new file mode 100644 index 0000000..dffcad0 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c @@ -0,0 +1,214 @@ +/* Copyright (c) 2011-2012, 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 +#include +#include + +// #include +#include +// #include +#include +#include + +#include "loc_eng_dmn_conn_glue_pipe.h" +#include "log_util.h" +#include "platform_lib_includes.h" +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_pipeget + +DESCRIPTION + create a named pipe. + + pipe_name - pipe name path + mode - mode + +DEPENDENCIES + None + +RETURN VALUE + 0: success or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode) +{ + int fd; + int result; + + LOC_LOGD("%s, mode = %d\n", pipe_name, mode); + result = mkfifo(pipe_name, 0660); + + if ((result == -1) && (errno != EEXIST)) { + LOC_LOGE("failed: %s\n", strerror(errno)); + return result; + } + + // The mode in mkfifo is not honoured and does not provide the + // group permissions. Doing chmod to add group permissions. + result = chmod (pipe_name, 0660); + if (result != 0){ + LOC_LOGE ("%s failed to change mode for %s, error = %s\n", __func__, + pipe_name, strerror(errno)); + } + + fd = open(pipe_name, mode); + if (fd <= 0) + { + LOC_LOGE("failed: %s\n", strerror(errno)); + } + LOC_LOGD("fd = %d, %s\n", fd, pipe_name); + return fd; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_piperemove + +DESCRIPTION + remove a pipe + + pipe_name - pipe name path + fd - fd for the pipe + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd) +{ + close(fd); + if (pipe_name) unlink(pipe_name); + LOC_LOGD("fd = %d, %s\n", fd, pipe_name); + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_pipewrite + +DESCRIPTION + write to a pipe + + fd - fd of a pipe + buf - buffer for the data to write + sz - size of the data in buffer + +DEPENDENCIES + None + +RETURN VALUE + number of bytes written or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_pipewrite(int fd, const void * buf, size_t sz) +{ + int result; + + result = write(fd, buf, sz); + + /* @todo check for non EINTR & EAGAIN, shall not do select again, select_tut Law 7) */ + + /* LOC_LOGD("fd = %d, buf = 0x%lx, size = %d, result = %d\n", fd, (long) buf, (int) sz, (int) result); */ + return result; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_piperead + +DESCRIPTION + read from a pipe + + fd - fd for the pipe + buf - buffer to hold the data read from pipe + sz - size of the buffer + +DEPENDENCIES + None + +RETURN VALUE + number of bytes read from pipe or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_piperead(int fd, void * buf, size_t sz) +{ + int len; + + len = read(fd, buf, sz); + + /* @todo check for non EINTR & EAGAIN, shall not do select again, select_tut Law 7) */ + + /* LOC_LOGD("fd = %d, buf = 0x%lx, size = %d, len = %d\n", fd, (long) buf, (int) sz, len); */ + return len; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_glue_pipeunblock + +DESCRIPTION + unblock a pipe + + fd - fd for the pipe + +DEPENDENCIES + None + +RETURN VALUE + 0 for success or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_glue_pipeunblock(int fd) +{ + int result; + struct flock flock_v; + LOC_LOGD("\n"); +// result = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NDELAY); + flock_v.l_type = F_UNLCK; + flock_v.l_len = 32; + result = fcntl(fd, F_SETLK, &flock_v); + if (result < 0) { + LOC_LOGE("fcntl failure, %s\n", strerror(errno)); + } + + return result; +} diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/gps/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h new file mode 100644 index 0000000..b2fa3a0 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2011, 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_ENG_DMN_CONN_GLUE_PIPE_H +#define LOC_ENG_DMN_CONN_GLUE_PIPE_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode); +int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd); +int loc_eng_dmn_conn_glue_pipewrite(int fd, const void * buf, size_t sz); +int loc_eng_dmn_conn_glue_piperead(int fd, void * buf, size_t sz); + +int loc_eng_dmn_conn_glue_pipeflush(int fd); +int loc_eng_dmn_conn_glue_pipeunblock(int fd); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LOC_ENG_DMN_CONN_GLUE_PIPE_H */ diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/gps/libloc_api_50001/loc_eng_dmn_conn_handler.cpp new file mode 100644 index 0000000..edd53f2 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn_handler.cpp @@ -0,0 +1,237 @@ +/* Copyright (c) 2011-2012, 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 +#include +#include +#include + +#include "log_util.h" +#include "platform_lib_includes.h" +#include "loc_eng_msg.h" +#include "loc_eng_dmn_conn.h" +#include "loc_eng_dmn_conn_handler.h" + +void* loc_api_handle = NULL; + +int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, int len) +{ + LOC_LOGD("%s:%d]\n", __func__, __LINE__); +#ifndef DEBUG_DMN_LOC_API + if (NULL == loc_api_handle) { + LOC_LOGE("%s:%d] NO agps data handle\n", __func__, __LINE__); + return 1; + } + + if (NULL != loc_api_handle) { + AGpsExtType type; + switch (pmsg->cmsg.cmsg_if_request.type) { + case IF_REQUEST_TYPE_SUPL: + { + LOC_LOGD("IF_REQUEST_TYPE_SUPL"); + type = AGPS_TYPE_SUPL; + break; + } + case IF_REQUEST_TYPE_WIFI: + { + LOC_LOGD("IF_REQUEST_TYPE_WIFI"); + type = AGPS_TYPE_WIFI; + break; + } + case IF_REQUEST_TYPE_ANY: + { + LOC_LOGD("IF_REQUEST_TYPE_ANY"); + type = AGPS_TYPE_ANY; + break; + } + default: + { + LOC_LOGD("invalid IF_REQUEST_TYPE!"); + return -1; + } + } + switch (pmsg->cmsg.cmsg_if_request.sender_id) { + case IF_REQUEST_SENDER_ID_QUIPC: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC"); + LocEngReqRelWifi* msg = + new LocEngReqRelWifi(loc_api_handle, + type, + LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC, + (char*)pmsg->cmsg.cmsg_if_request.ssid, + (char*)pmsg->cmsg.cmsg_if_request.password, + true); + msg->send(); + break; + } + case IF_REQUEST_SENDER_ID_MSAPM: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM"); + LocEngReqRelWifi* msg = + new LocEngReqRelWifi(loc_api_handle, + type, + LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM, + (char*)pmsg->cmsg.cmsg_if_request.ssid, + (char*)pmsg->cmsg.cmsg_if_request.password, + true); + msg->send(); + break; + } + case IF_REQUEST_SENDER_ID_MSAPU: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU"); + LocEngReqRelWifi* msg = + new LocEngReqRelWifi(loc_api_handle, + type, + LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU, + (char*)pmsg->cmsg.cmsg_if_request.ssid, + (char*)pmsg->cmsg.cmsg_if_request.password, + true); + msg->send(); + break; + } + case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); + LocEngReqRelBIT* msg = + new LocEngReqRelBIT(loc_api_handle, + type, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr, + true); + msg->send(); + break; + } + default: + { + LOC_LOGD("invalid IF_REQUEST_SENDER_ID!"); + return -1; + } + } + } + +#else + loc_eng_dmn_conn_loc_api_server_data_conn(LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, GPSONE_LOC_API_IF_REQUEST_SUCCESS); +#endif + return 0; +} + +int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, int len) +{ + LOC_LOGD("%s:%d]\n", __func__, __LINE__); +#ifndef DEBUG_DMN_LOC_API + AGpsExtType type; + switch (pmsg->cmsg.cmsg_if_request.type) { + case IF_REQUEST_TYPE_SUPL: + { + LOC_LOGD("IF_REQUEST_TYPE_SUPL"); + type = AGPS_TYPE_SUPL; + break; + } + case IF_REQUEST_TYPE_WIFI: + { + LOC_LOGD("IF_REQUEST_TYPE_WIFI"); + type = AGPS_TYPE_WIFI; + break; + } + case IF_REQUEST_TYPE_ANY: + { + LOC_LOGD("IF_REQUEST_TYPE_ANY"); + type = AGPS_TYPE_ANY; + break; + } + default: + { + LOC_LOGD("invalid IF_REQUEST_TYPE!"); + return -1; + } + } + switch (pmsg->cmsg.cmsg_if_request.sender_id) { + case IF_REQUEST_SENDER_ID_QUIPC: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC"); + LocEngReqRelWifi* msg = + new LocEngReqRelWifi(loc_api_handle, + type, + LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC, + (char*)pmsg->cmsg.cmsg_if_request.ssid, + (char*)pmsg->cmsg.cmsg_if_request.password, + false); + msg->send(); + break; + } + case IF_REQUEST_SENDER_ID_MSAPM: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM"); + LocEngReqRelWifi* msg = + new LocEngReqRelWifi(loc_api_handle, + type, + LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM, + (char*)pmsg->cmsg.cmsg_if_request.ssid, + (char*)pmsg->cmsg.cmsg_if_request.password, + false); + msg->send(); + break; + } + case IF_REQUEST_SENDER_ID_MSAPU: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU"); + LocEngReqRelWifi* msg = + new LocEngReqRelWifi(loc_api_handle, + type, + LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU, + (char*)pmsg->cmsg.cmsg_if_request.ssid, + (char*)pmsg->cmsg.cmsg_if_request.password, + false); + msg->send(); + break; + } + case IF_REQUEST_SENDER_ID_GPSONE_DAEMON: + { + LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON"); + LocEngReqRelBIT* msg = + new LocEngReqRelBIT(loc_api_handle, + type, + pmsg->cmsg.cmsg_if_request.ipv4_addr, + (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr, + false); + msg->send(); + break; + } + default: + { + LOC_LOGD("invalid IF_REQUEST_SENDER_ID!"); + return -1; + } + } +#else + loc_eng_dmn_conn_loc_api_server_data_conn(LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, GPSONE_LOC_API_IF_RELEASE_SUCCESS); +#endif + return 0; +} + diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn_handler.h b/gps/libloc_api_50001/loc_eng_dmn_conn_handler.h new file mode 100644 index 0000000..1c0edd5 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn_handler.h @@ -0,0 +1,106 @@ +/* Copyright (c) 2011-2012, 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_ENG_DATA_SERVER_HANDLER +#define LOC_ENG_DATA_SERVER_HANDLER + +#include +#include + +//for SSID_BUF_SIZE +#include + +#ifndef SSID_BUF_SIZE + #define SSID_BUF_SIZE (32+1) +#endif + +enum { + /* 0x0 - 0xEF is reserved for daemon internal */ + GPSONE_LOC_API_IF_REQUEST = 0xF0, + GPSONE_LOC_API_IF_RELEASE, + GPSONE_LOC_API_RESPONSE, + GPSONE_UNBLOCK, +}; + +enum { + GPSONE_LOC_API_IF_REQUEST_SUCCESS = 0xF0, + GPSONE_LOC_API_IF_RELEASE_SUCCESS, + GPSONE_LOC_API_IF_FAILURE, +}; + + +struct ctrl_msg_response { + int result; +}; + +struct ctrl_msg_unblock { + int reserved; +}; + +typedef enum { + IF_REQUEST_TYPE_SUPL = 0, + IF_REQUEST_TYPE_WIFI, + IF_REQUEST_TYPE_ANY +} ctrl_if_req_type_e_type; + +typedef enum { + IF_REQUEST_SENDER_ID_QUIPC = 0, + IF_REQUEST_SENDER_ID_MSAPM, + IF_REQUEST_SENDER_ID_MSAPU, + IF_REQUEST_SENDER_ID_GPSONE_DAEMON, + IF_REQUEST_SENDER_ID_MODEM +} ctrl_if_req_sender_id_e_type; + +struct ctrl_msg_if_request { + ctrl_if_req_type_e_type type; + ctrl_if_req_sender_id_e_type sender_id; + unsigned long ipv4_addr; + unsigned char ipv6_addr[16]; + char ssid[SSID_BUF_SIZE]; + char password[SSID_BUF_SIZE]; +}; + +/* do not change this structure */ +struct ctrl_msgbuf { + size_t msgsz; + uint16_t reserved1; + uint32_t reserved2; + uint8_t ctrl_type; + union { + struct ctrl_msg_response cmsg_response; + struct ctrl_msg_unblock cmsg_unblock; + struct ctrl_msg_if_request cmsg_if_request; + } cmsg; +}; + +extern void* loc_api_handle; + +int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, int len); +int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, int len); + +#endif /* LOC_ENG_DATA_SERVER_HANDLER */ diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/gps/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c new file mode 100644 index 0000000..9fed9d4 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c @@ -0,0 +1,399 @@ +/* Copyright (c) 2011, 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 + +#include "log_util.h" +#include "platform_lib_includes.h" +#include "loc_eng_dmn_conn_thread_helper.h" + +/*=========================================================================== +FUNCTION thelper_signal_init + +DESCRIPTION + This function will initialize the conditional variable resources. + + thelper - thelper instance + +DEPENDENCIES + None + +RETURN VALUE + 0: success or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int thelper_signal_init(struct loc_eng_dmn_conn_thelper * thelper) +{ + int result; + thelper->thread_exit = 0; + thelper->thread_ready = 0; + result = pthread_cond_init( &thelper->thread_cond, NULL); + if (result) { + return result; + } + + result = pthread_mutex_init(&thelper->thread_mutex, NULL); + if (result) { + pthread_cond_destroy(&thelper->thread_cond); + } + return result; +} + +/*=========================================================================== +FUNCTION + +DESCRIPTION + This function will destroy the conditional variable resources + + thelper - pointer to thelper instance + +DEPENDENCIES + None + +RETURN VALUE + 0: success or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int thelper_signal_destroy(struct loc_eng_dmn_conn_thelper * thelper) +{ + int result, ret_result = 0; + result = pthread_cond_destroy( &thelper->thread_cond); + if (result) { + ret_result = result; + } + + result = pthread_mutex_destroy(&thelper->thread_mutex); + if (result) { + ret_result = result; + } + + return ret_result; +} + +/*=========================================================================== +FUNCTION thelper_signal_wait + +DESCRIPTION + This function will be blocked on the conditional variable until thelper_signal_ready + is called + + thelper - pointer to thelper instance + +DEPENDENCIES + None + +RETURN VALUE + 0: success or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int thelper_signal_wait(struct loc_eng_dmn_conn_thelper * thelper) +{ + int result = 0; + + pthread_mutex_lock(&thelper->thread_mutex); + if (!thelper->thread_ready && !thelper->thread_exit) { + result = pthread_cond_wait(&thelper->thread_cond, &thelper->thread_mutex); + } + + if (thelper->thread_exit) { + result = -1; + } + pthread_mutex_unlock(&thelper->thread_mutex); + + return result; +} + +/*=========================================================================== +FUNCTION thelper_signal_ready + +DESCRIPTION + This function will wake up the conditional variable + + thelper - pointer to thelper instance + +DEPENDENCIES + None + +RETURN VALUE + 0: success or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int thelper_signal_ready(struct loc_eng_dmn_conn_thelper * thelper) +{ + int result; + + LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); + + pthread_mutex_lock(&thelper->thread_mutex); + thelper->thread_ready = 1; + result = pthread_cond_signal(&thelper->thread_cond); + pthread_mutex_unlock(&thelper->thread_mutex); + + return result; +} + +/*=========================================================================== +FUNCTION thelper_signal_block + +DESCRIPTION + This function will set the thread ready to 0 to block the thelper_signal_wait + + thelper - pointer to thelper instance + +DEPENDENCIES + None + +RETURN VALUE + if thread_ready is set + +SIDE EFFECTS + N/A + +===========================================================================*/ +int thelper_signal_block(struct loc_eng_dmn_conn_thelper * thelper) +{ + int result = thelper->thread_ready; + + LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); + + pthread_mutex_lock(&thelper->thread_mutex); + thelper->thread_ready = 0; + pthread_mutex_unlock(&thelper->thread_mutex); + + return result; +} + +/*=========================================================================== +FUNCTION thelper_main + +DESCRIPTION + This function is the main thread. It will be launched as a child thread + + data - pointer to the instance + +DEPENDENCIES + None + +RETURN VALUE + NULL + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void * thelper_main(void *data) +{ + int result = 0; + struct loc_eng_dmn_conn_thelper * thelper = (struct loc_eng_dmn_conn_thelper *) data; + + if (thelper->thread_proc_init) { + result = thelper->thread_proc_init(thelper->thread_context); + if (result < 0) { + thelper->thread_exit = 1; + thelper_signal_ready(thelper); + LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper); + return NULL; + } + } + + thelper_signal_ready(thelper); + + if (thelper->thread_proc_pre) { + result = thelper->thread_proc_pre(thelper->thread_context); + if (result < 0) { + thelper->thread_exit = 1; + LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper); + return NULL; + } + } + + do { + if (thelper->thread_proc) { + result = thelper->thread_proc(thelper->thread_context); + if (result < 0) { + thelper->thread_exit = 1; + LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper); + } + } + } while (thelper->thread_exit == 0); + + if (thelper->thread_proc_post) { + result = thelper->thread_proc_post(thelper->thread_context); + } + + if (result != 0) { + LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper); + } + return NULL; +} + +static void thelper_main_2(void *data) +{ + thelper_main(data); + return; +} + + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_launch_thelper + +DESCRIPTION + This function will initialize the thread context and launch the thelper_main + + thelper - pointer to thelper instance + thread_proc_init - The initialization function pointer + thread_proc_pre - The function to call before task loop and after initialization + thread_proc - The task loop + thread_proc_post - The function to call after the task loop + context - the context for the above four functions + +DEPENDENCIES + None + +RETURN VALUE + 0: success or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_launch_thelper(struct loc_eng_dmn_conn_thelper * thelper, + int (*thread_proc_init) (void * context), + int (*thread_proc_pre) (void * context), + int (*thread_proc) (void * context), + int (*thread_proc_post) (void * context), + thelper_create_thread create_thread_cb, + void * context) +{ + int result; + + thelper_signal_init(thelper); + + if (context) { + thelper->thread_context = context; + } + + thelper->thread_proc_init = thread_proc_init; + thelper->thread_proc_pre = thread_proc_pre; + thelper->thread_proc = thread_proc; + thelper->thread_proc_post = thread_proc_post; + + LOC_LOGD("%s:%d] 0x%lx call pthread_create\n", __func__, __LINE__, (long) thelper); + if (create_thread_cb) { + result = 0; + thelper->thread_id = create_thread_cb("loc_eng_dmn_conn", + thelper_main_2, (void *)thelper); + } else { + result = pthread_create(&thelper->thread_id, NULL, + thelper_main, (void *)thelper); + } + + if (result != 0) { + LOC_LOGE("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); + return -1; + } + + LOC_LOGD("%s:%d] 0x%lx pthread_create done\n", __func__, __LINE__, (long) thelper); + + thelper_signal_wait(thelper); + + LOC_LOGD("%s:%d] 0x%lx pthread ready\n", __func__, __LINE__, (long) thelper); + return thelper->thread_exit; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_unblock_thelper + +DESCRIPTION + This function unblocks thelper_main to release the thread + + thelper - pointer to thelper instance + +DEPENDENCIES + None + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_unblock_thelper(struct loc_eng_dmn_conn_thelper * thelper) +{ + LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); + thelper->thread_exit = 1; + return 0; +} + +/*=========================================================================== +FUNCTION loc_eng_dmn_conn_join_thelper + + thelper - pointer to thelper instance + +DESCRIPTION + This function will wait for the thread of thelper_main to finish + +DEPENDENCIES + None + +RETURN VALUE + 0: success or negative value for failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper) +{ + int result; + + LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); + result = pthread_join(thelper->thread_id, NULL); + if (result != 0) { + LOC_LOGE("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); + } + LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper); + + thelper_signal_destroy(thelper); + + return result; +} + diff --git a/gps/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/gps/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h new file mode 100644 index 0000000..89e598b --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2011, 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_ENG_DMN_CONN_THREAD_HELPER_H__ +#define __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +struct loc_eng_dmn_conn_thelper { + unsigned char thread_exit; + unsigned char thread_ready; + pthread_cond_t thread_cond; + pthread_mutex_t thread_mutex; + pthread_t thread_id; + void * thread_context; + int (*thread_proc_init) (void * context); + int (*thread_proc_pre) (void * context); + int (*thread_proc) (void * context); + int (*thread_proc_post) (void * context); +}; + +typedef pthread_t (* thelper_create_thread)(const char* name, void (*start)(void *), void* arg); +int loc_eng_dmn_conn_launch_thelper(struct loc_eng_dmn_conn_thelper * thelper, + int (*thread_proc_init) (void * context), + int (*thread_proc_pre) (void * context), + int (*thread_proc) (void * context), + int (*thread_proc_post) (void * context), + thelper_create_thread create_thread_cb, + void * context); + +int loc_eng_dmn_conn_unblock_thelper(struct loc_eng_dmn_conn_thelper * thelper); +int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper); + +/* if only need to use signal */ +int thelper_signal_init(struct loc_eng_dmn_conn_thelper * thelper); +int thelper_signal_destroy(struct loc_eng_dmn_conn_thelper * thelper); +int thelper_signal_wait(struct loc_eng_dmn_conn_thelper * thelper); +int thelper_signal_ready(struct loc_eng_dmn_conn_thelper * thelper); +int thelper_signal_block(struct loc_eng_dmn_conn_thelper * thelper); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ */ diff --git a/gps/libloc_api_50001/loc_eng_log.cpp b/gps/libloc_api_50001/loc_eng_log.cpp new file mode 100644 index 0000000..3a34167 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_log.cpp @@ -0,0 +1,35 @@ +/* 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_eng" + +#include "loc_log.h" +#include "loc_eng_log.h" + diff --git a/gps/libloc_api_50001/loc_eng_log.h b/gps/libloc_api_50001/loc_eng_log.h new file mode 100644 index 0000000..a68bd84 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_log.h @@ -0,0 +1,44 @@ +/* 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. + * + */ + +#ifndef LOC_ENG_LOG_H +#define LOC_ENG_LOG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_ENG_LOG_H */ diff --git a/gps/libloc_api_50001/loc_eng_msg.h b/gps/libloc_api_50001/loc_eng_msg.h new file mode 100644 index 0000000..b767dc5 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_msg.h @@ -0,0 +1,303 @@ +/* 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. + * + */ +#ifndef LOC_ENG_MSG_H +#define LOC_ENG_MSG_H + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SSID_BUF_SIZE + #define SSID_BUF_SIZE (32+1) +#endif +#ifdef USE_GLIB + +#include + +#endif /* USE_GLIB */ +#include "platform_lib_includes.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +using namespace loc_core; + +struct LocEngPositionMode : public LocMsg { + LocEngAdapter* mAdapter; + const LocPosMode mPosMode; + LocEngPositionMode(LocEngAdapter* adapter, LocPosMode &mode); + virtual void proc() const; + virtual void log() const; + void send() const; +}; + + +struct LocEngStartFix : public LocMsg { + LocEngAdapter* mAdapter; + LocEngStartFix(LocEngAdapter* adapter); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; +}; + +struct LocEngStopFix : public LocMsg { + LocEngAdapter* mAdapter; + LocEngStopFix(LocEngAdapter* adapter); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; +}; + +struct LocEngReportPosition : public LocMsg { + LocAdapterBase* mAdapter; + const UlpLocation mLocation; + const GpsLocationExtended mLocationExtended; + const void* mLocationExt; + const enum loc_sess_status mStatus; + const LocPosTechMask mTechMask; + LocEngReportPosition(LocAdapterBase* adapter, + UlpLocation &loc, + GpsLocationExtended &locExtended, + void* locExt, + enum loc_sess_status st, + LocPosTechMask technology); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; +}; + +struct LocEngReportSv : public LocMsg { + LocAdapterBase* mAdapter; + const GpsSvStatus mSvStatus; + const GpsLocationExtended mLocationExtended; + const void* mSvExt; + LocEngReportSv(LocAdapterBase* adapter, + GpsSvStatus &sv, + GpsLocationExtended &locExtended, + void* svExtended); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; +}; + +struct LocEngReportStatus : public LocMsg { + LocAdapterBase* mAdapter; + const GpsStatusValue mStatus; + LocEngReportStatus(LocAdapterBase* adapter, + GpsStatusValue engineStatus); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngReportNmea : public LocMsg { + void* mLocEng; + char* const mNmea; + const int mLen; + LocEngReportNmea(void* locEng, + const char* data, int len); + inline virtual ~LocEngReportNmea() + { + delete[] mNmea; + } + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngReportXtraServer : public LocMsg { + void* mLocEng; + int mMaxLen; + char *mServers; + LocEngReportXtraServer(void* locEng, + const char *url1, const char *url2, + const char *url3, const int maxlength); + inline virtual ~LocEngReportXtraServer() + { + delete[] mServers; + } + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngSuplEsOpened : public LocMsg { + void* mLocEng; + LocEngSuplEsOpened(void* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngSuplEsClosed : public LocMsg { + void* mLocEng; + LocEngSuplEsClosed(void* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngRequestSuplEs : public LocMsg { + void* mLocEng; + const int mID; + LocEngRequestSuplEs(void* locEng, int id); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngRequestATL : public LocMsg { + void* mLocEng; + const int mID; + const AGpsExtType mType; + LocEngRequestATL(void* locEng, int id, + AGpsExtType agps_type); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngReleaseATL : public LocMsg { + void* mLocEng; + const int mID; + LocEngReleaseATL(void* locEng, int id); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngReqRelBIT : public LocMsg { + void* mLocEng; + const AGpsExtType mType; + const int mIPv4Addr; + char* const mIPv6Addr; + const bool mIsReq; + LocEngReqRelBIT(void* instance, AGpsExtType type, + int ipv4, char* ipv6, bool isReq); + virtual ~LocEngReqRelBIT(); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; +}; + +struct LocEngReqRelWifi : public LocMsg { + void* mLocEng; + const AGpsExtType mType; + const loc_if_req_sender_id_e_type mSenderId; + char* const mSSID; + char* const mPassword; + const bool mIsReq; + LocEngReqRelWifi(void* locEng, AGpsExtType type, + loc_if_req_sender_id_e_type sender_id, + char* s, char* p, bool isReq); + virtual ~LocEngReqRelWifi(); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() const; +}; + +struct LocEngRequestXtra : public LocMsg { + void* mLocEng; + LocEngRequestXtra(void* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngRequestTime : public LocMsg { + void* mLocEng; + LocEngRequestTime(void* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngRequestNi : public LocMsg { + void* mLocEng; + const GpsNiNotification mNotify; + const void *mPayload; + LocEngRequestNi(void* locEng, + GpsNiNotification ¬if, + const void* data); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngDown : public LocMsg { + void* mLocEng; + LocEngDown(void* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngUp : public LocMsg { + void* mLocEng; + LocEngUp(void* locEng); + virtual void proc() const; + void locallog() const; + virtual void log() const; +}; + +struct LocEngGetZpp : public LocMsg { + LocEngAdapter* mAdapter; + LocEngGetZpp(LocEngAdapter* adapter); + virtual void proc() const; + void locallog() const; + virtual void log() const; + void send() 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 */ + +#endif /* LOC_ENG_MSG_H */ diff --git a/gps/libloc_api_50001/loc_eng_ni.cpp b/gps/libloc_api_50001/loc_eng_ni.cpp new file mode 100644 index 0000000..4597b98 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_ni.cpp @@ -0,0 +1,414 @@ +/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * 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_eng" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "log_util.h" +#include "platform_lib_includes.h" + +using namespace loc_core; + +/*============================================================================= + * + * DATA DECLARATION + * + *============================================================================*/ + +/*============================================================================= + * + * FUNCTION DECLARATIONS + * + *============================================================================*/ +static void* ni_thread_proc(void *args); + +struct LocEngInformNiResponse : public LocMsg { + LocEngAdapter* mAdapter; + const GpsUserResponseType mResponse; + const void *mPayload; + inline LocEngInformNiResponse(LocEngAdapter* adapter, + GpsUserResponseType resp, + const void* data) : + LocMsg(), mAdapter(adapter), + mResponse(resp), mPayload(data) + { + locallog(); + } + inline ~LocEngInformNiResponse() + { + // this is a bit weird since mPayload is not + // allocated by this class. But there is no better way. + // mPayload actually won't be NULL here. + free((void*)mPayload); + } + inline virtual void proc() const + { + mAdapter->informNiResponse(mResponse, mPayload); + } + inline void locallog() const + { + LOC_LOGV("LocEngInformNiResponse - " + "response: %s\n mPayload: %p", + loc_get_ni_response_name(mResponse), + mPayload); + } + inline virtual void log() const + { + locallog(); + } +}; + +/*=========================================================================== + +FUNCTION loc_eng_ni_request_handler + +DESCRIPTION + Displays the NI request and awaits user input. If a previous request is + in session, it is ignored. + +RETURN VALUE + none + +===========================================================================*/ +void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data, + const GpsNiNotification *notif, + const void* passThrough) +{ + ENTRY_LOG(); + char lcs_addr[32]; // Decoded LCS address for UMTS CP NI + loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data; + loc_eng_ni_session_s_type* pSession = NULL; + + if (NULL == loc_eng_data.ni_notify_cb) { + EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); + return; + } + + if (notif->ni_type == GPS_NI_TYPE_EMERGENCY_SUPL) { + if (NULL != loc_eng_ni_data_p->sessionEs.rawRequest) { + LOC_LOGW("loc_eng_ni_request_handler, supl es NI in progress, new supl es NI ignored, type: %d", + notif->ni_type); + if (NULL != passThrough) { + free((void*)passThrough); + } + } else { + pSession = &loc_eng_ni_data_p->sessionEs; + } + } else { + if (NULL != loc_eng_ni_data_p->session.rawRequest || + NULL != loc_eng_ni_data_p->sessionEs.rawRequest) { + LOC_LOGW("loc_eng_ni_request_handler, supl NI in progress, new supl NI ignored, type: %d", + notif->ni_type); + if (NULL != passThrough) { + free((void*)passThrough); + } + } else { + pSession = &loc_eng_ni_data_p->session; + } + } + + + if (pSession) { + /* Save request */ + pSession->rawRequest = (void*)passThrough; + pSession->reqID = ++loc_eng_ni_data_p->reqIDCounter; + pSession->adapter = loc_eng_data.adapter; + + /* Fill in notification */ + ((GpsNiNotification*)notif)->notification_id = pSession->reqID; + + if (notif->notify_flags == GPS_NI_PRIVACY_OVERRIDE) + { + loc_eng_mute_one_session(loc_eng_data); + } + + /* Log requestor ID and text for debugging */ + LOC_LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif->ni_type, notif->timeout, notif->default_response); + LOC_LOGI(" requestor_id: %s (encoding: %d)", notif->requestor_id, notif->requestor_id_encoding); + LOC_LOGI(" text: %s text (encoding: %d)", notif->text, notif->text_encoding); + if (notif->extras[0]) + { + LOC_LOGI(" extras: %s", notif->extras); + } + + /* For robustness, spawn a thread at this point to timeout to clear up the notification status, even though + * the OEM layer in java does not do so. + **/ + pSession->respTimeLeft = 5 + (notif->timeout != 0 ? notif->timeout : LOC_NI_NO_RESPONSE_TIME); + LOC_LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", pSession->respTimeLeft); + + int rc = 0; + rc = pthread_create(&pSession->thread, NULL, ni_thread_proc, pSession); + if (rc) + { + LOC_LOGE("Loc NI thread is not created.\n"); + } + rc = pthread_detach(pSession->thread); + if (rc) + { + LOC_LOGE("Loc NI thread is not detached.\n"); + } + + CALLBACK_LOG_CALLFLOW("ni_notify_cb - id", %d, notif->notification_id); + loc_eng_data.ni_notify_cb((GpsNiNotification*)notif); + } + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== + +FUNCTION ni_thread_proc + +===========================================================================*/ +static void* ni_thread_proc(void *args) +{ + ENTRY_LOG(); + + loc_eng_ni_session_s_type* pSession = (loc_eng_ni_session_s_type*)args; + int rc = 0; /* return code from pthread calls */ + + struct timeval present_time; + struct timespec expire_time; + + LOC_LOGD("Starting Loc NI thread...\n"); + pthread_mutex_lock(&pSession->tLock); + /* Calculate absolute expire time */ + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec + pSession->respTimeLeft; + expire_time.tv_nsec = present_time.tv_usec * 1000; + LOC_LOGD("ni_thread_proc-Time out set for abs time %ld with delay %d sec\n", + (long) expire_time.tv_sec, pSession->respTimeLeft ); + + while (!pSession->respRecvd) + { + rc = pthread_cond_timedwait(&pSession->tCond, + &pSession->tLock, + &expire_time); + if (rc == ETIMEDOUT) + { + pSession->resp = GPS_NI_RESPONSE_NORESP; + LOC_LOGD("ni_thread_proc-Thread time out after valting for specified time. Ret Val %d\n",rc ); + break; + } + } + LOC_LOGD("ni_thread_proc-Java layer has sent us a user response and return value from " + "pthread_cond_timedwait = %d\n",rc ); + pSession->respRecvd = FALSE; /* Reset the user response flag for the next session*/ + + LOC_LOGD("pSession->resp is %d\n",pSession->resp); + + // adding this check to support modem restart, in which case, we need the thread + // to exit without calling sending data. We made sure that rawRequest is NULL in + // loc_eng_ni_reset_on_engine_restart() + LocEngAdapter* adapter = pSession->adapter; + LocEngInformNiResponse *msg = NULL; + + if (NULL != pSession->rawRequest) { + if (pSession->resp != GPS_NI_RESPONSE_IGNORE) { + LOC_LOGD("pSession->resp != GPS_NI_RESPONSE_IGNORE \n"); + msg = new LocEngInformNiResponse(adapter, + pSession->resp, + pSession->rawRequest); + } else { + LOC_LOGD("this is the ignore reply for SUPL ES\n"); + free(pSession->rawRequest); + } + pSession->rawRequest = NULL; + } + pthread_mutex_unlock(&pSession->tLock); + + pSession->respTimeLeft = 0; + pSession->reqID = 0; + + if (NULL != msg) { + LOC_LOGD("ni_thread_proc: adapter->sendMsg(msg)\n"); + adapter->sendMsg(msg); + } + + EXIT_LOG(%s, VOID_RET); + return NULL; +} + +void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data; + + if (NULL == loc_eng_data.ni_notify_cb) { + EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); + return; + } + + // only if modem has requested but then died. + if (NULL != loc_eng_ni_data_p->sessionEs.rawRequest) { + free(loc_eng_ni_data_p->sessionEs.rawRequest); + loc_eng_ni_data_p->sessionEs.rawRequest = NULL; + + pthread_mutex_lock(&loc_eng_ni_data_p->sessionEs.tLock); + // the goal is to wake up ni_thread_proc + // and let it exit. + loc_eng_ni_data_p->sessionEs.respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->sessionEs.tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->sessionEs.tLock); + } + + if (NULL != loc_eng_ni_data_p->session.rawRequest) { + free(loc_eng_ni_data_p->session.rawRequest); + loc_eng_ni_data_p->session.rawRequest = NULL; + + pthread_mutex_lock(&loc_eng_ni_data_p->session.tLock); + // the goal is to wake up ni_thread_proc + // and let it exit. + loc_eng_ni_data_p->session.respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->session.tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->session.tLock); + } + + EXIT_LOG(%s, VOID_RET); +} + +/*=========================================================================== +FUNCTION loc_eng_ni_init + +DESCRIPTION + This function initializes the NI interface + +DEPENDENCIES + NONE + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiExtCallbacks *callbacks) +{ + ENTRY_LOG_CALLFLOW(); + + if(callbacks == NULL) + EXIT_LOG(%s, "loc_eng_ni_init: failed, cb is NULL"); + else if (NULL == callbacks->notify_cb) { + EXIT_LOG(%s, "loc_eng_ni_init: failed, no cb."); + } else if (NULL != loc_eng_data.ni_notify_cb) { + EXIT_LOG(%s, "loc_eng_ni_init: already inited."); + } else { + loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data; + loc_eng_ni_data_p->sessionEs.respTimeLeft = 0; + loc_eng_ni_data_p->sessionEs.respRecvd = FALSE; + loc_eng_ni_data_p->sessionEs.rawRequest = NULL; + loc_eng_ni_data_p->sessionEs.reqID = 0; + pthread_cond_init(&loc_eng_ni_data_p->sessionEs.tCond, NULL); + pthread_mutex_init(&loc_eng_ni_data_p->sessionEs.tLock, NULL); + + loc_eng_ni_data_p->session.respTimeLeft = 0; + loc_eng_ni_data_p->session.respRecvd = FALSE; + loc_eng_ni_data_p->session.rawRequest = NULL; + loc_eng_ni_data_p->session.reqID = 0; + pthread_cond_init(&loc_eng_ni_data_p->session.tCond, NULL); + pthread_mutex_init(&loc_eng_ni_data_p->session.tLock, NULL); + + loc_eng_data.ni_notify_cb = callbacks->notify_cb; + EXIT_LOG(%s, VOID_RET); + } +} + +/*=========================================================================== +FUNCTION loc_eng_ni_respond + +DESCRIPTION + This function receives user response from upper layer framework + +DEPENDENCIES + NONE + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data, + int notif_id, GpsUserResponseType user_response) +{ + ENTRY_LOG_CALLFLOW(); + loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data; + loc_eng_ni_session_s_type* pSession = NULL; + + if (NULL == loc_eng_data.ni_notify_cb) { + EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet."); + return; + } + + if (notif_id == loc_eng_ni_data_p->sessionEs.reqID && + NULL != loc_eng_ni_data_p->sessionEs.rawRequest) { + pSession = &loc_eng_ni_data_p->sessionEs; + // ignore any SUPL NI non-Es session if a SUPL NI ES is accepted + if (user_response == GPS_NI_RESPONSE_ACCEPT && + NULL != loc_eng_ni_data_p->session.rawRequest) { + pthread_mutex_lock(&loc_eng_ni_data_p->session.tLock); + loc_eng_ni_data_p->session.resp = GPS_NI_RESPONSE_IGNORE; + loc_eng_ni_data_p->session.respRecvd = TRUE; + pthread_cond_signal(&loc_eng_ni_data_p->session.tCond); + pthread_mutex_unlock(&loc_eng_ni_data_p->session.tLock); + } + } else if (notif_id == loc_eng_ni_data_p->session.reqID && + NULL != loc_eng_ni_data_p->session.rawRequest) { + pSession = &loc_eng_ni_data_p->session; + } + + if (pSession) { + LOC_LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id); + pthread_mutex_lock(&pSession->tLock); + pSession->resp = user_response; + pSession->respRecvd = TRUE; + pthread_cond_signal(&pSession->tCond); + pthread_mutex_unlock(&pSession->tLock); + } + else { + LOC_LOGE("loc_eng_ni_respond: notif_id %d not an active session", notif_id); + } + + EXIT_LOG(%s, VOID_RET); +} diff --git a/gps/libloc_api_50001/loc_eng_ni.h b/gps/libloc_api_50001/loc_eng_ni.h new file mode 100644 index 0000000..068f5cd --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_ni.h @@ -0,0 +1,59 @@ +/* Copyright (c) 2009,2011,2014 The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef LOC_ENG_NI_H +#define LOC_ENG_NI_H + +#include +#include + +#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */ +#define LOC_NI_NOTIF_KEY_ADDRESS "Address" +#define GPS_NI_RESPONSE_IGNORE 4 + +typedef struct { + pthread_t thread; /* NI thread */ + int respTimeLeft; /* examine time for NI response */ + bool respRecvd; /* NI User reponse received or not from Java layer*/ + void* rawRequest; + int reqID; /* ID to check against response */ + GpsUserResponseType resp; + pthread_cond_t tCond; + pthread_mutex_t tLock; + LocEngAdapter* adapter; +} loc_eng_ni_session_s_type; + +typedef struct { + loc_eng_ni_session_s_type session; /* SUPL NI Session */ + loc_eng_ni_session_s_type sessionEs; /* Emergency SUPL NI Session */ + int reqIDCounter; +} loc_eng_ni_data_s_type; + + +#endif /* LOC_ENG_NI_H */ diff --git a/gps/libloc_api_50001/loc_eng_nmea.cpp b/gps/libloc_api_50001/loc_eng_nmea.cpp new file mode 100644 index 0000000..4c6b9a3 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_nmea.cpp @@ -0,0 +1,836 @@ +/* Copyright (c) 2012, 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_eng_nmea" +#define GPS_PRN_START 1 +#define GPS_PRN_END 32 +#define GLONASS_PRN_START 65 +#define GLONASS_PRN_END 96 +#include +#include +#include +#include "log_util.h" + +/*=========================================================================== +FUNCTION loc_eng_nmea_send + +DESCRIPTION + send out NMEA sentence + +DEPENDENCIES + NONE + +RETURN VALUE + Total length of the nmea sentence + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p) +{ + struct timeval tv; + gettimeofday(&tv, (struct timezone *) NULL); + int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000; + CALLBACK_LOG_CALLFLOW("nmea_cb", %p, pNmea); + if (loc_eng_data_p->nmea_cb != NULL) + loc_eng_data_p->nmea_cb(now, pNmea, length); + LOC_LOGD("NMEA <%s", pNmea); +} + +/*=========================================================================== +FUNCTION loc_eng_nmea_put_checksum + +DESCRIPTION + Generate NMEA sentences generated based on position report + +DEPENDENCIES + NONE + +RETURN VALUE + Total length of the nmea sentence + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_nmea_put_checksum(char *pNmea, int maxSize) +{ + uint8_t checksum = 0; + int length = 0; + + pNmea++; //skip the $ + while (*pNmea != '\0') + { + checksum ^= *pNmea++; + length++; + } + + int checksumLength = snprintf(pNmea,(maxSize-length-1),"*%02X\r\n", checksum); + return (length + checksumLength); +} + +/*=========================================================================== +FUNCTION loc_eng_nmea_generate_pos + +DESCRIPTION + Generate NMEA sentences generated based on position report + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +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) +{ + ENTRY_LOG(); + time_t utcTime(location.gpsLocation.timestamp/1000); + tm * pTm = gmtime(&utcTime); + if (NULL == pTm) { + LOC_LOGE("gmtime failed"); + return; + } + + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char* pMarker = sentence; + int lengthRemaining = sizeof(sentence); + int length = 0; + int utcYear = pTm->tm_year % 100; // 2 digit year + int utcMonth = pTm->tm_mon + 1; // tm_mon starts at zero + int utcDay = pTm->tm_mday; + int utcHours = pTm->tm_hour; + int utcMinutes = pTm->tm_min; + int utcSeconds = pTm->tm_sec; + + if (generate_nmea) { + // ------------------ + // ------$GPGSA------ + // ------------------ + + uint32_t svUsedCount = 0; + uint32_t svUsedList[32] = {0}; + uint32_t mask = loc_eng_data_p->sv_used_mask; + for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++) + { + if (mask & 1) + svUsedList[svUsedCount++] = i; + mask = mask >> 1; + } + // clear the cache so they can't be used again + loc_eng_data_p->sv_used_mask = 0; + + char fixType; + if (svUsedCount == 0) + fixType = '1'; // no fix + else if (svUsedCount <= 3) + fixType = '2'; // 2D fix + else + fixType = '3'; // 3D fix + + length = snprintf(pMarker, lengthRemaining, "$GPGSA,A,%c,", fixType); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + for (uint8_t i = 0; i < 12; i++) // only the first 12 sv go in sentence + { + if (i < svUsedCount) + length = snprintf(pMarker, lengthRemaining, "%02d,", svUsedList[i]); + else + length = snprintf(pMarker, lengthRemaining, ","); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + } + + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) + { // dop is in locationExtended, (QMI) + length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", + locationExtended.pdop, + locationExtended.hdop, + locationExtended.vdop); + } + else if (loc_eng_data_p->pdop > 0 && loc_eng_data_p->hdop > 0 && loc_eng_data_p->vdop > 0) + { // dop was cached from sv report (RPC) + length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f", + loc_eng_data_p->pdop, + loc_eng_data_p->hdop, + loc_eng_data_p->vdop); + } + else + { // no dop + length = snprintf(pMarker, lengthRemaining, ",,"); + } + + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + + // ------------------ + // ------$GPVTG------ + // ------------------ + + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING) + { + float magTrack = location.gpsLocation.bearing; + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV) + { + float magTrack = location.gpsLocation.bearing - locationExtended.magneticDeviation; + if (magTrack < 0.0) + magTrack += 360.0; + else if (magTrack > 360.0) + magTrack -= 360.0; + } + + length = snprintf(pMarker, lengthRemaining, "$GPVTG,%.1lf,T,%.1lf,M,", location.gpsLocation.bearing, magTrack); + } + else + { + length = snprintf(pMarker, lengthRemaining, "$GPVTG,,T,,M,"); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED) + { + float speedKnots = location.gpsLocation.speed * (3600.0/1852.0); + float speedKmPerHour = location.gpsLocation.speed * 3.6; + + length = snprintf(pMarker, lengthRemaining, "%.1lf,N,%.1lf,K,", speedKnots, speedKmPerHour); + } + else + { + length = snprintf(pMarker, lengthRemaining, ",N,,K,"); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)) + length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix + else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode) + length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous + else + length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential + + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + + // ------------------ + // ------$GPRMC------ + // ------------------ + + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d,A," , + utcHours, utcMinutes, utcSeconds); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG) + { + double latitude = location.gpsLocation.latitude; + double longitude = location.gpsLocation.longitude; + char latHemisphere; + char lonHemisphere; + double latMinutes; + double lonMinutes; + + if (latitude > 0) + { + latHemisphere = 'N'; + } + else + { + latHemisphere = 'S'; + latitude *= -1.0; + } + + if (longitude < 0) + { + lonHemisphere = 'W'; + longitude *= -1.0; + } + else + { + lonHemisphere = 'E'; + } + + latMinutes = fmod(latitude * 60.0 , 60.0); + lonMinutes = fmod(longitude * 60.0 , 60.0); + + length = snprintf(pMarker, lengthRemaining, "%02d%09.6lf,%c,%03d%09.6lf,%c,", + (uint8_t)floor(latitude), latMinutes, latHemisphere, + (uint8_t)floor(longitude),lonMinutes, lonHemisphere); + } + else + { + length = snprintf(pMarker, lengthRemaining,",,,,"); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED) + { + float speedKnots = location.gpsLocation.speed * (3600.0/1852.0); + length = snprintf(pMarker, lengthRemaining, "%.1lf,", speedKnots); + } + else + { + length = snprintf(pMarker, lengthRemaining, ","); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING) + { + length = snprintf(pMarker, lengthRemaining, "%.1lf,", location.gpsLocation.bearing); + } + else + { + length = snprintf(pMarker, lengthRemaining, ","); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + length = snprintf(pMarker, lengthRemaining, "%2.2d%2.2d%2.2d,", + utcDay, utcMonth, utcYear); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV) + { + float magneticVariation = locationExtended.magneticDeviation; + char direction; + if (magneticVariation < 0.0) + { + direction = 'W'; + magneticVariation *= -1.0; + } + else + { + direction = 'E'; + } + + length = snprintf(pMarker, lengthRemaining, "%.1lf,%c,", + magneticVariation, direction); + } + else + { + length = snprintf(pMarker, lengthRemaining, ",,"); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)) + length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix + else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode) + length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous + else + length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential + + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + + // ------------------ + // ------$GPGGA------ + // ------------------ + + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d," , + utcHours, utcMinutes, utcSeconds); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG) + { + double latitude = location.gpsLocation.latitude; + double longitude = location.gpsLocation.longitude; + char latHemisphere; + char lonHemisphere; + double latMinutes; + double lonMinutes; + + if (latitude > 0) + { + latHemisphere = 'N'; + } + else + { + latHemisphere = 'S'; + latitude *= -1.0; + } + + if (longitude < 0) + { + lonHemisphere = 'W'; + longitude *= -1.0; + } + else + { + lonHemisphere = 'E'; + } + + latMinutes = fmod(latitude * 60.0 , 60.0); + lonMinutes = fmod(longitude * 60.0 , 60.0); + + length = snprintf(pMarker, lengthRemaining, "%02d%09.6lf,%c,%03d%09.6lf,%c,", + (uint8_t)floor(latitude), latMinutes, latHemisphere, + (uint8_t)floor(longitude),lonMinutes, lonHemisphere); + } + else + { + length = snprintf(pMarker, lengthRemaining,",,,,"); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + char gpsQuality; + if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)) + gpsQuality = '0'; // 0 means no fix + else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode) + gpsQuality = '1'; // 1 means GPS fix + else + gpsQuality = '2'; // 2 means DGPS fix + + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP) + { // dop is in locationExtended, (QMI) + length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", + gpsQuality, svUsedCount, locationExtended.hdop); + } + else if (loc_eng_data_p->pdop > 0 && loc_eng_data_p->hdop > 0 && loc_eng_data_p->vdop > 0) + { // dop was cached from sv report (RPC) + length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,", + gpsQuality, svUsedCount, loc_eng_data_p->hdop); + } + else + { // no hdop + length = snprintf(pMarker, lengthRemaining, "%c,%02d,,", + gpsQuality, svUsedCount); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL) + { + length = snprintf(pMarker, lengthRemaining, "%.1lf,M,", + locationExtended.altitudeMeanSeaLevel); + } + else + { + length = snprintf(pMarker, lengthRemaining,",,"); + } + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if ((location.gpsLocation.flags & GPS_LOCATION_HAS_ALTITUDE) && + (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL)) + { + length = snprintf(pMarker, lengthRemaining, "%.1lf,M,,", + location.gpsLocation.altitude - locationExtended.altitudeMeanSeaLevel); + } + else + { + length = snprintf(pMarker, lengthRemaining,",,,"); + } + + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + + } + //Send blank NMEA reports for non-final fixes + else { + 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); + + 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); + } + // clear the dop cache so they can't be used again + loc_eng_data_p->pdop = 0; + loc_eng_data_p->hdop = 0; + loc_eng_data_p->vdop = 0; + + EXIT_LOG(%d, 0); +} + + + +/*=========================================================================== +FUNCTION loc_eng_nmea_generate_sv + +DESCRIPTION + Generate NMEA sentences generated based on sv report + +DEPENDENCIES + NONE + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, + const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended) +{ + ENTRY_LOG(); + + char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0}; + char* pMarker = sentence; + int lengthRemaining = sizeof(sentence); + int length = 0; + int svCount = svStatus.num_svs; + int sentenceCount = 0; + int sentenceNumber = 1; + int svNumber = 1; + int gpsCount = 0; + int glnCount = 0; + + //Count GPS SVs for saparating GPS from GLONASS and throw others + + for(svNumber=1; svNumber <= svCount; svNumber++) { + if( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START)&& + (svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) ) + { + gpsCount++; + } + else if( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) && + (svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) ) + { + glnCount++; + } + } + + // ------------------ + // ------$GPGSV------ + // ------------------ + + if (gpsCount <= 0) + { + // no svs in view, so just send a blank $GPGSV sentence + strlcpy(sentence, "$GPGSV,1,1,0,", sizeof(sentence)); + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + } + else + { + svNumber = 1; + sentenceNumber = 1; + sentenceCount = gpsCount/4 + (gpsCount % 4 != 0); + + while (sentenceNumber <= sentenceCount) + { + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + length = snprintf(pMarker, lengthRemaining, "$GPGSV,%d,%d,%02d", + sentenceCount, sentenceNumber, gpsCount); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++) + { + if( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START) && + (svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) ) + { + length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", + svStatus.sv_list[svNumber-1].prn, + (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int + (int)(0.5 + svStatus.sv_list[svNumber-1].azimuth)); //float to int + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (svStatus.sv_list[svNumber-1].snr > 0) + { + length = snprintf(pMarker, lengthRemaining,"%02d", + (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + } + + i++; + } + + } + + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + sentenceNumber++; + + } //while + + } //if + + // ------------------ + // ------$GLGSV------ + // ------------------ + + if (glnCount <= 0) + { + // no svs in view, so just send a blank $GLGSV sentence + strlcpy(sentence, "$GLGSV,1,1,0,", sizeof(sentence)); + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + } + else + { + svNumber = 1; + sentenceNumber = 1; + sentenceCount = glnCount/4 + (glnCount % 4 != 0); + + while (sentenceNumber <= sentenceCount) + { + pMarker = sentence; + lengthRemaining = sizeof(sentence); + + length = snprintf(pMarker, lengthRemaining, "$GLGSV,%d,%d,%02d", + sentenceCount, sentenceNumber, glnCount); + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++) + { + if( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) && + (svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) ) { + + length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,", + svStatus.sv_list[svNumber-1].prn, + (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int + (int)(0.5 + svStatus.sv_list[svNumber-1].azimuth)); //float to int + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + + if (svStatus.sv_list[svNumber-1].snr > 0) + { + length = snprintf(pMarker, lengthRemaining,"%02d", + (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int + + if (length < 0 || length >= lengthRemaining) + { + LOC_LOGE("NMEA Error in string formatting"); + return; + } + pMarker += length; + lengthRemaining -= length; + } + + i++; + } + + } + + length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence)); + loc_eng_nmea_send(sentence, length, loc_eng_data_p); + sentenceNumber++; + + } //while + + }//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); + + 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); + } + 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; + } + + } + + EXIT_LOG(%d, 0); +} diff --git a/gps/libloc_api_50001/loc_eng_nmea.h b/gps/libloc_api_50001/loc_eng_nmea.h new file mode 100644 index 0000000..40c6dbb --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_nmea.h @@ -0,0 +1,42 @@ +/* Copyright (c) 2012, 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_ENG_NMEA_H +#define LOC_ENG_NMEA_H + +#include + +#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_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/libloc_api_50001/loc_eng_xtra.cpp b/gps/libloc_api_50001/loc_eng_xtra.cpp new file mode 100644 index 0000000..7bb8083 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_xtra.cpp @@ -0,0 +1,213 @@ +/* Copyright (c) 2009-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_eng" + +#include +#include +#include "log_util.h" +#include "platform_lib_includes.h" + +using namespace loc_core; + +struct LocEngRequestXtraServer : public LocMsg { + LocEngAdapter* mAdapter; + inline LocEngRequestXtraServer(LocEngAdapter* adapter) : + LocMsg(), mAdapter(adapter) + { + locallog(); + } + inline virtual void proc() const { + mAdapter->requestXtraServer(); + } + inline void locallog() const { + LOC_LOGV("LocEngRequestXtraServer"); + } + inline virtual void log() const { + locallog(); + } +}; + +struct LocEngInjectXtraData : public LocMsg { + LocEngAdapter* mAdapter; + char* mData; + const int mLen; + inline LocEngInjectXtraData(LocEngAdapter* adapter, + char* data, int len): + LocMsg(), mAdapter(adapter), + mData(new char[len]), mLen(len) + { + memcpy((void*)mData, (void*)data, len); + locallog(); + } + inline ~LocEngInjectXtraData() + { + delete[] mData; + } + inline virtual void proc() const { + mAdapter->setXtraData(mData, mLen); + } + inline void locallog() const { + LOC_LOGV("length: %d\n data: %p", mLen, mData); + } + inline virtual void log() const { + locallog(); + } +}; + +struct LocEngSetXtraVersionCheck : public LocMsg { + LocEngAdapter *mAdapter; + int mCheck; + inline LocEngSetXtraVersionCheck(LocEngAdapter* adapter, + int check): + mAdapter(adapter), mCheck(check) {} + inline virtual void proc() const { + locallog(); + mAdapter->setXtraVersionCheck(mCheck); + } + inline void locallog() const { + LOC_LOGD("%s:%d]: mCheck: %d", + __func__, __LINE__, mCheck); + } + inline virtual void log() const { + locallog(); + } +}; + +/*=========================================================================== +FUNCTION loc_eng_xtra_init + +DESCRIPTION + Initialize XTRA module. + +DEPENDENCIES + N/A + +RETURN VALUE + 0: success + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data, + GpsXtraExtCallbacks* callbacks) +{ + int ret_val = -1; + loc_eng_xtra_data_s_type *xtra_module_data_ptr; + ENTRY_LOG(); + + if(callbacks == NULL) { + LOC_LOGE("loc_eng_xtra_init: failed, cb is NULL"); + } else { + xtra_module_data_ptr = &loc_eng_data.xtra_module_data; + xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb; + xtra_module_data_ptr->report_xtra_server_cb = callbacks->report_xtra_server_cb; + + ret_val = 0; + } + EXIT_LOG(%d, ret_val); + return ret_val; +} + +/*=========================================================================== +FUNCTION loc_eng_xtra_inject_data + +DESCRIPTION + Injects XTRA file into the engine but buffers the data if engine is busy. + +DEPENDENCIES + N/A + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data, + char* data, int length) +{ + ENTRY_LOG(); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length)); + EXIT_LOG(%d, 0); + return 0; +} +/*=========================================================================== +FUNCTION loc_eng_xtra_request_server + +DESCRIPTION + Request the Xtra server url from the modem + +DEPENDENCIES + N/A + +RETURN VALUE + 0 + +SIDE EFFECTS + N/A + +===========================================================================*/ +int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data) +{ + ENTRY_LOG(); + LocEngAdapter* adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngRequestXtraServer(adapter)); + EXIT_LOG(%d, 0); + return 0; +} +/*=========================================================================== +FUNCTION loc_eng_xtra_version_check + +DESCRIPTION + Injects the enable/disable value for checking XTRA version + that is specified in gps.conf + +DEPENDENCIES + N/A + +RETURN VALUE + none + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_eng_xtra_version_check(loc_eng_data_s_type &loc_eng_data, + int check) +{ + ENTRY_LOG(); + LocEngAdapter *adapter = loc_eng_data.adapter; + adapter->sendMsg(new LocEngSetXtraVersionCheck(adapter, check)); + EXIT_LOG(%d, 0); +} diff --git a/gps/libloc_api_50001/loc_eng_xtra.h b/gps/libloc_api_50001/loc_eng_xtra.h new file mode 100644 index 0000000..175f497 --- /dev/null +++ b/gps/libloc_api_50001/loc_eng_xtra.h @@ -0,0 +1,47 @@ +/* Copyright (c) 2009,2011 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_ENG_XTRA_H +#define LOC_ENG_XTRA_H + +#include + +// Module data +typedef struct +{ + // loc_eng_ioctl_cb_data_s_type ioctl_cb_data; + gps_xtra_download_request download_request_cb; + report_xtra_server report_xtra_server_cb; + + // XTRA data buffer + char *xtra_data_for_injection; // NULL if no pending data + int xtra_data_len; +} loc_eng_xtra_data_s_type; + +#endif // LOC_ENG_XTRA_H diff --git a/gps/loc_api/ds_api/Android.mk b/gps/loc_api/ds_api/Android.mk new file mode 100644 index 0000000..18ab617 --- /dev/null +++ b/gps/loc_api/ds_api/Android.mk @@ -0,0 +1,49 @@ +ifneq ($(QCPATH),) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_ds_api + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libqmi_cci \ + libqmi_csi \ + libqmi_common_so \ + libgps.utils \ + libdsi_netctrl \ + libqmiservices + + +LOCAL_SRC_FILES += \ + ds_client.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_COPY_HEADERS_TO:= libloc_ds_api/ + +LOCAL_COPY_HEADERS:= \ + ds_client.h + +LOCAL_LDFLAGS += -Wl,--export-dynamic + +## Includes +LOCAL_C_INCLUDES := \ + $(TARGET_OUT_HEADERS)/libloc_eng \ + $(TARGET_OUT_HEADERS)/qmi-framework/inc \ + $(TARGET_OUT_HEADERS)/qmi/inc \ + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/data/inc + + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/gps/loc_api/ds_api/ds_client.c b/gps/loc_api/ds_api/ds_client.c new file mode 100644 index 0000000..e31f2af --- /dev/null +++ b/gps/loc_api/ds_api/ds_client.c @@ -0,0 +1,740 @@ +/* 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. + */ + +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_ds_client" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +//Timeout to wait for wds service notification from qmi +#define DS_CLIENT_SERVICE_TIMEOUT (4000) +//Max timeout for the service to come up +#define DS_CLIENT_SERVICE_TIMEOUT_TOTAL (40000) +//Timeout for the service to respond to sync msg +#define DS_CLIENT_SYNC_MSG_TIMEOUT (5000) +/*Request messages the WDS client can send to the WDS service*/ +typedef union +{ + /*Requests the service for a list of all profiles present*/ + wds_get_profile_list_req_msg_v01 *p_get_profile_list_req; + /*Requests the service for a profile's settings*/ + wds_get_profile_settings_req_msg_v01 *p_get_profile_settings_req; +}ds_client_req_union_type; + +/*Response indications that are sent by the WDS service*/ +typedef union +{ + wds_get_profile_list_resp_msg_v01 *p_get_profile_list_resp; + wds_get_profile_settings_resp_msg_v01 *p_get_profile_setting_resp; +}ds_client_resp_union_type; + +struct event_strings_s +{ + char * str; + dsi_net_evt_t evt; +}; + +struct event_strings_s event_string_tbl[DSI_EVT_MAX] = +{ + NAME_VAL(DSI_EVT_INVALID), + NAME_VAL(DSI_EVT_NET_IS_CONN), + NAME_VAL(DSI_EVT_NET_NO_NET), + NAME_VAL(DSI_EVT_PHYSLINK_DOWN_STATE), + NAME_VAL(DSI_EVT_PHYSLINK_UP_STATE), + NAME_VAL(DSI_EVT_NET_RECONFIGURED), + NAME_VAL(DSI_EVT_WDS_CONNECTED) +}; + +typedef struct +{ + ds_client_event_ind_cb_type event_cb; + void *caller_cookie; +}ds_caller_data; + +typedef struct { + //Global dsi handle + dsi_hndl_t dsi_net_handle; + //Handle to caller's data + ds_caller_data caller_data; +} ds_client_session_data; + +void net_ev_cb(dsi_hndl_t handle, void* user_data, + dsi_net_evt_t evt, dsi_evt_payload_t *payload_ptr) +{ + int i; + (void)handle; + (void)user_data; + (void)payload_ptr; + ds_caller_data *callback_data = (ds_caller_data *)user_data; + + LOC_LOGD("%s:%d]: Enter. Callback data: %p\n", __func__, __LINE__, callback_data); + if(evt > DSI_EVT_INVALID && evt < DSI_EVT_MAX) + { + for(i=0;ievent_cb(E_DS_CLIENT_DATA_CALL_CONNECTED, + callback_data->caller_cookie); + break; + } + case DSI_EVT_NET_NO_NET: + { + LOC_LOGD("%s:%d]: Emergency call stopped\n", __func__, __LINE__); + callback_data->event_cb(E_DS_CLIENT_DATA_CALL_DISCONNECTED, + callback_data->caller_cookie); + break; + } + default: + LOC_LOGD("%s:%d]: uninteresting event\n", __func__, __LINE__); + } + } + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); +} + +/*This function is called to obtain a handle to the QMI WDS service*/ +static ds_client_status_enum_type +ds_client_qmi_ctrl_point_init(qmi_client_type *p_wds_qmi_client) +{ + qmi_client_type wds_qmi_client, notifier = NULL; + ds_client_status_enum_type status = E_DS_CLIENT_SUCCESS; + qmi_service_info *p_service_info = NULL; + uint32_t num_services = 0, num_entries = 0; + qmi_client_error_type ret = QMI_NO_ERR; + unsigned char no_signal = 0; + qmi_client_os_params os_params; + int timeout = 0; + + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + + //Get service object for QMI_WDS service + qmi_idl_service_object_type ds_client_service_object = + wds_get_service_object_v01(); + if(ds_client_service_object == NULL) { + LOC_LOGE("%s:%d]: wds_get_service_object_v01 failed\n" , + __func__, __LINE__); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + + //get service addressing information + ret = qmi_client_get_service_list(ds_client_service_object, NULL, NULL, + &num_services); + LOC_LOGD("%s:%d]: qmi_client_get_service_list() first try ret %d, " + "num_services %d]\n", __func__, __LINE__, ret, num_services); + if(ret != QMI_NO_ERR) { + //Register for service notification + ret = qmi_client_notifier_init(ds_client_service_object, &os_params, ¬ifier); + if (ret != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", + __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + + do { + QMI_CCI_OS_SIGNAL_CLEAR(&os_params); + ret = qmi_client_get_service_list(ds_client_service_object, NULL, + NULL, &num_services); + if(ret != QMI_NO_ERR) { + QMI_CCI_OS_SIGNAL_WAIT(&os_params, DS_CLIENT_SERVICE_TIMEOUT); + no_signal = QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params); + if(!no_signal) + ret = qmi_client_get_service_list(ds_client_service_object, NULL, + NULL, &num_services); + } + timeout += DS_CLIENT_SERVICE_TIMEOUT; + LOC_LOGV("%s:%d]: qmi_client_get_service_list() returned ret: %d," + "no_signal: %d, total timeout: %d\n", __func__, __LINE__, + ret, no_signal, timeout); + } while( (timeout < DS_CLIENT_SERVICE_TIMEOUT_TOTAL) && + no_signal && + (ret != QMI_NO_ERR) ); + } + + //Handle failure cases + if(num_services == 0 || ret != QMI_NO_ERR) { + if(!no_signal) { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed even though" + "service is up! Error: %d \n", __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_INTERNAL; + } + else { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed after retries" + "Error: %d \n", __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_TIMEOUT; + } + goto err; + } + + LOC_LOGD("%s:%d]: qmi_client_get_service_list succeeded\n", __func__, __LINE__); + + //Success + p_service_info = (qmi_service_info *)malloc(num_services * sizeof(qmi_service_info)); + if(p_service_info == NULL) { + LOC_LOGE("%s:%d]: could not allocate memory for serviceInfo !!\n", + __func__, __LINE__); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + num_entries = num_services; + + //Populate service info + ret = qmi_client_get_service_list(ds_client_service_object, p_service_info, + &num_entries, &num_services); + if(ret != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_get_service_list failed. ret: %d \n", + __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + + //Initialize wds_qmi_client + LOC_LOGD("%s:%d]: Initializing WDS client with qmi_client_init\n", __func__, + __LINE__); + ret = qmi_client_init(&p_service_info[0], ds_client_service_object, + NULL, NULL, NULL, &wds_qmi_client); + if(ret != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_init Error. ret: %d\n", __func__, __LINE__, ret); + status = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + LOC_LOGD("%s:%d]: WDS client initialized with qmi_client_init\n", __func__, + __LINE__); + + //Store WDS QMI client handle in the parameter passed in + *p_wds_qmi_client = wds_qmi_client; + + status = E_DS_CLIENT_SUCCESS; + LOC_LOGD("%s:%d]: init success\n", __func__, __LINE__); + + if(notifier) + qmi_client_release(notifier); + +err: + if(p_service_info) + free(p_service_info); + + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return status; +} + +/*This function reads the error code from within the response struct*/ +static ds_client_status_enum_type ds_client_convert_qmi_response( + uint32_t req_id, + ds_client_resp_union_type *resp_union) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + switch(req_id) + { + case QMI_WDS_GET_PROFILE_LIST_REQ_V01 : + { + if(resp_union->p_get_profile_list_resp->resp.error != + QMI_ERR_NONE_V01) { + LOC_LOGE("%s:%d]: Response error: %d", __func__, __LINE__, + resp_union->p_get_profile_list_resp->resp.error); + } + else + ret = E_DS_CLIENT_SUCCESS; + } + break; + + case QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01 : + { + if(resp_union->p_get_profile_setting_resp->resp.error != + QMI_ERR_NONE_V01) { + LOC_LOGE("%s:%d]: Response error: %d", __func__, __LINE__, + resp_union->p_get_profile_setting_resp->resp.error); + } + else + ret = E_DS_CLIENT_SUCCESS; + } + break; + + default: + LOC_LOGE("%s:%d]: Unknown request ID\n", __func__, __LINE__); + } + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + + +static ds_client_status_enum_type ds_client_send_qmi_sync_req( + qmi_client_type *ds_client_handle, + uint32_t req_id, + ds_client_resp_union_type *resp_union, + ds_client_req_union_type *req_union) +{ + uint32_t req_len = 0; + uint32_t resp_len = 0; + ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; + qmi_client_error_type qmi_ret = QMI_NO_ERR; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + switch(req_id) + { + case QMI_WDS_GET_PROFILE_LIST_REQ_V01 : + { + req_len = sizeof(wds_get_profile_list_req_msg_v01); + resp_len = sizeof(wds_get_profile_list_resp_msg_v01); + LOC_LOGD("%s:%d]: req_id = GET_PROFILE_LIST_REQ\n", + __func__, __LINE__); + } + break; + + case QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01 : + { + req_len = sizeof(wds_get_profile_settings_req_msg_v01); + resp_len = sizeof(wds_get_profile_settings_resp_msg_v01); + LOC_LOGD("%s:%d]: req_id = GET_PROFILE_SETTINGS_REQ\n", + __func__, __LINE__); + } + break; + + default: + LOC_LOGE("%s:%d]: Error unknown req_id=%d\n", __func__, __LINE__, + req_id); + ret = E_DS_CLIENT_FAILURE_INVALID_PARAMETER; + goto err; + } + + LOC_LOGD("%s:%d]: req_id=%d, len = %d; resp_len= %d\n", __func__, __LINE__, + req_id, req_len, resp_len); + //Send msg through QCCI + qmi_ret = qmi_client_send_msg_sync( + *ds_client_handle, + req_id, + (void *)req_union->p_get_profile_list_req, + req_len, + (void *)resp_union->p_get_profile_list_resp, + resp_len, + DS_CLIENT_SYNC_MSG_TIMEOUT); + LOC_LOGD("%s:%d]: qmi_client_send_msg_sync returned: %d", __func__, __LINE__, qmi_ret); + + if(qmi_ret != QMI_NO_ERR) { + ret = E_DS_CLIENT_FAILURE_INTERNAL; + goto err; + } + + ret = ds_client_convert_qmi_response(req_id, resp_union); + +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + +/*This function obtains the list of supported profiles*/ +static ds_client_status_enum_type ds_client_get_profile_list( + qmi_client_type *ds_client_handle, + ds_client_resp_union_type *profile_list_resp_msg, + wds_profile_type_enum_v01 profile_type) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; + ds_client_req_union_type req_union; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + + req_union.p_get_profile_list_req = NULL; + req_union.p_get_profile_list_req = (wds_get_profile_list_req_msg_v01 *) + calloc(1, sizeof(wds_get_profile_list_req_msg_v01)); + if(req_union.p_get_profile_list_req == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory for" + "wds_get_profile_list_req_msg_v01\n", __func__, __LINE__); + goto err; + } + //Populate required members of the request structure + req_union.p_get_profile_list_req->profile_type_valid = 1; + req_union.p_get_profile_list_req->profile_type = profile_type; + ret = ds_client_send_qmi_sync_req(ds_client_handle, + QMI_WDS_GET_PROFILE_LIST_REQ_V01, + profile_list_resp_msg, &req_union); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_send_qmi_req failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + if(req_union.p_get_profile_list_req) + free(req_union.p_get_profile_list_req); + return ret; +} + +/*This function obtains settings for the profile specified by + the profile_identifier*/ +static ds_client_status_enum_type ds_client_get_profile_settings( + qmi_client_type *ds_client_handle, + ds_client_resp_union_type *profile_settings_resp_msg, + wds_profile_identifier_type_v01 *profile_identifier) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; + ds_client_req_union_type req_union; + + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + //Since it's a union containing a pointer to a structure, + //following entities have the same address + //- req_union + //- req_union.p_get_profile_settings_req + //- req_union.p_get_profile_settings_req->profile + //so we can very well assign req_union = profile_identifier + req_union.p_get_profile_settings_req = + (wds_get_profile_settings_req_msg_v01 *)profile_identifier; + ret = ds_client_send_qmi_sync_req(ds_client_handle, + QMI_WDS_GET_PROFILE_SETTINGS_REQ_V01, + profile_settings_resp_msg, &req_union); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_send_qmi_req failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + +/* + Starts data call using the handle and the profile index +*/ +ds_client_status_enum_type +ds_client_start_call(dsClientHandleType client_handle, int profile_index, int pdp_type) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL; + dsi_call_param_value_t param_info; + dsi_hndl_t dsi_handle; + ds_client_session_data *ds_global_data = (ds_client_session_data *)client_handle; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + if(ds_global_data == NULL) { + LOC_LOGE("%s:%d]: Null callback parameter\n", __func__, __LINE__); + goto err; + } + dsi_handle = ds_global_data->dsi_net_handle; + //Set profile index as call parameter + param_info.buf_val = NULL; + param_info.num_val = profile_index; + dsi_set_data_call_param(dsi_handle, + DSI_CALL_INFO_UMTS_PROFILE_IDX, + ¶m_info); + + //Set IP Version as call parameter + param_info.buf_val = NULL; + param_info.num_val = pdp_type; + dsi_set_data_call_param(dsi_handle, + DSI_CALL_INFO_IP_VERSION, + ¶m_info); + LOC_LOGD("%s:%d]: Starting emergency call with profile index %d; pdp_type:%d\n", + __func__, __LINE__, profile_index, pdp_type); + if(dsi_start_data_call(dsi_handle) == DSI_SUCCESS) { + LOC_LOGD("%s:%d]: Sent request to start data call\n", + __func__, __LINE__); + ret = E_DS_CLIENT_SUCCESS; + } + else { + LOC_LOGE("%s:%d]: Could not send req to start data call \n", __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + goto err; + } + +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; + +} + +/*Function to open an emergency call. Does the following things: + - Obtains a handle to the WDS service + - Obtains a list of profiles configured in the modem + - Queries each profile and obtains settings to check if emergency calls + are supported + - Returns the profile index that supports emergency calls + - Returns handle to dsi_netctrl*/ +ds_client_status_enum_type +ds_client_open_call(dsClientHandleType *client_handle, + ds_client_cb_data *callback, + void *caller_cookie, + int *profile_index, + int *pdp_type) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_FAILURE_GENERAL; + ds_client_resp_union_type profile_list_resp_msg; + ds_client_resp_union_type profile_settings_resp_msg; + wds_profile_identifier_type_v01 profile_identifier; + uint32_t i=0; + dsi_hndl_t dsi_handle; + ds_client_session_data **ds_global_data = (ds_client_session_data **)client_handle; + unsigned char call_profile_index_found = 0; + uint32_t emergency_profile_index=0; + qmi_client_type wds_qmi_client; + + profile_list_resp_msg.p_get_profile_list_resp = NULL; + profile_settings_resp_msg.p_get_profile_setting_resp = NULL; + + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + if(callback == NULL || ds_global_data == NULL) { + LOC_LOGE("%s:%d]: Null callback parameter\n", __func__, __LINE__); + goto err; + } + + ret = ds_client_qmi_ctrl_point_init(&wds_qmi_client); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_qmi_ctrl_point_init failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } + + //Allocate memory for the response msg to obtain a list of profiles + profile_list_resp_msg.p_get_profile_list_resp = (wds_get_profile_list_resp_msg_v01 *) + calloc(1, sizeof(wds_get_profile_list_resp_msg_v01)); + if(profile_list_resp_msg.p_get_profile_list_resp == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory for" + "p_get_profile_list_resp\n", __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY; + goto err; + } + + LOC_LOGD("%s:%d]: Getting profile list\n", __func__, __LINE__); + ret = ds_client_get_profile_list(&wds_qmi_client, + &profile_list_resp_msg, + WDS_PROFILE_TYPE_3GPP_V01); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_get_profile_list failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } + LOC_LOGD("%s:%d]: Got profile list; length = %d\n", __func__, __LINE__, + profile_list_resp_msg.p_get_profile_list_resp->profile_list_len); + + //Allocate memory for the response msg to obtain profile settings + //We allocate memory for only one response msg and keep re-using it + profile_settings_resp_msg.p_get_profile_setting_resp = + (wds_get_profile_settings_resp_msg_v01 *) + calloc(1, sizeof(wds_get_profile_settings_resp_msg_v01)); + if(profile_settings_resp_msg.p_get_profile_setting_resp == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory for" + "p_get_profile_setting_resp\n", __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY; + goto err; + } + + //Loop over the list of profiles to find a profile that supports + //emergency calls + for(i=0; i < profile_list_resp_msg.p_get_profile_list_resp->profile_list_len; i++) { + /*QMI_WDS_GET_PROFILE_SETTINGS_REQ requires an input data + structure that is of type wds_profile_identifier_type_v01 + We have to fill that structure for each profile from the + info obtained from the profile list*/ + //copy profile type + profile_identifier.profile_type = + profile_list_resp_msg.p_get_profile_list_resp->profile_list[i].profile_type; + //copy profile index + profile_identifier.profile_index = + profile_list_resp_msg.p_get_profile_list_resp->profile_list[i].profile_index; + + ret = ds_client_get_profile_settings(&wds_qmi_client, + &profile_settings_resp_msg, + &profile_identifier); + if(ret != E_DS_CLIENT_SUCCESS) { + LOC_LOGE("%s:%d]: ds_client_get_profile_settings failed. ret: %d\n", + __func__, __LINE__, ret); + goto err; + } + LOC_LOGD("%s:%d]: Got profile setting for profile %d; name: %s\n", + __func__, __LINE__, i, + profile_settings_resp_msg.p_get_profile_setting_resp->profile_name); + + if(profile_settings_resp_msg.p_get_profile_setting_resp->support_emergency_calls_valid) { + if(profile_settings_resp_msg.p_get_profile_setting_resp->support_emergency_calls) { + LOC_LOGD("%s:%d]: Found emergency profile in profile %d" + , __func__, __LINE__, i); + call_profile_index_found = 1; + emergency_profile_index = profile_identifier.profile_index; + + if(profile_settings_resp_msg.p_get_profile_setting_resp->pdp_type_valid) { + *pdp_type = (int)profile_settings_resp_msg.p_get_profile_setting_resp->pdp_type; + LOC_LOGD("%s:%d]: pdp_type: %d\n", __func__, __LINE__, *pdp_type); + switch(*pdp_type) { + case WDS_PDP_TYPE_PDP_IPV4_V01: + *pdp_type = DSI_IP_VERSION_4; + break; + case WDS_PDP_TYPE_PDP_IPV6_V01: + *pdp_type = DSI_IP_VERSION_6; + break; + case WDS_PDP_TYPE_PDP_IPV4V6_V01: + *pdp_type = DSI_IP_VERSION_4_6; + break; + default: + LOC_LOGE("%s:%d]: pdp_type unknown. Setting default as ipv4/v6\n", + __func__, __LINE__); + *pdp_type = DSI_IP_VERSION_4; + + } + } + else { + LOC_LOGD("%s:%d]: pdp type not valid in profile setting. Default ipv4\n", + __func__, __LINE__); + *pdp_type = DSI_IP_VERSION_4; + } + //Break out of for loop since we found the emergency profile + break; + } + else + LOC_LOGE("%s:%d]: Emergency profile valid but not supported in profile: %d " + , __func__, __LINE__, i); + } + //Since this struct is loaded with settings for the next profile, + //it is important to clear out the memory to avoid values/flags + //from being carried over + memset((void *)profile_settings_resp_msg.p_get_profile_setting_resp, + 0, sizeof(wds_get_profile_settings_resp_msg_v01)); + } + + //Release qmi client handle + if(qmi_client_release(wds_qmi_client) != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: Could not release qmi client handle\n", + __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + } + + if(call_profile_index_found) { + *profile_index = emergency_profile_index; + *ds_global_data = (ds_client_session_data *)calloc(1, sizeof(ds_client_session_data)); + if(*ds_global_data == NULL) { + LOC_LOGE("%s:%d]: Could not allocate memory for ds_global_data. Failing\n", + __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY; + goto err; + } + + (*ds_global_data)->caller_data.event_cb = callback->event_cb; + (*ds_global_data)->caller_data.caller_cookie = caller_cookie; + dsi_handle = dsi_get_data_srvc_hndl(net_ev_cb, &(*ds_global_data)->caller_data); + if(dsi_handle == NULL) { + LOC_LOGE("%s:%d]: Could not get data handle. Retry Later\n", + __func__, __LINE__); + ret = E_DS_CLIENT_RETRY_LATER; + goto err; + } + else + (*ds_global_data)->dsi_net_handle = dsi_handle; + } + else { + LOC_LOGE("%s:%d]: Could not find a profile that supports emergency calls", + __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + } +err: + if(profile_list_resp_msg.p_get_profile_list_resp) + free(profile_list_resp_msg.p_get_profile_list_resp); + if(profile_settings_resp_msg.p_get_profile_setting_resp) + free(profile_settings_resp_msg.p_get_profile_setting_resp); + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + +ds_client_status_enum_type ds_client_stop_call(dsClientHandleType client_handle) +{ + ds_client_status_enum_type ret = E_DS_CLIENT_SUCCESS; + ds_client_session_data *p_ds_global_data = (ds_client_session_data *)client_handle; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + + if(client_handle == NULL) { + LOC_LOGE("%s:%d]: Null argument received. Failing\n", __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + goto err; + } + + if(dsi_stop_data_call(p_ds_global_data->dsi_net_handle) == DSI_SUCCESS) { + LOC_LOGD("%s:%d]: Sent request to stop data call\n", __func__, __LINE__); + } + else { + LOC_LOGE("%s:%d]: Could not send request to stop data call\n", + __func__, __LINE__); + ret = E_DS_CLIENT_FAILURE_GENERAL; + goto err; + } + +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} + +/* + Stops data call associated with the data handle +*/ +void ds_client_close_call(dsClientHandleType *client_handle) +{ + ds_client_session_data **ds_global_data = (ds_client_session_data **)client_handle; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + if(client_handle == NULL || *client_handle == NULL) { + LOC_LOGE("%s:%d]: Null argument received. Failing\n", __func__, __LINE__); + goto err; + } + dsi_rel_data_srvc_hndl((*ds_global_data)->dsi_net_handle); + (*ds_global_data)->dsi_net_handle = NULL; + free(*ds_global_data); + *ds_global_data = NULL; + LOC_LOGD("%s:%d]: Released Data handle\n", __func__, __LINE__); +err: + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return; +} + +int ds_client_init() +{ + int ret = 0; + LOC_LOGD("%s:%d]:Enter\n", __func__, __LINE__); + if(DSI_SUCCESS != dsi_init(DSI_MODE_GENERAL)) + { + LOC_LOGE("%s:%d]:dsi_init failed\n", __func__, __LINE__); + ret = -1; + } + LOC_LOGD("%s:%d]:Exit\n", __func__, __LINE__); + return ret; +} diff --git a/gps/loc_api/ds_api/ds_client.h b/gps/loc_api/ds_api/ds_client.h new file mode 100644 index 0000000..71ec770 --- /dev/null +++ b/gps/loc_api/ds_api/ds_client.h @@ -0,0 +1,144 @@ +/* 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. + */ + +#ifndef _DS_CLIENT_H_ +#define _DS_CLIENT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* dsClientHandleType; + +typedef enum +{ + E_DS_CLIENT_SUCCESS = 0, + /**< Request was successful. */ + + E_DS_CLIENT_FAILURE_GENERAL = 1, + /**< Failed because of a general failure. */ + + E_DS_CLIENT_FAILURE_UNSUPPORTED = 2, + /**< Failed because the service does not support the command. */ + + E_DS_CLIENT_FAILURE_INVALID_PARAMETER = 3, + /**< Failed because the request contained invalid parameters. */ + + E_DS_CLIENT_FAILURE_ENGINE_BUSY = 4, + /**< Failed because the engine is busy. */ + + E_DS_CLIENT_FAILURE_PHONE_OFFLINE = 5, + /**< Failed because the phone is offline. */ + + E_DS_CLIENT_FAILURE_TIMEOUT = 6, + /**< Failed because of a timeout. */ + + E_DS_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, + /**< Failed because the service is not present. */ + + E_DS_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, + /**< Failed because the service version is unsupported. */ + + E_DS_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, + /**< Failed because the service does not support client version. */ + + E_DS_CLIENT_FAILURE_INVALID_HANDLE = 10, + /**< Failed because an invalid handle was specified. */ + + E_DS_CLIENT_FAILURE_INTERNAL = 11, + /**< Failed because of an internal error in the service. */ + + E_DS_CLIENT_FAILURE_NOT_INITIALIZED = 12, + /**< Failed because the service has not been initialized. */ + + E_DS_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13, + /**< Failed because not rnough memory to do the operation.*/ + + E_DS_CLIENT_SERVICE_ALREADY_STARTED = 14, + /*Service is already started*/ + + E_DS_CLIENT_DATA_CALL_CONNECTED = 15, + + E_DS_CLIENT_DATA_CALL_DISCONNECTED = 16, + + E_DS_CLIENT_RETRY_LATER = 17 +}ds_client_status_enum_type; + +typedef enum { + DATA_CALL_NONE = 0, + DATA_CALL_OPEN, + DATA_CALL_CLOSE +}data_call_request_enum_type; + +typedef void (*ds_client_event_ind_cb_type)(ds_client_status_enum_type result, + void* loc_adapter_cookie); +typedef struct { + ds_client_event_ind_cb_type event_cb; +}ds_client_cb_data; + +/* + This function is to be called as a first step by each process that + needs to use data services. This call internally calls dsi_init() + and prepares the module for making data calls. + Needs to be called once for every process +*/ +int ds_client_init(); + +/* + Obtains a handle to the dsi_netctrl layer and looks up the profile + to make the call. As of now. It only searches for profiles that + support emergency calls + */ +ds_client_status_enum_type ds_client_open_call(dsClientHandleType *client_handle, + ds_client_cb_data *callback, + void *loc_adapter_cookie, + int *profile_index, + int *pdp_type); + +/* + Starts a data call using the profile number provided + */ +ds_client_status_enum_type ds_client_start_call(dsClientHandleType client_handle, + int profile_index, + int pdp_type); + +/* + Stops a data call associated with the handle +*/ +ds_client_status_enum_type ds_client_stop_call(dsClientHandleType client_handle); + +/* + Releases the handle used for making data calls +*/ +void ds_client_close_call(dsClientHandleType *client_handle); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/gps/loc_api/loc_api_v02/Android.mk b/gps/loc_api/loc_api_v02/Android.mk new file mode 100644 index 0000000..58b21e1 --- /dev/null +++ b/gps/loc_api/loc_api_v02/Android.mk @@ -0,0 +1,55 @@ +ifneq ($(QCPATH),) + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libloc_api_v02 + +LOCAL_MODULE_TAGS := optional + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + libqmi_cci \ + libqmi_csi \ + libqmi_common_so \ + libloc_core \ + libgps.utils \ + libloc_ds_api + +LOCAL_SRC_FILES = \ + LocApiV02.cpp \ + loc_api_v02_log.c \ + loc_api_v02_client.c \ + loc_api_sync_req.c \ + location_service_v02.c + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +LOCAL_COPY_HEADERS_TO:= libloc_api_v02/ + +LOCAL_COPY_HEADERS:= \ + location_service_v02.h \ + loc_api_v02_log.h \ + loc_api_v02_client.h \ + loc_api_sync_req.h \ + LocApiV02.h \ + loc_util_log.h + + +## Includes +LOCAL_C_INCLUDES := \ + $(TARGET_OUT_HEADERS)/libloc_core \ + $(TARGET_OUT_HEADERS)/qmi-framework/inc \ + $(TARGET_OUT_HEADERS)/qmi/inc \ + $(TARGET_OUT_HEADERS)/gps.utils \ + $(TARGET_OUT_HEADERS)/libloc_ds_api + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) + +endif # not BUILD_TINY_ANDROID diff --git a/gps/loc_api/loc_api_v02/LocApiV02.cpp b/gps/loc_api/loc_api_v02/LocApiV02.cpp new file mode 100644 index 0000000..6791129 --- /dev/null +++ b/gps/loc_api/loc_api_v02/LocApiV02.cpp @@ -0,0 +1,3032 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundatoin, 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_NDEBUG 0 +#define LOG_TAG "LocSvc_ApiV02" + +#include +#include +#include +#include + +#include + +#ifndef USE_GLIB +#include +#endif /* USE_GLIB */ +#include +#include +#include +#include +#include +#include "platform_lib_includes.h" + +using namespace loc_core; + +/* Default session id ; TBD needs incrementing for each */ +#define LOC_API_V02_DEF_SESSION_ID (1) + +/* UMTS CP Address key*/ +#define LOC_NI_NOTIF_KEY_ADDRESS "Address" + +/* GPS SV Id offset */ +#define GPS_SV_ID_OFFSET (1) + +/* GLONASS SV Id offset */ +#define GLONASS_SV_ID_OFFSET (65) + +/* SV ID range */ +#define SV_ID_RANGE (32) + + +#define BDS_SV_ID_OFFSET (201) + +/* BeiDou SV ID RANGE*/ +#define BDS_SV_ID_RANGE QMI_LOC_DELETE_MAX_BDS_SV_INFO_LENGTH_V02 + +/* static event callbacks that call the LocApiV02 callbacks*/ + +/* global event callback, call the eventCb function in loc api adapter v02 + instance */ +static void globalEventCb(locClientHandleType clientHandle, + uint32_t eventId, + const locClientEventIndUnionType eventPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(eventId)); + LocApiV02 *locApiV02Instance = + (LocApiV02 *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, event id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, eventId, pClientCookie); + + // return if null is passed + if( NULL == locApiV02Instance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, event id = %d\n", + __func__, __LINE__, clientHandle, eventId); + return; + } + locApiV02Instance->eventCb(clientHandle, eventId, eventPayload); +} + +/* global response callback, it calls the sync request process + indication function to unblock the request that is waiting on this + response indication*/ +static void globalRespCb(locClientHandleType clientHandle, + uint32_t respId, + const locClientRespIndUnionType respPayload, + void* pClientCookie) +{ + MODEM_LOG_CALLFLOW(%s, loc_get_v02_event_name(respId)); + LocApiV02 *locApiV02Instance = + (LocApiV02 *)pClientCookie; + + + LOC_LOGV ("%s:%d] client = %p, resp id = %d, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, respId, pClientCookie); + + if( NULL == locApiV02Instance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, resp id = %d\n", + __func__, __LINE__, clientHandle, respId); + return; + } + // process the sync call + // use pDeleteAssistDataInd as a dummy pointer + loc_sync_process_ind(clientHandle, respId, + (void *)respPayload.pDeleteAssistDataInd); +} + +/* global error callback, it will call the handle service down + function in the loc api adapter instance. */ +static void globalErrorCb (locClientHandleType clientHandle, + locClientErrorEnumType errorId, + void *pClientCookie) +{ + LocApiV02 *locApiV02Instance = + (LocApiV02 *)pClientCookie; + + LOC_LOGV ("%s:%d] client = %p, error id = %d\n, client cookie ptr = %p\n", + __func__, __LINE__, clientHandle, errorId, pClientCookie); + if( NULL == locApiV02Instance) + { + LOC_LOGE ("%s:%d] NULL object passed : client = %p, error id = %d\n", + __func__, __LINE__, clientHandle, errorId); + return; + } + locApiV02Instance->errorCb(clientHandle, errorId); +} + +/* global structure containing the callbacks */ +locClientCallbacksType globalCallbacks = +{ + sizeof(locClientCallbacksType), + globalEventCb, + globalRespCb, + globalErrorCb +}; + +/* Constructor for LocApiV02 */ +LocApiV02 :: LocApiV02(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase* context): + LocApiBase(msgTask, exMask, context), + clientHandle(LOC_CLIENT_INVALID_HANDLE_VALUE), + dsClientHandle(NULL) +{ + // initialize loc_sync_req interface + loc_sync_req_init(); +} + +/* Destructor for LocApiV02 */ +LocApiV02 :: ~LocApiV02() +{ + close(); +} + +LocApiBase* getLocApi(const MsgTask *msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase* context) +{ + LOC_LOGD("%s:%d]: Creating new LocApiV02", __func__, __LINE__); + return new LocApiV02(msgTask, exMask, context); +} + +/* Initialize a loc api v02 client AND + check which loc message are supported by modem */ +enum loc_api_adapter_err +LocApiV02 :: open(LOC_API_ADAPTER_EVENT_MASK_T mask) +{ + enum loc_api_adapter_err rtv = LOC_API_ADAPTER_ERR_SUCCESS; + LOC_API_ADAPTER_EVENT_MASK_T newMask = mMask | (mask & ~mExcludedMask); + locClientEventMaskType qmiMask = convertMask(newMask); + LOC_LOGD("%s:%d]: Enter mMask: %x; mask: %x; newMask: %x mQmiMask: %lld qmiMask: %lld", + __func__, __LINE__, mMask, mask, newMask, mQmiMask, qmiMask); + /* If the client is already open close it first */ + if(LOC_CLIENT_INVALID_HANDLE_VALUE == clientHandle) + { + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + + LOC_LOGV ("%s:%d]: reference to this = %p passed in \n", + __func__, __LINE__, this); + /* initialize the loc api v02 interface, note that + the locClientOpen() function will block if the + service is unavailable for a fixed time out */ + + // it is important to cap the mask here, because not all LocApi's + // can enable the same bits, e.g. foreground and bckground. + status = locClientOpen(adjustMaskForNoSession(qmiMask), &globalCallbacks, + &clientHandle, (void *)this); + mMask = newMask; + mQmiMask = qmiMask; + if (eLOC_CLIENT_SUCCESS != status || + clientHandle == LOC_CLIENT_INVALID_HANDLE_VALUE ) + { + mMask = 0; + mQmiMask = 0; + LOC_LOGE ("%s:%d]: locClientOpen failed, status = %s\n", __func__, + __LINE__, loc_get_v02_client_status_name(status)); + rtv = LOC_API_ADAPTER_ERR_FAILURE; + } else { + uint64_t supportedMsgList = 0; + const uint32_t msgArray[LOC_API_ADAPTER_MESSAGE_MAX] = + { + // For - LOC_API_ADAPTER_MESSAGE_BATCHED_GENFENCE_BREACH + QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02, + + // For - LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING + QMI_LOC_GET_BATCH_SIZE_REQ_V02 + }; + + // check the modem + status = locClientSupportMsgCheck(clientHandle, + msgArray, + LOC_API_ADAPTER_MESSAGE_MAX, + &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); + } + + // 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. + if (!registerEventMask(qmiMask)) { + // we do not update mMask here, because it did not change + // as the mask update has failed. + rtv = LOC_API_ADAPTER_ERR_FAILURE; + } + else { + mMask = newMask; + mQmiMask = qmiMask; + } + } + LOC_LOGD("%s:%d]: Exit mMask: %x; mask: %x mQmiMask: %lld qmiMask: %lld", + __func__, __LINE__, mMask, mask, mQmiMask, qmiMask); + + return rtv; +} + +bool LocApiV02 :: registerEventMask(locClientEventMaskType qmiMask) +{ + if (!mInSession) { + qmiMask = adjustMaskForNoSession(qmiMask); + } + LOC_LOGD("%s:%d]: mQmiMask=%lld qmiMask=%lld", + __func__, __LINE__, mQmiMask, qmiMask); + return locClientRegisterEventMask(clientHandle, qmiMask); +} + +locClientEventMaskType LocApiV02 :: adjustMaskForNoSession(locClientEventMaskType qmiMask) +{ + LOC_LOGD("%s:%d]: before qmiMask=%lld", + __func__, __LINE__, qmiMask); + if (qmiMask & QMI_LOC_EVENT_MASK_POSITION_REPORT_V02) { + qmiMask ^= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; + } + if (qmiMask & QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02) { + qmiMask ^= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; + } + if (qmiMask & QMI_LOC_EVENT_MASK_NMEA_V02) { + qmiMask ^= QMI_LOC_EVENT_MASK_NMEA_V02; + } + if (qmiMask & QMI_LOC_EVENT_MASK_ENGINE_STATE_V02) { + qmiMask ^= QMI_LOC_EVENT_MASK_ENGINE_STATE_V02; + } + LOC_LOGD("%s:%d]: after qmiMask=%lld", + __func__, __LINE__, qmiMask); + return qmiMask; +} + +enum loc_api_adapter_err LocApiV02 :: close() +{ + enum loc_api_adapter_err rtv = + // success if either client is already invalid, or + // we successfully close the handle + (LOC_CLIENT_INVALID_HANDLE_VALUE == clientHandle || + eLOC_CLIENT_SUCCESS == locClientClose(&clientHandle)) ? + LOC_API_ADAPTER_ERR_SUCCESS : LOC_API_ADAPTER_ERR_FAILURE; + + mMask = 0; + clientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + + return rtv; +} + +/* start positioning session */ +enum loc_api_adapter_err LocApiV02 :: startFix(const LocPosMode& fixCriteria) +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStartReqMsgT_v02 start_msg; + + qmiLocSetOperationModeReqMsgT_v02 set_mode_msg; + qmiLocSetOperationModeIndMsgT_v02 set_mode_ind; + + // clear all fields, validity masks + memset (&start_msg, 0, sizeof(start_msg)); + memset (&set_mode_msg, 0, sizeof(set_mode_msg)); + memset (&set_mode_ind, 0, sizeof(set_mode_ind)); + + LOC_LOGV("%s:%d]: start \n", __func__, __LINE__); + fixCriteria.logv(); + + mInSession = true; + registerEventMask(mQmiMask); + + // fill in the start request + switch(fixCriteria.mode) + { + case LOC_POSITION_MODE_MS_BASED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSB_V02; + break; + + case LOC_POSITION_MODE_MS_ASSISTED: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_MSA_V02; + break; + + case LOC_POSITION_MODE_RESERVED_4: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_CELL_ID_V02; + break; + + case LOC_POSITION_MODE_RESERVED_5: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_WWAN_V02; + break; + + default: + set_mode_msg.operationMode = eQMI_LOC_OPER_MODE_STANDALONE_V02; + break; + } + + req_union.pSetOperationModeReq = &set_mode_msg; + + // send the mode first, before the start message. + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_OPERATION_MODE_REQ_V02, + 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) + { + 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 { + start_msg.minInterval_valid = 1; + start_msg.minInterval = fixCriteria.min_interval; + + if (fixCriteria.preferred_accuracy >= 0) { + start_msg.horizontalAccuracyLevel_valid = 1; + + if (fixCriteria.preferred_accuracy <= 100) + { + // fix needs high accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_HIGH_V02; + } + else if (fixCriteria.preferred_accuracy <= 1000) + { + //fix needs med accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_MED_V02; + } + else + { + //fix needs low accuracy + start_msg.horizontalAccuracyLevel = eQMI_LOC_ACCURACY_LOW_V02; + } + } + + start_msg.fixRecurrence_valid = 1; + if(GPS_POSITION_RECURRENCE_SINGLE == fixCriteria.recurrence) + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_SINGLE_V02; + } + else + { + start_msg.fixRecurrence = eQMI_LOC_RECURRENCE_PERIODIC_V02; + } + + //dummy session id + // TBD: store session ID, check for session id in pos reports. + start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; + + if (fixCriteria.credentials[0] != 0) { + int size1 = sizeof(start_msg.applicationId.applicationName); + int size2 = sizeof(fixCriteria.credentials); + int len = ((size1 < size2) ? size1 : size2) - 1; + memcpy(start_msg.applicationId.applicationName, + fixCriteria.credentials, + len); + + size1 = sizeof(start_msg.applicationId.applicationProvider); + size2 = sizeof(fixCriteria.provider); + len = ((size1 < size2) ? size1 : size2) - 1; + memcpy(start_msg.applicationId.applicationProvider, + fixCriteria.provider, + len); + + start_msg.applicationId_valid = 1; + } + + // config Altitude Assumed + start_msg.configAltitudeAssumed_valid = 1; + start_msg.configAltitudeAssumed = eQMI_LOC_ALTITUDE_ASSUMED_IN_GNSS_SV_INFO_DISABLED_V02; + + req_union.pStartReq = &start_msg; + + status = locClientSendReq (clientHandle, QMI_LOC_START_REQ_V02, + req_union ); + } + + return convertErr(status); +} + +/* stop a positioning session */ +enum loc_api_adapter_err LocApiV02 :: stopFix() +{ + locClientStatusEnumType status; + locClientReqUnionType req_union; + + qmiLocStopReqMsgT_v02 stop_msg; + + LOC_LOGD(" %s:%d]: stop called \n", __func__, __LINE__); + + memset(&stop_msg, 0, sizeof(stop_msg)); + + // dummy session id + stop_msg.sessionId = LOC_API_V02_DEF_SESSION_ID; + + req_union.pStopReq = &stop_msg; + + status = locClientSendReq(clientHandle, + QMI_LOC_STOP_REQ_V02, + req_union); + + mInSession = false; + // if engine on never happend, deregister events + // without waiting for Engine Off + if (!mEngineOn) { + registerEventMask(mQmiMask); + } + + if( eLOC_CLIENT_SUCCESS != status) + { + LOC_LOGE("%s:%d]: error = %s\n",__func__, __LINE__, + loc_get_v02_client_status_name(status)); + } + + return convertErr(status); +} + +/* set the positioning fix criteria */ +enum loc_api_adapter_err LocApiV02 :: setPositionMode( + const LocPosMode& posMode) +{ + if(isInSession()) + { + //fix is in progress, send a restart + LOC_LOGD ("%s:%d]: fix is in progress restarting the fix with new " + "criteria\n", __func__, __LINE__); + + return( startFix(posMode)); + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +/* inject time into the position engine */ +enum loc_api_adapter_err LocApiV02 :: + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg; + qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind; + + memset(&inject_time_msg, 0, sizeof(inject_time_msg)); + + inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02; + + inject_time_msg.timeUtc = time; + + inject_time_msg.timeUtc += (int64_t)(ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION - timeReference); + + inject_time_msg.timeUnc = uncertainty; + + req_union.pInjectUtcTimeReq = &inject_time_msg; + + LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__, + uncertainty); + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_UTC_TIME_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_UTC_TIME_IND_V02, + &inject_time_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_time_ind.status) + { + LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_time_ind.status)); + } + + return convertErr(status); +} + +/* inject position into the position engine */ +enum loc_api_adapter_err LocApiV02 :: + injectPosition(double latitude, double longitude, float accuracy) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectPositionReqMsgT_v02 inject_pos_msg; + qmiLocInjectPositionIndMsgT_v02 inject_pos_ind; + + memset(&inject_pos_msg, 0, sizeof(inject_pos_msg)); + + inject_pos_msg.latitude_valid = 1; + inject_pos_msg.latitude = latitude; + + inject_pos_msg.longitude_valid = 1; + inject_pos_msg.longitude = longitude; + + inject_pos_msg.horUncCircular_valid = 1; + + inject_pos_msg.horUncCircular = accuracy; //meters assumed + if (inject_pos_msg.horUncCircular < 1000) { + inject_pos_msg.horUncCircular = 1000; + } + + inject_pos_msg.horConfidence_valid = 1; + + inject_pos_msg.horConfidence = 68; //1 std dev assumed as specified by API + + inject_pos_msg.rawHorUncCircular_valid = 1; + + inject_pos_msg.rawHorUncCircular = accuracy; //meters assumed + + inject_pos_msg.rawHorConfidence_valid = 1; + + inject_pos_msg.rawHorConfidence = 68; //1 std dev assumed as specified by API + + /* Log */ + LOC_LOGD("%s:%d]: Lat=%lf, Lon=%lf, Acc=%.2lf rawAcc=%.2lf", __func__, __LINE__, + inject_pos_msg.latitude, inject_pos_msg.longitude, + inject_pos_msg.horUncCircular, inject_pos_msg.rawHorUncCircular); + + req_union.pInjectPositionReq = &inject_pos_msg; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_POSITION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_POSITION_IND_V02, + &inject_pos_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_pos_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, inject_pos_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_pos_ind.status)); + } + + return convertErr(status); +} + +/* delete assistance date */ +enum loc_api_adapter_err LocApiV02 :: deleteAidingData(GpsAidingData f) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocDeleteAssistDataReqMsgT_v02 delete_req; + qmiLocDeleteAssistDataIndMsgT_v02 delete_resp; + + memset(&delete_req, 0, sizeof(delete_req)); + memset(&delete_resp, 0, sizeof(delete_resp)); + + if( f == GPS_DELETE_ALL ) + { + delete_req.deleteAllFlag = true; + } + + else + { + /* to keep track of svInfoList for GPS and GLO*/ + uint32_t curr_sv_len = 0; + uint32_t curr_sv_idx = 0; + uint32_t sv_id = 0; + + if((f & GPS_DELETE_EPHEMERIS ) || ( f & GPS_DELETE_ALMANAC )) + { + /* do delete for all GPS SV's */ + + curr_sv_len += SV_ID_RANGE; + + sv_id = GPS_SV_ID_OFFSET; + + delete_req.deleteSvInfoList_valid = 1; + + delete_req.deleteSvInfoList_len = curr_sv_len; + + LOC_LOGV("%s:%d]: Delete GPS 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_GPS_V02; + + if(f & GPS_DELETE_EPHEMERIS ) + { + // set ephemeris mask for all GPS SV's + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_EPHEMERIS_V02; + } + + if( f & GPS_DELETE_ALMANAC ) + { + delete_req.deleteSvInfoList[i].deleteSvInfoMask |= + QMI_LOC_MASK_DELETE_ALMANAC_V02; + } + } + // increment the current index + curr_sv_idx += SV_ID_RANGE; + + } + + if(f & GPS_DELETE_POSITION ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_POSITION_V02; + } + + if(f & GPS_DELETE_TIME ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_TIME_V02; + } + + if(f & GPS_DELETE_IONO ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_IONO_V02; + } + + if(f & GPS_DELETE_UTC ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_UTC_V02; + } + + if(f & GPS_DELETE_HEALTH ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_HEALTH_V02; + } + + if(f & GPS_DELETE_SVDIR ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_GPS_SVDIR_V02; + } + if(f & GPS_DELETE_SADATA ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_SADATA_V02; + } + if(f & GPS_DELETE_RTI ) + { + delete_req.deleteGnssDataMask_valid = 1; + delete_req.deleteGnssDataMask |= QMI_LOC_MASK_DELETE_RTI_V02; + } + if(f & GPS_DELETE_CELLDB_INFO ) + { + delete_req.deleteCellDbDataMask_valid = 1; + delete_req.deleteCellDbDataMask = + ( QMI_LOC_MASK_DELETE_CELLDB_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LATEST_GPS_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 | + QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 | + QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 | + QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02) ; + + } +#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 + + } + + req_union.pDeleteAssistDataReq = &delete_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + &delete_resp); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != delete_resp.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, delete_resp.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(delete_resp.status)); + } + + return convertErr(status); +} + +/* send NI user repsonse to the engine */ +enum loc_api_adapter_err LocApiV02 :: + informNiResponse(GpsUserResponseType userResponse, + const void* passThroughData) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + + qmiLocNiUserRespReqMsgT_v02 ni_resp; + qmiLocNiUserRespIndMsgT_v02 ni_resp_ind; + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *request_pass_back = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)passThroughData; + + memset(&ni_resp,0, sizeof(ni_resp)); + + memset(&ni_resp_ind,0, sizeof(ni_resp_ind)); + + switch (userResponse) + { + case GPS_NI_RESPONSE_ACCEPT: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02; + break; + case GPS_NI_RESPONSE_DENY: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02; + break; + case GPS_NI_RESPONSE_NORESP: + ni_resp.userResp = eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02; + break; + default: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + LOC_LOGV(" %s:%d]: NI response: %d\n", __func__, __LINE__, + ni_resp.userResp); + + ni_resp.notificationType = request_pass_back->notificationType; + + // copy SUPL payload from request + if(request_pass_back->NiSuplInd_valid == 1) + { + ni_resp.NiSuplPayload_valid = 1; + memcpy(&(ni_resp.NiSuplPayload), &(request_pass_back->NiSuplInd), + sizeof(qmiLocNiSuplNotifyVerifyStructT_v02)); + + } + // should this be an "else if"?? we don't need to decide + + // copy UMTS-CP payload from request + if( request_pass_back->NiUmtsCpInd_valid == 1 ) + { + ni_resp.NiUmtsCpPayload_valid = 1; + memcpy(&(ni_resp.NiUmtsCpPayload), &(request_pass_back->NiUmtsCpInd), + sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02)); + } + + //copy Vx payload from the request + if( request_pass_back->NiVxInd_valid == 1) + { + ni_resp.NiVxPayload_valid = 1; + memcpy(&(ni_resp.NiVxPayload), &(request_pass_back->NiVxInd), + sizeof(qmiLocNiVxNotifyVerifyStructT_v02)); + } + + // copy Vx service interaction payload from the request + if(request_pass_back->NiVxServiceInteractionInd_valid == 1) + { + ni_resp.NiVxServiceInteractionPayload_valid = 1; + memcpy(&(ni_resp.NiVxServiceInteractionPayload), + &(request_pass_back->NiVxServiceInteractionInd), + sizeof(qmiLocNiVxServiceInteractionStructT_v02)); + } + + // copy Network Initiated SUPL Version 2 Extension + if (request_pass_back->NiSuplVer2ExtInd_valid == 1) + { + ni_resp.NiSuplVer2ExtPayload_valid = 1; + memcpy(&(ni_resp.NiSuplVer2ExtPayload), + &(request_pass_back->NiSuplVer2ExtInd), + sizeof(qmiLocNiSuplVer2ExtStructT_v02)); + } + + // copy SUPL Emergency Notification + if(request_pass_back->suplEmergencyNotification_valid) + { + ni_resp.suplEmergencyNotification_valid = 1; + memcpy(&(ni_resp.suplEmergencyNotification), + &(request_pass_back->suplEmergencyNotification), + sizeof(qmiLocEmergencyNotificationStructT_v02)); + } + + req_union.pNiUserRespReq = &ni_resp; + + status = loc_sync_send_req ( + clientHandle, QMI_LOC_NI_USER_RESPONSE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_NI_USER_RESPONSE_IND_V02, &ni_resp_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != ni_resp_ind.status) + { + LOC_LOGE ("%s:%d]: error! status = %s, ni_resp_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(ni_resp_ind.status)); + } + + return convertErr(status); +} + +/* Set UMTs SLP server URL */ +enum loc_api_adapter_err LocApiV02 :: setServer( + const char* url, int len) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + + if(len < 0 || len > sizeof(set_server_req.urlAddr)) + { + LOC_LOGE("%s:%d]: len = %d greater than max allowed url length\n", + __func__, __LINE__, len); + + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, url = %s, len = %d\n", __func__, __LINE__, url, len); + + set_server_req.serverType = eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02; + + set_server_req.urlAddr_valid = 1; + + strlcpy(set_server_req.urlAddr, url, sizeof(set_server_req.urlAddr)); + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + } + + return convertErr(status); +} + +enum loc_api_adapter_err LocApiV02 :: + setServer(unsigned int ip, int port, LocServerType type) +{ + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocSetServerReqMsgT_v02 set_server_req; + qmiLocSetServerIndMsgT_v02 set_server_ind; + qmiLocServerTypeEnumT_v02 set_server_cmd; + + switch (type) { + case LOC_AGPS_MPC_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02; + break; + case LOC_AGPS_CUSTOM_PDE_SERVER: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02; + break; + default: + set_server_cmd = eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02; + break; + } + + memset(&set_server_req, 0, sizeof(set_server_req)); + + LOC_LOGD("%s:%d]:, ip = %u, port = %d\n", __func__, __LINE__, ip, port); + + set_server_req.serverType = set_server_cmd; + set_server_req.ipv4Addr_valid = 1; + set_server_req.ipv4Addr.addr = ip; + set_server_req.ipv4Addr.port = port; + + req_union.pSetServerReq = &set_server_req; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SERVER_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SERVER_IND_V02, + &set_server_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != set_server_ind.status) + { + LOC_LOGE ("%s:%d]: error status = %s, set_server_ind.status = %s\n", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(set_server_ind.status)); + } + + return convertErr(status); +} + +/* Inject XTRA data, this module breaks down the XTRA + file into "chunks" and injects them one at a time */ +enum loc_api_adapter_err LocApiV02 :: setXtraData( + char* data, int length) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + int total_parts; + uint8_t part; + uint16_t len_injected; + + locClientReqUnionType req_union; + qmiLocInjectPredictedOrbitsDataReqMsgT_v02 inject_xtra; + qmiLocInjectPredictedOrbitsDataIndMsgT_v02 inject_xtra_ind; + + req_union.pInjectPredictedOrbitsDataReq = &inject_xtra; + + LOC_LOGD("%s:%d]: xtra size = %d\n", __func__, __LINE__, length); + + inject_xtra.formatType_valid = 1; + inject_xtra.formatType = eQMI_LOC_PREDICTED_ORBITS_XTRA_V02; + inject_xtra.totalSize = length; + + total_parts = ((length - 1) / QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) + 1; + + inject_xtra.totalParts = total_parts; + + len_injected = 0; // O bytes injected + + // XTRA injection starts with part 1 + for (part = 1; part <= total_parts; part++) + { + inject_xtra.partNum = part; + + if (QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 > (length - len_injected)) + { + inject_xtra.partData_len = length - len_injected; + } + else + { + inject_xtra.partData_len = QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02; + } + + // copy data into the message + memcpy(inject_xtra.partData, data+len_injected, inject_xtra.partData_len); + + LOC_LOGD("[%s:%d] part %d/%d, len = %d, total injected = %d\n", + __func__, __LINE__, + inject_xtra.partNum, total_parts, inject_xtra.partData_len, + len_injected); + + status = loc_sync_send_req( clientHandle, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + &inject_xtra_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != inject_xtra_ind.status || + inject_xtra.partNum != inject_xtra_ind.partNum) + { + LOC_LOGE ("%s:%d]: failed status = %s, inject_pos_ind.status = %s," + " part num = %d, ind.partNum = %d\n", __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(inject_xtra_ind.status), + inject_xtra.partNum, inject_xtra_ind.partNum); + } else { + len_injected += inject_xtra.partData_len; + LOC_LOGD("%s:%d]: XTRA injected length: %d\n", __func__, __LINE__, + len_injected); + } + } + + return convertErr(status); +} + +/* Request the Xtra Server Url from the modem */ +enum loc_api_adapter_err LocApiV02 :: requestXtraServer() +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + + locClientReqUnionType req_union; + qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02 request_xtra_server_ind; + + status = loc_sync_send_req( clientHandle, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, + &request_xtra_server_ind); + + if (status == eLOC_CLIENT_SUCCESS && + eQMI_LOC_SUCCESS_V02 == request_xtra_server_ind.status && + false != request_xtra_server_ind.serverList_valid && + 0 != request_xtra_server_ind.serverList.serverList_len) + { + if (request_xtra_server_ind.serverList.serverList_len == 1) + { + reportXtraServer(request_xtra_server_ind.serverList.serverList[0].serverUrl, + "", + "", + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); + } + else if (request_xtra_server_ind.serverList.serverList_len == 2) + { + reportXtraServer(request_xtra_server_ind.serverList.serverList[0].serverUrl, + request_xtra_server_ind.serverList.serverList[1].serverUrl, + "", + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); + } + else + { + reportXtraServer(request_xtra_server_ind.serverList.serverList[0].serverUrl, + request_xtra_server_ind.serverList.serverList[1].serverUrl, + request_xtra_server_ind.serverList.serverList[2].serverUrl, + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); + } + } + + return convertErr(status); +} + +enum loc_api_adapter_err LocApiV02 :: atlOpenStatus( + int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + + LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, " + "APN = [%s], bearer = %d \n", __func__, __LINE__, + handle, is_succ, apn, bear); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_OPEN_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + + if(apn != NULL) + strlcpy(conn_status_req.apnProfile.apnName, apn, + sizeof(conn_status_req.apnProfile.apnName) ); + + switch(bear) + { + case AGPS_APN_BEARER_IPV4: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02; + conn_status_req.apnProfile_valid = 1; + break; + + case AGPS_APN_BEARER_IPV6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02; + conn_status_req.apnProfile_valid = 1; + break; + + case AGPS_APN_BEARER_IPV4V6: + conn_status_req.apnProfile.pdnType = + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02; + conn_status_req.apnProfile_valid = 1; + break; + + case AGPS_APN_BEARER_INVALID: + conn_status_req.apnProfile_valid = 0; + break; + + default: + LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__); + conn_status_req.apnProfile_valid = 0; + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + } + + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + } + + return convertErr(result); + +} + + +/* close atl connection */ +enum loc_api_adapter_err LocApiV02 :: atlCloseStatus( + int handle, int is_succ) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req; + qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind; + + LOC_LOGD("%s:%d]: ATL close handle = %d, is_succ = %d\n", + __func__, __LINE__, handle, is_succ); + + memset(&conn_status_req, 0, sizeof(conn_status_req)); + memset(&conn_status_ind, 0, sizeof(conn_status_ind)); + + // Fill in data + conn_status_req.connHandle = handle; + + conn_status_req.requestType = eQMI_LOC_SERVER_REQUEST_CLOSE_V02; + + if(is_succ) + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02; + } + else + { + conn_status_req.statusType = eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02; + } + + req_union.pInformLocationServerConnStatusReq = &conn_status_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + &conn_status_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != conn_status_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(conn_status_ind.status)); + } + + return convertErr(result); +} + +/* set the SUPL version */ +enum loc_api_adapter_err LocApiV02 :: setSUPLVersion(uint32_t version) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetProtocolConfigParametersReqMsgT_v02 supl_config_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 supl_config_ind; + + LOC_LOGD("%s:%d]: supl version = %d\n", __func__, __LINE__, version); + + + memset(&supl_config_req, 0, sizeof(supl_config_req)); + memset(&supl_config_ind, 0, sizeof(supl_config_ind)); + + supl_config_req.suplVersion_valid = 1; + // SUPL version from MSByte to LSByte: + // (reserved)(major version)(minor version)(serviceIndicator) + + supl_config_req.suplVersion = (version == 0x00020000)? + eQMI_LOC_SUPL_VERSION_2_0_V02 : eQMI_LOC_SUPL_VERSION_1_0_V02; + + req_union.pSetProtocolConfigParametersReq = &supl_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &supl_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != supl_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(supl_config_ind.status)); + } + + return convertErr(result); +} + +/* set the configuration for LTE positioning profile (LPP) */ +enum loc_api_adapter_err LocApiV02 :: setLPPConfig(uint32_t profile) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocSetProtocolConfigParametersReqMsgT_v02 lpp_config_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 lpp_config_ind; + + LOC_LOGD("%s:%d]: lpp profile = %d\n", __func__, __LINE__, profile); + + memset(&lpp_config_req, 0, sizeof(lpp_config_req)); + memset(&lpp_config_ind, 0, sizeof(lpp_config_ind)); + + lpp_config_req.lppConfig_valid = 1; + + lpp_config_req.lppConfig = profile; + + req_union.pSetProtocolConfigParametersReq = &lpp_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &lpp_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != lpp_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(lpp_config_ind.status)); + } + + return convertErr(result); +} + +/* set the Sensor Configuration */ +enum loc_api_adapter_err LocApiV02 :: setSensorControlConfig( + int sensorsDisabled, int sensorProvider) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorControlConfigReqMsgT_v02 sensor_config_req; + qmiLocSetSensorControlConfigIndMsgT_v02 sensor_config_ind; + + LOC_LOGD("%s:%d]: sensors disabled = %d\n", __func__, __LINE__, sensorsDisabled); + + memset(&sensor_config_req, 0, sizeof(sensor_config_req)); + memset(&sensor_config_ind, 0, sizeof(sensor_config_ind)); + + sensor_config_req.sensorsUsage_valid = 1; + sensor_config_req.sensorsUsage = (sensorsDisabled == 1) ? eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 + : eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02; + + sensor_config_req.sensorProvider_valid = 1; + sensor_config_req.sensorProvider = (sensorProvider == 1 || sensorProvider == 4) ? + eQMI_LOC_SENSOR_CONFIG_USE_PROVIDER_SSC_V02 : + eQMI_LOC_SENSOR_CONFIG_USE_PROVIDER_NATIVE_V02; + + req_union.pSetSensorControlConfigReq = &sensor_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + &sensor_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_config_ind.status)); + } + + return convertErr(result); +} + +/* set the Sensor Properties */ +enum loc_api_adapter_err LocApiV02 :: setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, + bool accelBiasVarianceRandomWalk_valid, float accelBiasVarianceRandomWalk, + bool angleBiasVarianceRandomWalk_valid, float angleBiasVarianceRandomWalk, + bool rateBiasVarianceRandomWalk_valid, float rateBiasVarianceRandomWalk, + bool velocityBiasVarianceRandomWalk_valid, float velocityBiasVarianceRandomWalk) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPropertiesReqMsgT_v02 sensor_prop_req; + qmiLocSetSensorPropertiesIndMsgT_v02 sensor_prop_ind; + + LOC_LOGI("%s:%d]: sensors prop: gyroBiasRandomWalk = %f, accelRandomWalk = %f, " + "angleRandomWalk = %f, rateRandomWalk = %f, velocityRandomWalk = %f\n", + __func__, __LINE__, gyroBiasVarianceRandomWalk, accelBiasVarianceRandomWalk, + angleBiasVarianceRandomWalk, rateBiasVarianceRandomWalk, velocityBiasVarianceRandomWalk); + + memset(&sensor_prop_req, 0, sizeof(sensor_prop_req)); + memset(&sensor_prop_ind, 0, sizeof(sensor_prop_ind)); + + /* Set the validity bit and value for each sensor property */ + sensor_prop_req.gyroBiasVarianceRandomWalk_valid = gyroBiasVarianceRandomWalk_valid; + sensor_prop_req.gyroBiasVarianceRandomWalk = gyroBiasVarianceRandomWalk; + + sensor_prop_req.accelerationRandomWalkSpectralDensity_valid = accelBiasVarianceRandomWalk_valid; + sensor_prop_req.accelerationRandomWalkSpectralDensity = accelBiasVarianceRandomWalk; + + sensor_prop_req.angleRandomWalkSpectralDensity_valid = angleBiasVarianceRandomWalk_valid; + sensor_prop_req.angleRandomWalkSpectralDensity = angleBiasVarianceRandomWalk; + + sensor_prop_req.rateRandomWalkSpectralDensity_valid = rateBiasVarianceRandomWalk_valid; + sensor_prop_req.rateRandomWalkSpectralDensity = rateBiasVarianceRandomWalk; + + sensor_prop_req.velocityRandomWalkSpectralDensity_valid = velocityBiasVarianceRandomWalk_valid; + sensor_prop_req.velocityRandomWalkSpectralDensity = velocityBiasVarianceRandomWalk; + + req_union.pSetSensorPropertiesReq = &sensor_prop_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + &sensor_prop_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_prop_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_prop_ind.status)); + } + + return convertErr(result); +} + +/* set the Sensor Performance Config */ +enum loc_api_adapter_err LocApiV02 :: setSensorPerfControlConfig(int controlMode, + int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, + int algorithmConfig) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetSensorPerformanceControlConfigReqMsgT_v02 sensor_perf_config_req; + qmiLocSetSensorPerformanceControlConfigIndMsgT_v02 sensor_perf_config_ind; + + LOC_LOGD("%s:%d]: Sensor Perf Control Config (performanceControlMode)(%u) " + "accel(#smp,#batches) (%u,%u) gyro(#smp,#batches) (%u,%u) " + "accel_high(#smp,#batches) (%u,%u) gyro_high(#smp,#batches) (%u,%u) " + "algorithmConfig(%u)\n", + __FUNCTION__, + __LINE__, + controlMode, + accelSamplesPerBatch, + accelBatchesPerSec, + gyroSamplesPerBatch, + gyroBatchesPerSec, + accelSamplesPerBatchHigh, + accelBatchesPerSecHigh, + gyroSamplesPerBatchHigh, + gyroBatchesPerSecHigh, + algorithmConfig + ); + + memset(&sensor_perf_config_req, 0, sizeof(sensor_perf_config_req)); + memset(&sensor_perf_config_ind, 0, sizeof(sensor_perf_config_ind)); + + sensor_perf_config_req.performanceControlMode_valid = 1; + sensor_perf_config_req.performanceControlMode = (qmiLocSensorPerformanceControlModeEnumT_v02)controlMode; + sensor_perf_config_req.accelSamplingSpec_valid = 1; + sensor_perf_config_req.accelSamplingSpec.batchesPerSecond = accelBatchesPerSec; + sensor_perf_config_req.accelSamplingSpec.samplesPerBatch = accelSamplesPerBatch; + sensor_perf_config_req.gyroSamplingSpec_valid = 1; + sensor_perf_config_req.gyroSamplingSpec.batchesPerSecond = gyroBatchesPerSec; + sensor_perf_config_req.gyroSamplingSpec.samplesPerBatch = gyroSamplesPerBatch; + sensor_perf_config_req.accelSamplingSpecHigh_valid = 1; + sensor_perf_config_req.accelSamplingSpecHigh.batchesPerSecond = accelBatchesPerSecHigh; + sensor_perf_config_req.accelSamplingSpecHigh.samplesPerBatch = accelSamplesPerBatchHigh; + sensor_perf_config_req.gyroSamplingSpecHigh_valid = 1; + sensor_perf_config_req.gyroSamplingSpecHigh.batchesPerSecond = gyroBatchesPerSecHigh; + sensor_perf_config_req.gyroSamplingSpecHigh.samplesPerBatch = gyroSamplesPerBatchHigh; + sensor_perf_config_req.algorithmConfig_valid = 1; + sensor_perf_config_req.algorithmConfig = algorithmConfig; + + req_union.pSetSensorPerformanceControlConfigReq = &sensor_perf_config_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + &sensor_perf_config_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != sensor_perf_config_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(sensor_perf_config_ind.status)); + } + + return convertErr(result); +} + +/* set the External Power Config */ +enum loc_api_adapter_err LocApiV02 :: setExtPowerConfig(int isBatteryCharging) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + + qmiLocSetExternalPowerConfigReqMsgT_v02 ext_pwr_req; + qmiLocGetExternalPowerConfigIndMsgT_v02 ext_pwr_ind; + + LOC_LOGI("%s:%d]: Ext Pwr Config (isBatteryCharging)(%u)", + __FUNCTION__, + __LINE__, + isBatteryCharging + ); + + memset(&ext_pwr_req, 0, sizeof(ext_pwr_req)); + memset(&ext_pwr_ind, 0, sizeof(ext_pwr_ind)); + + switch(isBatteryCharging) + { + /* Charging */ + case 1: + ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02; + break; + + /* Not charging */ + case 0: + ext_pwr_req.externalPowerState = eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02; + break; + + default: + LOC_LOGE("%s:%d]: Invalid ext power state = %d!", + __FUNCTION__, + __LINE__, + isBatteryCharging); + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + break; + } + + req_union.pSetExternalPowerConfigReq = &ext_pwr_req; + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, + &ext_pwr_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != ext_pwr_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %d, ind..status = %d ", + __func__, __LINE__, result, ext_pwr_ind.status); + } + + return convertErr(result); +} + +/* set the Positioning Protocol on A-GLONASS system */ +enum loc_api_adapter_err LocApiV02 :: setAGLONASSProtocol(unsigned long aGlonassProtocol) +{ + locClientStatusEnumType result = eLOC_CLIENT_SUCCESS; + locClientReqUnionType req_union; + qmiLocSetProtocolConfigParametersReqMsgT_v02 aGlonassProtocol_req; + qmiLocSetProtocolConfigParametersIndMsgT_v02 aGlonassProtocol_ind; + + memset(&aGlonassProtocol_req, 0, sizeof(aGlonassProtocol_req)); + memset(&aGlonassProtocol_ind, 0, sizeof(aGlonassProtocol_ind)); + + aGlonassProtocol_req.assistedGlonassProtocolMask_valid = 1; + aGlonassProtocol_req.assistedGlonassProtocolMask = aGlonassProtocol; + + req_union.pSetProtocolConfigParametersReq = &aGlonassProtocol_req; + + LOC_LOGD("%s:%d]: aGlonassProtocolMask = 0x%x\n", __func__, __LINE__, + aGlonassProtocol_req.assistedGlonassProtocolMask); + + result = loc_sync_send_req(clientHandle, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + &aGlonassProtocol_ind); + + if(result != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != aGlonassProtocol_ind.status) + { + LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ", + __func__, __LINE__, + loc_get_v02_client_status_name(result), + loc_get_v02_qmi_status_name(aGlonassProtocol_ind.status)); + } + + return convertErr(result); +} + +/* Convert event mask from loc eng to loc_api_v02 format */ +locClientEventMaskType LocApiV02 :: convertMask( + LOC_API_ADAPTER_EVENT_MASK_T mask) +{ + locClientEventMaskType eventMask = 0; + LOC_LOGD("%s:%d]: adapter mask = %u\n", __func__, __LINE__, mask); + + if (mask & LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_POSITION_REPORT_V02; + + if (mask & LOC_API_ADAPTER_BIT_SATELLITE_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02; + + /* treat NMEA_1Hz and NMEA_POSITION_REPORT the same*/ + if ((mask & LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT) || + (mask & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) ) + eventMask |= QMI_LOC_EVENT_MASK_NMEA_V02; + + if (mask & LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02; + + if (mask & LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST) + { + // TBD: This needs to be decoupled in the HAL + eventMask |= QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02; + eventMask |= QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02; + } + + if (mask & LOC_API_ADAPTER_BIT_STATUS_REPORT) + { + eventMask |= (QMI_LOC_EVENT_MASK_ENGINE_STATE_V02); + } + + if (mask & LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST) + eventMask |= QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02; + + if (mask & LOC_API_ADAPTER_REQUEST_WIFI) + eventMask |= QMI_LOC_EVENT_MASK_WIFI_REQ_V02; + + if (mask & LOC_API_ADAPTER_SENSOR_STATUS) + eventMask |= QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02; + + if (mask & LOC_API_ADAPTER_REQUEST_TIME_SYNC) + eventMask |= QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02; + + if (mask & LOC_API_ADAPTER_REPORT_SPI) + eventMask |= QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02; + + if (mask & LOC_API_ADAPTER_REPORT_NI_GEOFENCE) + eventMask |= QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02; + + if (mask & LOC_API_ADAPTER_GEOFENCE_GEN_ALERT) + eventMask |= QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02; + + if (mask & LOC_API_ADAPTER_REPORT_GENFENCE_BREACH) + eventMask |= QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02; + + if (mask & LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_GEOFENCE_BATCH_BREACH_NOTIFICATION_V02; + + if (mask & LOC_API_ADAPTER_PEDOMETER_CTRL) + eventMask |= QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02; + + if (mask & LOC_API_ADAPTER_MOTION_CTRL) + eventMask |= QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02; + + if (mask & LOC_API_ADAPTER_REQUEST_WIFI_AP_DATA) + eventMask |= QMI_LOC_EVENT_MASK_INJECT_WIFI_AP_DATA_REQ_V02; + + if(mask & LOC_API_ADAPTER_BIT_BATCH_FULL) + eventMask |= QMI_LOC_EVENT_MASK_BATCH_FULL_NOTIFICATION_V02; + + if(mask & LOC_API_ADAPTER_BIT_BATCHED_POSITION_REPORT) + eventMask |= QMI_LOC_EVENT_MASK_LIVE_BATCHED_POSITION_REPORT_V02; + + return eventMask; +} + +qmiLocLockEnumT_v02 LocApiV02 :: convertGpsLockMask(LOC_GPS_LOCK_MASK lockMask) +{ + if (isGpsLockAll(lockMask)) + return eQMI_LOC_LOCK_ALL_V02; + if (isGpsLockMO(lockMask)) + return eQMI_LOC_LOCK_MI_V02; + if (isGpsLockMT(lockMask)) + return eQMI_LOC_LOCK_MT_V02; + if (isGpsLockNone(lockMask)) + return eQMI_LOC_LOCK_NONE_V02; + return (qmiLocLockEnumT_v02)lockMask; +} + +/* Convert error from loc_api_v02 to loc eng format*/ +enum loc_api_adapter_err LocApiV02 :: convertErr( + locClientStatusEnumType status) +{ + switch( status) + { + case eLOC_CLIENT_SUCCESS: + return LOC_API_ADAPTER_ERR_SUCCESS; + + case eLOC_CLIENT_FAILURE_GENERAL: + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + + case eLOC_CLIENT_FAILURE_UNSUPPORTED: + return LOC_API_ADAPTER_ERR_UNSUPPORTED; + + case eLOC_CLIENT_FAILURE_INVALID_PARAMETER: + return LOC_API_ADAPTER_ERR_INVALID_PARAMETER; + + case eLOC_CLIENT_FAILURE_ENGINE_BUSY: + return LOC_API_ADAPTER_ERR_ENGINE_BUSY; + + case eLOC_CLIENT_FAILURE_PHONE_OFFLINE: + return LOC_API_ADAPTER_ERR_PHONE_OFFLINE; + + case eLOC_CLIENT_FAILURE_TIMEOUT: + return LOC_API_ADAPTER_ERR_TIMEOUT; + + case eLOC_CLIENT_FAILURE_INVALID_HANDLE: + return LOC_API_ADAPTER_ERR_INVALID_HANDLE; + + case eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT: + return LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT; + + case eLOC_CLIENT_FAILURE_INTERNAL: + return LOC_API_ADAPTER_ERR_INTERNAL; + + default: + return LOC_API_ADAPTER_ERR_FAILURE; + } +} + +/* convert position report to loc eng format and send the converted + position to loc eng */ + +void LocApiV02 :: reportPosition ( + const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr) +{ + UlpLocation location; + LocPosTechMask tech_Mask = LOC_POS_TECH_MASK_DEFAULT; + LOC_LOGD("Reporting postion from V2 Adapter\n"); + memset(&location, 0, sizeof (UlpLocation)); + location.size = sizeof(location); + GpsLocationExtended locationExtended; + memset(&locationExtended, 0, sizeof (GpsLocationExtended)); + locationExtended.size = sizeof(locationExtended); + // Process the position from final and intermediate reports + + if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) || + (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02) + ) + { + // Latitude & Longitude + if( (location_report_ptr->latitude_valid == 1 ) && + (location_report_ptr->longitude_valid == 1) && + (location_report_ptr->latitude != 0 || + location_report_ptr->longitude!= 0)) + { + location.gpsLocation.flags |= GPS_LOCATION_HAS_LAT_LONG; + location.gpsLocation.latitude = location_report_ptr->latitude; + location.gpsLocation.longitude = location_report_ptr->longitude; + + // Time stamp (UTC) + if(location_report_ptr->timestampUtc_valid == 1) + { + location.gpsLocation.timestamp = location_report_ptr->timestampUtc; + } + + // Altitude + if(location_report_ptr->altitudeWrtEllipsoid_valid == 1 ) + { + location.gpsLocation.flags |= GPS_LOCATION_HAS_ALTITUDE; + location.gpsLocation.altitude = location_report_ptr->altitudeWrtEllipsoid; + } + + // Speed + if((location_report_ptr->speedHorizontal_valid == 1) && + (location_report_ptr->speedVertical_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) ); + } + + // Heading + if(location_report_ptr->heading_valid == 1) + { + location.gpsLocation.flags |= GPS_LOCATION_HAS_BEARING; + location.gpsLocation.bearing = location_report_ptr->heading; + } + + // Uncertainty (circular) + if( (location_report_ptr->horUncCircular_valid ) ) + { + location.gpsLocation.flags |= GPS_LOCATION_HAS_ACCURACY; + location.gpsLocation.accuracy = location_report_ptr->horUncCircular; + } + + // Technology Mask + tech_Mask |= location_report_ptr->technologyMask; + + //Mark the location source as from GNSS + location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO; + location.position_source = ULP_LOCATION_IS_FROM_GNSS; + if (location_report_ptr->magneticDeviation_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_MAG_DEV; + locationExtended.magneticDeviation = location_report_ptr->magneticDeviation; + } + + if (location_report_ptr->DOP_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_DOP; + locationExtended.pdop = location_report_ptr->DOP.PDOP; + locationExtended.hdop = location_report_ptr->DOP.HDOP; + locationExtended.vdop = location_report_ptr->DOP.VDOP; + } + + if (location_report_ptr->altitudeWrtMeanSeaLevel_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL; + locationExtended.altitudeMeanSeaLevel = location_report_ptr->altitudeWrtMeanSeaLevel; + } + + if (location_report_ptr->vertUnc_valid) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_VERT_UNC; + locationExtended.vert_unc = location_report_ptr->vertUnc; + } + + if (location_report_ptr->speedUnc_valid ) + { + locationExtended.flags |= GPS_LOCATION_EXTENDED_HAS_SPEED_UNC; + locationExtended.speed_unc = location_report_ptr->speedUnc; + } + + LocApiBase::reportPosition( location, + locationExtended, + (void*)location_report_ptr, + (location_report_ptr->sessionStatus + == eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 ? + LOC_SESS_INTERMEDIATE : LOC_SESS_SUCCESS), + tech_Mask); + } + } + else + { + LocApiBase::reportPosition(location, + locationExtended, + NULL, + LOC_SESS_FAILURE); + + LOC_LOGD("%s:%d]: Ignoring position report with sess status = %d, " + "fix id = %u\n", __func__, __LINE__, + location_report_ptr->sessionStatus, + location_report_ptr->fixId ); + } +} + +/* convert satellite report to loc eng format and send the converted + report to loc eng */ +void LocApiV02 :: reportSv ( + const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr) +{ + GpsSvStatus SvStatus; + GpsLocationExtended locationExtended; + int num_svs_max, i; + const qmiLocSvInfoStructT_v02 *sv_info_ptr; + + LOC_LOGV ("%s:%d]: num of sv = %d\n", __func__, __LINE__, + gnss_report_ptr->svList_len); + + num_svs_max = 0; + memset (&SvStatus, 0, sizeof (GpsSvStatus)); + memset(&locationExtended, 0, sizeof (GpsLocationExtended)); + locationExtended.size = sizeof(locationExtended); + if(gnss_report_ptr->svList_valid == 1) + { + num_svs_max = gnss_report_ptr->svList_len; + if(num_svs_max > GPS_MAX_SVS) + { + num_svs_max = GPS_MAX_SVS; + } + SvStatus.num_svs = 0; + for(i = 0; i < num_svs_max; i++) + { + sv_info_ptr = &(gnss_report_ptr->svList[i]); + if((sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02) && + (sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02) + && (sv_info_ptr->gnssSvId != 0 )) + { + 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].prn = (int)sv_info_ptr->gnssSvId; + + // We only have the data field to report gps eph and alm mask + if(sv_info_ptr->validMask & + QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02) + { + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02) + { + SvStatus.ephemeris_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + if(sv_info_ptr->svInfoMask & + QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02) + { + SvStatus.almanac_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + } + + 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.used_in_fix_mask |= (1 << (sv_info_ptr->gnssSvId-1)); + } + } + // SBAS: GPS PRN: 120-151, + // In exteneded measurement report, we follow nmea standard, + // which is from 33-64. + else if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_SBAS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + 33 - 120; + } + // Gloness: Slot id: 1-32 + // In extended measurement report, we follow nmea standard, + // which is 65-96 + else if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_GLONASS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId + (65-1); + } + //BeiDou: Slot id: 1-37 + //In extended measurement report, we follow nmea standard, + //which is 201-237 + else if(sv_info_ptr->system == eQMI_LOC_SV_SYSTEM_BDS_V02) + { + SvStatus.sv_list[SvStatus.num_svs].prn = + sv_info_ptr->gnssSvId; + } + // Unsupported SV system + else + { + continue; + } + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ) + { + SvStatus.sv_list[SvStatus.num_svs].snr = sv_info_ptr->snr; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02) + { + SvStatus.sv_list[SvStatus.num_svs].elevation = sv_info_ptr->elevation; + } + + if(sv_info_ptr->validMask & QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02) + { + SvStatus.sv_list[SvStatus.num_svs].azimuth = sv_info_ptr->azimuth; + } + + SvStatus.num_svs++; + } + } + + if (SvStatus.num_svs >= 0) + { + LOC_LOGV ("%s:%d]: firing SV callback\n", __func__, __LINE__); + LocApiBase::reportSv(SvStatus, + locationExtended, + (void*)gnss_report_ptr); + } +} + +/* convert engine state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02 :: reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr) +{ + + LOC_LOGV("%s:%d]: state = %d\n", __func__, __LINE__, + engine_state_ptr->engineState); + + struct MsgUpdateEngineState : public LocMsg { + LocApiV02* mpLocApiV02; + bool mEngineOn; + inline MsgUpdateEngineState(LocApiV02* pLocApiV02, bool engineOn) : + LocMsg(), mpLocApiV02(pLocApiV02), mEngineOn(engineOn) {} + inline virtual void proc() const { + // If EngineOn is true and InSession is false and Engine is just turned off, + // then unregister the gps tracking specific event masks + if (mpLocApiV02->mEngineOn && !mpLocApiV02->mInSession && !mEngineOn) { + mpLocApiV02->registerEventMask(mpLocApiV02->mQmiMask); + } + mpLocApiV02->mEngineOn = mEngineOn; + } + }; + + 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 + { + reportStatus(GPS_STATUS_NONE); + } + +} + +/* convert fix session state report to loc eng format and send the converted + report to loc eng */ +void LocApiV02 :: reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr) +{ + GpsStatusValue status; + LOC_LOGD("%s:%d]: state = %d\n", __func__, __LINE__, + fix_session_state_ptr->sessionState); + + status = GPS_STATUS_NONE; + if (fix_session_state_ptr->sessionState == eQMI_LOC_FIX_SESSION_STARTED_V02) + { + status = GPS_STATUS_SESSION_BEGIN; + } + else if (fix_session_state_ptr->sessionState + == eQMI_LOC_FIX_SESSION_FINISHED_V02) + { + status = GPS_STATUS_SESSION_END; + } + reportStatus(status); +} + +/* convert NMEA report to loc eng format and send the converted + report to loc eng */ +void LocApiV02 :: reportNmea ( + const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr) +{ + + LocApiBase::reportNmea(nmea_report_ptr->nmea, + strlen(nmea_report_ptr->nmea)); + + LOC_LOGD("NMEA <%s", nmea_report_ptr->nmea); +} + +/* convert and report an ATL request to loc engine */ +void LocApiV02 :: reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 * server_request_ptr) +{ + uint32_t connHandle = server_request_ptr->connHandle; + // service ATL open request; copy the WWAN type + if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 ) + { + AGpsType agpsType; + switch(server_request_ptr->wwanType) + { + case eQMI_LOC_WWAN_TYPE_INTERNET_V02: + agpsType = AGPS_TYPE_WWAN_ANY; + requestATL(connHandle, agpsType); + break; + case eQMI_LOC_WWAN_TYPE_AGNSS_V02: + agpsType = AGPS_TYPE_SUPL; + requestATL(connHandle, agpsType); + break; + case eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02: + requestSuplES(connHandle); + break; + default: + agpsType = AGPS_TYPE_WWAN_ANY; + requestATL(connHandle, agpsType); + break; + } + } + // service the ATL close request + else if (server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_CLOSE_V02) + { + releaseATL(connHandle); + } +} + +/* conver the NI report to loc eng format and send t loc engine */ +void LocApiV02 :: reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr) +{ + GpsNiNotification notif; + + /* initialize the notification*/ + memset(notif.extras, 0, sizeof notif.extras); + memset(notif.text, 0, sizeof notif.text); + memset(notif.requestor_id, 0, sizeof notif.requestor_id); + + /* NI timeout gets overwritten in LocApiEngAdapter, + initializing to 0 here */ + notif.timeout = 0; + + notif.text_encoding = GPS_ENC_NONE ; + + notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + + notif.notify_flags = 0; + + notif.default_response = GPS_NI_RESPONSE_NORESP; + + /*Handle Vx request */ + if(ni_req_ptr->NiVxInd_valid == 1) + { + const qmiLocNiVxNotifyVerifyStructT_v02 *vx_req = &(ni_req_ptr->NiVxInd); + + notif.ni_type = GPS_NI_TYPE_VOICE; + + // Requestor ID, the requestor id recieved is NULL terminated + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char *)vx_req->requestorId, vx_req->requestorId_len ); + } + + /* Handle UMTS CP request*/ + else if(ni_req_ptr->NiUmtsCpInd_valid == 1) + { + const qmiLocNiUmtsCpNotifyVerifyStructT_v02 *umts_cp_req = + &ni_req_ptr->NiUmtsCpInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_CTRL_PLANE; + + /* notificationText should always be a NULL terminated string */ + hexcode(notif.text, sizeof notif.text, + (char *)umts_cp_req->notificationText, + umts_cp_req->notificationText_len); + + /* Store requestor ID */ + hexcode(notif.requestor_id, sizeof(notif.requestor_id), + (char *)umts_cp_req->requestorId.codedString, + umts_cp_req->requestorId.codedString_len); + + /* convert encodings */ + notif.text_encoding = convertNiEncoding(umts_cp_req->dataCodingScheme); + + notif.requestor_id_encoding = + convertNiEncoding(umts_cp_req->requestorId.dataCodingScheme); + + /* LCS address (using extras field) */ + if ( umts_cp_req->clientAddress_len != 0) + { + char lcs_addr[32]; // Decoded LCS address for UMTS CP NI + + // Copy LCS Address into notif.extras in the format: Address = 012345 + strlcat(notif.extras, LOC_NI_NOTIF_KEY_ADDRESS, sizeof (notif.extras)); + strlcat(notif.extras, " = ", sizeof notif.extras); + int addr_len = 0; + const char *address_source = NULL; + address_source = (char *)umts_cp_req->clientAddress; + // client Address is always NULL terminated + addr_len = decodeAddress(lcs_addr, sizeof(lcs_addr), address_source, + umts_cp_req->clientAddress_len); + + // The address is ASCII string + if (addr_len) + { + strlcat(notif.extras, lcs_addr, sizeof notif.extras); + } + } + + } + else if(ni_req_ptr->NiSuplInd_valid == 1) + { + const qmiLocNiSuplNotifyVerifyStructT_v02 *supl_req = + &ni_req_ptr->NiSuplInd; + + notif.ni_type = GPS_NI_TYPE_UMTS_SUPL; + + // Client name + if (supl_req->valid_flags & QMI_LOC_SUPL_CLIENT_NAME_MASK_V02) + { + hexcode(notif.text, sizeof(notif.text), + (char *)supl_req->clientName.formattedString, + supl_req->clientName.formattedString_len); + LOC_LOGV("%s:%d]: SUPL NI: client_name: %s \n", __func__, __LINE__, + notif.text); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: client_name not present.", + __func__, __LINE__); + } + + // Requestor ID + if (supl_req->valid_flags & QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02) + { + hexcode(notif.requestor_id, sizeof notif.requestor_id, + (char*)supl_req->requestorId.formattedString, + supl_req->requestorId.formattedString_len ); + + LOC_LOGV("%s:%d]: SUPL NI: requestor_id: %s \n", __func__, __LINE__, + notif.requestor_id); + } + else + { + LOC_LOGV("%s:%d]: SUPL NI: requestor_id not present.", + __func__, __LINE__); + } + + // Encoding type + if (supl_req->valid_flags & QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02) + { + notif.text_encoding = convertNiEncoding(supl_req->dataCodingScheme); + + notif.requestor_id_encoding = convertNiEncoding(supl_req->dataCodingScheme); + } + else + { + notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN; + } + + // ES SUPL + if(ni_req_ptr->suplEmergencyNotification_valid ==1) + { + const qmiLocEmergencyNotificationStructT_v02 *supl_emergency_request = + &ni_req_ptr->suplEmergencyNotification; + + notif.ni_type = GPS_NI_TYPE_EMERGENCY_SUPL; + } + + } //ni_req_ptr->NiSuplInd_valid == 1 + else + { + LOC_LOGE("%s:%d]: unknown request event \n",__func__, __LINE__); + return; + } + + // Set default_response & notify_flags + convertNiNotifyVerifyType(¬if, ni_req_ptr->notificationType); + + qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_copy_ptr = + (qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *)malloc(sizeof(*ni_req_copy_ptr)); + + if( NULL != ni_req_copy_ptr) + { + memcpy(ni_req_copy_ptr, ni_req_ptr, sizeof(*ni_req_copy_ptr)); + + requestNiNotify(notif, (const void*)ni_req_copy_ptr); + } + else + { + LOC_LOGE("%s:%d]: Error copying NI request\n", __func__, __LINE__); + } + +} + +/* Report the Xtra Server Url from the modem to HAL*/ +void LocApiV02 :: reportXtraServerUrl( + const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* + server_request_ptr) +{ + + if (server_request_ptr->serverList.serverList_len == 1) + { + reportXtraServer(server_request_ptr->serverList.serverList[0].serverUrl, + "", + "", + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); + } + else if (server_request_ptr->serverList.serverList_len == 2) + { + reportXtraServer(server_request_ptr->serverList.serverList[0].serverUrl, + server_request_ptr->serverList.serverList[1].serverUrl, + "", + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); + } + else + { + reportXtraServer(server_request_ptr->serverList.serverList[0].serverUrl, + server_request_ptr->serverList.serverList[1].serverUrl, + server_request_ptr->serverList.serverList[2].serverUrl, + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02); + } + +} + +/* convert Ni Encoding type from QMI_LOC to loc eng format */ +GpsNiEncodingType LocApiV02 ::convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding) +{ + GpsNiEncodingType enc = GPS_ENC_UNKNOWN; + + switch (loc_encoding) + { + case eQMI_LOC_NI_SUPL_UTF8_V02: + enc = GPS_ENC_SUPL_UTF8; + break; + case eQMI_LOC_NI_SUPL_UCS2_V02: + enc = GPS_ENC_SUPL_UCS2; + break; + case eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; + break; + case eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02: + enc = GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM + break; + default: + break; + } + + return enc; +} + +/*convert NI notify verify type from QMI LOC to loc eng format*/ +bool LocApiV02 :: convertNiNotifyVerifyType ( + GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv) +{ + switch (notif_priv) + { + case eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02: + notif->notify_flags = 0; + break; + + case eQMI_LOC_NI_USER_NOTIFY_ONLY_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_ACCEPT; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02: + notif->notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY; + notif->default_response = GPS_NI_RESPONSE_DENY; + break; + + case eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02: + notif->notify_flags = GPS_NI_PRIVACY_OVERRIDE; + break; + + default: + return false; + } + + return true; +} + +/* event callback registered with the loc_api v02 interface */ +void LocApiV02 :: eventCb(locClientHandleType clientHandle, + uint32_t eventId, locClientEventIndUnionType eventPayload) +{ + LOC_LOGD("%s:%d]: event id = %d\n", __func__, __LINE__, + eventId); + + switch(eventId) + { + //Position Report + case QMI_LOC_EVENT_POSITION_REPORT_IND_V02: + reportPosition(eventPayload.pPositionReportEvent); + break; + + // Satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + reportSv(eventPayload.pGnssSvInfoReportEvent); + break; + + // Status report + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + reportEngineState(eventPayload.pEngineState); + break; + + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + reportFixSessionState(eventPayload.pFixSessionState); + break; + + // NMEA + case QMI_LOC_EVENT_NMEA_IND_V02: + reportNmea(eventPayload.pNmeaReportEvent); + break; + + // XTRA request + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + LOC_LOGD("%s:%d]: XTRA download request\n", __func__, + __LINE__); + reportXtraServerUrl(eventPayload.pInjectPredictedOrbitsReqEvent); + requestXtraData(); + break; + + // time request + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + LOC_LOGD("%s:%d]: Time request\n", __func__, + __LINE__); + requestTime(); + break; + + //position request + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + LOC_LOGD("%s:%d]: Position request\n", __func__, + __LINE__); + requestLocation(); + break; + + // NI request + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + reportNiRequest(eventPayload.pNiNotifyVerifyReqEvent); + break; + + // AGPS connection request + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + reportAtlRequest(eventPayload.pLocationServerConnReqEvent); + break; + } +} + +/* Call the service LocAdapterBase down event*/ +void LocApiV02 :: errorCb(locClientHandleType handle, + locClientErrorEnumType errorId) +{ + if(errorId == eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE) + { + LOC_LOGE("%s:%d]: Service unavailable error\n", + __func__, __LINE__); + + handleEngineDownEvent(); + + /* immediately send the engine up event so that + the loc engine re-initializes the adapter and the + loc-api_v02 interface */ + + handleEngineUpEvent(); + } +} + +static void ds_client_global_event_cb(ds_client_status_enum_type result, + void *loc_adapter_cookie) +{ + LocApiV02 *locApiV02Instance = + (LocApiV02 *)loc_adapter_cookie; + locApiV02Instance->ds_client_event_cb(result); + return; +} + +void LocApiV02::ds_client_event_cb(ds_client_status_enum_type result) +{ + if(result == E_DS_CLIENT_DATA_CALL_CONNECTED) { + LOC_LOGD("%s:%d]: Emergency call is up", __func__, __LINE__); + reportDataCallOpened(); + } + else if(result == E_DS_CLIENT_DATA_CALL_DISCONNECTED) { + LOC_LOGE("%s:%d]: Emergency call is stopped", __func__, __LINE__); + reportDataCallClosed(); + } + return; +} + +ds_client_cb_data ds_client_cb{ + ds_client_global_event_cb +}; + +int LocApiV02 :: initDataServiceClient() +{ + int ret=0; + ret = ds_client_init(); + LOC_LOGD("%s:%d]: ret = %d\n", __func__, __LINE__,ret); + return ret; +} + +int LocApiV02 :: openAndStartDataCall() +{ + enum loc_api_adapter_err ret; + int profile_index; + int pdp_type; + ds_client_status_enum_type result = ds_client_open_call(&dsClientHandle, + &ds_client_cb, + (void *)this, + &profile_index, + &pdp_type); + if(result == E_DS_CLIENT_SUCCESS) { + result = ds_client_start_call(dsClientHandle, profile_index, pdp_type); + + if(result == E_DS_CLIENT_SUCCESS) { + LOC_LOGD("%s:%d]: Request to start Emergency call sent\n", + __func__, __LINE__); + ret = LOC_API_ADAPTER_ERR_SUCCESS; + } + else { + LOC_LOGE("%s:%d]: Unable to bring up emergency call using DS. result = %d", + __func__, __LINE__, (int)result); + ret = LOC_API_ADAPTER_ERR_UNSUPPORTED; + } + } + else if(result == E_DS_CLIENT_RETRY_LATER) { + LOC_LOGE("%s:%d]: Could not start emergency call. Retry after delay\n", + __func__, __LINE__); + ret = LOC_API_ADAPTER_ERR_ENGINE_BUSY; + } + else { + LOC_LOGE("%s:%d]: Unable to bring up emergency call using DS. ret = %d", + __func__, __LINE__, (int)ret); + ret = LOC_API_ADAPTER_ERR_UNSUPPORTED; + } + + return (int)ret; +} + +void LocApiV02 :: stopDataCall() +{ + ds_client_status_enum_type ret = + ds_client_stop_call(dsClientHandle); + if (ret == E_DS_CLIENT_SUCCESS) { + LOC_LOGD("%s:%d]: Request to Close SUPL ES call sent\n", __func__, __LINE__); + } + else { + if (ret == E_DS_CLIENT_FAILURE_INVALID_HANDLE) { + LOC_LOGE("%s:%d]: Conn handle not found for SUPL ES", + __func__, __LINE__); + } + LOC_LOGE("%s:%d]: Could not close SUPL ES call. Ret: %d\n" + ,__func__, __LINE__, ret); + } + return; +} + +void LocApiV02 :: closeDataCall() +{ + ds_client_close_call(&dsClientHandle); + LOC_LOGD("%s:%d]: Release data client handle\n", __func__, __LINE__); + return; +} + +enum loc_api_adapter_err LocApiV02 :: +getWwanZppFix(GpsLocation &zppLoc) +{ + locClientReqUnionType req_union; + qmiLocGetAvailWwanPositionReqMsgT_v02 zpp_req; + qmiLocGetAvailWwanPositionIndMsgT_v02 zpp_ind; + memset(&zpp_ind, 0, sizeof(zpp_ind)); + memset(&zpp_req, 0, sizeof(zpp_req)); + memset(&zppLoc, 0, sizeof(zppLoc)); + + req_union.pGetAvailWwanPositionReq = &zpp_req; + + LOC_LOGD("%s:%d]: Get ZPP Fix from available wwan position\n", __func__, __LINE__); + + locClientStatusEnumType status = + loc_sync_send_req(clientHandle, + QMI_LOC_GET_AVAILABLE_WWAN_POSITION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02, + &zpp_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != zpp_ind.status) { + LOC_LOGE ("%s:%d]: error! status = %s, zpp_ind.status = %s\n", + __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; + } + + LOC_LOGD("Got Zpp fix location validity (lat:%d, lon:%d, timestamp:%d accuracy:%d)", + zpp_ind.latitude_valid, + zpp_ind.longitude_valid, + zpp_ind.timestampUtc_valid, + zpp_ind.horUncCircular_valid); + + LOC_LOGD("(%.7f, %.7f), timestamp %llu, accuracy %f", + zpp_ind.latitude, + zpp_ind.longitude, + zpp_ind.timestampUtc, + zpp_ind.horUncCircular); + + zppLoc.size = sizeof(GpsLocation); + if (zpp_ind.timestampUtc_valid) { + zppLoc.timestamp = zpp_ind.timestampUtc; + } + else { + /* The UTC time from modem is not valid. + In this case, we use current system time instead.*/ + + struct timespec time_info_current; + clock_gettime(CLOCK_REALTIME,&time_info_current); + zppLoc.timestamp = (time_info_current.tv_sec)*1e3 + + (time_info_current.tv_nsec)/1e6; + LOC_LOGD("zpp timestamp got from system: %llu", zppLoc.timestamp); + } + + if ((zpp_ind.latitude_valid == false) || + (zpp_ind.longitude_valid == false) || + (zpp_ind.horUncCircular_valid == false)) { + return LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + zppLoc.flags = GPS_LOCATION_HAS_LAT_LONG | GPS_LOCATION_HAS_ACCURACY; + zppLoc.latitude = zpp_ind.latitude; + zppLoc.longitude = zpp_ind.longitude; + zppLoc.accuracy = zpp_ind.horUncCircular; + + if (zpp_ind.altitudeWrtEllipsoid_valid) { + zppLoc.flags |= GPS_LOCATION_HAS_ALTITUDE; + zppLoc.altitude = zpp_ind.altitudeWrtEllipsoid; + } + + return LOC_API_ADAPTER_ERR_SUCCESS; +} + +enum loc_api_adapter_err LocApiV02 :: getBestAvailableZppFix(GpsLocation & zppLoc) +{ + LocPosTechMask tech_mask; + return getBestAvailableZppFix(zppLoc, tech_mask); +} + +enum loc_api_adapter_err LocApiV02 :: +getBestAvailableZppFix(GpsLocation &zppLoc, LocPosTechMask &tech_mask) +{ + locClientReqUnionType req_union; + + qmiLocGetBestAvailablePositionIndMsgT_v02 zpp_ind; + qmiLocGetBestAvailablePositionReqMsgT_v02 zpp_req; + + memset(&zpp_ind, 0, sizeof(zpp_ind)); + memset(&zpp_req, 0, sizeof(zpp_req)); + memset(&zppLoc, 0, sizeof(zppLoc)); + + req_union.pGetBestAvailablePositionReq = &zpp_req; + + LOC_LOGD("%s:%d]: Get ZPP Fix from best available source\n", __func__, __LINE__); + + locClientStatusEnumType status = + loc_sync_send_req(clientHandle, + QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, + &zpp_ind); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != zpp_ind.status) { + LOC_LOGE ("%s:%d]: error! status = %s, zpp_ind.status = %s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(zpp_ind.status)); + } else { + LOC_LOGD("Got Zpp fix location validity (lat:%d, lon:%d, timestamp:%d accuracy:%d)" + " (%.7f, %.7f), timestamp %llu, accuracy %f", + zpp_ind.latitude_valid, + zpp_ind.longitude_valid, + zpp_ind.timestampUtc_valid, + zpp_ind.horUncCircular_valid, + zpp_ind.latitude, + zpp_ind.longitude, + zpp_ind.timestampUtc, + zpp_ind.horUncCircular); + + zppLoc.size = sizeof(GpsLocation); + if (zpp_ind.timestampUtc_valid) { + zppLoc.timestamp = zpp_ind.timestampUtc; + } + else { + /* The UTC time from modem is not valid. + In this case, we use current system time instead.*/ + + struct timespec time_info_current; + clock_gettime(CLOCK_REALTIME,&time_info_current); + zppLoc.timestamp = (time_info_current.tv_sec)*1e3 + + (time_info_current.tv_nsec)/1e6; + LOC_LOGD("zpp timestamp got from system: %llu", zppLoc.timestamp); + } + + if (zpp_ind.latitude_valid && + zpp_ind.longitude_valid && + zpp_ind.horUncCircular_valid ) { + zppLoc.flags = GPS_LOCATION_HAS_LAT_LONG | GPS_LOCATION_HAS_ACCURACY; + zppLoc.latitude = zpp_ind.latitude; + zppLoc.longitude = zpp_ind.longitude; + zppLoc.accuracy = zpp_ind.horUncCircular; + + if (zpp_ind.altitudeWrtEllipsoid_valid) { + zppLoc.flags |= GPS_LOCATION_HAS_ALTITUDE; + zppLoc.altitude = zpp_ind.altitudeWrtEllipsoid; + } + + if (zpp_ind.horSpeed_valid) { + zppLoc.flags |= GPS_LOCATION_HAS_SPEED; + zppLoc.speed = zpp_ind.horSpeed; + } + + if (zpp_ind.heading_valid) { + zppLoc.flags |= GPS_LOCATION_HAS_BEARING; + zppLoc.bearing = zpp_ind.heading; + } + + if (zpp_ind.technologyMask_valid) { + tech_mask = zpp_ind.technologyMask; + } + } + } + + return convertErr(status); +} + +/*Values for lock + 1 = Do not lock any position sessions + 2 = Lock MI position sessions + 3 = Lock MT position sessions + 4 = Lock all position sessions + + Returns values: + zero on success; non-zero on failure +*/ +int LocApiV02 :: setGpsLock(LOC_GPS_LOCK_MASK lockMask) +{ + qmiLocSetEngineLockReqMsgT_v02 setEngineLockReq; + qmiLocSetEngineLockIndMsgT_v02 setEngineLockInd; + locClientStatusEnumType status; + locClientReqUnionType req_union; + int ret=0; + + LOC_LOGD("%s:%d]: Set Gps Lock: %x\n", __func__, __LINE__, lockMask); + setEngineLockReq.lockType = convertGpsLockMask(lockMask); + req_union.pSetEngineLockReq = &setEngineLockReq; + memset(&setEngineLockInd, 0, sizeof(setEngineLockInd)); + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_ENGINE_LOCK_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_ENGINE_LOCK_IND_V02, + &setEngineLockInd); + + if(status != eLOC_CLIENT_SUCCESS || setEngineLockInd.status != eQMI_LOC_SUCCESS_V02) { + LOC_LOGE("%s:%d]: Set engine lock failed. status: %s, ind status:%s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(setEngineLockInd.status)); + ret = -1; + } + LOC_LOGD("%s:%d]: exit\n", __func__, __LINE__); + return ret; +} +/* + Returns + Current value of GPS Lock on success + -1 on failure +*/ +int LocApiV02 :: getGpsLock() +{ + qmiLocGetEngineLockReqMsgT_v02 getEngineLockReq; + qmiLocGetEngineLockIndMsgT_v02 getEngineLockInd; + locClientStatusEnumType status; + locClientReqUnionType req_union; + int ret=0; + LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__); + memset(&getEngineLockInd, 0, sizeof(getEngineLockInd)); + + //Passing req_union as a parameter even though this request has no payload + //since NULL or 0 gives an error during compilation + status = loc_sync_send_req(clientHandle, + QMI_LOC_GET_ENGINE_LOCK_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_GET_ENGINE_LOCK_IND_V02, + &getEngineLockInd); + if(status != eLOC_CLIENT_SUCCESS || getEngineLockInd.status != eQMI_LOC_SUCCESS_V02) { + LOC_LOGE("%s:%d]: Set engine lock failed. status: %s, ind status:%s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(getEngineLockInd.status)); + ret = -1; + } + else { + if(getEngineLockInd.lockType_valid) { + ret = (int)getEngineLockInd.lockType; + LOC_LOGD("%s:%d]: Lock Type: %d\n", __func__, __LINE__, ret); + } + else { + LOC_LOGE("%s:%d]: Lock Type not valid\n", __func__, __LINE__); + ret = -1; + } + } + LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__); + return ret; +} + +enum loc_api_adapter_err LocApiV02:: setXtraVersionCheck(enum xtra_version_check check) +{ + qmiLocSetXtraVersionCheckReqMsgT_v02 req; + qmiLocSetXtraVersionCheckIndMsgT_v02 ind; + locClientStatusEnumType status; + locClientReqUnionType req_union; + enum loc_api_adapter_err ret = LOC_API_ADAPTER_ERR_SUCCESS; + + LOC_LOGD("%s:%d]: Enter. check: %d", __func__, __LINE__, check); + memset(&req, 0, sizeof(req)); + memset(&ind, 0, sizeof(ind)); + switch (check) { + case DISABLED: + req.xtraVersionCheckMode = eQMI_LOC_XTRA_VERSION_CHECK_DISABLE_V02; + break; + case AUTO: + req.xtraVersionCheckMode = eQMI_LOC_XTRA_VERSION_CHECK_AUTO_V02; + break; + case XTRA2: + req.xtraVersionCheckMode = eQMI_LOC_XTRA_VERSION_CHECK_XTRA2_V02; + break; + case XTRA3: + req.xtraVersionCheckMode = eQMI_LOC_XTRA_VERSION_CHECK_XTRA3_V02; + break; + default: + req.xtraVersionCheckMode = eQMI_LOC_XTRA_VERSION_CHECK_DISABLE_V02; + break; + } + + req_union.pSetXtraVersionCheckReq = &req; + status = loc_sync_send_req(clientHandle, + QMI_LOC_SET_XTRA_VERSION_CHECK_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_SET_XTRA_VERSION_CHECK_IND_V02, + &ind); + if(status != eLOC_CLIENT_SUCCESS || ind.status != eQMI_LOC_SUCCESS_V02) { + LOC_LOGE("%s:%d]: Set xtra version check failed. status: %s, ind status:%s\n", + __func__, __LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(ind.status)); + ret = LOC_API_ADAPTER_ERR_GENERAL_FAILURE; + } + + LOC_LOGD("%s:%d]: Exit. ret: %d", __func__, __LINE__, (int)ret); + return ret; +} + +void LocApiV02 :: installAGpsCert(const DerEncodedCertificate* pData, + size_t numberOfCerts, + uint32_t slotBitMask) +{ + LOC_LOGD("%s:%d]:, slot mask=%u number of certs=%u", + __func__, __LINE__, slotBitMask, numberOfCerts); + + uint8_t certIndex = 0; + for (uint8_t slot = 0; slot <= AGPS_CERTIFICATE_MAX_SLOTS-1; slot++, slotBitMask >>= 1) + { + if (slotBitMask & 1) //slot is writable + { + if (certIndex < numberOfCerts && pData[certIndex].data && pData[certIndex].length > 0) + { + LOC_LOGD("%s:%d]:, Inject cert#%u slot=%u length=%u", + __func__, __LINE__, certIndex, slot, pData[certIndex].length); + + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectSuplCertificateReqMsgT_v02 injectCertReq; + qmiLocInjectSuplCertificateIndMsgT_v02 injectCertInd; + + memset(&injectCertReq, 0, sizeof(injectCertReq)); + injectCertReq.suplCertId = slot; + injectCertReq.suplCertData_len = pData[certIndex].length; + memcpy(injectCertReq.suplCertData, pData[certIndex].data, pData[certIndex].length); + + req_union.pInjectSuplCertificateReq = &injectCertReq; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, + &injectCertInd); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != injectCertInd.status) + { + LOC_LOGE ("%s:%d]: inject-error status = %s, set_server_ind.status = %s", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(injectCertInd.status)); + } + + certIndex++; //move to next cert + + } else { + + LOC_LOGD("%s:%d]:, Delete slot=%u", + __func__, __LINE__, slot); + + // A fake cert is injected first before delete is called to workaround + // an issue that is seen with trying to delete an empty slot. + { + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocInjectSuplCertificateReqMsgT_v02 injectFakeCertReq; + qmiLocInjectSuplCertificateIndMsgT_v02 injectFakeCertInd; + + memset(&injectFakeCertReq, 0, sizeof(injectFakeCertReq)); + injectFakeCertReq.suplCertId = slot; + injectFakeCertReq.suplCertData_len = 1; + injectFakeCertReq.suplCertData[0] = 1; + + req_union.pInjectSuplCertificateReq = &injectFakeCertReq; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, + &injectFakeCertInd); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != injectFakeCertInd.status) + { + LOC_LOGE ("%s:%d]: inject-fake-error status = %s, set_server_ind.status = %s", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(injectFakeCertInd.status)); + } + } + + locClientReqUnionType req_union; + locClientStatusEnumType status; + qmiLocDeleteSuplCertificateReqMsgT_v02 deleteCertReq; + qmiLocDeleteSuplCertificateIndMsgT_v02 deleteCertInd; + + memset(&deleteCertReq, 0, sizeof(deleteCertReq)); + deleteCertReq.suplCertId = slot; + deleteCertReq.suplCertId_valid = 1; + + req_union.pDeleteSuplCertificateReq = &deleteCertReq; + + status = loc_sync_send_req(clientHandle, + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, + req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT, + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, + &deleteCertInd); + + if (status != eLOC_CLIENT_SUCCESS || + eQMI_LOC_SUCCESS_V02 != deleteCertInd.status) + { + LOC_LOGE("%s:%d]: delete-error status = %s, set_server_ind.status = %s", + __func__,__LINE__, + loc_get_v02_client_status_name(status), + loc_get_v02_qmi_status_name(deleteCertInd.status)); + } + } + } else { + LOC_LOGD("%s:%d]:, Not writable slot=%u", + __func__, __LINE__, slot); + } + } +} diff --git a/gps/loc_api/loc_api_v02/LocApiV02.h b/gps/loc_api/loc_api_v02/LocApiV02.h new file mode 100644 index 0000000..7185f5d --- /dev/null +++ b/gps/loc_api/loc_api_v02/LocApiV02.h @@ -0,0 +1,218 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOC_API_V_0_2_H +#define LOC_API_V_0_2_H + +#include +#include +#include "ds_client.h" +#include +#include + +using namespace loc_core; + +/* This class derives from the LocApiBase class. + The members of this class are responsible for converting + the Loc API V02 data structures into Loc Adapter data structures. + This class also implements some of the virtual functions that + handle the requests from loc engine. */ +class LocApiV02 : public LocApiBase { +protected: + /* loc api v02 handle*/ + locClientHandleType clientHandle; + +private: + /*ds client handle*/ + dsClientHandleType dsClientHandle; + + /* Convert event mask from loc eng to loc_api_v02 format */ + static locClientEventMaskType convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask); + + /* Convert GPS LOCK mask from gps.conf definition */ + static qmiLocLockEnumT_v02 convertGpsLockMask(LOC_GPS_LOCK_MASK lockMask); + + /* Convert error from loc_api_v02 to loc eng format*/ + static enum loc_api_adapter_err convertErr(locClientStatusEnumType status); + + /* convert Ni Encoding type from QMI_LOC to loc eng format */ + static GpsNiEncodingType convertNiEncoding( + qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding); + + /*convert NI notify verify type from QMI LOC to loc eng format*/ + static bool convertNiNotifyVerifyType (GpsNiNotification *notif, + qmiLocNiNotifyVerifyEnumT_v02 notif_priv); + + /* convert position report to loc eng format and send the converted + position to loc eng */ + void reportPosition + (const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr); + + /* convert satellite report to loc eng format and send the converted + report to loc eng */ + void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr); + + /* convert engine state report to loc eng format and send the converted + report to loc eng */ + void reportEngineState ( + const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr); + + /* convert fix session report to loc eng format and send the converted + report to loc eng */ + void reportFixSessionState ( + const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr); + + /* convert NMEA report to loc eng format and send the converted + report to loc eng */ + void reportNmea (const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr); + + /* convert and report an ATL request to loc engine */ + void reportAtlRequest( + const qmiLocEventLocationServerConnectionReqIndMsgT_v02 + *server_request_ptr); + + /* convert and report NI request to loc eng */ + void reportNiRequest( + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr); + + /* report the xtra server info */ + void reportXtraServerUrl( + const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* server_request_ptr); + +protected: + virtual enum loc_api_adapter_err + open(LOC_API_ADAPTER_EVENT_MASK_T mask); + virtual enum loc_api_adapter_err + close(); + +public: + LocApiV02(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase *context = NULL); + ~LocApiV02(); + + /* event callback registered with the loc_api v02 interface */ + virtual void eventCb(locClientHandleType client_handle, + uint32_t loc_event_id, + locClientEventIndUnionType loc_event_payload); + + /* error callback, this function handles the service unavailable + error */ + void errorCb(locClientHandleType handle, + locClientErrorEnumType errorId); + + void ds_client_event_cb(ds_client_status_enum_type result); + + virtual enum loc_api_adapter_err startFix(const LocPosMode& posMode); + + virtual enum loc_api_adapter_err stopFix(); + + virtual enum loc_api_adapter_err + setPositionMode(const LocPosMode& mode); + + virtual enum loc_api_adapter_err + setTime(GpsUtcTime time, int64_t timeReference, int uncertainty); + + virtual enum loc_api_adapter_err + injectPosition(double latitude, double longitude, float accuracy); + + virtual enum loc_api_adapter_err + deleteAidingData(GpsAidingData f); + + virtual enum loc_api_adapter_err + informNiResponse(GpsUserResponseType userResponse, + const void* passThroughData); + + virtual enum loc_api_adapter_err + setServer(const char* url, int len); + virtual enum loc_api_adapter_err + setServer(unsigned int ip, int port, LocServerType type); + virtual enum loc_api_adapter_err + setXtraData(char* data, int length); + virtual enum loc_api_adapter_err + requestXtraServer(); + virtual enum loc_api_adapter_err + atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, + AGpsType agpsType); + virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ); + virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version); + virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile); + + virtual enum loc_api_adapter_err + setSensorControlConfig(int sensorUsage, int sensorProvider); + + virtual enum loc_api_adapter_err + setSensorProperties(bool gyroBiasVarianceRandomWalk_valid, float gyroBiasVarianceRandomWalk, + bool accelBiasVarianceRandomWalk_valid, float accelBiasVarianceRandomWalk, + bool angleBiasVarianceRandomWalk_valid, float angleBiasVarianceRandomWalk, + bool rateBiasVarianceRandomWalk_valid, float rateBiasVarianceRandomWalk, + bool velocityBiasVarianceRandomWalk_valid, float velocityBiasVarianceRandomWalk); + + virtual enum loc_api_adapter_err + setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, + int gyroSamplesPerBatch, int gyroBatchesPerSec, + int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh, + int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig); + virtual enum loc_api_adapter_err setExtPowerConfig(int isBatteryCharging); + virtual enum loc_api_adapter_err setAGLONASSProtocol(unsigned long aGlonassProtocol); + virtual enum loc_api_adapter_err + getWwanZppFix(GpsLocation & zppLoc); + virtual enum loc_api_adapter_err + getBestAvailableZppFix(GpsLocation & zppLoc); + virtual enum loc_api_adapter_err + getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask); + virtual int initDataServiceClient(); + virtual int openAndStartDataCall(); + virtual void stopDataCall(); + virtual void closeDataCall(); + virtual int setGpsLock(LOC_GPS_LOCK_MASK lock); + + /* + Returns + Current value of GPS Lock on success + -1 on failure + */ + virtual int getGpsLock(void); + virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check); + virtual void installAGpsCert(const DerEncodedCertificate* pData, + size_t length, + uint32_t slotBitMask); + +private: + locClientEventMaskType mQmiMask = 0; + bool mInSession = false; + bool mEngineOn = false; + + bool registerEventMask(locClientEventMaskType qmiMask); + locClientEventMaskType adjustMaskForNoSession(locClientEventMaskType qmiMask); +}; + +extern "C" LocApiBase* getLocApi(const MsgTask* msgTask, + LOC_API_ADAPTER_EVENT_MASK_T exMask, + ContextBase *context); +#endif //LOC_API_V_0_2_H diff --git a/gps/loc_api/loc_api_v02/Makefile.am b/gps/loc_api/loc_api_v02/Makefile.am new file mode 100644 index 0000000..2308cd4 --- /dev/null +++ b/gps/loc_api/loc_api_v02/Makefile.am @@ -0,0 +1,42 @@ +AM_CFLAGS = \ + ${QMIF_CFLAGS} \ + -I../../utils \ + -I../../platform_lib_abstractions \ + -I../libloc_api_50001 + +requiredlibs = \ + ${QMIF_LIBS} \ + ../libloc_api_50001/libloc_adapter_so.la \ + ../../utils/libgps_utils_so.la + +h_sources = LocApiV02Adapter.h \ + loc_util_log.h \ + location_service_v02.h \ + loc_api_sync_req.h \ + loc_api_v02_client.h \ + loc_api_v02_log.h + +c_sources = LocApiV02Adapter.cpp \ + loc_api_v02_log.c \ + loc_api_v02_client.c \ + loc_api_sync_req.c \ + location_service_v02.c + +library_includedir = $(pkgincludedir) +library_include_HEADERS = $(h_sources) + +libloc_api_la_SOURCES = $(c_sources) $(h_sources) + +if USE_GLIB +libloc_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libloc_api_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libloc_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libloc_api_la_CFLAGS = $(AM_CFLAGS) +libloc_api_la_LDFLAGS = -shared -version-info 1:0:0 +libloc_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +libloc_api_la_LIBADD = $(requiredlibs) -lstdc++ + +lib_LTLIBRARIES = libloc_api.la diff --git a/gps/loc_api/loc_api_v02/loc_api_sync_req.c b/gps/loc_api/loc_api_v02/loc_api_sync_req.c new file mode 100644 index 0000000..6a08666 --- /dev/null +++ b/gps/loc_api/loc_api_v02/loc_api_sync_req.c @@ -0,0 +1,547 @@ +/* Copyright (c) 2011-2012, 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include "loc_api_v02_client.h" +#include "loc_api_sync_req.h" + +/* Logging */ +// Uncomment to log verbose logs +#define LOG_NDEBUG 1 + +// log debug logs +#define LOG_NDDEBUG 1 +#define LOG_TAG "LocSvc_api_v02" +#include "loc_util_log.h" + +#define LOC_SYNC_REQ_BUFFER_SIZE 8 +#define GPS_CONF_FILE "/etc/gps.conf" +pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER; + +static bool loc_sync_call_initialized = false; + +typedef struct { + pthread_mutex_t sync_req_lock; + + /* Client ID */ + locClientHandleType client_handle; + + /* waiting conditional variable */ + pthread_cond_t ind_arrived_cond; + + /* Callback waiting data block, protected by loc_cb_data_mutex */ + bool ind_is_selected; /* is cb selected? */ + bool ind_is_waiting; /* is waiting? */ + bool ind_has_arrived; /* callback has arrived */ + uint32_t req_id; /* sync request */ + void *recv_ind_payload_ptr; /* received payload */ + uint32_t recv_ind_id; /* received ind */ + +} loc_sync_req_data_s_type; + +typedef struct { + bool in_use; /* at least one sync call is active */ + bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE]; + loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE]; +} loc_sync_req_array_s_type; + +/*************************************************************************** + * DATA FOR ASYNCHRONOUS RPC PROCESSING + **************************************************************************/ +loc_sync_req_array_s_type loc_sync_array; + +/*=========================================================================== + +FUNCTION loc_sync_req_init + +DESCRIPTION + Initialize this module + +DEPENDENCIES + N/A + +RETURN VALUE + none + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_sync_req_init() +{ + LOC_LOGV(" %s:%d]:\n", __func__, __LINE__); + UTIL_READ_CONF_DEFAULT(GPS_CONF_FILE); + pthread_mutex_lock(&loc_sync_call_mutex); + if(true == loc_sync_call_initialized) + { + LOC_LOGD("%s:%d]:already initialized\n", __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + loc_sync_array.in_use = false; + + memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use)); + + int i; + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + pthread_mutex_init(&slot->sync_req_lock, NULL); + pthread_cond_init(&slot->ind_arrived_cond, NULL); + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; /* req id */ + } + + loc_sync_call_initialized = true; + pthread_mutex_unlock(&loc_sync_call_mutex); +} + + +/*=========================================================================== + +FUNCTION loc_sync_process_ind + +DESCRIPTION + Wakes up blocked API calls to check if the needed callback has arrived + +DEPENDENCIES + N/A + +RETURN VALUE + none + +SIDE EFFECTS + N/A + +===========================================================================*/ +void loc_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* ind id */ + void *ind_payload_ptr /* payload */ +) +{ + + LOC_LOGV("%s:%d]: received indication, handle = %p ind_id = %u \n", + __func__,__LINE__, client_handle, ind_id); + + pthread_mutex_lock(&loc_sync_call_mutex); + + if (!loc_sync_array.in_use) + { + LOC_LOGD("%s:%d]: loc_sync_array not in use \n", + __func__, __LINE__); + pthread_mutex_unlock(&loc_sync_call_mutex); + return; + } + + bool in_use = false, consumed = false; + int i; + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++) + { + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i]; + + in_use |= loc_sync_array.slot_in_use[i]; + + pthread_mutex_lock(&slot->sync_req_lock); + + if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle) + && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived)) + { + // copy the payload to the slot waiting for this ind + size_t payload_size = 0; + + LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n", + __func__, __LINE__, i, ind_id); + + if(true == locClientGetSizeByRespIndId(ind_id, &payload_size) && + NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr) + { + LOC_LOGV("%s:%d]: copying ind payload size = %u \n", + __func__, __LINE__, payload_size); + + memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size); + + consumed = true; + + } + /* Received a callback while waiting, wake up thread to check it */ + if (slot->ind_is_waiting) + { + slot->recv_ind_id = ind_id; + + pthread_cond_signal(&slot->ind_arrived_cond); + } + else + { + /* If callback arrives before wait, remember it */ + LOC_LOGV("%s:%d]: ind %u arrived before wait was called \n", + __func__, __LINE__, ind_id); + + slot->ind_has_arrived = true; + } + } + pthread_mutex_unlock(&slot->sync_req_lock); + } + + if (!in_use) { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_alloc_slot + +DESCRIPTION + Allocates a buffer slot for the synchronous API call + +DEPENDENCIES + N/A + +RETURN VALUE + Select ID (>=0) : successful + -1 : buffer full + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_alloc_slot() +{ + int i, select_id = -1; /* no free buffer */ + + pthread_mutex_lock(&loc_sync_call_mutex); + + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (!loc_sync_array.slot_in_use[i]) + { + select_id = i; + loc_sync_array.slot_in_use[i] = 1; + loc_sync_array.in_use = true; + break; + } + } + + pthread_mutex_unlock(&loc_sync_call_mutex); + LOC_LOGV("%s:%d]: returning slot %d\n", + __func__, __LINE__, select_id); + return select_id; +} + +/*=========================================================================== + +FUNCTION loc_free_slot + +DESCRIPTION + Frees a buffer slot after the synchronous API call + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A + +===========================================================================*/ +static void loc_free_slot(int select_id) +{ + int i; + loc_sync_req_data_s_type *slot; + + pthread_mutex_lock(&loc_sync_call_mutex); + + LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id); + + loc_sync_array.slot_in_use[select_id] = 0; + + slot = &loc_sync_array.slots[select_id]; + + slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE; + slot->ind_is_selected = false; /* is ind selected? */ + slot->ind_is_waiting = false; /* is waiting? */ + slot->ind_has_arrived = false; /* callback has arrived */ + slot->recv_ind_id = 0; /* ind to wait for */ + slot->recv_ind_payload_ptr = NULL; + slot->req_id = 0; + + // check if all slots are now free + for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++) + { + if (loc_sync_array.slot_in_use[i]) break; + } + + if (i >= LOC_SYNC_REQ_BUFFER_SIZE) + { + loc_sync_array.in_use = false; + } + + pthread_mutex_unlock(&loc_sync_call_mutex); +} + +/*=========================================================================== + +FUNCTION loc_sync_select_ind + +DESCRIPTION + Selects which indication to wait for. + + +DEPENDENCIES + N/A + +RETURN VALUE + Select ID (>=0) : successful + -ENOMEM : out of buffer + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_select_ind( + locClientHandleType client_handle, /* Client handle */ + uint32_t ind_id, /* ind Id wait for */ + uint32_t req_id, /* req id */ + void * ind_payload_ptr /* ptr where payload should be copied to*/ +) +{ + int select_id = loc_alloc_slot(); + + LOC_LOGV("%s:%d]: client handle %p, ind_id %u, req_id %u \n", + __func__, __LINE__, client_handle, ind_id, req_id); + + if (select_id < 0) + { + LOC_LOGE("%s:%d]: buffer full for this synchronous req %s \n", + __func__, __LINE__, loc_get_v02_event_name(req_id)); + return -ENOMEM; + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + pthread_mutex_lock(&slot->sync_req_lock); + + slot->client_handle = client_handle; + slot->ind_is_selected = true; + slot->ind_is_waiting = false; + slot->ind_has_arrived = false; + + slot->recv_ind_id = ind_id; + slot->req_id = req_id; + slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr + + pthread_mutex_unlock(&slot->sync_req_lock); + + return select_id; +} + + +/*=========================================================================== + +FUNCTION loc_sync_wait_for_ind + +DESCRIPTION + Waits for a selected indication. The wait expires in timeout_seconds seconds. + If the function is called before an existing wait has finished, it will + immediately return error. + +DEPENDENCIES + N/A + +RETURN VALUE + 0 on SUCCESS, -ve value on failure + +SIDE EFFECTS + N/A + +===========================================================================*/ +static int loc_sync_wait_for_ind( + int select_id, /* ID from loc_sync_select_ind() */ + int timeout_seconds, /* Timeout in this number of seconds */ + uint32_t ind_id +) +{ + if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id]) + { + LOC_LOGE("%s:%d]: invalid select_id: %d \n", + __func__, __LINE__, select_id); + + return (-EINVAL); + } + + loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id]; + + int ret_val = 0; /* the return value of this function: 0 = no error */ + int rc; /* return code from pthread calls */ + + struct timeval present_time; + struct timespec expire_time; + + pthread_mutex_lock(&slot->sync_req_lock); + + do + { + if (slot->ind_has_arrived) + { + ret_val = 0; /* success */ + break; + } + + if (slot->ind_is_waiting) + { + LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__, + __LINE__, select_id); + ret_val = -EBUSY; // busy + break; + } + + /* Calculate absolute expire time */ + gettimeofday(&present_time, NULL); + expire_time.tv_sec = present_time.tv_sec; + expire_time.tv_nsec = present_time.tv_usec * 1000; + expire_time.tv_sec += timeout_seconds; + + /* Take new wait request */ + slot->ind_is_waiting = true; + + /* Waiting */ + rc = pthread_cond_timedwait(&slot->ind_arrived_cond, + &slot->sync_req_lock, &expire_time); + + slot->ind_is_waiting = false; + + if(rc == ETIMEDOUT) + { + LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n", + __func__, __LINE__, select_id, loc_get_v02_event_name(ind_id)); + ret_val = -ETIMEDOUT; //time out + } + + } while (0); + + pthread_mutex_unlock(&slot->sync_req_lock); + loc_free_slot(select_id); + + return ret_val; +} + +/*=========================================================================== + +FUNCTION loc_sync_send_req + +DESCRIPTION + Synchronous req call (thread safe) + +DEPENDENCIES + N/A + +RETURN VALUE + Loc API 2.0 status + +SIDE EFFECTS + N/A + +===========================================================================*/ +locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ; + int select_id; + int rc = 0; + + // Select the callback we are waiting for + select_id = loc_sync_select_ind(client_handle, ind_id, req_id, + ind_payload_ptr); + + if (select_id >= 0) + { + status = locClientSendReq (client_handle, req_id, req_payload); + LOC_LOGV("%s:%d]: select_id = %d,locClientSendReq returned %d\n", + __func__, __LINE__, select_id, status); + + if (status != eLOC_CLIENT_SUCCESS ) + { + loc_free_slot(select_id); + } + else + { + // Wait for the indication callback + if (( rc = loc_sync_wait_for_ind( select_id, + timeout_msec / 1000, + ind_id) ) < 0) + { + if ( rc == -ETIMEDOUT) + status = eLOC_CLIENT_FAILURE_TIMEOUT; + else + status = eLOC_CLIENT_FAILURE_INTERNAL; + + // Callback waiting failed + LOC_LOGE("%s:%d]: loc_api_wait_for_ind failed, err %d, " + "select id %d, status %s", __func__, __LINE__, rc , + select_id, loc_get_v02_client_status_name(status)); + } + else + { + status = eLOC_CLIENT_SUCCESS; + LOC_LOGV("%s:%d]: success (select id %d)\n", + __func__, __LINE__, select_id); + } + } + } /* select id */ + + return status; +} + + diff --git a/gps/loc_api/loc_api_v02/loc_api_sync_req.h b/gps/loc_api/loc_api_v02/loc_api_sync_req.h new file mode 100644 index 0000000..167c7c3 --- /dev/null +++ b/gps/loc_api/loc_api_v02/loc_api_sync_req.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2011, 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_SYNC_REQ_H +#define LOC_SYNC_REQ_H + +#ifdef __cplusplus +extern "C" +{ +#endif +#include +#include +#include "loc_api_v02_client.h" + +#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second + +#define LOC_SEND_SYNC_REQ(NAME, ID, REQ, HANDLE) \ + int rv = true; \ + locClientStatusEnumType st; \ + locClientReqUnionType reqUnion; \ + qmiLoc##NAME##IndMsgT_v02 ind; \ +\ + reqUnion.p##NAME##Req = &REQ; \ +\ + st = loc_sync_send_req(HANDLE, \ + QMI_LOC_##ID##_REQ_V02, \ + reqUnion, \ + LOC_ENGINE_SYNC_REQUEST_TIMEOUT, \ + QMI_LOC_##ID##_IND_V02, \ + &ind); \ +\ + if (st != eLOC_CLIENT_SUCCESS || \ + eQMI_LOC_SUCCESS_V02 != ind.status) { \ + LOC_LOGE ("%s:%d]: Error : st = %d, ind.status = %d", \ + __func__, __LINE__, st, ind.status); \ + rv = false; \ + } + +/* Init function */ +extern void loc_sync_req_init(); + + +/* Process Loc API indications to wake up blocked user threads */ +extern void loc_sync_process_ind( + locClientHandleType client_handle, /* handle of the client */ + uint32_t ind_id , /* respInd id */ + void *ind_payload_ptr /* payload */ +); + +/* Thread safe synchronous request, using Loc API status return code */ +extern locClientStatusEnumType loc_sync_send_req +( + locClientHandleType client_handle, + uint32_t req_id, /* req id */ + locClientReqUnionType req_payload, + uint32_t timeout_msec, + uint32_t ind_id, //ind ID to block for, usually the same as req_id */ + void *ind_payload_ptr /* can be NULL*/ +); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_SYNC_REQ_H */ 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 new file mode 100644 index 0000000..7022268 --- /dev/null +++ b/gps/loc_api/loc_api_v02/loc_api_v02_client.c @@ -0,0 +1,2648 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include + +#include "qmi_client.h" +#include "qmi_idl_lib.h" +#include "qmi_cci_target_ext.h" + +#if defined( _ANDROID_) +#include "qmi_cci_target.h" +#include "qmi_cci_common.h" +#define LOG_NDEBUG 0 +#define LOG_TAG "LocSvc_api_v02" +#endif //_ANDROID_ + + +#include "loc_api_v02_client.h" +#include "loc_util_log.h" + +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (5000) + +#else + +// timeout in ms before send_msg_sync should return +#define LOC_CLIENT_ACK_TIMEOUT (1000) + +#endif //LOC_UTIL_TARGET_OFF_TARGET + +#define LOC_CLIENT_MAX_OPEN_RETRIES (20) +#define LOC_CLIENT_TIME_BETWEEN_OPEN_RETRIES (1) + +enum +{ + //! Special value for selecting any available service + /** This value enables selection of any available service */ + eLOC_CLIENT_INSTANCE_ID_ANY = -1, + //! qca1530 service id value + /** qca1530 service daemon uses service id value 1 */ + eLOC_CLIENT_INSTANCE_ID_QCA1530 = 1, + //! GSS service id value + /* GSS service id value is 0, but here it is set to -1 for compatibitily */ + eLOC_CLIENT_INSTANCE_ID_GSS = eLOC_CLIENT_INSTANCE_ID_ANY, + //! MSM service id value + /** MSM service id value is 0, but here it is set to -1 for compatibitily */ + eLOC_CLIENT_INSTANCE_ID_MSM = eLOC_CLIENT_INSTANCE_ID_ANY, + //! MDM service id value + /** MDM connects using QMUXD and assigned a value of + QMI_CLIENT_QMUX_RMNET_USB_INSTANCE_0 ("qmi_client_instance_defs.h", 37). + -1 for compatibility */ + eLOC_CLIENT_INSTANCE_ID_MDM = eLOC_CLIENT_INSTANCE_ID_ANY, +}; + +/* Table to relate eventId, size and mask value used to enable the event*/ +typedef struct +{ + uint32_t eventId; + size_t eventSize; + locClientEventMaskType eventMask; +}locClientEventIndTableStructT; + + +static locClientEventIndTableStructT locClientEventIndTable[]= { + + // position report ind + { QMI_LOC_EVENT_POSITION_REPORT_IND_V02, + sizeof(qmiLocEventPositionReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 }, + + // satellite report ind + { QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, + sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), + QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 }, + + // NMEA report ind + { QMI_LOC_EVENT_NMEA_IND_V02, + sizeof(qmiLocEventNmeaIndMsgT_v02), + QMI_LOC_EVENT_MASK_NMEA_V02 }, + + //NI event ind + { QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, + sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 }, + + //Time Injection Request Ind + { QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, + sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 }, + + //Predicted Orbits Injection Request + { QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, + sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 }, + + //Position Injection Request Ind + { QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, + sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 } , + + //Engine State Report Ind + { QMI_LOC_EVENT_ENGINE_STATE_IND_V02, + sizeof(qmiLocEventEngineStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 }, + + //Fix Session State Report Ind + { QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, + sizeof(qmiLocEventFixSessionStateIndMsgT_v02), + QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 }, + + //Wifi Request Indication + { QMI_LOC_EVENT_WIFI_REQ_IND_V02, + sizeof(qmiLocEventWifiReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_WIFI_REQ_V02 }, + + //Sensor Streaming Ready Status Ind + { QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, + sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), + QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 }, + + // Time Sync Request Indication + { QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02, + sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 }, + + //Set Spi Streaming Report Event + { QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02, + sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 }, + + //Location Server Connection Request event + { QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02, + sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 }, + + // NI Geofence Event + { QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02, + sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), + QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02}, + + // Geofence General Alert Event + { QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02, + sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), + QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02}, + + //Geofence Breach event + { QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02, + sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), + QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02}, + + //Geofence Batched Breach event + { QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02, + sizeof(qmiLocEventGeofenceBatchedBreachIndMsgT_v02), + QMI_LOC_EVENT_MASK_GEOFENCE_BATCH_BREACH_NOTIFICATION_V02}, + + //Pedometer Control event + { QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02, + sizeof(qmiLocEventPedometerControlIndMsgT_v02), + QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 }, + + //Motion Data Control event + { QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02, + sizeof(qmiLocEventMotionDataControlIndMsgT_v02), + QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 }, + + //Wifi AP data request event + { QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_IND_V02, + sizeof(qmiLocEventInjectWifiApDataReqIndMsgT_v02), + QMI_LOC_EVENT_MASK_INJECT_WIFI_AP_DATA_REQ_V02 }, + + //Get Batching On Fix Event + { QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02, + sizeof(qmiLocEventLiveBatchedPositionReportIndMsgT_v02), + QMI_LOC_EVENT_MASK_LIVE_BATCHED_POSITION_REPORT_V02 }, + + //Get Batching On Full Event + { QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02, + sizeof(qmiLocEventBatchFullIndMsgT_v02), + QMI_LOC_EVENT_MASK_BATCH_FULL_NOTIFICATION_V02 }, + + //Vehicle Data Readiness event + { QMI_LOC_EVENT_VEHICLE_DATA_READY_STATUS_IND_V02, + sizeof(qmiLocEventVehicleDataReadyIndMsgT_v02), + QMI_LOC_EVENT_MASK_VEHICLE_DATA_READY_STATUS_V02 }, + + //Geofence Proximity event + { QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02, + sizeof(qmiLocEventGeofenceProximityIndMsgT_v02), + QMI_LOC_EVENT_MASK_GEOFENCE_PROXIMITY_NOTIFICATION_V02} + +}; + +/* table to relate the respInd Id with its size */ +typedef struct +{ + uint32_t respIndId; + size_t respIndSize; +}locClientRespIndTableStructT; + +static locClientRespIndTableStructT locClientRespIndTable[]= { + + // get service revision ind + { QMI_LOC_GET_SERVICE_REVISION_IND_V02, + sizeof(qmiLocGetServiceRevisionIndMsgT_v02)}, + + // Get Fix Criteria Resp Ind + { QMI_LOC_GET_FIX_CRITERIA_IND_V02, + sizeof(qmiLocGetFixCriteriaIndMsgT_v02)}, + + // NI User Resp In + { QMI_LOC_NI_USER_RESPONSE_IND_V02, + sizeof(qmiLocNiUserRespIndMsgT_v02)}, + + //Inject Predicted Orbits Data Resp Ind + { QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, + sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02)}, + + //Get Predicted Orbits Data Src Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02)}, + + // Get Predicted Orbits Data Validity Resp Ind + { QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, + sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02)}, + + // Inject UTC Time Resp Ind + { QMI_LOC_INJECT_UTC_TIME_IND_V02, + sizeof(qmiLocInjectUtcTimeIndMsgT_v02)}, + + //Inject Position Resp Ind + { QMI_LOC_INJECT_POSITION_IND_V02, + sizeof(qmiLocInjectPositionIndMsgT_v02)}, + + //Set Engine Lock Resp Ind + { QMI_LOC_SET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocSetEngineLockIndMsgT_v02)}, + + //Get Engine Lock Resp Ind + { QMI_LOC_GET_ENGINE_LOCK_IND_V02, + sizeof(qmiLocGetEngineLockIndMsgT_v02)}, + + //Set SBAS Config Resp Ind + { QMI_LOC_SET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocSetSbasConfigIndMsgT_v02)}, + + //Get SBAS Config Resp Ind + { QMI_LOC_GET_SBAS_CONFIG_IND_V02, + sizeof(qmiLocGetSbasConfigIndMsgT_v02)}, + + //Set NMEA Types Resp Ind + { QMI_LOC_SET_NMEA_TYPES_IND_V02, + sizeof(qmiLocSetNmeaTypesIndMsgT_v02)}, + + //Get NMEA Types Resp Ind + { QMI_LOC_GET_NMEA_TYPES_IND_V02, + sizeof(qmiLocGetNmeaTypesIndMsgT_v02)}, + + //Set Low Power Mode Resp Ind + { QMI_LOC_SET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocSetLowPowerModeIndMsgT_v02)}, + + //Get Low Power Mode Resp Ind + { QMI_LOC_GET_LOW_POWER_MODE_IND_V02, + sizeof(qmiLocGetLowPowerModeIndMsgT_v02)}, + + //Set Server Resp Ind + { QMI_LOC_SET_SERVER_IND_V02, + sizeof(qmiLocSetServerIndMsgT_v02)}, + + //Get Server Resp Ind + { QMI_LOC_GET_SERVER_IND_V02, + sizeof(qmiLocGetServerIndMsgT_v02)}, + + //Delete Assist Data Resp Ind + { QMI_LOC_DELETE_ASSIST_DATA_IND_V02, + sizeof(qmiLocDeleteAssistDataIndMsgT_v02)}, + + //Set XTRA-T Session Control Resp Ind + { QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02)}, + + //Get XTRA-T Session Control Resp Ind + { QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, + sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02)}, + + //Inject Wifi Position Resp Ind + { QMI_LOC_INJECT_WIFI_POSITION_IND_V02, + sizeof(qmiLocInjectWifiPositionIndMsgT_v02)}, + + //Notify Wifi Status Resp Ind + { QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, + sizeof(qmiLocNotifyWifiStatusIndMsgT_v02)}, + + //Get Registered Events Resp Ind + { QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, + sizeof(qmiLocGetRegisteredEventsIndMsgT_v02)}, + + //Set Operation Mode Resp Ind + { QMI_LOC_SET_OPERATION_MODE_IND_V02, + sizeof(qmiLocSetOperationModeIndMsgT_v02)}, + + //Get Operation Mode Resp Ind + { QMI_LOC_GET_OPERATION_MODE_IND_V02, + sizeof(qmiLocGetOperationModeIndMsgT_v02)}, + + //Set SPI Status Resp Ind + { QMI_LOC_SET_SPI_STATUS_IND_V02, + sizeof(qmiLocSetSpiStatusIndMsgT_v02)}, + + //Inject Sensor Data Resp Ind + { QMI_LOC_INJECT_SENSOR_DATA_IND_V02, + sizeof(qmiLocInjectSensorDataIndMsgT_v02)}, + + //Inject Time Sync Data Resp Ind + { QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, + sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02)}, + + //Set Cradle Mount config Resp Ind + { QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocSetCradleMountConfigIndMsgT_v02)}, + + //Get Cradle Mount config Resp Ind + { QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, + sizeof(qmiLocGetCradleMountConfigIndMsgT_v02)}, + + //Set External Power config Resp Ind + { QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02)}, + + //Get External Power config Resp Ind + { QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, + sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02)}, + + //Location server connection status + { QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, + sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02)}, + + //Set Protocol Config Parameters + { QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02)}, + + //Get Protocol Config Parameters + { QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02)}, + + //Set Sensor Control Config + { QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocSetSensorControlConfigIndMsgT_v02)}, + + //Get Sensor Control Config + { QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, + sizeof(qmiLocGetSensorControlConfigIndMsgT_v02)}, + + //Set Sensor Properties + { QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocSetSensorPropertiesIndMsgT_v02)}, + + //Get Sensor Properties + { QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, + sizeof(qmiLocGetSensorPropertiesIndMsgT_v02)}, + + //Set Sensor Performance Control Config + { QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02)}, + + //Get Sensor Performance Control Config + { QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, + sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02)}, + //Inject SUPL certificate + { QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocInjectSuplCertificateIndMsgT_v02) }, + + //Delete SUPL certificate + { QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, + sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02) }, + + // Set Position Engine Config + { QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02)}, + + // Get Position Engine Config + { QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, + sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02)}, + + //Add a Circular Geofence + { QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02, + sizeof(qmiLocAddCircularGeofenceIndMsgT_v02)}, + + //Delete a Geofence + { QMI_LOC_DELETE_GEOFENCE_IND_V02, + sizeof(qmiLocDeleteGeofenceIndMsgT_v02)} , + + //Query a Geofence + { QMI_LOC_QUERY_GEOFENCE_IND_V02, + sizeof(qmiLocQueryGeofenceIndMsgT_v02)}, + + //Edit a Geofence + { QMI_LOC_EDIT_GEOFENCE_IND_V02, + sizeof(qmiLocEditGeofenceIndMsgT_v02)}, + + //Get best available position + { QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, + sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02)}, + + //Inject motion data + { QMI_LOC_INJECT_MOTION_DATA_IND_V02, + sizeof(qmiLocInjectMotionDataIndMsgT_v02)}, + + //Get NI Geofence list + { QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, + sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02)}, + + //Inject GSM Cell Info + { QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, + sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02)}, + + //Inject Network Initiated Message + { QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, + sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02)}, + + //WWAN Out of Service Notification + { QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, + sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02)}, + + //Pedomete Report + { QMI_LOC_PEDOMETER_REPORT_IND_V02, + sizeof(qmiLocPedometerReportIndMsgT_v02)}, + + { QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, + sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02)}, + + { QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, + sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02)}, + + { QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, + sizeof(qmiLocInjectSubscriberIDIndMsgT_v02)}, + + //Inject Wifi AP data Resp Ind + { QMI_LOC_INJECT_WIFI_AP_DATA_IND_V02, + sizeof(qmiLocInjectWifiApDataIndMsgT_v02)}, + + { QMI_LOC_START_BATCHING_IND_V02, + sizeof(qmiLocStartBatchingIndMsgT_v02)}, + + { QMI_LOC_STOP_BATCHING_IND_V02, + sizeof(qmiLocStopBatchingIndMsgT_v02)}, + + { QMI_LOC_GET_BATCH_SIZE_IND_V02, + sizeof(qmiLocGetBatchSizeIndMsgT_v02)}, + + { QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02, + sizeof(qmiLocEventPositionReportIndMsgT_v02)}, + + { QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02, + sizeof(qmiLocEventBatchFullIndMsgT_v02)}, + + { QMI_LOC_READ_FROM_BATCH_IND_V02, + sizeof(qmiLocReadFromBatchIndMsgT_v02)}, + + { QMI_LOC_RELEASE_BATCH_IND_V02, + sizeof(qmiLocReleaseBatchIndMsgT_v02)}, + + { QMI_LOC_SET_XTRA_VERSION_CHECK_IND_V02, + sizeof(qmiLocSetXtraVersionCheckIndMsgT_v02)}, + + //Vehicle Sensor Data + { QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02, + sizeof(qmiLocInjectVehicleSensorDataIndMsgT_v02)}, + + { QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_IND_V02, + sizeof(qmiLocNotifyWifiAttachmentStatusIndMsgT_v02)}, + + { QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_IND_V02, + sizeof(qmiLocNotifyWifiEnabledStatusIndMsgT_v02)}, + + { QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_IND_V02, + sizeof(qmiLocSetPremiumServicesCfgReqMsgT_v02)}, + + { QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02, + sizeof(qmiLocGetAvailWwanPositionIndMsgT_v02)} +}; + + +/** whether indication is an event or a response */ +typedef enum { eventIndType =0, respIndType = 1 } locClientIndEnumT; + + +/** @struct locClientInternalState + */ + +typedef struct locClientCbDataStructT locClientCallbackDataType; + +struct locClientCbDataStructT +{ + // client cookie + void *pClientCookie; + //QCCI handle for this control point + qmi_client_type userHandle; + + // callbacks registered by the clients + locClientEventIndCbType eventCallback; + locClientRespIndCbType respCallback; + locClientErrorCbType errorCallback; + + // the event mask the client has registered for + locClientEventMaskType eventRegMask; + + //pointer to itself for checking consistency data + locClientCallbackDataType *pMe; +}; + + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ + +/** locClientGetSizeAndTypeByIndId + * @brief this function gets the size and the type (event, + * response)of the indication structure from its ID + * @param [in] indId ID of the indication + * @param [out] type event or response indication + * @param [out] size size of the indications + * + * @return true if the ID was found, false otherwise */ + +static bool locClientGetSizeAndTypeByIndId (uint32_t indId, size_t *pIndSize, + locClientIndEnumT *pIndType) +{ + // look in the event table + if(true == locClientGetSizeByEventIndId(indId, pIndSize)) + { + *pIndType = eventIndType; + + LOC_LOGV("%s:%d]: indId %d is an event size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + //else look in response table + if(true == locClientGetSizeByRespIndId(indId, pIndSize)) + { + *pIndType = respIndType; + + LOC_LOGV("%s:%d]: indId %d is a resp size = %d\n", __func__, __LINE__, + indId, (uint32_t)*pIndSize); + return true; + } + + // Id not found + LOC_LOGW("%s:%d]: indId %d not found\n", __func__, __LINE__, indId); + 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>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, + qmiLocGetSupportMsgT_v02 *pResponse, + uint64_t* supportedMsg) +{ + uint64_t result = 0; + if (pResponse->resp.supported_msgs_valid) { + + /* For example, if a service supports exactly four messages with + IDs 0, 1, 30, and 31 (decimal), the array (in hexadecimal) is + 4 bytes [03 00 00 c0]. */ + + size_t idx = 0; + uint32_t reqId = 0; + uint32_t length = 0; + uint32_t supportedMsgsLen = pResponse->resp.supported_msgs_len; + + // every bit saves a checked message result + uint32_t maxCheckedMsgsSavedNum = sizeof(result)<<3; + + uint32_t loopSize = reqIdArrayLength; + loopSize = + loopSize < supportedMsgsLen ? loopSize : supportedMsgsLen; + loopSize = + loopSize < maxCheckedMsgsSavedNum ? loopSize : maxCheckedMsgsSavedNum; + + for (idx = 0; idx < loopSize; idx++) { + reqId = reqIdArray[idx]; + length = reqId >> 3; + if(supportedMsgsLen > length) { + uint32_t bit = reqId & ((uint32_t)7); + if (pResponse->resp.supported_msgs[length] & (1<resp.result == QMI_RESULT_SUCCESS_V01 ) + { + status = eLOC_CLIENT_SUCCESS; + } + else + { + switch(pResponse->resp.error) + { + case QMI_ERR_MALFORMED_MSG_V01: + case QMI_ERR_INVALID_ARG_V01: + status = eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + break; + + case QMI_ERR_DEVICE_IN_USE_V01: + status = eLOC_CLIENT_FAILURE_ENGINE_BUSY; + break; + + default: + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + } + LOC_LOGV("%s:%d]: result = %d, error = %d, status = %d\n", + __func__, __LINE__, pResponse->resp.result, + pResponse->resp.error, status); + return status; +} + +/** convertQmiErrorToLocError + @brief converts a qmi service error type to + locClientErrorEnumType + @param [in] error received QMI service. + @return locClientErrorEnumType corresponding to the error. +*/ + +static locClientErrorEnumType convertQmiErrorToLocError( + qmi_client_error_type error) +{ + locClientErrorEnumType locError ; + switch(error) + { + case QMI_SERVICE_ERR: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + + default: + locError = eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE; + break; + } + LOC_LOGV("%s:%d]: qmi error = %d, loc error = %d\n", + __func__, __LINE__, error, locError); + return locError; +} + +/** locClienHandlePosReportInd + * @brief Validates a position report ind + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if pos report is valid, false otherwise +*/ +static bool locClientHandlePosReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate position report + qmiLocEventPositionReportIndMsgT_v02 *posReport = + (qmiLocEventPositionReportIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %d lat = %f, lon = %f, alt = %f\n", + __func__, __LINE__, ind_buf_len, + posReport->latitude, posReport->longitude, + posReport->altitudeWrtEllipsoid); + + return true; +} +//----------------------------------------------------------------------------- + +/** locClientHandleSatReportInd + * @brief Validates a satellite report indication. Dk + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if sat report is valid, false otherwise +*/ +static bool locClientHandleSatReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate sat reports + unsigned int idx = 0; + qmiLocEventGnssSvInfoIndMsgT_v02 *satReport = + (qmiLocEventGnssSvInfoIndMsgT_v02 *)ind_buf; + + LOC_LOGV ("%s:%d]: len = %u , altitude assumed = %u, num SV's = %u" + " validity = %d \n ", __func__, __LINE__, + ind_buf_len, satReport->altitudeAssumed, + satReport->svList_len, satReport->svList_valid); + //Log SV report + for( idx = 0; idx svList_len; idx++ ) + { + LOC_LOGV("%s:%d]: valid_mask = %x, prn = %u, system = %d, " + "status = %d \n", __func__, __LINE__, + satReport->svList[idx].validMask, satReport->svList[idx].gnssSvId, + satReport->svList[idx].system, satReport->svList[idx].svStatus); + } + + return true; +} + + +/** locClientHandleNmeaReportInd + * @brief Validate a NMEA report indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if nmea report is valid, false otherwise +*/ + + +static bool locClientHandleNmeaReportInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + // validate NMEA report + return true; +} + +/** locClientHandleGetServiceRevisionRespInd + * @brief Handles a Get Service Revision Rresponse indication. + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @return true if service revision is valid, false otherwise +*/ + +static bool locClientHandleGetServiceRevisionRespInd +( + uint32_t msg_id, + const void* ind_buf, + uint32_t ind_buf_len +) +{ + LOC_LOGV("%s:%d] :\n", __func__, __LINE__); + return true; +} + +/** 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: + { + status = locClientHandlePosReportInd(indId, indBuffer, indSize); + break; + } + // handle satellite report + case QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02: + { + status = locClientHandleSatReportInd(indId, indBuffer, indSize); + break; + } + + // handle NMEA report + case QMI_LOC_EVENT_NMEA_IND_V02: + { + status = locClientHandleNmeaReportInd(indId, indBuffer, indSize); + break; + } + + // handle NI Notify Verify Request Ind + case QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02: + { + // locClientHandleNiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Time Inject request Ind + case QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02: + { + // locClientHandleTimeInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle XTRA data Inject request Ind + case QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02: + { + // locClientHandleXtraInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle position inject request Ind + case QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02: + { + // locClientHandlePositionInjectReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle engine state Ind + case QMI_LOC_EVENT_ENGINE_STATE_IND_V02: + { + // locClientHandleEngineStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle fix session state Ind + case QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02: + { + // locClientHandleFixSessionStateInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle Wifi request Ind + case QMI_LOC_EVENT_WIFI_REQ_IND_V02: + { + // locClientHandleWifiReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle sensor streaming ready status Ind + case QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02: + { + // locClientHandleSensorStreamingReadyInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle time sync Ind + case QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02: + { + // locClientHandleTimeSyncReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // handle set streaming report ind + case QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02: + { + // locClientHandleSetSpiStreamingInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02: + { + //locClientHandleLocServerConnReqInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02: + { + //locClientHandleNiGeofenceNotificationInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02: + { + //locClientHandleGeofenceGenAlertInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02: + { + //locClientHandleGeofenceBreachInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02: + { + //locClientHandleGeofenceBatchedBreachInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 : + { + //locClientHandlePedometerControlInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02: + { + //locClientHandleMotionDataControlInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_EVENT_VEHICLE_DATA_READY_STATUS_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02: + { + status = true; + break; + } + //------------------------------------------------------------------------- + + // handle the response indications + //------------------------------------------------------------------------- + + // Get service Revision response indication + case QMI_LOC_GET_SERVICE_REVISION_IND_V02: + { + status = locClientHandleGetServiceRevisionRespInd(indId, + indBuffer, indSize); + break; + } + + case QMI_LOC_GET_FIX_CRITERIA_IND_V02: + { + status = true; + break; + } + + // predicted orbits data response indication + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02: + { + //locClientHandleInjectPredictedOrbitsDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // get predicted orbits source response indication + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02: + { + //locClientHandleGetPredictedOrbitsSourceInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + // get predicted orbits validity response indication + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02: + { + //locClientHandleGetPredictedOrbitsDataValidityInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_IND_V02 : + { + //locClientHandleInjectSensorDataInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleGetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02: + { + //locClientHandleSetProtocolConfigParametersInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02: + { + //locClientHandleGetExtPowerConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02: + { + //locClientHandleGetCradleMountConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02: + { + //locClientHandleGetSensorControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleGetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02: + { + //locClientHandleGetSensorPropertiesInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02: + { + //locClientHandleSetSensorPerformanceControlConfigInd(user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02: + { + // locClientHandleSetPositionEngineConfigParam( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02: + { + // locClientHandleAddCircularGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_DELETE_GEOFENCE_IND_V02: + { + // locClientHandleDeleteGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_EDIT_GEOFENCE_IND_V02: + { + // locClientHandleEditGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_QUERY_GEOFENCE_IND_V02: + { + // locClientHandleQueryGeofenceInd( + // user_handle, msg_id, ind_buf, ind_buf_len); + status = true; + break; + } + + case QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02: + { + status = true; + break; + } + case QMI_LOC_GET_ENGINE_LOCK_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_PEDOMETER_REPORT_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_START_BATCHING_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_STOP_BATCHING_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_GET_BATCH_SIZE_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_READ_FROM_BATCH_IND_V02: + { + status = true; + break; + } + + case QMI_LOC_RELEASE_BATCH_IND_V02: + { + status = true; + break; + } + + // for indications that only have a "status" field + 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 + * available. + * @param [in] user handle + * @param [in] error + * @param [in] *err_cb_data + */ + +static void locClientErrorCb +( + qmi_client_type user_handle, + qmi_client_error_type error, + void *err_cb_data +) +{ + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)err_cb_data; + locClientErrorCbType localErrorCallback = NULL; + + /* copy the errorCallback function pointer from the callback + * data to local variable. This is to protect against the race + * condition between open/close and error callback. + */ + if(NULL != pCallbackData) + { + localErrorCallback = pCallbackData->errorCallback; + } + + LOC_LOGD("%s:%d]: Service Error %d received, pCallbackData = %p\n", + __func__, __LINE__, error, err_cb_data); + + /* call the error callback + * To avoid calling the errorCallback after locClientClose + * is called, check pCallbackData->errorCallback again here + */ + + if( (NULL != pCallbackData) && + (NULL != localErrorCallback) && + (NULL != pCallbackData->errorCallback) && + (pCallbackData == pCallbackData->pMe) ) + { + //invoke the error callback for the corresponding client + localErrorCallback( + (locClientHandleType)pCallbackData, + convertQmiErrorToLocError(error), + pCallbackData->pClientCookie); + } +} + + +/** locClientIndCb + * @brief handles the indications sent from the service, if a + * response indication was received then the it is sent + * to the response callback. If a event indication was + * received then it is sent to the event callback + * @param [in] user handle + * @param [in] msg_id + * @param [in] ind_buf + * @param [in] ind_buf_len + * @param [in] ind_cb_data */ + +static void locClientIndCb +( + qmi_client_type user_handle, + unsigned int msg_id, + void *ind_buf, + unsigned int ind_buf_len, + void *ind_cb_data +) +{ + locClientIndEnumT indType; + size_t indSize = 0; + qmi_client_error_type rc ; + locClientCallbackDataType* pCallbackData = + (locClientCallbackDataType *)ind_cb_data; + + LOC_LOGV("%s:%d]: Indication: msg_id=%d buf_len=%d pCallbackData = %p\n", + __func__, __LINE__, (uint32_t)msg_id, ind_buf_len, + pCallbackData); + + // check callback data + if(NULL == pCallbackData ||(pCallbackData != pCallbackData->pMe)) + { + LOC_LOGE("%s:%d]: invalid callback data", __func__, __LINE__); + return; + } + + // check user handle + if(memcmp(&pCallbackData->userHandle, &user_handle, sizeof(user_handle))) + { + LOC_LOGE("%s:%d]: invalid user_handle got %p expected %p\n", + __func__, __LINE__, + user_handle, pCallbackData->userHandle); + return; + } + // Get the indication size and type ( eventInd or respInd) + if( true == locClientGetSizeAndTypeByIndId(msg_id, &indSize, &indType)) + { + 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); + + if(NULL == indBuffer) + { + LOC_LOGE("%s:%d]: memory allocation failed\n", __func__, __LINE__); + return; + } + + rc = QMI_NO_ERR; + + if (ind_buf_len > 0) + { + // decode the indication + rc = qmi_client_message_decode( + user_handle, + QMI_IDL_INDICATION, + msg_id, + ind_buf, + ind_buf_len, + indBuffer, + indSize); + } + + if( rc == QMI_NO_ERR ) + { + //validate indication + if (true == locClientHandleIndication(msg_id, indBuffer, indSize)) + { + if(eventIndType == indType) + { + 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; + + // 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) + { + 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; + + // 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); + } + } + } + else // error handling indication + { + LOC_LOGE("%s:%d]: Error handling the indication %d\n", + __func__, __LINE__, (uint32_t)msg_id); + } + } + else + { + LOC_LOGE("%s:%d]: Error decoding indication %d\n", + __func__, __LINE__, rc); + } + if(indBuffer) + { + free (indBuffer); + } + } + else // Id not found + { + LOC_LOGE("%s:%d]: Error indication not found %d\n", + __func__, __LINE__,(uint32_t)msg_id); + } + return; +} + + +/** locClientRegisterEventMask + * @brief registers the event mask with loc service + * @param [in] clientHandle + * @param [in] eventRegMask + * @return true if indication was validated; else false */ + +bool locClientRegisterEventMask( + locClientHandleType clientHandle, + locClientEventMaskType eventRegMask) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientReqUnionType reqUnion; + qmiLocRegEventsReqMsgT_v02 regEventsReq; + + memset(®EventsReq, 0, sizeof(regEventsReq)); + + regEventsReq.eventRegMask = eventRegMask; + reqUnion.pRegEventsReq = ®EventsReq; + + status = locClientSendReq(clientHandle, + QMI_LOC_REG_EVENTS_REQ_V02, + reqUnion); + + if(eLOC_CLIENT_SUCCESS != status ) + { + LOC_LOGE("%s:%d] status %s\n", __func__, __LINE__, + loc_get_v02_client_status_name(status) ); + return false; + } + + return true; +} + +/** validateRequest + @brief validates the input request + @param [in] reqId request ID + @param [in] reqPayload Union of pointers to message payload + @param [out] ppOutData Pointer to void *data if successful + @param [out] pOutLen Pointer to length of data if succesful. + @return false on failure, true on Success +*/ + +static bool validateRequest( + uint32_t reqId, + const locClientReqUnionType reqPayload, + void **ppOutData, + uint32_t *pOutLen ) + +{ + bool noPayloadFlag = false; + + LOC_LOGV("%s:%d]: reqId = %d\n", __func__, __LINE__, reqId); + switch(reqId) + { + case QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformClientRevisionReqMsgT_v02); + break; + } + + case QMI_LOC_REG_EVENTS_REQ_V02: + { + *pOutLen = sizeof(qmiLocRegEventsReqMsgT_v02); + break; + } + + case QMI_LOC_START_REQ_V02: + { + *pOutLen = sizeof(qmiLocStartReqMsgT_v02); + break; + } + + case QMI_LOC_STOP_REQ_V02: + { + *pOutLen = sizeof(qmiLocStopReqMsgT_v02); + break; + } + + case QMI_LOC_NI_USER_RESPONSE_REQ_V02: + { + *pOutLen = sizeof(qmiLocNiUserRespReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_UTC_TIME_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectUtcTimeReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectPositionReqMsgT_v02); + break; + } + + case QMI_LOC_SET_ENGINE_LOCK_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetEngineLockReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SBAS_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSbasConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_NMEA_TYPES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetNmeaTypesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_LOW_POWER_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetLowPowerModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SERVER_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetServerReqMsgT_v02); + break; + } + + case QMI_LOC_DELETE_ASSIST_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteAssistDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_WIFI_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectWifiPositionReqMsgT_v02); + break; + } + + case QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocNotifyWifiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_OPERATION_MODE_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetOperationModeReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SPI_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSpiStatusReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SENSOR_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSensorDataReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02); + break; + } + + case QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetCradleMountConfigReqMsgT_v02); + break; + } + + case QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetSensorPropertiesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPropertiesReqMsgT_v02); + break; + } + + case QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02); + break; + } + case QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02); + break; + } + case QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02); + break; + } + case QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocAddCircularGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_DELETE_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocDeleteGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_QUERY_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocQueryGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_EDIT_GEOFENCE_REQ_V02: + { + *pOutLen = sizeof(qmiLocEditGeofenceReqMsgT_v02); + break; + } + case QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_MOTION_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectMotionDataReqMsgT_v02); + break; + } + + case QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02); + break; + } + + case QMI_LOC_PEDOMETER_REPORT_REQ_V02: + { + *pOutLen = sizeof(qmiLocPedometerReportReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02: + { + *pOutLen = sizeof(qmiLocInjectSubscriberIDReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_WIFI_AP_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectWifiApDataReqMsgT_v02); + break; + } + + case QMI_LOC_GET_BATCH_SIZE_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetBatchSizeReqMsgT_v02); + break; + } + + case QMI_LOC_START_BATCHING_REQ_V02: + { + *pOutLen = sizeof(qmiLocStartBatchingReqMsgT_v02); + break; + } + + case QMI_LOC_READ_FROM_BATCH_REQ_V02: + { + *pOutLen = sizeof(qmiLocReadFromBatchReqMsgT_v02); + break; + } + + case QMI_LOC_STOP_BATCHING_REQ_V02: + { + *pOutLen = sizeof(qmiLocStopBatchingReqMsgT_v02); + break; + } + + case QMI_LOC_RELEASE_BATCH_REQ_V02: + { + *pOutLen = sizeof(qmiLocReleaseBatchReqMsgT_v02); + break; + } + + case QMI_LOC_SET_XTRA_VERSION_CHECK_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetXtraVersionCheckReqMsgT_v02); + break; + } + + case QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_REQ_V02: + { + *pOutLen = sizeof(qmiLocInjectVehicleSensorDataReqMsgT_v02); + break; + } + + case QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocNotifyWifiAttachmentStatusReqMsgT_v02); + break; + } + + case QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_REQ_V02: + { + *pOutLen = sizeof(qmiLocNotifyWifiEnabledStatusReqMsgT_v02); + break; + } + + case QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_REQ_V02: + { + *pOutLen = sizeof(qmiLocSetPremiumServicesCfgReqMsgT_v02); + break; + } + + case QMI_LOC_GET_AVAILABLE_WWAN_POSITION_REQ_V02: + { + *pOutLen = sizeof(qmiLocGetAvailWwanPositionReqMsgT_v02); + break; + } + + // ALL requests with no payload + case QMI_LOC_GET_SERVICE_REVISION_REQ_V02: + case QMI_LOC_GET_FIX_CRITERIA_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02: + case QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02: + case QMI_LOC_GET_ENGINE_LOCK_REQ_V02: + case QMI_LOC_GET_SBAS_CONFIG_REQ_V02: + case QMI_LOC_GET_NMEA_TYPES_REQ_V02: + case QMI_LOC_GET_LOW_POWER_MODE_REQ_V02: + case QMI_LOC_GET_SERVER_REQ_V02: + case QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02: + case QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02: + case QMI_LOC_GET_OPERATION_MODE_REQ_V02: + case QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02: + case QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02: + case QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02: + case QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02: + case QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02: + case QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02: + { + noPayloadFlag = true; + break; + } + + default: + LOC_LOGW("%s:%d]: Error unknown reqId=%d\n", __func__, __LINE__, + reqId); + return false; + } + if(true == noPayloadFlag) + { + *ppOutData = NULL; + *pOutLen = 0; + } + else + { + //set dummy pointer for request union + *ppOutData = (void*) reqPayload.pInformClientRevisionReq; + } + LOC_LOGV("%s:%d]: reqId=%d, len = %d\n", __func__, __LINE__, + reqId, *pOutLen); + return true; +} + +/** locClientQmiCtrlPointInit + @brief wait for the service to come up or timeout; when the + service comes up initialize the control point and set + internal handle and indication callback. + @param pQmiClient, +*/ + +static locClientStatusEnumType locClientQmiCtrlPointInit( + locClientCallbackDataType *pLocClientCbData, + int instanceId) +{ + qmi_client_type clnt, notifier; + bool notifierInitFlag = false; + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + // os_params must stay in the same scope as notifier + // because when notifier is initialized, the pointer + // of os_params is retained in QMI framework, and it + // used when notifier is released. + qmi_client_os_params os_params; + // instances of this service + qmi_service_info serviceInfo; + + do + { + qmi_client_error_type rc = QMI_NO_ERR; + + // Get the service object for the qmiLoc Service + qmi_idl_service_object_type locClientServiceObject = + loc_get_service_object_v02(); + + // Verify that qmiLoc_get_service_object did not return NULL + if (NULL == locClientServiceObject) + { + LOC_LOGE("%s:%d]: qmiLoc_get_service_object_v02 failed\n" , + __func__, __LINE__ ); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + // register for service notification + rc = qmi_client_notifier_init(locClientServiceObject, &os_params, ¬ifier); + notifierInitFlag = (NULL != notifier); + + if (rc != QMI_NO_ERR) { + LOC_LOGE("%s:%d]: qmi_client_notifier_init failed %d\n", + __func__, __LINE__, rc); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + while (1) { + QMI_CCI_OS_SIGNAL_CLEAR(&os_params); + + if (instanceId >= 0) { + // use instance-specific lookup + rc = qmi_client_get_service_instance(locClientServiceObject, instanceId, &serviceInfo); + } else { + // lookup service with any instance id + rc = qmi_client_get_any_service(locClientServiceObject, &serviceInfo); + } + + // get the service addressing information + LOC_LOGV("%s:%d]: qmi_client_get_service() rc: %d ", __func__, __LINE__, rc); + + if(rc == QMI_NO_ERR) + break; + + QMI_CCI_OS_SIGNAL_WAIT(&os_params, 0); + } + + LOC_LOGV("%s:%d]: passing the pointer %p to qmi_client_init \n", + __func__, __LINE__, pLocClientCbData); + + // initialize the client + //sent the address of the first service found + // if IPC router is present, this will go to the service instance + // enumerated over IPC router, else it will go over the next transport where + // the service was enumerated. + rc = qmi_client_init(&serviceInfo, locClientServiceObject, + locClientIndCb, (void *) pLocClientCbData, + NULL, &clnt); + + if(rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: qmi_client_init error %d\n", + __func__, __LINE__, rc); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + LOC_LOGV("%s:%d]: passing the pointer %p to" + "qmi_client_register_error_cb \n", + __func__, __LINE__, pLocClientCbData); + + // register error callback + rc = qmi_client_register_error_cb(clnt, + locClientErrorCb, (void *) pLocClientCbData); + + if( QMI_NO_ERR != rc) + { + LOC_LOGE("%s:%d]: could not register QCCI error callback error:%d\n", + __func__, __LINE__, rc); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + // copy the clnt handle returned in qmi_client_init + memcpy(&(pLocClientCbData->userHandle), &clnt, sizeof(qmi_client_type)); + + status = eLOC_CLIENT_SUCCESS; + + } while(0); + + /* release the notifier handle */ + if(true == notifierInitFlag) + { + qmi_client_release(notifier); + } + + return status; +} +//----------------------- END INTERNAL FUNCTIONS ---------------------------------------- + +/** locClientOpenInstance + @brief Connects a location client to the location engine. If the connection + is successful, returns a handle that the location client uses for + future location operations. + + @param [in] eventRegMask Mask of asynchronous events the client is + interested in receiving + @param [in] instanceId Value of QMI service instance id to use. + @param [in] eventIndCb Function to be invoked to handle an event. + @param [in] respIndCb Function to be invoked to handle a response + indication. + @param [out] locClientHandle Handle to be used by the client + for any subsequent requests. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - non-zero error code(see locClientStatusEnumType)-- On failure. +*/ +locClientStatusEnumType locClientOpenInstance ( + locClientEventMaskType eventRegMask, + int instanceId, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pClientCookie) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + locClientCallbackDataType *pCallbackData = NULL; + + // check input parameters + if( (NULL == pLocClientCallbacks) || (NULL == pLocClientHandle) + || (NULL == pLocClientCallbacks->respIndCb) || + (pLocClientCallbacks->size != sizeof(locClientCallbacksType))) + { + LOC_LOGE("%s:%d]: Invalid parameters in locClientOpen\n", + __func__, __LINE__); + return eLOC_CLIENT_FAILURE_INVALID_PARAMETER; + } + + do + { + // Allocate memory for the callback data + pCallbackData = + ( locClientCallbackDataType*)calloc( + 1, sizeof(locClientCallbackDataType)); + + if(NULL == pCallbackData) + { + LOC_LOGE("%s:%d]: Could not allocate memory for callback data \n", + __func__, __LINE__); + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize the QMI control point; this function will block + * until a service is up or a timeout occurs. If the connection to + * the service succeeds the callback data will be filled in with + * a qmi_client value. + */ + + + EXIT_LOG_CALLFLOW(%s, "loc client open"); + status = locClientQmiCtrlPointInit(pCallbackData, instanceId); + + LOC_LOGV ("%s:%d] locClientQmiCtrlPointInit returned %d\n", + __func__, __LINE__, status); + + if(status != eLOC_CLIENT_SUCCESS) + { + free(pCallbackData); + pCallbackData = NULL; + LOC_LOGE ("%s:%d] locClientQmiCtrlPointInit returned %d\n", + __func__, __LINE__, status); + break; + } + // set the self pointer + pCallbackData->pMe = pCallbackData; + // set the handle to the callback data + *pLocClientHandle = (locClientHandleType)pCallbackData; + + if(true != locClientRegisterEventMask(*pLocClientHandle,eventRegMask)) + { + LOC_LOGE("%s:%d]: Error sending registration mask\n", + __func__, __LINE__); + + // release the client + locClientClose(pLocClientHandle); + + status = eLOC_CLIENT_FAILURE_INTERNAL; + break; + } + + /* Initialize rest of the client structure now that the connection + * to the service has been created successfully. + */ + + //fill in the event callback + pCallbackData->eventCallback = pLocClientCallbacks->eventIndCb; + + //fill in the response callback + pCallbackData->respCallback = pLocClientCallbacks->respIndCb; + + //fill in the error callback + pCallbackData->errorCallback = pLocClientCallbacks->errorCb; + + //set the client event registration mask + pCallbackData->eventRegMask = eventRegMask; + + // set the client cookie + pCallbackData->pClientCookie = (void *)pClientCookie; + + }while(0); + + if(eLOC_CLIENT_SUCCESS != status) + { + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + LOC_LOGE("%s:%d]: Error! status = %d\n", __func__, __LINE__,status); + } + + else + { + LOC_LOGD("%s:%d]: returning handle = %p, user_handle=%p, status = %d\n", + __func__, __LINE__, *pLocClientHandle, + pCallbackData->userHandle, status); + } + + return(status); +} + +/** locClientOpen + @brief Connects a location client to the location engine. If the connection + is successful, returns a handle that the location client uses for + future location operations. + + @param [in] eventRegMask Mask of asynchronous events the client is + interested in receiving + @param [in] eventIndCb Function to be invoked to handle an event. + @param [in] respIndCb Function to be invoked to handle a response + indication. + @param [out] locClientHandle Handle to be used by the client + for any subsequent requests. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - non-zero error code(see locClientStatusEnumType)-- On failure. +*/ + +locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pClientCookie) +{ + int instanceId; + locClientStatusEnumType status; + int tries = 1; +#ifdef _ANDROID_ + switch (getTargetGnssType(loc_get_target())) + { + case GNSS_GSS: + instanceId = eLOC_CLIENT_INSTANCE_ID_GSS; + break; + case GNSS_QCA1530: + instanceId = eLOC_CLIENT_INSTANCE_ID_QCA1530; + break; + case GNSS_MSM: + instanceId = eLOC_CLIENT_INSTANCE_ID_MSM; + break; + case GNSS_MDM: + instanceId = eLOC_CLIENT_INSTANCE_ID_MDM; + break; + default: + instanceId = eLOC_CLIENT_INSTANCE_ID_ANY; + break; + } + + LOC_LOGI("%s:%d]: Service instance id is %d\n", + __func__, __LINE__, instanceId); +#else + instanceId = eLOC_CLIENT_INSTANCE_ID_ANY; +#endif + + while ((status = locClientOpenInstance(eventRegMask, instanceId, pLocClientCallbacks, + pLocClientHandle, pClientCookie)) != eLOC_CLIENT_SUCCESS) { + if (tries <= LOC_CLIENT_MAX_OPEN_RETRIES) { + LOC_LOGE("%s:%d]: failed with status=%d on try %d", + __func__, __LINE__, status, tries); + tries++; + sleep(LOC_CLIENT_TIME_BETWEEN_OPEN_RETRIES); + } else { + LOC_LOGE("%s:%d]: failed with status=%d Aborting...", + __func__, __LINE__, status); + break; + } + } + + return status; +} + +/** locClientClose + @brief Disconnects a client from the location engine. + @param [in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) - On success. + - non-zero error code(see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientClose( + locClientHandleType* pLocClientHandle) +{ + // convert handle to callback data + locClientCallbackDataType *pCallbackData; + qmi_client_error_type rc = QMI_NO_ERR; //No error + + if(NULL == pLocClientHandle) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid pointer to handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + pCallbackData = (locClientCallbackDataType *)(*pLocClientHandle); + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle || + pCallbackData != pCallbackData->pMe ) + { + // invalid handle + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + LOC_LOGV("locClientClose releasing handle %p, user handle %p\n", + *pLocClientHandle, pCallbackData->userHandle ); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, "loc client close"); + + // release the handle + rc = qmi_client_release(pCallbackData->userHandle); + if(QMI_NO_ERR != rc ) + { + LOC_LOGW("%s:%d]: qmi_client_release error %d for client %p\n", + __func__, __LINE__, rc, pCallbackData->userHandle); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + /* clear the memory allocated to callback data to minimize the chances + * of a race condition occurring between close and the indication + * callback + */ + memset(pCallbackData, 0, sizeof(*pCallbackData)); + + // free the memory assigned in locClientOpen + free(pCallbackData); + pCallbackData= NULL; + + // set the handle to invalid value + *pLocClientHandle = LOC_CLIENT_INVALID_HANDLE_VALUE; + return eLOC_CLIENT_SUCCESS; +} + +/** locClientSendReq + @brief Sends a message to the location engine. If the locClientSendMsg() + function is successful, the client should expect an indication + (except start, stop, event reg and sensor injection messages), + through the registered callback in the locOpen() function. The + indication will contain the status of the request and if status is a + success, indication also contains the payload + associated with response. + @param [in] handle Handle returned by the locClientOpen() + function. + @param [in] reqId message ID of the request + @param [in] reqPayload Payload of the request, can be NULL + if request has no payload + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS ) - On success. + - non-zero error code (see locClientStatusEnumType) - On failure. +*/ + +locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload ) +{ + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + qmi_client_error_type rc = QMI_NO_ERR; //No error + qmiLocGenRespMsgT_v02 resp; + uint32_t reqLen = 0; + void *pReqData = NULL; + locClientCallbackDataType *pCallbackData = + (locClientCallbackDataType *)handle; + + // check the input handle for sanity + if(NULL == pCallbackData || + NULL == pCallbackData->userHandle || + pCallbackData != pCallbackData->pMe ) + { + // did not find the handle in the client List + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_HANDLE); + } + + // validate that the request is correct + if (validateRequest(reqId, reqPayload, &pReqData, &reqLen) == false) + { + + LOC_LOGE("%s:%d] error invalid request\n", __func__, + __LINE__); + + return(eLOC_CLIENT_FAILURE_INVALID_PARAMETER); + } + + LOC_LOGV("%s:%d] sending reqId= %d, len = %d\n", __func__, + __LINE__, reqId, reqLen); + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(reqId)); + rc = qmi_client_send_msg_sync( + pCallbackData->userHandle, + reqId, + pReqData, + reqLen, + &resp, + sizeof(resp), + LOC_CLIENT_ACK_TIMEOUT); + + LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, + __LINE__, rc); + + if (QMI_SERVICE_ERR == rc) + { + LOC_LOGE("%s:%d]: send_msg_sync error: QMI_SERVICE_ERR\n",__func__, __LINE__); + return(eLOC_CLIENT_FAILURE_PHONE_OFFLINE); + } + else if (rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); + return(eLOC_CLIENT_FAILURE_INTERNAL); + } + + // map the QCCI response to Loc API v02 status + status = convertQmiResponseToLocStatus(&resp); + + // if the request is to change registered events, update the + // loc api copy of that + if(eLOC_CLIENT_SUCCESS == status && + QMI_LOC_REG_EVENTS_REQ_V02 == reqId) + { + if(NULL != reqPayload.pRegEventsReq ) + { + pCallbackData->eventRegMask = + (locClientEventMaskType)(reqPayload.pRegEventsReq->eventRegMask); + } + } + return(status); +} + +/** locClientSupportMsgCheck + @brief Sends a QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02 message to the + location engine, and then receives a list of all services supported + by the engine. This function will check if the input service(s) form + the client is in the list or not. If the locClientSupportMsgCheck() + function is successful, the client should expect an result of + the service is supported or not recorded in supportedMsg. + @param [in] handle Handle returned by the locClientOpen() + function. + @param [in] supportedMsg an integer used to record which + message is supported + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. +*/ + +locClientStatusEnumType locClientSupportMsgCheck( + locClientHandleType handle, + const uint32_t* msgArray, + uint32_t msgArrayLength, + uint64_t* supportedMsg) +{ + + // set to true if one client has checked the modem capability. + static bool isCheckedAlready = false; + /* + The 1st bit in supportedMsgChecked indicates if + QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02 + is supported or not; + The 2ed bit in supportedMsgChecked indicates if + QMI_LOC_GET_BATCH_SIZE_REQ_V02 + is supported or not; + */ + static uint64_t supportedMsgChecked = 0; + + if (isCheckedAlready) { + // already checked modem + LOC_LOGV("%s:%d]: Already checked. The supportedMsgChecked is %lld\n", + __func__, __LINE__, supportedMsgChecked); + *supportedMsg = supportedMsgChecked; + return eLOC_CLIENT_SUCCESS; + } + + locClientStatusEnumType status = eLOC_CLIENT_SUCCESS; + qmi_client_error_type rc = QMI_NO_ERR; //No error + qmiLocGetSupportMsgT_v02 resp; + + uint32_t reqLen = 0; + void *pReqData = NULL; + locClientCallbackDataType *pCallbackData = + (locClientCallbackDataType *)handle; + + // check the input handle for sanity + if( NULL == pCallbackData || + NULL == pCallbackData->userHandle || + pCallbackData != pCallbackData->pMe ) { + // did not find the handle in the client List + LOC_LOGE("%s:%d]: invalid handle \n", + __func__, __LINE__); + + return eLOC_CLIENT_FAILURE_GENERAL; + } + + // NEXT call goes out to modem. We log the callflow before it + // actually happens to ensure the this comes before resp callflow + // back from the modem, to avoid confusing log order. We trust + // that the QMI framework is robust. + + EXIT_LOG_CALLFLOW(%s, loc_get_v02_event_name(QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02)); + rc = qmi_client_send_msg_sync( + pCallbackData->userHandle, + QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02, + pReqData, + reqLen, + &resp, + sizeof(resp), + LOC_CLIENT_ACK_TIMEOUT); + + LOC_LOGV("%s:%d] qmi_client_send_msg_sync returned %d\n", __func__, + __LINE__, rc); + + if (rc != QMI_NO_ERR) + { + LOC_LOGE("%s:%d]: send_msg_sync error: %d\n",__func__, __LINE__, rc); + return eLOC_CLIENT_FAILURE_GENERAL; + } + + // map the QCCI response to Loc API v02 status + status = convertQmiResponseToLocStatus(&resp); + + if(eLOC_CLIENT_SUCCESS == status) + { + LOC_LOGV("%s:%d]eLOC_CLIENT_SUCCESS == status\n", __func__, __LINE__); + + // check every message listed in msgArray supported by modem or not + checkQmiMsgsSupported(msgArray, msgArrayLength, &resp, &supportedMsgChecked); + + LOC_LOGV("%s:%d]: supportedMsgChecked is %lld\n", + __func__, __LINE__, supportedMsgChecked); + *supportedMsg = supportedMsgChecked; + isCheckedAlready = true; + return status; + } else { + + LOC_LOGE("%s:%d]: convertQmiResponseToLocStatus error: %d\n", + __func__, __LINE__, status); + return eLOC_CLIENT_FAILURE_GENERAL; + } +} + +/** locClientGetSizeByRespIndId + * @brief Get the size of the response indication structure, + * from a specified id + * @param [in] respIndId + * @param [out] pRespIndSize + * @return true if resp ID was found; else false +*/ + +bool locClientGetSizeByRespIndId(uint32_t respIndId, size_t *pRespIndSize) +{ + size_t idx = 0, respIndTableSize = 0; + respIndTableSize = (sizeof(locClientRespIndTable)/sizeof(locClientRespIndTableStructT)); + for(idx=0; idx +#include + +#include "location_service_v02.h" //QMI LOC Service data types definitions + +#include + +/****************************************************************************** + * Constants and configuration + *****************************************************************************/ + +/** @ingroup constants_macros + Specific value of #locClientHandleType, indicating an invalid handle. */ +#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL) + + +/** @addtogroup data_types +@{ */ + +/** Location client handle used to represent a specific client. Negative values + are invalid handles. +*/ +typedef void* locClientHandleType; + +/** Data type for events and event masks. */ +typedef uint64_t locClientEventMaskType; + +/** Location client status values. +*/ +typedef enum +{ + eLOC_CLIENT_SUCCESS = 0, + /**< Request was successful. */ + + eLOC_CLIENT_FAILURE_GENERAL = 1, + /**< Failed because of a general failure. */ + + eLOC_CLIENT_FAILURE_UNSUPPORTED = 2, + /**< Failed because the service does not support the command. */ + + eLOC_CLIENT_FAILURE_INVALID_PARAMETER = 3, + /**< Failed because the request contained invalid parameters. */ + + eLOC_CLIENT_FAILURE_ENGINE_BUSY = 4, + /**< Failed because the engine is busy. */ + + eLOC_CLIENT_FAILURE_PHONE_OFFLINE = 5, + /**< Failed because the phone is offline. */ + + eLOC_CLIENT_FAILURE_TIMEOUT = 6, + /**< Failed because of a timeout. */ + + eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT = 7, + /**< Failed because the service is not present. */ + + eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED = 8, + /**< Failed because the service version is unsupported. */ + + eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED = 9, + /**< Failed because the service does not support client version. */ + + eLOC_CLIENT_FAILURE_INVALID_HANDLE = 10, + /**< Failed because an invalid handle was specified. */ + + eLOC_CLIENT_FAILURE_INTERNAL = 11, + /**< Failed because of an internal error in the service. */ + + eLOC_CLIENT_FAILURE_NOT_INITIALIZED = 12, + /**< Failed because the service has not been initialized. */ + + eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY = 13 + /**< Failed because there is not enough memory to do the operation. */ + +}locClientStatusEnumType; + +/** Location client error values +*/ +typedef enum +{ + eLOC_CLIENT_ERROR_SERVICE_UNAVAILABLE = 1 + /**< Service is no longer available. Upon getting this error, the client + must close the existing connection and reopen the connection. */ + +}locClientErrorEnumType; + + +/** Request messages the client can send to the location engine. + + The following requests do not have any data associated, so they do not have a + payload structure defined: + + - GetServiceRevision + - GetFixCriteria + - GetPredictedOrbitsDataSource + - GetPredictedOrbitsDataValidity + - GetEngineLock + - GetSbasConfigReq + - GetRegisteredEvents + - GetNmeaTypes + - GetLowPowerMode + - GetXtraTSessionControl + - GetRegisteredEvents + - GetOperationMode + - GetCradleMountConfig + - GetExternalPowerConfig + - GetSensorControlConfig + - GetSensorPerformanceControlConfiguration + - WWANOutOfServiceNotification +*/ +typedef union +{ + const qmiLocInformClientRevisionReqMsgT_v02* pInformClientRevisionReq; + /**< Notifies the service about the revision the client is using. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02. */ + + const qmiLocRegEventsReqMsgT_v02* pRegEventsReq; + /**< Changes the events the client is interested in receiving. + + The client does not receive any indications corresponding to this + request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_REG_EVENTS_REQ_V02. */ + + const qmiLocStartReqMsgT_v02* pStartReq; + /**< Starts a positioning session. + + The client receives the following indications: position report, + satellite report, fix session report, and NMEA report (if applicable). + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_START_REQ_V02. */ + + const qmiLocStopReqMsgT_v02* pStopReq; + /**< Stops a positioning session. The client receives a fix session report + denoting that the fix session ended after this message was sent. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_STOP_REQ_V02. */ + + const qmiLocNiUserRespReqMsgT_v02* pNiUserRespReq; + /**< Informs the service about the user response for a network-initiated call. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NI_USER_RESPONSE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NI_USER_RESPONSE_REQ_V02. */ + + const qmiLocInjectPredictedOrbitsDataReqMsgT_v02* pInjectPredictedOrbitsDataReq; + /**< Injects the predicted orbits data into the service. + + When all predicted orbits data parts have been injected, the client + receives the following indication containing a response: + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. + + The client injects successive data parts without waiting for this + indication as long as locClientSendReq() returns successfully. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. */ + + const qmiLocInjectUtcTimeReqMsgT_v02* pInjectUtcTimeReq; + /**< Injects UTC time into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_UTC_TIME_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_UTC_TIME_REQ_V02. */ + + const qmiLocInjectPositionReqMsgT_v02* pInjectPositionReq; + /**< Injects a position into the service. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_POSITION_REQ_V02. */ + + const qmiLocSetEngineLockReqMsgT_v02* pSetEngineLockReq; + /**< Sets the location engine lock. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_ENGINE_LOCK_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_ENGINE_LOCK_REQ_V02. */ + + const qmiLocSetSbasConfigReqMsgT_v02* pSetSbasConfigReq; + /**< Sets the SBAS configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SBAS_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SBAS_CONFIG_REQ_V02 . */ + + const qmiLocSetNmeaTypesReqMsgT_v02* pSetNmeaTypesReq; + /**< Sets the NMEA types configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_NMEA_TYPES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_NMEA_TYPES_REQ_V02. */ + + const qmiLocSetLowPowerModeReqMsgT_v02* pSetLowPowerModeReq; + /**< Sets the Low Power mode configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_LOW_POWER_MODE_REQ_V02. */ + + const qmiLocSetServerReqMsgT_v02* pSetServerReq; + /**< Sets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SERVER_REQ_V02. */ + + const qmiLocGetServerReqMsgT_v02* pGetServerReq; + /**< Gets the A-GPS server type and address. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_SERVER_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_SERVER_REQ_V02. */ + + const qmiLocDeleteAssistDataReqMsgT_v02* pDeleteAssistDataReq; + /**< Deletes the aiding data from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_ASSIST_DATA_REQ_V02. */ + + const qmiLocSetXtraTSessionControlReqMsgT_v02* pSetXtraTSessionControlReq; + /**< Sets XTRA-T session control in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02. */ + + const qmiLocInjectWifiPositionReqMsgT_v02* pInjectWifiPositionReq; + /**< Injects a WiFi position into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_WIFI_POSITION_REQ_V02. */ + + const qmiLocNotifyWifiStatusReqMsgT_v02* pNotifyWifiStatusReq; + /**< Notifies the engine about the WiFi status. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02. */ + + const qmiLocSetOperationModeReqMsgT_v02* pSetOperationModeReq; + /**< Sets the engine Operation mode. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_OPERATION_MODE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_OPERATION_MODE_REQ_V02. */ + + const qmiLocSetSpiStatusReqMsgT_v02* pSetSpiStatusReq; + /**< Sends the stationary position status to the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SPI_STATUS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SPI_STATUS_REQ_V02. */ + + const qmiLocInjectSensorDataReqMsgT_v02* pInjectSensorDataReq; + /**< Injects sensor data into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SENSOR_DATA_REQ_V02. */ + + const qmiLocInjectTimeSyncDataReqMsgT_v02* pInjectTimeSyncReq; + /**< Injects time synchronization information into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02. */ + + const qmiLocSetCradleMountConfigReqMsgT_v02* pSetCradleMountConfigReq; + /**< Sets the cradle mount state information in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + SET_CRADLE_MOUNT_CONFIG_REQ_V02. + + To send this request, set the reqId field in locClientSendReq() to + SET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigReqMsgT_v02* pSetExternalPowerConfigReq; + /**< Sets external power configuration state in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02. */ + + const qmiLocInformLocationServerConnStatusReqMsgT_v02* + pInformLocationServerConnStatusReq; + /**< Informs the engine about the connection status to the location server. + + This can be sent in response to a + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 request. The + service sends back a QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 + response indication for this request. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02. */ + + const qmiLocSetProtocolConfigParametersReqMsgT_v02* + pSetProtocolConfigParametersReq; + /**< Sets the protocol configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocGetProtocolConfigParametersReqMsgT_v02* + pGetProtocolConfigParametersReq; + /**< Retrieves protocol configuration parameters from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocSetSensorControlConfigReqMsgT_v02* + pSetSensorControlConfigReq; + /**< Sets the sensor control configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02. */ + + const qmiLocSetSensorPerformanceControlConfigReqMsgT_v02* + pSetSensorPerformanceControlConfigReq; + /**< Sets the sensor performance configuration parameters in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02. */ + + const qmiLocGetSensorPropertiesReqMsgT_v02* pGetSensorPropertiesReq; + /**< Retrieves the sensor properties from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02. */ + + const qmiLocSetSensorPropertiesReqMsgT_v02* pSetSensorPropertiesReq; + /**< Sets the sensor properties in the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02. */ + + const qmiLocInjectSuplCertificateReqMsgT_v02* pInjectSuplCertificateReq; + /**< Injects a SUPL certificate into the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02. */ + + const qmiLocDeleteSuplCertificateReqMsgT_v02* pDeleteSuplCertificateReq; + /**< Deletes a SUPL certificate from the engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02. */ + + const qmiLocSetPositionEngineConfigParametersReqMsgT_v02* + pSetPositionEngineConfigParametersReq; + /**< Sets position engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND _V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocGetPositionEngineConfigParametersReqMsgT_v02* + pGetPositionEngineConfigParametersReq; + /**< Gets position engine configuration. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02. */ + + const qmiLocAddCircularGeofenceReqMsgT_v02* pAddCircularGeofenceReq; + /**< Adds a circular geofence. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 */ + + const qmiLocDeleteGeofenceReqMsgT_v02* pDeleteGeofenceReq; + /**< Deletes a geofence. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_DELETE_GEOFENCE_IND_V02. + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_DELETE_GEOFENCE_REQ_V02 */ + + const qmiLocQueryGeofenceReqMsgT_v02* pQueryGeofenceReq; + /**< Queries a geofence. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_QUERY_GEOFENCE_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_QUERY_GEOFENCE_REQ_V02. */ + + const qmiLocEditGeofenceReqMsgT_v02* pEditGeofenceReq; + /**< Edits geofence parameters. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_EDIT_GEOFENCE_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_EDIT_GEOFENCE_REQ_V02. */ + + const qmiLocGetBestAvailablePositionReqMsgT_v02* + pGetBestAvailablePositionReq; + /**< 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 + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_MOTION_DATA_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_MOTION_DATA_REQ_V02 */ + + const qmiLocGetNiGeofenceIdListReqMsgT_v02* pGetNiGeofenceIdListReq; + /**< Get the list of Network Initiated Geofences from the location engine. + + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 */ + + const qmiLocInjectGSMCellInfoReqMsgT_v02 *pInjectGSMCellInfoReq; + /**< Inject GSM Cell Information into the location engine. + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 */ + + const qmiLocInjectNetworkInitiatedMessageReqMsgT_v02 + *pInjectNetworkInitiatedMessageReq; + /**< Inject Network Initiated Message into the location engine. + If the request is accepted by the service, the client receives the + following indication containing a response: + QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 */ + + const void *pWWANOutOfServiceNotificationReq; + + const qmiLocPedometerReportReqMsgT_v02 *pPedometerReportReq; + /**< Send pedometer data to the location engine. If the request is + accepted by the service, the client receives the following + indication containing a response: + QMI_LOC_PEDOMETER_REPORT_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_PEDOMETER_REPORT_REQ_V02 */ + + const qmiLocInjectWCDMACellInfoReqMsgT_v02 *pInjectWCDMACellInfoReq; + const qmiLocInjectTDSCDMACellInfoReqMsgT_v02 *pInjectTDSCDMACellInfoReq; + const qmiLocInjectSubscriberIDReqMsgT_v02 *pInjectSubscriberIDReq; + const qmiLocInjectWifiApDataReqMsgT_v02 *pInjectWifiApDataReq; + const qmiLocNotifyWifiAttachmentStatusReqMsgT_v02 *pNotifyWifiAttachmentStatusReq; + const qmiLocNotifyWifiEnabledStatusReqMsgT_v02 *pNotifyWifiEnabledStatusReq; + + const qmiLocReadFromBatchReqMsgT_v02 *pReadFromBatchReq; + const qmiLocGetBatchSizeReqMsgT_v02 *pGetBatchSizeReq; + const qmiLocStartBatchingReqMsgT_v02 *pStartBatchingReq; + const qmiLocStopBatchingReqMsgT_v02 *pStopBatchingReq; + const qmiLocReleaseBatchReqMsgT_v02 *pReleaseBatchReq; + + const qmiLocInjectVehicleSensorDataReqMsgT_v02 *pInjectVehicleSensorDataReq; + + /**< Send vehicle sensor data to the location engine. If the request is + accepted by the service, the client receives the following + indication containing a response: + QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02 + + To send this request, set the reqId field in locClientSendReq() to + QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_REQ_V02 */ + + const qmiLocSetPremiumServicesCfgReqMsgT_v02 *pSetPremiumServicesCfgReq; + /*QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_REQ_V02*/ + + const qmiLocGetAvailWwanPositionReqMsgT_v02 *pGetAvailWwanPositionReq; + /*QMI_LOC_GET_AVAILABLE_WWAN_POSITION_REQ_V02*/ + + const qmiLocSetXtraVersionCheckReqMsgT_v02 *pSetXtraVersionCheckReq; +}locClientReqUnionType; + + +/** Event indications that are sent by the service. +*/ +typedef union +{ + const qmiLocEventPositionReportIndMsgT_v02* pPositionReportEvent; + /**< Contains the position information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. If + periodic fix criteria is specified, this event is generated multiple + times periodically at the specified rate until QMI_LOC_STOP_REQ_V02 is + sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_POSITION_REPORT_IND_V02. */ + + const qmiLocEventGnssSvInfoIndMsgT_v02* pGnssSvInfoReportEvent; + /**< Contains the GNSS satellite information. + + This event is generated after QMI_LOC_START_REQ_V02 is sent. This event + is generated at 1 Hz if the location engine is tracking satellites to + make a location fix. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GNSS_INFO_IND_V02. */ + + const qmiLocEventNmeaIndMsgT_v02* pNmeaReportEvent; + /**< Contains an NMEA report sentence. + + The entire NMEA report consisting of multiple sentences is sent at a + 1 Hz rate. This event is generated after QMI_LOC_START_REQ_V02 is sent. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NMEA_IND_V02. */ + + const qmiLocEventNiNotifyVerifyReqIndMsgT_v02* pNiNotifyVerifyReqEvent; + /**< Notifies a location client when the network triggers a positioning + request to the mobile. + + Upon getting this event, the location client displays the + network-initiated fix request in a dialog and prompts the user to + accept or deny the request. The client responds to this request with + the message QMI_LOC_NI_USER_RESPONSE_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02. */ + + const qmiLocEventInjectTimeReqIndMsgT_v02* pInjectTimeReqEvent; + /**< Asks the client for time assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_UTC_TIME_REQ_V02. + + The eventIndId field in the event indication callback is + set to QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02. */ + + const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* + pInjectPredictedOrbitsReqEvent; + /**< Asks the client for predicted orbits data assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02. */ + + const qmiLocEventInjectPositionReqIndMsgT_v02* pInjectPositionReqEvent; + /**< Asks the client for position assistance. + + The client responds to this request with the message + QMI_LOC_INJECT_POSITION_REQ_V02. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02. */ + + const qmiLocEventEngineStateIndMsgT_v02* pEngineState; + /**< Sent by the engine whenever it turns on or off. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_ENGINE_STATE_IND_V02. */ + + const qmiLocEventFixSessionStateIndMsgT_v02* pFixSessionState; + /**< Sent by the engine when a location session begins or ends. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02. */ + + const qmiLocEventWifiReqIndMsgT_v02* pWifiReqEvent; + /**< Sent by the engine when it needs WiFi support. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_WIFI_REQ_IND_V02. */ + + const qmiLocEventSensorStreamingReadyStatusIndMsgT_v02* + pSensorStreamingReadyStatusEvent; + /**< Notifies the client that the engine is ready to accept sensor data. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02. */ + + const qmiLocEventTimeSyncReqIndMsgT_v02* pTimeSyncReqEvent; + /**< Sent by the engine when it needs to synchronize its time with the sensor + processor time. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02. */ + + const qmiLocEventSetSpiStreamingReportIndMsgT_v02* + pSetSpiStreamingReportEvent; + /**< Asks the client to start/stop sending a Stationary Position Indicator + (SPI) stream. + + The eventIndId field in the event indication callback is set to + QMI_LOC_SET_SPI_STREAMING_REPORT_IND_V02. */ + + const qmiLocEventLocationServerConnectionReqIndMsgT_v02* + pLocationServerConnReqEvent; + /**< Sent by the engine to ask the client to open or close a connection to + a location server. + + The client responds to this request by sending the + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 message. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02. */ + + const qmiLocEventNiGeofenceNotificationIndMsgT_v02* + pNiGeofenceNotificationEvent; + /**< Sent by the engine to notify the client about changes to a + network-initiated geofence. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02. */ + + const qmiLocEventGeofenceGenAlertIndMsgT_v02* pGeofenceGenAlertEvent; + /**< Sent by the engine to notify the client about updates that may + affect a geofence operation. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02. */ + + const qmiLocEventGeofenceBreachIndMsgT_v02* pGeofenceBreachEvent; + /**< Sent by the engine to notify the client about a geofence breach + event. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02. @newpagetable */ + + const qmiLocEventGeofenceBatchedBreachIndMsgT_v02* pGeofenceBatchedBreachEvent; + /**< Sent by the engine to notify the client about a geofence breach + event. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02. @newpagetable */ + + const qmiLocEventPedometerControlIndMsgT_v02* pPedometerControlEvent; + /**< Sent by the engine to recommend how pedometer data is sent to the + location engine. + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02. @newpagetable */ + + const qmiLocEventMotionDataControlIndMsgT_v02* pMotionDataControlEvent; + /**< Sent by the engine to recommend how motion data is sent to the + location engine. + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02. @newpagetable */ + + const qmiLocEventInjectWifiApDataReqIndMsgT_v02* pWifiApDataReqEvent; + const qmiLocEventLiveBatchedPositionReportIndMsgT_v02* pBatchPositionReportEvent; + /**< Sent by the engine to notify the client that live batch location + is ready, and the location info. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02. */ + + const qmiLocEventBatchFullIndMsgT_v02* pBatchCount; + /**< Sent by the engine to notify the client that batch location is + full, and how many location are available to read. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_BATCH_FULL_IND_V02. */ + + const qmiLocEventVehicleDataReadyIndMsgT_v02* pVehicleDataReadyEvent; + + /**< Sent by the engine to recommend how vehicle sensor data is + sent to the location engine. + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_VEHICLE_DATA_READY_STATUS_IND_V02. @newpagetable */ + + const qmiLocEventGeofenceProximityIndMsgT_v02* pGeofenceProximityEvent; + /**< Sent by the engine to notify the client about a geofence proximity + event. + + The eventIndId field in the event indication callback is set to + QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02. @newpagetable */ +}locClientEventIndUnionType; + + +/** Response indications that are sent by the service. +*/ +typedef union +{ + const qmiLocGetServiceRevisionIndMsgT_v02* pGetServiceRevisionInd; + /**< Response to the QMI_LOC_GET_SERVICE_REVISION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVICE_REVISION_IND_V02. */ + + const qmiLocGetFixCriteriaIndMsgT_v02* pGetFixCriteriaInd; + /**< Response to the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_FIX_CRITERIA_IND_V02. */ + + const qmiLocNiUserRespIndMsgT_v02* pNiUserRespInd; + /**< Response to the QMI_LOC_NI_USER_RESPONSE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_NI_USER_RESPONSE_IND_V02. */ + + const qmiLocInjectPredictedOrbitsDataIndMsgT_v02* + pInjectPredictedOrbitsDataInd; + /**< Sent after a predicted orbits data part has been successfully injected. + + The client waits for this indication before injecting the next part. + This indication is sent in response to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02* + pGetPredictedOrbitsDataSourceInd; + /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02. */ + + const qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02* + pGetPredictedOrbitsDataValidityInd; + /**< Response to the QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02. */ + + const qmiLocInjectUtcTimeIndMsgT_v02* pInjectUtcTimeInd; + /**< Response to the QMI_LOC_INJECT_UTC_TIME_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_UTC_TIME_IND_V02. */ + + const qmiLocInjectPositionIndMsgT_v02* pInjectPositionInd; + /**< Response to the QMI_LOC_INJECT_POSITION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_POSITION_IND_V02. */ + + const qmiLocSetEngineLockIndMsgT_v02* pSetEngineLockInd; + /**< Response to the QMI_LOC_SET_ENGINE_LOCK_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_ENGINE_LOCK_IND_V02. */ + + const qmiLocGetEngineLockIndMsgT_v02* pGetEngineLockInd; + /**< Response to the QMI_LOC_GET_ENGINE_LOCK_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_ENGINE_LOCK_IND_V02. */ + + const qmiLocSetSbasConfigIndMsgT_v02* pSetSbasConfigInd; + /**< Response to the QMI_LOC_SET_SBAS_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SBAS_CONFIG_IND_V02. */ + + const qmiLocGetSbasConfigIndMsgT_v02* pGetSbasConfigInd; + /**< Response to the QMI_LOC_GET_SBAS_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SBAS_CONFIG_IND_V02. */ + + const qmiLocSetNmeaTypesIndMsgT_v02* pSetNmeaTypesInd; + /**< Response to the QMI_LOC_SET_NMEA_TYPES_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_NMEA_TYPES_IND_V02. */ + + const qmiLocGetNmeaTypesIndMsgT_v02* pGetNmeaTypesInd; + /**< Response to the QMI_LOC_GET_NMEA_TYPES_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_NMEA_TYPES_IND_V02. */ + + const qmiLocSetLowPowerModeIndMsgT_v02* pSetLowPowerModeInd; + /**< Response to the QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocGetLowPowerModeIndMsgT_v02* pGetLowPowerModeInd; + /**< Response to the QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_LOW_POWER_MODE_IND_V02. */ + + const qmiLocSetServerIndMsgT_v02* pSetServerInd; + /**< Response to the QMI_LOC_SET_SERVER_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SERVER_IND_V02. */ + + const qmiLocGetServerIndMsgT_v02* pGetServerInd; + /**< Response to the QMI_LOC_GET_SERVER_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SERVER_IND_V02. */ + + const qmiLocDeleteAssistDataIndMsgT_v02* pDeleteAssistDataInd; + /**< Response to the QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_ASSIST_DATA_IND_V02. */ + + const qmiLocSetXtraTSessionControlIndMsgT_v02* pSetXtraTSessionControlInd; + /**< Response to the QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocGetXtraTSessionControlIndMsgT_v02* pGetXtraTSessionControlInd; + /**< Response to the QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02. */ + + const qmiLocInjectWifiPositionIndMsgT_v02* pInjectWifiPositionInd; + /**< Response to the QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_WIFI_POSITION_IND_V02. */ + + const qmiLocNotifyWifiStatusIndMsgT_v02* pNotifyWifiStatusInd; + /**< Response to the QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02. */ + + const qmiLocGetRegisteredEventsIndMsgT_v02* pGetRegisteredEventsInd; + /**< Response to the QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_REGISTERED_EVENTS_IND_V02. */ + + const qmiLocSetOperationModeIndMsgT_v02* pSetOperationModeInd; + /**< Response to the QMI_LOC_SET_OPERATION_MODE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_OPERATION_MODE_IND_V02. */ + + const qmiLocGetOperationModeIndMsgT_v02* pGetOperationModeInd; + /**< Response to the QMI_LOC_GET_OPERATION_MODE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_OPERATION_MODE_IND_V02. */ + + const qmiLocSetSpiStatusIndMsgT_v02* pSetSpiStatusInd; + /**< Response to the QMI_LOC_SET_SPI_STATUS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SPI_STATUS_IND_V02. */ + + const qmiLocInjectSensorDataIndMsgT_v02* pInjectSensorDataInd; + /**< Response to the QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SENSOR_DATA_IND_V02. */ + + const qmiLocInjectTimeSyncDataIndMsgT_v02* pInjectTimeSyncDataInd; + /**< Response to the QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02. */ + + const qmiLocSetCradleMountConfigIndMsgT_v02* pSetCradleMountConfigInd; + /**< Response to the QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02. */ + + const qmiLocGetCradleMountConfigIndMsgT_v02* pGetCradleMountConfigInd; + /**< Response to the QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02. */ + + const qmiLocSetExternalPowerConfigIndMsgT_v02* pSetExternalPowerConfigInd; + /**< Response to the QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocGetExternalPowerConfigIndMsgT_v02* pGetExternalPowerConfigInd; + /**< Response to the QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02. */ + + const qmiLocInformLocationServerConnStatusIndMsgT_v02* + pInformLocationServerConnStatusInd; + /**< Response to the QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02.*/ + + const qmiLocSetProtocolConfigParametersIndMsgT_v02* + pSetProtocolConfigParametersInd; + /**< Response to the QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocGetProtocolConfigParametersIndMsgT_v02* + pGetProtocolConfigParametersInd; + /**< Response to the QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocSetSensorControlConfigIndMsgT_v02* pSetSensorControlConfigInd; + /**< Response to the QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02. + */ + + const qmiLocGetSensorControlConfigIndMsgT_v02* pGetSensorControlConfigInd; + /**< Response to the QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02. + */ + + const qmiLocSetSensorPropertiesIndMsgT_v02* pSetSensorPropertiesInd; + /**< Response to the QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02. + */ + + const qmiLocGetSensorPropertiesIndMsgT_v02* pGetSensorPropertiesInd; + /**< Response to the QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02. + */ + + const qmiLocSetSensorPerformanceControlConfigIndMsgT_v02* + pSetSensorPerformanceControlConfigInd; + /**< Response to the + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ + + const qmiLocGetSensorPerformanceControlConfigIndMsgT_v02* + pGetSensorPerformanceControlConfigInd; + /**< Response to the + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02. */ + + const qmiLocInjectSuplCertificateIndMsgT_v02* pInjectSuplCertificateInd; + /**< Response to the QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02. */ + + const qmiLocDeleteSuplCertificateIndMsgT_v02* pDeleteSuplCertificateInd; + /**< Response to the QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02. */ + + const qmiLocSetPositionEngineConfigParametersIndMsgT_v02* + pSetPositionEngineConfigParametersInd; + /**< Response to the QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocGetPositionEngineConfigParametersIndMsgT_v02* + pGetPositionEngineConfigParametersInd; + /**< Response to the QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02. */ + + const qmiLocAddCircularGeofenceIndMsgT_v02* pAddCircularGeofenceInd; + /**< Response to the QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02. */ + + const qmiLocDeleteGeofenceIndMsgT_v02* pDeleteGeofenceInd; + /**< Response to the QMI_LOC_DELETE_GEOFENCE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_DELETE_GEOFENCE_IND_V02. */ + + const qmiLocQueryGeofenceIndMsgT_v02* pQueryGeofenceInd; + /**< Response to the QMI_LOC_QUERY_GEOFENCE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_QUERY_GEOFENCE_IND_V02. */ + + const qmiLocEditGeofenceIndMsgT_v02* pEditGeofenceInd; + /**< Response to the QMI_LOC_EDIT_GEOFENCE_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_EDIT_GEOFENCE_IND_V02. */ + + const qmiLocGetBestAvailablePositionIndMsgT_v02* + pGetBestAvailablePositionInd; + /**< Response to the QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02. */ + + const qmiLocInjectMotionDataIndMsgT_v02* pInjectMotionDataInd; + /**< Response to the QMI_LOC_INJECT_MOTION_DATA_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_MOTION_DATA_IND_V02. */ + + const qmiLocGetNiGeofenceIdListIndMsgT_v02* pGetNiGeofenceIdListInd; + /**< Response to the QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02. */ + + const qmiLocInjectGSMCellInfoIndMsgT_v02* pInjectGSMCellInfoInd; + /**< Response to the QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02. */ + + const qmiLocInjectNetworkInitiatedMessageIndMsgT_v02* + pInjectNetworkInitiatedMessageInd; + + /**< Response to the QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 + request. + + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02. */ + + const qmiLocWWANOutOfServiceNotificationIndMsgT_v02* + pWWANOutOfServiceNotificationInd; + + /**< Response to the QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 + request. + The respIndId field in the response indication callback is set to + QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02. */ + + const qmiLocPedometerReportIndMsgT_v02* pPedometerReportInd; + + /**< Response to the QMI_LOC_PEDOMETER_REPORT_REQ_V02 request. + The respIndId field in the response indication callback is set to + QMI_LOC_PEDOMETER_REPORT_IND_V02. */ + + const qmiLocInjectWCDMACellInfoIndMsgT_v02 *pInjectWCDMACellInfoInd; + const qmiLocInjectTDSCDMACellInfoIndMsgT_v02 *pInjectTDSCDMACellInfoInd; + const qmiLocInjectSubscriberIDIndMsgT_v02 *pInjectSubscriberIDInd; + const qmiLocInjectWifiApDataIndMsgT_v02 *pInjectWifiApDataInd; + const qmiLocNotifyWifiAttachmentStatusIndMsgT_v02 *pNotifyWifiAttachmentStatusInd; + const qmiLocNotifyWifiEnabledStatusIndMsgT_v02 *pNotifyWifiEnabledStatusInd; + + const qmiLocInjectVehicleSensorDataIndMsgT_v02 *pInjectVehicleSensorDataInd; + + /**< Response to the QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_REQ_V02 request. + The respIndId field in the response indication callback is set to + QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02. */ + + const qmiLocGetAvailWwanPositionIndMsgT_v02 *pGetAvailWwanPositionInd; + /*QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02*/ + + const qmiLocSetXtraVersionCheckIndMsgT_v02 *pSetXtraVersionCheckInd; +}locClientRespIndUnionType; + +/** @} */ /* end_addtogroup data_types */ + +/** @addtogroup callback_functions +@{ */ +/** + Location event indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the asynchronous event indications. + + @datatypes + #locClientHandleType \n + #locClientEventIndUnionType + + @param handle Location client for this event. Only the client who + registered for the corresponding event receives + this callback. + @param eventIndId ID of the event indication. + @param eventIndPayload Event indication payload. + @param pClientCookie Pointer to the cookie the client specified during + registration. + + @return + None. + + @dependencies + None. @newpage +*/ +typedef void (*locClientEventIndCbType)( + locClientHandleType handle, + uint32_t eventIndId, + const locClientEventIndUnionType eventIndPayload, + void *pClientCookie +); + +/** + Location response indication callback function type. The Location service can + generate two types of indications: + + - Asynchronous events indications, such as time injection request and satellite + reports. The client specifies the asynchronous events it is interested in + receiving through the event mask (see locClientOpen()). + - Response indications that are generated as a response to a request. For + example, the QMI_LOC_GET_FIX_CRITERIA_REQ_V02 request generates the + indication, QMI_LOC_GET_FIX_CRITERIA_IND_V02. + + This callback handles the response indications. + + @datatypes + #locClientHandleType \n + #locClientRespIndUnionType + + @param handle Location client who sent the request for which this + response indication is generated. + @param respIndId ID of the response. It is the same value as the ID + of request sent to the engine. + @param respIndPayload Payload of the response indication. + @param pClientCookie Pointer to the cookie the client specified during + registration. + + @return + None. + + @dependencies + None. @newpage +*/ +typedef void (*locClientRespIndCbType)( + locClientHandleType handle, + uint32_t respIndId, + const locClientRespIndUnionType respIndPayload, + void *pClientCookie +); + +/** + Location error callback function type. This function is called to inform + the client that the service is no longer available. When the client + receives this callback, it must close the existing connection and reopen + the client connection. + + @datatypes + #locClientHandleType \n + #locClientErrorEnumType + + @param handle Location client who sent the request for which this + error indication is generated. + @param errorId Error ID. + @param pClientCookie Payload associated with the error indication. + + @return + None. + + @dependencies + None. +*/ +typedef void (*locClientErrorCbType)( + locClientHandleType handle, + locClientErrorEnumType errorId, + void* pClientCookie + ); +/** @} */ /* end_addtogroup callback_functions */ + + +/** @ingroup data_types + Callback functions to be registered during locClientOpen(). +*/ +typedef struct +{ + uint32_t size; /**< Size of the structure. */ + locClientEventIndCbType eventIndCb; /**< Event indication callback. */ + locClientRespIndCbType respIndCb; /**< Response indication callback. */ + locClientErrorCbType errorCb; /**< Error indication callback. + @newpagetable */ +}locClientCallbacksType; + +/** + Response for getting qmi service list +*/ +typedef struct +{ + qmi_get_supported_msgs_resp_v01 resp; /**< Response */ +}qmiLocGetSupportMsgT_v02; + +/*=========================================================================== + * + * FUNCTION DECLARATION + * + *==========================================================================*/ +/** @addtogroup operation_functions +@{ */ +/*========================================================================== + locClientOpen */ +/** @xreflabel{hdr:locClientOpenFunction} + Connects a location client to the location engine. If the connection is + successful, this function returns a handle that the location client uses for + future location operations. + + @datatypes + #locClientStatusEnumType \n + #locClientEventMaskType \n + #locClientCallbacksType \n + #locClientHandleType + + @param[in] eventRegMask Mask of asynchronous events the client is + interested in receiving. + @param[in] pLocClientCallbacks Pointer to structure containing the + callbacks. + @param[out] pLocClientHandle Pointer to the handle to be used by the + client for any subsequent requests. + @param[in] pLocClientCookie Pointer to a cookie to be returned to the + client along with the callbacks. + + @return + One of the following error codes: + - eLOC_CLIENT_SUCCESS -- If the connection is opened. + - Non-zero error code (see #locClientStatusEnumType) -- On failure. + + @dependencies + None. @newpage +*/ +extern locClientStatusEnumType locClientOpen ( + locClientEventMaskType eventRegMask, + const locClientCallbacksType* pLocClientCallbacks, + locClientHandleType* pLocClientHandle, + const void* pLocClientCookie +); + + +/*========================================================================== + locClientClose */ +/** @xreflabel{hdr:locClientCloseFunction} + Disconnects a client from the location engine and sets the handle to + LOC_CLIENT_INVALID_HANDLE_VALUE. + + @datatypes + #locClientStatusEnumType \n + #locClientHandleType + + @param[in] pLocClientHandle Pointer to the handle returned by the + locClientOpen() function. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. @newpage +*/ +extern locClientStatusEnumType locClientClose ( + locClientHandleType* pLocClientHandle +); + +/*============================================================================= + locClientSendReq */ +/** @xreflabel{hdr:locClientSendReqFunction} + Sends a message to the location engine. If this function is successful, the + client expects an indication (except start, stop, event registration, and + sensor injection messages) through the registered callback in the + locClientOpen() function. + + The indication contains the status of the request. If the status is a success, + the indication also contains the payload associated with response. + + @datatypes + #locClientStatusEnumType \n + #locClientHandleType \n + #locClientReqUnionType + + @param[in] handle Handle returned by the locClientOpen() function. + @param[in] reqId QMI_LOC service message ID of the request. + @param[in] reqPayload Payload of the request. This can be NULL if the + request has no payload. + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. @newpage +*/ +extern locClientStatusEnumType locClientSendReq( + locClientHandleType handle, + uint32_t reqId, + locClientReqUnionType reqPayload +); + +/*============================================================================= + locClientSupportMsgCheck */ +/** + @brief Sends a QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02 message to the + location engine, and then receives a list of all services supported + by the engine. This function will check if the input service(s) form + the client is in the list or not. If the locClientSupportMsgCheck() + function is successful, the client should expect an result of + the service is supported or not recorded in supportedMsg. + @param [in] handle Handle returned by the locClientOpen() + function. + @param [in] supportedMsg a integer used to record which + message is supported + + @return + One of the following error codes: + - 0 (eLOC_CLIENT_SUCCESS) -- On success. + - Non-zero error code (see \ref locClientStatusEnumType) -- On failure. + + @dependencies + None. @newpage +*/ +extern locClientStatusEnumType locClientSupportMsgCheck( + locClientHandleType handle, + const uint32_t* msgArray, + uint32_t msgArrayLength, + uint64_t* supportedMsg +); + +/*============================================================================= + locClientGetSizeByEventIndId */ +/** Gets the size of the event indication structure from a specified ID. + + @param[in] eventIndId Event indicator ID. + @param[out] pEventIndSize Pointer to the size of the structure. + + @return + TRUE -- The event ID was found. \n + FALSE -- Otherwise. + + @dependencies + None. @newpage +*/ +extern bool locClientGetSizeByEventIndId( + uint32_t eventIndId, + size_t *pEventIndSize); + + +/*============================================================================= + locClientGetSizeByRespIndId */ +/** Gets the size of the response indication structure from a specified ID. + + @param[in] respIndId Response indicator ID. + @param[out] pRespIndSize Pointer to the size of the structure. + + @return + TRUE -- The response ID was found. \n + FALSE -- Otherwise. + + @dependencies + None. +*/ +extern bool locClientGetSizeByRespIndId( + uint32_t respIndId, + size_t *pRespIndSize); + +/** locClientRegisterEventMask + * @brief registers the event mask with loc service + * @param [in] clientHandle + * @param [in] eventRegMask + * @return true if indication was validated; else false */ + +extern bool locClientRegisterEventMask( + locClientHandleType clientHandle, + locClientEventMaskType eventRegMask); + +/*=============================================================================*/ +/** @} */ /* end_addtogroup operation_functions */ + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_CLIENT_H*/ 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 new file mode 100644 index 0000000..3326975 --- /dev/null +++ b/gps/loc_api/loc_api_v02/loc_api_v02_log.c @@ -0,0 +1,335 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include +#include + +static loc_name_val_s_type loc_v02_event_name[] = +{ + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_REG_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_START_REQ_V02), + NAME_VAL(QMI_LOC_START_RESP_V02), + NAME_VAL(QMI_LOC_STOP_REQ_V02), + NAME_VAL(QMI_LOC_STOP_RESP_V02), + NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NMEA_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02), + NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02), + NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02), + NAME_VAL(QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_IND_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_RESP_V02), + NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_IND_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_RESP_V02), + NAME_VAL(QMI_LOC_NI_USER_RESPONSE_IND_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02), + NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_UTC_TIME_IND_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_POSITION_IND_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_RESP_V02), + NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_IND_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_SET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_REQ_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_RESP_V02), + NAME_VAL(QMI_LOC_GET_NMEA_TYPES_IND_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_SET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_SET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02), + NAME_VAL(QMI_LOC_GET_SERVER_RESP_V02), + NAME_VAL(QMI_LOC_GET_SERVER_IND_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02), + NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_IND_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02), + NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_IND_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_SET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_RESP_V02), + NAME_VAL(QMI_LOC_GET_OPERATION_MODE_IND_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_SET_SPI_STATUS_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_IND_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02), + NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02), + NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02), + NAME_VAL(QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_DELETE_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_DELETE_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_DELETE_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_QUERY_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_QUERY_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_QUERY_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_EDIT_GEOFENCE_REQ_V02), + NAME_VAL(QMI_LOC_EDIT_GEOFENCE_RESP_V02), + NAME_VAL(QMI_LOC_EDIT_GEOFENCE_IND_V02), + NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02), + NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_IND_V02), + NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02), + NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02), + NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02), + NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02), + NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02), + NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02), + NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02), + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_REQ_V02), + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_RESP_V02), + NAME_VAL(QMI_LOC_PEDOMETER_REPORT_IND_V02), + NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02), + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02), + NAME_VAL(QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02), + NAME_VAL(QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02), + NAME_VAL(QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02), + NAME_VAL(QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_AP_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_AP_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_WIFI_AP_DATA_IND_V02), + NAME_VAL(QMI_LOC_GET_BATCH_SIZE_REQ_V02), + NAME_VAL(QMI_LOC_GET_BATCH_SIZE_RESP_V02), + NAME_VAL(QMI_LOC_GET_BATCH_SIZE_IND_V02), + NAME_VAL(QMI_LOC_START_BATCHING_REQ_V02), + NAME_VAL(QMI_LOC_START_BATCHING_RESP_V02), + NAME_VAL(QMI_LOC_START_BATCHING_IND_V02), + NAME_VAL(QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02), + NAME_VAL(QMI_LOC_READ_FROM_BATCH_REQ_V02), + NAME_VAL(QMI_LOC_READ_FROM_BATCH_RESP_V02), + NAME_VAL(QMI_LOC_READ_FROM_BATCH_IND_V02), + NAME_VAL(QMI_LOC_STOP_BATCHING_REQ_V02), + NAME_VAL(QMI_LOC_STOP_BATCHING_RESP_V02), + NAME_VAL(QMI_LOC_STOP_BATCHING_IND_V02), + NAME_VAL(QMI_LOC_RELEASE_BATCH_REQ_V02), + NAME_VAL(QMI_LOC_RELEASE_BATCH_RESP_V02), + NAME_VAL(QMI_LOC_RELEASE_BATCH_IND_V02), + NAME_VAL(QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_REQ_V02), + NAME_VAL(QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_RESP_V02), + NAME_VAL(QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_IND_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_REQ_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_RESP_V02), + NAME_VAL(QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_IND_V02), + NAME_VAL(QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_REQ_V02), + NAME_VAL(QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_RESP_V02), + NAME_VAL(QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_IND_V02), + NAME_VAL(QMI_LOC_GET_AVAILABLE_WWAN_POSITION_REQ_V02), + NAME_VAL(QMI_LOC_GET_AVAILABLE_WWAN_POSITION_RESP_V02), + NAME_VAL(QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02), + NAME_VAL(QMI_LOC_SET_XTRA_VERSION_CHECK_REQ_V02), + NAME_VAL(QMI_LOC_SET_XTRA_VERSION_CHECK_RESP_V02), + NAME_VAL(QMI_LOC_SET_XTRA_VERSION_CHECK_IND_V02), + NAME_VAL(QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02) +}; +static int loc_v02_event_num = sizeof(loc_v02_event_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_event_name(uint32_t event) +{ + return loc_get_name_from_val(loc_v02_event_name, loc_v02_event_num, (long) event); +} + +static loc_name_val_s_type loc_v02_client_status_name[] = +{ + NAME_VAL(eLOC_CLIENT_SUCCESS), + NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL), + NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER), + NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY), + NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE), + NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT), + NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED), + NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE), + NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL), + NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED), + NAME_VAL(eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY), +}; +static int loc_v02_client_status_num = sizeof(loc_v02_client_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_client_status_name(locClientStatusEnumType status) +{ + return loc_get_name_from_val(loc_v02_client_status_name, loc_v02_client_status_num, (long) status); +} + + +static loc_name_val_s_type loc_v02_qmi_status_name[] = +{ + NAME_VAL(eQMI_LOC_SUCCESS_V02), + NAME_VAL(eQMI_LOC_GENERAL_FAILURE_V02), + NAME_VAL(eQMI_LOC_UNSUPPORTED_V02), + NAME_VAL(eQMI_LOC_INVALID_PARAMETER_V02), + NAME_VAL(eQMI_LOC_ENGINE_BUSY_V02), + NAME_VAL(eQMI_LOC_PHONE_OFFLINE_V02), + NAME_VAL(eQMI_LOC_TIMEOUT_V02), + NAME_VAL(eQMI_LOC_CONFIG_NOT_SUPPORTED_V02), + NAME_VAL(eQMI_LOC_INSUFFICIENT_MEMORY_V02), +}; +static int loc_v02_qmi_status_num = sizeof(loc_v02_qmi_status_name) / sizeof(loc_name_val_s_type); + +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status) +{ + return loc_get_name_from_val(loc_v02_qmi_status_name, loc_v02_qmi_status_num, (long) status); +} diff --git a/gps/loc_api/loc_api_v02/loc_api_v02_log.h b/gps/loc_api/loc_api_v02/loc_api_v02_log.h new file mode 100644 index 0000000..8d4670c --- /dev/null +++ b/gps/loc_api/loc_api_v02/loc_api_v02_log.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2011, 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_API_V02_LOG_H +#define LOC_API_V02_LOG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include + +const char* loc_get_v02_event_name(uint32_t event); +const char* loc_get_v02_client_status_name(locClientStatusEnumType status); +const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status); + + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_API_V02_LOG_H */ diff --git a/gps/loc_api/loc_api_v02/loc_util_log.h b/gps/loc_api/loc_api_v02/loc_util_log.h new file mode 100644 index 0000000..49201f8 --- /dev/null +++ b/gps/loc_api/loc_api_v02/loc_util_log.h @@ -0,0 +1,85 @@ +/* Copyright (c) 2011-2012, 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_UTIL_LOG_H +#define LOC_UTIL_LOG_H + +#if defined(_ANDROID_) +#include "loc_api_v02_log.h" +#include + +#else // no _ANDROID_ + +#if defined(__LOC_API_V02_LOG_SILENT__) +#define MSG_LOG +#define LOC_LOGE(...) MSG_LOG(__VA_ARGS__); +#define LOC_LOGW(...) MSG_LOG(__VA_ARGS__); +#define LOC_LOGD(...) MSG_LOG(__VA_ARGS__); +#define LOC_LOGI(...) MSG_LOG(__VA_ARGS__); +#define LOC_LOGV(...) MSG_LOG(__VA_ARGS__); +#else + +// common for QNX and Griffon + +//error logs +#define LOC_LOGE(...) printf(__VA_ARGS__) +//warning logs +#define LOC_LOGW(...) printf(__VA_ARGS__) +// debug logs +#define LOC_LOGD(...) printf(__VA_ARGS__) +//info logs +#define LOC_LOGI(...) printf(__VA_ARGS__) +//verbose logs +#define LOC_LOGV(...) printf(__VA_ARGS__) +#endif //__LOC_API_V02_LOG_SILENT__ + +#define MODEM_LOG_CALLFLOW(SPEC, VAL) +#define EXIT_LOG_CALLFLOW(SPEC, VAL) + +#define loc_get_v02_event_name(X) #X +#define loc_get_v02_client_status_name(X) #X + +#define loc_get_v02_qmi_status_name(X) #X + +//specific to OFF TARGET +#ifdef LOC_UTIL_TARGET_OFF_TARGET + +#include +# include +# include + +// get around strl*: not found in glibc +// TBD:look for presence of eglibc other libraries +// with strlcpy supported. +#define strlcpy(X,Y,Z) strcpy(X,Y) +#define strlcat(X,Y,Z) strcat(X,Y) + +#endif //LOC_UTIL_TARGET_OFF_TARGET + +#endif //_ANDROID_ + +#endif //LOC_UTIL_LOG_H diff --git a/gps/loc_api/loc_api_v02/location_service_v02.c b/gps/loc_api/loc_api_v02/location_service_v02.c new file mode 100644 index 0000000..3bbdc5d --- /dev/null +++ b/gps/loc_api/loc_api_v02/location_service_v02.c @@ -0,0 +1,4916 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 6.10 + It was generated on: Tue Jul 29 2014 (Spin 0) + From IDL File: location_service_v02.idl */ + +#include "stdint.h" +#include "qmi_idl_lib_internal.h" +#include "location_service_v02.h" +#include "common_v01.h" + + +/*Type Definitions*/ +static const uint8_t qmiLocApplicationIdStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationProvider), + QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02, + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationName), + QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02, + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion_valid), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApplicationIdStructT_v02, applicationVersion), + QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGPSTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsWeek), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGPSTimeStructT_v02, gpsTimeOfWeekMs), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDOPStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, PDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, HDOP), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDOPStructT_v02, VDOP), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorUsageIndicatorStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, usageMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorUsageIndicatorStructT_v02, aidingIndicatorMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, validMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, healthStatus), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svStatus), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, svInfoMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, elevation), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, azimuth), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSvInfoStructT_v02, snr), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQosIncl), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posQos), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, numFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, timeBetweenFixes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, posMode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, encodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId), + QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId) - QMI_IDL_OFFSET8(qmiLocNiVxNotifyVerifyStructT_v02, requestorId_len), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxNotifyVerifyStructT_v02, userRespTimerInSeconds), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplFormattedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formatType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString) - QMI_IDL_OFFSET8(qmiLocNiSuplFormattedStringStructT_v02, formattedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplQopStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, validMask), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, horizontalAccuracy), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, verticalAccuracy), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, maxLocAge), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplQopStructT_v02, delay), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV4AddrStructType_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, addr), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV4AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIpV6AddrStructType_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, addr), + QMI_LOC_IPV6_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIpV6AddrStructType_v02, port), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplServerInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, suplServerAddrTypeMask), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv4Addr), + QMI_IDL_TYPE88(0, 8), + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, ipv6Addr), + QMI_IDL_TYPE88(0, 9), + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocNiSuplServerInfoStructT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiSuplNotifyVerifyStructT_v02, suplServerInfo), + QMI_IDL_TYPE88(0, 10), + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplSessionId), + QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplHash), + QMI_LOC_NI_SUPL_HASH_LENGTH_V02, + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, posMethod), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, requestorId), + QMI_IDL_TYPE88(0, 6), + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, clientName), + QMI_IDL_TYPE88(0, 6), + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, suplQop), + QMI_IDL_TYPE88(0, 7), + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiSuplNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpCodedStringStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString), + QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpCodedStringStructT_v02, codedString_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiUmtsCpNotifyVerifyStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, valid_flags), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, invokeId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, dataCodingScheme), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText), + QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, notificationText_len), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress), + QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress) - QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, clientAddress_len), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, locationType), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, requestorId), + QMI_IDL_TYPE88(0, 12), + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, codewordString), + QMI_IDL_TYPE88(0, 12), + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, lcsServiceTypeId), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUmtsCpNotifyVerifyStructT_v02, userResponseTimer), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiVxServiceInteractionStructT_data_v02[] = { + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiVxServiceInteractionStructT_v02, niVxReq), + QMI_IDL_TYPE88(0, 5), + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiVxServiceInteractionStructT_v02, serviceInteractionType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocNiSuplVer2ExtStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, supportedNetworksMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, triggerType), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocNiSuplVer2ExtStructT_v02, gnssType), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocEmergencyNotificationStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEmergencyNotificationStructT_v02, eslpUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAssistanceServerUrlStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocAssistanceServerUrlStructT_v02, serverUrl), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTimeServerListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, delayThreshold), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList), + QMI_LOC_MAX_NTP_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList) - QMI_IDL_OFFSET8(qmiLocTimeServerListStructT_v02, timeServerList_len), + QMI_IDL_TYPE88(0, 17), + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsAllowedSizesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxFileSizeInBytes), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsAllowedSizesStructT_v02, maxPartSize), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsServerListStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList), + QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocPredictedOrbitsServerListStructT_v02, serverList_len), + QMI_IDL_TYPE88(0, 17), + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorControlConfigSamplingSpecStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, samplesPerBatch), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorControlConfigSamplingSpecStructT_v02, batchesPerSecond), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorReadyStatusStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, injectEnable), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorReadyStatusStructT_v02, dataFrequency), + QMI_IDL_TYPE88(0, 21), + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGeofencePositionStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, timestampUtc), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMinor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseSemiMajor), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedHorizontal), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, altitudeWrtEllipsoid), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, vertUnc), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, speedVertical), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofencePositionStructT_v02, heading), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGeofenceIdContinuousStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofenceIdContinuousStructT_v02, idLow), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofenceIdContinuousStructT_v02, idHigh), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocPredictedOrbitsDataValidityStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, startTimeInUTC), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocPredictedOrbitsDataValidityStructT_v02, durationHours), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocAltitudeSrcInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, source), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, linkage), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAltitudeSrcInfoStructT_v02, coverage), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDeleteSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, system), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSvInfoStructT_v02, deleteSvInfoMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocDeleteBDSSvInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteBDSSvInfoStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteBDSSvInfoStructT_v02, deleteSvInfoMask), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixTimeStructT_v02, wifiPositionTime), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiFixPosStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lat), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, lon), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, hepe), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, numApsUsed), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiFixPosStructT_v02, fixErrorCode), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApInfoStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, macAddr), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, rssi), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, channel), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApInfoStructT_v02, apQualifier), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApSsidStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocWifiApSsidStructT_v02, ssid), + QMI_LOC_MAX_WIFI_AP_SSID_STR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, xAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, yAxis), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleStructT_v02, zAxis), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLoc3AxisSensorSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, flags), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData) - QMI_IDL_OFFSET8(qmiLoc3AxisSensorSampleListStructT_v02, sensorData_len), + QMI_IDL_TYPE88(0, 33), + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, timeOffset), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleStructT_v02, temperature), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSensorTemperatureSampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeSource), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, timeOfFirstSample), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData), + QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02, + QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData) - QMI_IDL_OFFSET8(qmiLocSensorTemperatureSampleListStructT_v02, temperatureData_len), + QMI_IDL_TYPE88(0, 35), + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocApnProfilesStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, pdnType), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocApnProfilesStructT_v02, apnName), + QMI_LOC_MAX_APN_NAME_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocCircularGeofenceArgsStructT_data_v02[] = { + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocCircularGeofenceArgsStructT_v02, radius), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGeofenceMotionStateConfigStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofenceMotionStateConfigStructT_v02, motionState), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGeofenceMotionStateConfigStructT_v02, motionStateSpeed), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocMotionDataStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_state), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, motion_mode), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, probability_of_state), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, age), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocMotionDataStructT_v02, timeout), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGSMCellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MCC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, MNC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, LAC), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGSMCellIdStructT_v02, CID), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWCDMACellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mcc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, mnc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWCDMACellIdStructT_v02, cid), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocTDSCDMACellIdStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mcc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, mnc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, cid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocTDSCDMACellIdStructT_v02, lac), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocBatchedReportStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, fixId), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, validFields), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, latitude), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, longitude), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, horUncCircular), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, speedHorizontal), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, speedUnc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, altitudeWrtEllipsoid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, speedVertical), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, heading), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, headingUnc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, technologyMask), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, timestampUtc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, timeUnc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, magneticDeviation), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, vertUnc), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, horConfidence), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocBatchedReportStructT_v02, gpsTime), + QMI_IDL_TYPE88(0, 1), + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApDataStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, wifiApDataMask), + + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, macAddress), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, apTransmitPower), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, apAntennaGain), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, apSignalToNoise), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, apDeviceType), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, apRssi), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, apChannel), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, apRoundTripDelay), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, apRoundTripDelayUnit), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, apRoundTripDelayAccuracy), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, mobileSignalToNoise), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApDataStructT_v02, mobileRssi), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocVehicleSensorSampleStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleSensorSampleStructT_v02, timeOffset), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleSensorSampleStructT_v02, axisSample), + QMI_LOC_VEHICLE_SENSOR_DATA_MAX_AXES_V02, + QMI_IDL_OFFSET8(qmiLocVehicleSensorSampleStructT_v02, axisSample) - QMI_IDL_OFFSET8(qmiLocVehicleSensorSampleStructT_v02, axisSample_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocVehicleSensorSampleListStructType_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleSensorSampleListStructType_v02, sampleTimeBase), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleSensorSampleListStructType_v02, axesValidity), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_AGGREGATE, + 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, 46), + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocVehicleOdometrySampleStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleStructT_v02, timeOffset), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleStructT_v02, distanceTravelled), + QMI_LOC_VEHICLE_ODOMETRY_MAX_MEASUREMENTS_V02, + QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleStructT_v02, distanceTravelled) - QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleStructT_v02, distanceTravelled_len), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocVehicleOdometrySampleListStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleListStructT_v02, sampleTimeBase), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleListStructT_v02, flags), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleListStructT_v02, wheelFlags), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocVehicleOdometrySampleListStructT_v02, distanceTravelledBase), + + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_AGGREGATE, + 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, 48), + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocRcvrClockFrequencyInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocRcvrClockFrequencyInfoStructT_v02, clockDrift), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocRcvrClockFrequencyInfoStructT_v02, clockDriftUnc), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocRcvrClockFrequencyInfoStructT_v02, sourceOfFreq), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocLeapSecondInfoStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocLeapSecondInfoStructT_v02, leapSec), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocLeapSecondInfoStructT_v02, leapSecUnc), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocInterSystemBiasStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInterSystemBiasStructT_v02, validMask), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInterSystemBiasStructT_v02, timeBias), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInterSystemBiasStructT_v02, timeBiasUnc), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGnssTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGnssTimeStructT_v02, system), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocGnssTimeStructT_v02, systemWeek), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGnssTimeStructT_v02, systemMsec), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGnssTimeStructT_v02, systemClkTimeBias), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGnssTimeStructT_v02, systemClkTimeUncMs), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGloTimeStructT_data_v02[] = { + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGloTimeStructT_v02, gloFourYear), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocGloTimeStructT_v02, gloDays), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGloTimeStructT_v02, gloMsec), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGloTimeStructT_v02, gloClkTimeBias), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGloTimeStructT_v02, gloClkTimeUncMs), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocGnssTimeExtStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGnssTimeExtStructT_v02, refFCount), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGnssTimeExtStructT_v02, systemRtc_valid), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGnssTimeExtStructT_v02, systemRtcMs), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGnssTimeExtStructT_v02, sourceOfTime), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSVTimeSpeedStructT_data_v02[] = { + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVTimeSpeedStructT_v02, svTimeMs), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVTimeSpeedStructT_v02, svTimeSubMs), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVTimeSpeedStructT_v02, svTimeUncMs), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVTimeSpeedStructT_v02, dopplerShift), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVTimeSpeedStructT_v02, dopplerShiftUnc), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSVTimeSpeedStructT_v02, dopplerAccel_valid), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVTimeSpeedStructT_v02, dopplerAccel), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocSVMeasurementStructT_data_v02[] = { + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, gnssSvId), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, gloFrequency), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, svStatus), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, validMask), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, healthStatus), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, svInfoMask), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, validMeasStatusMask), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, measurementStatus), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, CNo), + + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, gloRfLoss), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, measLatency), + + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, svTimeSpeed), + QMI_IDL_TYPE88(0, 56), + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, lossOfLock), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, multipathEstimate), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, fineSpeed), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, fineSpeedUnc), + + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, carrierPhase), + + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, cycleSlipCount), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, svAzimuth), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSVMeasurementStructT_v02, svElevation), + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocWifiApMacAddressStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY |QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocWifiApMacAddressStructT_v02, wifiApMacAddress), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_FLAG_END_VALUE +}; + +static const uint8_t qmiLocIBeaconIdStructT_data_v02[] = { + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN |QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocIBeaconIdStructT_v02, uuid), + QMI_LOC_MAX_IBEACON_UUID_STR_LENGTH_V02, + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIBeaconIdStructT_v02, majorNumber), + + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocIBeaconIdStructT_v02, minorNumber), + + QMI_IDL_FLAG_END_VALUE +}; + +/*Message Definitions*/ +static const uint8_t qmiLocGenRespMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGenRespMsgT_v02, resp), + QMI_IDL_TYPE88(1, 0) +}; + +static const uint8_t qmiLocInformClientRevisionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformClientRevisionReqMsgT_v02, revision) +}; + +static const uint8_t qmiLocRegEventsReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocRegEventsReqMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocStartReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, fixRecurrence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, applicationId), + QMI_IDL_TYPE88(0, 0), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, configAltitudeAssumed) - QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, configAltitudeAssumed_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartReqMsgT_v02, configAltitudeAssumed) +}; + +static const uint8_t qmiLocStopReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocStopReqMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventPositionReportIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionStatus), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, sessionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence_valid)), + 0x16, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedHorizontal), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence_valid)), + 0x1D, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, speedVertical), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc_valid)), + 0x21, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP_valid)), + 0x24, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, DOP), + QMI_IDL_TYPE88(0, 2), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc_valid)), + 0x25, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds_valid)), + 0x26, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, leapSeconds), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime_valid)), + 0x27, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, gpsTime), + QMI_IDL_TYPE88(0, 1), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPositionReportIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, timeSrc_valid)), + 0x29, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, sensorDataUsage), + QMI_IDL_TYPE88(0, 3), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, fixId_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, fixId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_valid)), + 0x2C, + 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(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, gnssSvUsedList_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, altitudeAssumed) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventPositionReportIndMsgT_v02, altitudeAssumed_valid)), + 0x2D, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventPositionReportIndMsgT_v02, altitudeAssumed) +}; + +static const uint8_t qmiLocEventGnssSvInfoIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, altitudeAssumed), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList), + QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02, + QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList) - QMI_IDL_OFFSET8(qmiLocEventGnssSvInfoIndMsgT_v02, svList_len), + QMI_IDL_TYPE88(0, 4) +}; + +static const uint8_t qmiLocEventNmeaIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocEventNmeaIndMsgT_v02, nmea), + QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 +}; + +static const uint8_t qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd) - QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxInd), + QMI_IDL_TYPE88(0, 5), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplInd), + QMI_IDL_TYPE88(0, 11), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiUmtsCpInd), + QMI_IDL_TYPE88(0, 13), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiVxServiceInteractionInd), + QMI_IDL_TYPE88(0, 14), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, NiSuplVer2ExtInd), + QMI_IDL_TYPE88(0, 15), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventNiNotifyVerifyReqIndMsgT_v02, suplEmergencyNotification), + QMI_IDL_TYPE88(0, 16) +}; + +static const uint8_t qmiLocEventInjectTimeReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo) - QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectTimeReqIndMsgT_v02, timeServerInfo), + QMI_IDL_TYPE88(0, 18) +}; + +static const uint8_t qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, allowedSizes), + QMI_IDL_TYPE88(0, 19), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02, serverList), + QMI_IDL_TYPE88(0, 20) +}; + +static const uint8_t qmiLocEventInjectPositionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, latitude), + + 0x02, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, longitude), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventInjectPositionReqIndMsgT_v02, timestampUtc) +}; + +static const uint8_t qmiLocEventEngineStateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventEngineStateIndMsgT_v02, engineState) +}; + +static const uint8_t qmiLocEventFixSessionStateIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) - QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventFixSessionStateIndMsgT_v02, sessionId) +}; + +static const uint8_t qmiLocEventWifiReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) - QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventWifiReqIndMsgT_v02, tbfInMs) +}; + +static const uint8_t qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelReady), + QMI_IDL_TYPE88(0, 22), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroReady), + QMI_IDL_TYPE88(0, 22), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, accelTemperatureReady), + QMI_IDL_TYPE88(0, 22), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady) - QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady_valid)), + 0x13, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02, gyroTemperatureReady), + QMI_IDL_TYPE88(0, 22) +}; + +static const uint8_t qmiLocEventTimeSyncReqIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventTimeSyncReqIndMsgT_v02, refCounter) +}; + +static const uint8_t qmiLocEventSetSpiStreamingReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventSetSpiStreamingReportIndMsgT_v02, enable) +}; + +static const uint8_t qmiLocEventLocationServerConnectionReqIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, requestType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventLocationServerConnectionReqIndMsgT_v02, wwanType) +}; + +static const uint8_t qmiLocEventNiGeofenceNotificationIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventNiGeofenceNotificationIndMsgT_v02, operationType) +}; + +static const uint8_t qmiLocEventGeofenceGenAlertIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceGenAlertIndMsgT_v02, geofenceAlert) +}; + +static const uint8_t qmiLocEventGeofenceBreachIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, geofencePosition), + QMI_IDL_TYPE88(0, 23), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachConfidence) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachConfidence_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBreachIndMsgT_v02, breachConfidence) +}; + +static const uint8_t qmiLocEventPedometerControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, requestPedometerData), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, resetStepCount), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) - QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventPedometerControlIndMsgT_v02, stepCountThreshold) +}; + +static const uint8_t qmiLocEventMotionDataControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventMotionDataControlIndMsgT_v02, requestMotionData) +}; + +static const uint8_t qmiLocEventGeofenceBatchedBreachIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, breachType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofenceIdContinuousList) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofenceIdContinuousList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofenceIdContinuousList), + QMI_LOC_MAX_GEOFENCE_ID_CONTINUOUS_LIST_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofenceIdContinuousList) - QMI_IDL_OFFSET8(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofenceIdContinuousList_len), + QMI_IDL_TYPE88(0, 24), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofenceIdDiscreteList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_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(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofenceIdDiscreteList), + QMI_LOC_MAX_GEOFENCE_ID_DISCRETE_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofenceIdDiscreteList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofenceIdDiscreteList_len), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofencePosition) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofencePosition_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, geofencePosition), + QMI_IDL_TYPE88(0, 23), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, breachConfidence) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, breachConfidence_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, breachConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, headingUnc_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, vertUnc_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, speedUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, speedUnc_valid)), + 0x16, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, speedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, horConfidence) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, horConfidence_valid)), + 0x17, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, vertConfidence_valid)), + 0x18, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, DOP) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, DOP_valid)), + 0x19, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, DOP), + QMI_IDL_TYPE88(0, 2), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, gnssSvUsedList_valid)), + 0x1A, + 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(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGeofenceBatchedBreachIndMsgT_v02, gnssSvUsedList_len) +}; + +static const uint8_t qmiLocEventGeofenceProximityIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceProximityIndMsgT_v02, proximityType), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceProximityIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGeofenceProximityIndMsgT_v02, contextId) - QMI_IDL_OFFSET8(qmiLocEventGeofenceProximityIndMsgT_v02, contextId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGeofenceProximityIndMsgT_v02, contextId) +}; + +/* + * qmiLocGetServiceRevisionReqMsgT is empty + * static const uint8_t qmiLocGetServiceRevisionReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetServiceRevisionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, revision), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssMeFWVerString), + QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString) - QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServiceRevisionIndMsgT_v02, gnssHostSWVerString), + QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_STRING, + QMI_IDL_OFFSET16ARRAY(qmiLocGetServiceRevisionIndMsgT_v02, gnssSWVerString), + QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 +}; + +/* + * qmiLocGetFixCriteriaReqMsgT is empty + * static const uint8_t qmiLocGetFixCriteriaReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetFixCriteriaIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, horizontalAccuracyLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, intermediateReportState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId) - QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId_valid)), + 0x13, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetFixCriteriaIndMsgT_v02, applicationId), + QMI_IDL_TYPE88(0, 0) +}; + +static const uint8_t qmiLocNiUserRespReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, userResp), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, notificationType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload) - QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocNiUserRespReqMsgT_v02, NiVxPayload), + QMI_IDL_TYPE88(0, 5), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplPayload), + QMI_IDL_TYPE88(0, 11), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiUmtsCpPayload), + QMI_IDL_TYPE88(0, 13), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiVxServiceInteractionPayload), + QMI_IDL_TYPE88(0, 14), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, NiSuplVer2ExtPayload), + QMI_IDL_TYPE88(0, 15), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification) - QMI_IDL_OFFSET16RELATIVE(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocNiUserRespReqMsgT_v02, suplEmergencyNotification), + QMI_IDL_TYPE88(0, 16) +}; + +static const uint8_t qmiLocNiUserRespIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNiUserRespIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalSize), + + 0x02, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, totalParts), + + 0x03, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partNum), + + 0x04, + 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(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData), + ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) & 0xFF), ((QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, partData_len), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType_valid)), + 0x10, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectPredictedOrbitsDataReqMsgT_v02, formatType) +}; + +static const uint8_t qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) - QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum_valid)), + 0x10, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPredictedOrbitsDataIndMsgT_v02, partNum) +}; + +/* + * qmiLocGetPredictedOrbitsDataSourceReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataSourceReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, allowedSizes), + QMI_IDL_TYPE88(0, 19), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02, serverList), + QMI_IDL_TYPE88(0, 20) +}; + +/* + * qmiLocGetPredictedOrbitsDataValidityReqMsgT is empty + * static const uint8_t qmiLocGetPredictedOrbitsDataValidityReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo) - QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02, validityInfo), + QMI_IDL_TYPE88(0, 25) +}; + +static const uint8_t qmiLocInjectUtcTimeReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUtc), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeReqMsgT_v02, timeUnc) +}; + +static const uint8_t qmiLocInjectUtcTimeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectUtcTimeIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence_valid)), + 0x18, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo_valid)), + 0x1A, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, altSourceInfo), + QMI_IDL_TYPE88(0, 26), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc_valid)), + 0x1B, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge_valid)), + 0x1C, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, timestampAge), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, positionSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, rawHorUncCircular) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, rawHorUncCircular_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, rawHorUncCircular), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, rawHorConfidence) - QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, rawHorConfidence_valid)), + 0x1F, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionReqMsgT_v02, rawHorConfidence) +}; + +static const uint8_t qmiLocInjectPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetEngineLockReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockReqMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetEngineLockIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetEngineLockIndMsgT_v02, status) +}; + +/* + * qmiLocGetEngineLockReqMsgT is empty + * static const uint8_t qmiLocGetEngineLockReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetEngineLockIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) - QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetEngineLockIndMsgT_v02, lockType) +}; + +static const uint8_t qmiLocSetSbasConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigReqMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetSbasConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSbasConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSbasConfigReqMsgT is empty + * static const uint8_t qmiLocGetSbasConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSbasConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) - QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSbasConfigIndMsgT_v02, sbasConfig) +}; + +static const uint8_t qmiLocSetNmeaTypesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesReqMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetNmeaTypesIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetNmeaTypesIndMsgT_v02, status) +}; + +/* + * qmiLocGetNmeaTypesReqMsgT is empty + * static const uint8_t qmiLocGetNmeaTypesReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetNmeaTypesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) - QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNmeaTypesIndMsgT_v02, nmeaSentenceType) +}; + +static const uint8_t qmiLocSetLowPowerModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeReqMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetLowPowerModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetLowPowerModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetLowPowerModeReqMsgT is empty + * static const uint8_t qmiLocGetLowPowerModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetLowPowerModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) - QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetLowPowerModeIndMsgT_v02, lowPowerMode) +}; + +static const uint8_t qmiLocSetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv4Addr), + QMI_IDL_TYPE88(0, 8), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, ipv6Addr), + QMI_IDL_TYPE88(0, 9), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocSetServerReqMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocSetServerIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetServerIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetServerReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) - QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerReqMsgT_v02, serverAddrTypeMask) +}; + +static const uint8_t qmiLocGetServerIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, serverType), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv4Addr), + QMI_IDL_TYPE88(0, 8), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, ipv6Addr), + QMI_IDL_TYPE88(0, 9), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr) - QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocGetServerIndMsgT_v02, urlAddr), + QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 +}; + +static const uint8_t qmiLocDeleteAssistDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteAllFlag), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList), + QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList) - QMI_IDL_OFFSET8(qmiLocDeleteAssistDataReqMsgT_v02, deleteSvInfoList_len), + QMI_IDL_TYPE88(0, 27), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask_valid)), + 0x11, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteGnssDataMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocDeleteAssistDataReqMsgT_v02, deleteCellDbDataMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask) - QMI_IDL_OFFSET16RELATIVE(qmiLocDeleteAssistDataReqMsgT_v02, deleteClockInfoMask_valid)), + 0x13, + 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)), + 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) +}; + +static const uint8_t qmiLocDeleteAssistDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteAssistDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetXtraTSessionControlReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlReqMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocSetXtraTSessionControlIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraTSessionControlIndMsgT_v02, status) +}; + +/* + * qmiLocGetXtraTSessionControlReqMsgT is empty + * static const uint8_t qmiLocGetXtraTSessionControlReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetXtraTSessionControlIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) - QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetXtraTSessionControlIndMsgT_v02, xtraTSessionControl) +}; + +static const uint8_t qmiLocInjectWifiPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixTime), + QMI_IDL_TYPE88(0, 29), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, wifiFixPosition), + QMI_IDL_TYPE88(0, 30), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo), + QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo) - QMI_IDL_OFFSET8(qmiLocInjectWifiPositionReqMsgT_v02, apInfo_len), + QMI_IDL_TYPE88(0, 31), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, horizontalReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, rawHepe) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, rawHepe_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectWifiPositionReqMsgT_v02, rawHepe), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, wifiApSsidInfo) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, wifiApSsidInfo_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(qmiLocInjectWifiPositionReqMsgT_v02, wifiApSsidInfo), + QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, wifiApSsidInfo) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectWifiPositionReqMsgT_v02, wifiApSsidInfo_len), + QMI_IDL_TYPE88(0, 32) +}; + +static const uint8_t qmiLocInjectWifiPositionIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWifiPositionIndMsgT_v02, status) +}; + +static const uint8_t qmiLocNotifyWifiStatusReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusReqMsgT_v02, wifiStatus) +}; + +static const uint8_t qmiLocNotifyWifiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiStatusIndMsgT_v02, status) +}; + +/* + * qmiLocGetRegisteredEventsReqMsgT is empty + * static const uint8_t qmiLocGetRegisteredEventsReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetRegisteredEventsIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) - QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetRegisteredEventsIndMsgT_v02, eventRegMask) +}; + +static const uint8_t qmiLocSetOperationModeReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeReqMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetOperationModeIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetOperationModeIndMsgT_v02, status) +}; + +/* + * qmiLocGetOperationModeReqMsgT is empty + * static const uint8_t qmiLocGetOperationModeReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetOperationModeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) - QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetOperationModeIndMsgT_v02, operationMode) +}; + +static const uint8_t qmiLocSetSpiStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, stationary), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) - QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusReqMsgT_v02, confidenceStationary) +}; + +static const uint8_t qmiLocSetSpiStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSpiStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSensorDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelData), + QMI_IDL_TYPE88(0, 34), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData_valid)), + 0x12, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroData), + QMI_IDL_TYPE88(0, 34), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource_valid)), + 0x13, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisAccelDataTimeSource), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource_valid)), + 0x14, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, threeAxisGyroDataTimeSource), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData_valid)), + 0x15, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, accelTemperatureData), + QMI_IDL_TYPE88(0, 36), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData) - QMI_IDL_OFFSET16RELATIVE(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData_valid)), + 0x16, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectSensorDataReqMsgT_v02, gyroTemperatureData), + QMI_IDL_TYPE88(0, 36) +}; + +static const uint8_t qmiLocInjectSensorDataIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, opaqueIdentifier), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisAccelSamplesAccepted), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, threeAxisGyroSamplesAccepted), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, accelTemperatureSamplesAccepted), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) - QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted_valid)), + 0x14, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSensorDataIndMsgT_v02, gyroTemperatureSamplesAccepted) +}; + +static const uint8_t qmiLocInjectTimeSyncDataReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, refCounter), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcRxTime), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataReqMsgT_v02, sensorProcTxTime) +}; + +static const uint8_t qmiLocInjectTimeSyncDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTimeSyncDataIndMsgT_v02, status) +}; + +/* + * qmiLocGetCradleMountConfigReqMsgT is empty + * static const uint8_t qmiLocGetCradleMountConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetCradleMountConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetCradleMountConfigIndMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, cradleMountState), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) - QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigReqMsgT_v02, confidenceCradleMountState) +}; + +static const uint8_t qmiLocSetCradleMountConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetCradleMountConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetExternalPowerConfigReqMsgT is empty + * static const uint8_t qmiLocGetExternalPowerConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetExternalPowerConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) - QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetExternalPowerConfigIndMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigReqMsgT_v02, externalPowerState) +}; + +static const uint8_t qmiLocSetExternalPowerConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetExternalPowerConfigIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInformLocationServerConnStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, connHandle), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, requestType), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, statusType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile) - QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusReqMsgT_v02, apnProfile), + QMI_IDL_TYPE88(0, 37) +}; + +static const uint8_t qmiLocInformLocationServerConnStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInformLocationServerConnStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, assistedGlonassProtocolMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplHashAlgo), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, suplTlsVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, emergencyProtocol), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, wifiScanInjectTimeout) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, wifiScanInjectTimeout_valid)), + 0x18, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersReqMsgT_v02, wifiScanInjectTimeout) +}; + +static const uint8_t qmiLocSetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetProtocolConfigParametersIndMsgT_v02, failedProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersReqMsgT_v02, getProtocolConfigParamMask) +}; + +static const uint8_t qmiLocGetProtocolConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplSecurity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, vxVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, lppConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, assistedGlonassProtocolMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplHashAlgo), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, suplTlsVersion), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, emergencyProtocol), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, wifiScanInjectTimeout) - QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, wifiScanInjectTimeout_valid)), + 0x18, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetProtocolConfigParametersIndMsgT_v02, wifiScanInjectTimeout) +}; + +static const uint8_t qmiLocSetSensorControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorsUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorProvider) - QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorProvider_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigReqMsgT_v02, sensorProvider) +}; + +static const uint8_t qmiLocSetSensorControlConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorControlConfigIndMsgT_v02, status) +}; + +/* + * qmiLocGetSensorControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorsUsage), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorProvider) - QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorProvider_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorControlConfigIndMsgT_v02, sensorProvider) +}; + +static const uint8_t qmiLocSetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, rateRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleDataUse) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleDataUse_valid)), + 0x15, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleDataUse), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleVelocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleVelocityRandomWalkSpectralDensity_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleVelocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleAccelRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleAccelRandomWalkSpectralDensity_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleAccelRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleAngleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleAngleRandomWalkSpectralDensity_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleAngleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleAngularRateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleAngularRateRandomWalkSpectralDensity_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleAngularRateRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleOdometryScaleFactorRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleOdometryScaleFactorRandomWalkSpectralDensity_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleOdometryScaleFactorRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleOdometryVariance) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleOdometryVariance_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesReqMsgT_v02, vehicleOdometryVariance) +}; + +static const uint8_t qmiLocSetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) - QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPropertiesIndMsgT_v02, failedSensorPropertiesMask) +}; + +static const uint8_t qmiLocGetSensorPropertiesReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesReqMsgT_v02, getSensorPropertiesMask) +}; + +static const uint8_t qmiLocGetSensorPropertiesIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, gyroBiasVarianceRandomWalk), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, velocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, accelerationRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, angleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, rateRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleDataUse) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleDataUse_valid)), + 0x15, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleDataUse), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleVelocityRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleVelocityRandomWalkSpectralDensity_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleVelocityRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleAccelRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleAccelRandomWalkSpectralDensity_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleAccelRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleAngleRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleAngleRandomWalkSpectralDensity_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleAngleRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleAngularRateRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleAngularRateRandomWalkSpectralDensity_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleAngularRateRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleOdometryScaleFactorRandomWalkSpectralDensity) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleOdometryScaleFactorRandomWalkSpectralDensity_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleOdometryScaleFactorRandomWalkSpectralDensity), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleOdometryVariance) - QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleOdometryVariance_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPropertiesIndMsgT_v02, vehicleOdometryVariance) +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpec), + QMI_IDL_TYPE88(0, 21), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpec), + QMI_IDL_TYPE88(0, 21), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, accelSamplingSpecHigh), + QMI_IDL_TYPE88(0, 21), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02, gyroSamplingSpecHigh), + QMI_IDL_TYPE88(0, 21) +}; + +static const uint8_t qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) - QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02, failedConfiguration) +}; + +/* + * qmiLocGetSensorPerformanceControlConfigReqMsgT is empty + * static const uint8_t qmiLocGetSensorPerformanceControlConfigReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, performanceControlMode), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec_valid)), + 0x11, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpec), + QMI_IDL_TYPE88(0, 21), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec_valid)), + 0x12, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpec), + QMI_IDL_TYPE88(0, 21), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, algorithmConfig), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, accelSamplingSpecHigh), + QMI_IDL_TYPE88(0, 21), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh) - QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh_valid)), + 0x15, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02, gyroSamplingSpecHigh), + QMI_IDL_TYPE88(0, 21) +}; + +static const uint8_t qmiLocInjectSuplCertificateReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertId), + + 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(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData), + ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_SUPL_CERT_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData) - QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateReqMsgT_v02, suplCertData_len) +}; + +static const uint8_t qmiLocInjectSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocDeleteSuplCertificateReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) - QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateReqMsgT_v02, suplCertId) +}; + +static const uint8_t qmiLocDeleteSuplCertificateIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteSuplCertificateIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, storeAssistData), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, enableFasterTTFF) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, enableFasterTTFF_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersReqMsgT_v02, enableFasterTTFF) +}; + +static const uint8_t qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) - QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPositionEngineConfigParametersIndMsgT_v02, failedPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersReqMsgT_v02, getPositionEngineConfigParamMask) +}; + +static const uint8_t qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, injectedPositionControl), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, filterSvUsage), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, storeAssistData), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, enableFasterTTFF) - QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, enableFasterTTFF_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetPositionEngineConfigParametersIndMsgT_v02, enableFasterTTFF) +}; + +static const uint8_t qmiLocAddCircularGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, transactionId), + + 0x02, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, circularGeofenceArgs), + QMI_IDL_TYPE88(0, 38), + + 0x03, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, breachMask), + + 0x04, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, includePosition), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, responsiveness), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceReqMsgT_v02, confidence) +}; + +static const uint8_t qmiLocAddCircularGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddCircularGeofenceIndMsgT_v02, geofenceId) +}; + +static const uint8_t qmiLocDeleteGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocDeleteGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceIndMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocQueryGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceOrigin), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, posWrtGeofence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs_valid)), + 0x14, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, circularGeofenceArgs), + QMI_IDL_TYPE88(0, 38), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocQueryGeofenceIndMsgT_v02, geofenceState) +}; + +static const uint8_t qmiLocSetGeofenceEngineConfigReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, gnssUnavailableIndicationTimeout) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, gnssUnavailableIndicationTimeout_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, gnssUnavailableIndicationTimeout), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, maxGeofences) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, maxGeofences_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, maxGeofences), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, enableMotionDetectionSources) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, enableMotionDetectionSources_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, enableMotionDetectionSources), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, enableCpiUsage) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, enableCpiUsage_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, enableCpiUsage), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, gnssPositionSessionTimeout) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, gnssPositionSessionTimeout_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, gnssPositionSessionTimeout), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, gnssPositionMaxPuncAcceptable) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, gnssPositionMaxPuncAcceptable_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, gnssPositionMaxPuncAcceptable), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, mediumResponsivenessValue) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, mediumResponsivenessValue_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, mediumResponsivenessValue), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, chalGnssEnvMinCpiWaitInterval) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, chalGnssEnvMinCpiWaitInterval_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, chalGnssEnvMinCpiWaitInterval), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, motionStateInfo) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, motionStateInfo_valid)), + 0x18, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, motionStateInfo), + QMI_LOC_GEOFENCE_MAX_MOTION_STATES_V02, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, motionStateInfo) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigReqMsgT_v02, motionStateInfo_len), + QMI_IDL_TYPE88(0, 39) +}; + +static const uint8_t qmiLocSetGeofenceEngineConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineConfigIndMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetGeofenceEngineConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetGeofenceEngineConfigIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, gnssUnavailableIndicationTimeout) - QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, gnssUnavailableIndicationTimeout_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, gnssUnavailableIndicationTimeout), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, maxGeofences) - QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, maxGeofences_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, maxGeofences), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, enabledMotionDetectionSources) - QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, enabledMotionDetectionSources_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, enabledMotionDetectionSources), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, enabledCpiUsage) - QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, enabledCpiUsage_valid)), + 0x14, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetGeofenceEngineConfigIndMsgT_v02, enabledCpiUsage) +}; + +static const uint8_t qmiLocEditGeofenceReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, geofenceState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, breachMask), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, responsiveness) - QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, responsiveness_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceReqMsgT_v02, responsiveness) +}; + +static const uint8_t qmiLocEditGeofenceIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) - QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEditGeofenceIndMsgT_v02, failedParams) +}; + +static const uint8_t qmiLocGetBestAvailablePositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetBestAvailablePositionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude_valid)), + 0x12, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc_valid)), + 0x16, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence_valid)), + 0x1B, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horCircularConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence_valid)), + 0x1C, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horEllipticalConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc_valid)), + 0x1F, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, horSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence_valid)), + 0x21, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed_valid)), + 0x23, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeed), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc_valid)), + 0x24, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, vertSpeedUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading_valid)), + 0x25, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, heading), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc_valid)), + 0x26, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, headingUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation_valid)), + 0x27, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, magneticDeviation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask_valid)), + 0x28, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, technologyMask), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP) - QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP_valid)), + 0x29, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetBestAvailablePositionIndMsgT_v02, DOP), + QMI_IDL_TYPE88(0, 2), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime_valid)), + 0x2A, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, gpsTime), + QMI_IDL_TYPE88(0, 1), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc_valid)), + 0x2B, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, timeSrc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage_valid)), + 0x2C, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET16ARRAY(qmiLocGetBestAvailablePositionIndMsgT_v02, sensorDataUsage), + QMI_IDL_TYPE88(0, 3), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_valid)), + 0x2D, + 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(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList), + QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02, + QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList) - QMI_IDL_OFFSET16RELATIVE(qmiLocGetBestAvailablePositionIndMsgT_v02, gnssSvUsedList_len) +}; + +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, 40) +}; + +static const uint8_t qmiLocInjectMotionDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectMotionDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetNiGeofenceIdListIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList), + QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList) - QMI_IDL_OFFSET8(qmiLocGetNiGeofenceIdListIndMsgT_v02, niGeofenceIdList_len) +}; + +static const uint8_t qmiLocInjectGSMCellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, gsmCellId), + QMI_IDL_TYPE88(0, 41), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, roamingStatus), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) - QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoReqMsgT_v02, timingAdvance) +}; + +static const uint8_t qmiLocInjectGSMCellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectGSMCellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectWCDMACellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, wcdmaCellId), + QMI_IDL_TYPE88(0, 42), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, roamingStatus), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, freq), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) - QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoReqMsgT_v02, psc) +}; + +static const uint8_t qmiLocInjectWCDMACellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWCDMACellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, tdscdmaCellId), + QMI_IDL_TYPE88(0, 43), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, roamingStatus), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) - QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoReqMsgT_v02, freq) +}; + +static const uint8_t qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectTDSCDMACellInfoIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectSubscriberIDReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredIMSI), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) - QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDReqMsgT_v02, preferredMSISDN) +}; + +static const uint8_t qmiLocInjectSubscriberIDIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectSubscriberIDIndMsgT_v02, status) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessageType), + + 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(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage), + ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) & 0xFF), ((QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02) >> 8), + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage) - QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02, injectedNIMessage_len) +}; + +static const uint8_t qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02, status) +}; + +/* + * qmiLocWWANOutOfServiceNotificationReqMsgT is empty + * static const uint8_t qmiLocWWANOutOfServiceNotificationReqMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocWWANOutOfServiceNotificationIndMsgT_v02, status) +}; + +static const uint8_t qmiLocPedometerReportReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeSource), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timestamp), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, timeInterval), + + 0x04, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCount), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepCountUncertainty), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) - QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportReqMsgT_v02, stepRate) +}; + +static const uint8_t qmiLocPedometerReportIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocPedometerReportIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetBatchSizeReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBatchSizeReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBatchSizeReqMsgT_v02, batchSize) +}; + +static const uint8_t qmiLocGetBatchSizeIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBatchSizeIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBatchSizeIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetBatchSizeIndMsgT_v02, batchSize) +}; + +static const uint8_t qmiLocStartBatchingReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, minInterval) - QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, minInterval_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, minInterval), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, horizontalAccuracyLevel) - QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, horizontalAccuracyLevel_valid)), + 0x11, + 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)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartBatchingReqMsgT_v02, fixSessionTimeout) +}; + +static const uint8_t qmiLocStartBatchingIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStartBatchingIndMsgT_v02, status) +}; + +static const uint8_t qmiLocEventBatchFullIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventBatchFullIndMsgT_v02, batchCount) +}; + +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, 44) +}; + +static const uint8_t qmiLocReadFromBatchReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocReadFromBatchReqMsgT_v02, numberOfEntries), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocReadFromBatchReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocReadFromBatchIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, status), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, numberOfEntries) - QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, numberOfEntries_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, numberOfEntries), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, batchedReportList) - QMI_IDL_OFFSET8(qmiLocReadFromBatchIndMsgT_v02, batchedReportList_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + 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, 44) +}; + +static const uint8_t qmiLocStopBatchingReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStopBatchingReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocStopBatchingIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStopBatchingIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocStopBatchingIndMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocReleaseBatchReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocReleaseBatchReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocReleaseBatchIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocReleaseBatchIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocReleaseBatchIndMsgT_v02, transactionId) +}; + +/* + * qmiLocEventInjectWifiApDataReqIndMsgT is empty + * static const uint8_t qmiLocEventInjectWifiApDataReqIndMsgT_data_v02[] = { + * }; + */ + +static const uint8_t qmiLocInjectWifiApDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + 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, 45) +}; + +static const uint8_t qmiLocInjectWifiApDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectWifiApDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocNotifyWifiAttachmentStatusReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiAttachmentStatusReqMsgT_v02, attachState), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNotifyWifiAttachmentStatusReqMsgT_v02, accessPointMacAddress) - QMI_IDL_OFFSET8(qmiLocNotifyWifiAttachmentStatusReqMsgT_v02, accessPointMacAddress_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiAttachmentStatusReqMsgT_v02, accessPointMacAddress), + QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02, + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocNotifyWifiAttachmentStatusReqMsgT_v02, wifiApSsid) - QMI_IDL_OFFSET8(qmiLocNotifyWifiAttachmentStatusReqMsgT_v02, wifiApSsid_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_STRING, + QMI_IDL_OFFSET8(qmiLocNotifyWifiAttachmentStatusReqMsgT_v02, wifiApSsid), + QMI_LOC_MAX_WIFI_AP_SSID_STR_LENGTH_V02 +}; + +static const uint8_t qmiLocNotifyWifiAttachmentStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiAttachmentStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocNotifyWifiEnabledStatusReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiEnabledStatusReqMsgT_v02, enabledStatus) +}; + +static const uint8_t qmiLocNotifyWifiEnabledStatusIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocNotifyWifiEnabledStatusIndMsgT_v02, status) +}; + +static const uint8_t qmiLocEventVehicleDataReadyIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventVehicleDataReadyIndMsgT_v02, vehicleAccelReadyStatus) - QMI_IDL_OFFSET8(qmiLocEventVehicleDataReadyIndMsgT_v02, vehicleAccelReadyStatus_valid)), + 0x10, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventVehicleDataReadyIndMsgT_v02, vehicleAccelReadyStatus), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventVehicleDataReadyIndMsgT_v02, vehicleAngularRateReadyStatus) - QMI_IDL_OFFSET8(qmiLocEventVehicleDataReadyIndMsgT_v02, vehicleAngularRateReadyStatus_valid)), + 0x11, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventVehicleDataReadyIndMsgT_v02, vehicleAngularRateReadyStatus), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventVehicleDataReadyIndMsgT_v02, vehicleOdometryReadyStatus) - QMI_IDL_OFFSET8(qmiLocEventVehicleDataReadyIndMsgT_v02, vehicleOdometryReadyStatus_valid)), + 0x12, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventVehicleDataReadyIndMsgT_v02, vehicleOdometryReadyStatus) +}; + +static const uint8_t qmiLocInjectVehicleSensorDataReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocInjectVehicleSensorDataReqMsgT_v02, accelData) - QMI_IDL_OFFSET8(qmiLocInjectVehicleSensorDataReqMsgT_v02, accelData_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocInjectVehicleSensorDataReqMsgT_v02, accelData), + 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, 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, 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, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocInjectVehicleSensorDataReqMsgT_v02, changeInTimeScales) +}; + +static const uint8_t qmiLocInjectVehicleSensorDataIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocInjectVehicleSensorDataIndMsgT_v02, status) +}; + +static const uint8_t qmiLocGetAvailWwanPositionReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionReqMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocGetAvailWwanPositionIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, latitude) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, latitude_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, latitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, longitude) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, longitude_valid)), + 0x12, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, longitude), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncCircular) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncCircular_valid)), + 0x13, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncCircular), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, altitudeWrtEllipsoid) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, altitudeWrtEllipsoid_valid)), + 0x14, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, altitudeWrtEllipsoid), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, vertUnc) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, vertUnc_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, vertUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, timestampUtc) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, timestampUtc_valid)), + 0x16, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, timestampUtc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, timeUnc) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, timeUnc_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, timeUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncEllipseSemiMinor) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncEllipseSemiMinor_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncEllipseSemiMinor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncEllipseSemiMajor) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncEllipseSemiMajor_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncEllipseSemiMajor), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncEllipseOrientAzimuth) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncEllipseOrientAzimuth_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horUncEllipseOrientAzimuth), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horCircularConfidence) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horCircularConfidence_valid)), + 0x1B, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horCircularConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horEllipticalConfidence) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horEllipticalConfidence_valid)), + 0x1C, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horEllipticalConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horReliability) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horReliability_valid)), + 0x1D, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, horReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, altitudeWrtMeanSeaLevel) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, altitudeWrtMeanSeaLevel_valid)), + 0x1E, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, altitudeWrtMeanSeaLevel), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, vertConfidence) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, vertConfidence_valid)), + 0x1F, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, vertConfidence), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, vertReliability) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, vertReliability_valid)), + 0x20, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, vertReliability), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, gpsTime) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, gpsTime_valid)), + 0x21, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, gpsTime), + QMI_IDL_TYPE88(0, 1), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, timeSrc) - QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, timeSrc_valid)), + 0x22, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocGetAvailWwanPositionIndMsgT_v02, timeSrc) +}; + +static const uint8_t qmiLocSetPremiumServicesCfgReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPremiumServicesCfgReqMsgT_v02, premiumServiceType), + + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPremiumServicesCfgReqMsgT_v02, premiumServiceCfg) +}; + +static const uint8_t qmiLocSetPremiumServicesCfgIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetPremiumServicesCfgIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetXtraVersionCheckReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraVersionCheckReqMsgT_v02, xtraVersionCheckMode) +}; + +static const uint8_t qmiLocSetXtraVersionCheckIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetXtraVersionCheckIndMsgT_v02, status) +}; + +static const uint8_t qmiLocSetGNSSConstRepConfigReqMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGNSSConstRepConfigReqMsgT_v02, measReportConfig) - QMI_IDL_OFFSET8(qmiLocSetGNSSConstRepConfigReqMsgT_v02, measReportConfig_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGNSSConstRepConfigReqMsgT_v02, measReportConfig), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGNSSConstRepConfigReqMsgT_v02, svPolyReportConfig) - QMI_IDL_OFFSET8(qmiLocSetGNSSConstRepConfigReqMsgT_v02, svPolyReportConfig_valid)), + 0x11, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGNSSConstRepConfigReqMsgT_v02, svPolyReportConfig) +}; + +static const uint8_t qmiLocSetGNSSConstRepConfigIndMsgT_data_v02[] = { + QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGNSSConstRepConfigIndMsgT_v02, status) +}; + +static const uint8_t qmiLocEventGnssSvMeasInfoIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, seqNum), + + 0x02, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, maxMessageNum), + + 0x03, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, system), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, rcvrClockFrequencyInfo) - QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, rcvrClockFrequencyInfo_valid)), + 0x10, + QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvMeasInfoIndMsgT_v02, rcvrClockFrequencyInfo), + 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + 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, 57) +}; + +static const uint8_t qmiLocEventGnssSvPolyIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, gnssSvId), + + 0x02, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, T0), + + 0x03, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, svPolyFlagValid), + + 0x04, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, svPolyFlags), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, polyCoeffXYZ0) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, polyCoeffXYZ0_valid)), + 0x10, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, polyCoeffXYZ0), + QMI_LOC_SV_POLY_XYZ_0_TH_ORDER_COEFF_SIZE_V02, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, polyCoefXYZN) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, polyCoefXYZN_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, polyCoefXYZN), + QMI_LOC_SV_POLY_XYZ_N_TH_ORDER_COEFF_SIZE_V02, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, polyCoefClockBias) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, polyCoefClockBias_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, polyCoefClockBias), + QMI_LOC_SV_POLY_SV_CLKBIAS_COEFF_SIZE_V02, + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, gloFrequency) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, gloFrequency_valid)), + 0x13, + QMI_IDL_GENERIC_1_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, gloFrequency), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, IODE) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, IODE_valid)), + 0x14, + QMI_IDL_GENERIC_2_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, IODE), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, enhancedIOD) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, enhancedIOD_valid)), + 0x15, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, enhancedIOD), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, svPosUnc) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, svPosUnc_valid)), + 0x16, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, svPosUnc), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, ionoDelay) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, ionoDelay_valid)), + 0x17, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, ionoDelay), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, ionoDot) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, ionoDot_valid)), + 0x18, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, ionoDot), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, sbasIonoDelay) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, sbasIonoDelay_valid)), + 0x19, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, sbasIonoDelay), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, sbasIonoDot) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, sbasIonoDot_valid)), + 0x1A, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, sbasIonoDot), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, tropoDelay) - QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, tropoDelay_valid)), + 0x1B, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocEventGnssSvPolyIndMsgT_v02, tropoDelay), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGnssSvPolyIndMsgT_v02, elevation) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGnssSvPolyIndMsgT_v02, elevation_valid)), + 0x1C, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGnssSvPolyIndMsgT_v02, elevation), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGnssSvPolyIndMsgT_v02, elevationDot) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGnssSvPolyIndMsgT_v02, elevationDot_valid)), + 0x1D, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGnssSvPolyIndMsgT_v02, elevationDot), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGnssSvPolyIndMsgT_v02, elenationUnc) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGnssSvPolyIndMsgT_v02, elenationUnc_valid)), + 0x1E, + QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGnssSvPolyIndMsgT_v02, elenationUnc), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocEventGnssSvPolyIndMsgT_v02, velCoef) - QMI_IDL_OFFSET16RELATIVE(qmiLocEventGnssSvPolyIndMsgT_v02, velCoef_valid)), + 0x1F, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET16ARRAY(qmiLocEventGnssSvPolyIndMsgT_v02, velCoef), + QMI_LOC_SV_POLY_VELOCITY_COEF_SIZE_V02 +}; + +static const uint8_t qmiLocAddGeofenceContextReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddGeofenceContextReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddGeofenceContextReqMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddGeofenceContextReqMsgT_v02, geofenceId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddGeofenceContextReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddGeofenceContextReqMsgT_v02, wifiApSsidInfo) - QMI_IDL_OFFSET8(qmiLocAddGeofenceContextReqMsgT_v02, wifiApSsidInfo_valid)), + 0x11, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_AGGREGATE, + QMI_IDL_OFFSET8(qmiLocAddGeofenceContextReqMsgT_v02, wifiApSsidInfo), + QMI_LOC_WIFI_AREA_ID_LIST_LENGTH_V02, + QMI_IDL_OFFSET8(qmiLocAddGeofenceContextReqMsgT_v02, wifiApSsidInfo) - QMI_IDL_OFFSET8(qmiLocAddGeofenceContextReqMsgT_v02, wifiApSsidInfo_len), + QMI_IDL_TYPE88(0, 32), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wifiApMacAddressList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wifiApMacAddressList_valid)), + 0x12, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + 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, 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, 43), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wcdmaCellIDList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, wcdmaCellIDList_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(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, 42), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, gsmCellIDList) - QMI_IDL_OFFSET16RELATIVE(qmiLocAddGeofenceContextReqMsgT_v02, gsmCellIDList_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(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, 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, + QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE, + 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, 59) +}; + +static const uint8_t qmiLocAddGeofenceContextIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, geofenceId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, contextId) - QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, contextId_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocAddGeofenceContextIndMsgT_v02, contextId) +}; + +static const uint8_t qmiLocSetGeofenceEngineContextReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextReqMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextReqMsgT_v02, utcTimeOfDay) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextReqMsgT_v02, utcTimeOfDay_valid)), + 0x10, + QMI_IDL_GENERIC_8_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextReqMsgT_v02, utcTimeOfDay), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextReqMsgT_v02, temperature) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextReqMsgT_v02, temperature_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextReqMsgT_v02, temperature) +}; + +static const uint8_t qmiLocSetGeofenceEngineContextIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocSetGeofenceEngineContextIndMsgT_v02, transactionId) +}; + +static const uint8_t qmiLocDeleteGeofenceContextReqMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextReqMsgT_v02, transactionId), + + 0x02, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextReqMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextReqMsgT_v02, contextId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextReqMsgT_v02, contextId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextReqMsgT_v02, contextId) +}; + +static const uint8_t qmiLocDeleteGeofenceContextIndMsgT_data_v02[] = { + 0x01, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, status), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, transactionId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, transactionId_valid)), + 0x10, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, transactionId), + + QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, geofenceId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, geofenceId_valid)), + 0x11, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, geofenceId), + + QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, contextId) - QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, contextId_valid)), + 0x12, + QMI_IDL_GENERIC_4_BYTE, + QMI_IDL_OFFSET8(qmiLocDeleteGeofenceContextIndMsgT_v02, contextId) +}; + +/* Type Table */ +static const qmi_idl_type_table_entry loc_type_table_v02[] = { + {sizeof(qmiLocApplicationIdStructT_v02), qmiLocApplicationIdStructT_data_v02}, + {sizeof(qmiLocGPSTimeStructT_v02), qmiLocGPSTimeStructT_data_v02}, + {sizeof(qmiLocDOPStructT_v02), qmiLocDOPStructT_data_v02}, + {sizeof(qmiLocSensorUsageIndicatorStructT_v02), qmiLocSensorUsageIndicatorStructT_data_v02}, + {sizeof(qmiLocSvInfoStructT_v02), qmiLocSvInfoStructT_data_v02}, + {sizeof(qmiLocNiVxNotifyVerifyStructT_v02), qmiLocNiVxNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiSuplFormattedStringStructT_v02), qmiLocNiSuplFormattedStringStructT_data_v02}, + {sizeof(qmiLocNiSuplQopStructT_v02), qmiLocNiSuplQopStructT_data_v02}, + {sizeof(qmiLocIpV4AddrStructType_v02), qmiLocIpV4AddrStructType_data_v02}, + {sizeof(qmiLocIpV6AddrStructType_v02), qmiLocIpV6AddrStructType_data_v02}, + {sizeof(qmiLocNiSuplServerInfoStructT_v02), qmiLocNiSuplServerInfoStructT_data_v02}, + {sizeof(qmiLocNiSuplNotifyVerifyStructT_v02), qmiLocNiSuplNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpCodedStringStructT_v02), qmiLocNiUmtsCpCodedStringStructT_data_v02}, + {sizeof(qmiLocNiUmtsCpNotifyVerifyStructT_v02), qmiLocNiUmtsCpNotifyVerifyStructT_data_v02}, + {sizeof(qmiLocNiVxServiceInteractionStructT_v02), qmiLocNiVxServiceInteractionStructT_data_v02}, + {sizeof(qmiLocNiSuplVer2ExtStructT_v02), qmiLocNiSuplVer2ExtStructT_data_v02}, + {sizeof(qmiLocEmergencyNotificationStructT_v02), qmiLocEmergencyNotificationStructT_data_v02}, + {sizeof(qmiLocAssistanceServerUrlStructT_v02), qmiLocAssistanceServerUrlStructT_data_v02}, + {sizeof(qmiLocTimeServerListStructT_v02), qmiLocTimeServerListStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsAllowedSizesStructT_v02), qmiLocPredictedOrbitsAllowedSizesStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsServerListStructT_v02), qmiLocPredictedOrbitsServerListStructT_data_v02}, + {sizeof(qmiLocSensorControlConfigSamplingSpecStructT_v02), qmiLocSensorControlConfigSamplingSpecStructT_data_v02}, + {sizeof(qmiLocSensorReadyStatusStructT_v02), qmiLocSensorReadyStatusStructT_data_v02}, + {sizeof(qmiLocGeofencePositionStructT_v02), qmiLocGeofencePositionStructT_data_v02}, + {sizeof(qmiLocGeofenceIdContinuousStructT_v02), qmiLocGeofenceIdContinuousStructT_data_v02}, + {sizeof(qmiLocPredictedOrbitsDataValidityStructT_v02), qmiLocPredictedOrbitsDataValidityStructT_data_v02}, + {sizeof(qmiLocAltitudeSrcInfoStructT_v02), qmiLocAltitudeSrcInfoStructT_data_v02}, + {sizeof(qmiLocDeleteSvInfoStructT_v02), qmiLocDeleteSvInfoStructT_data_v02}, + {sizeof(qmiLocDeleteBDSSvInfoStructT_v02), qmiLocDeleteBDSSvInfoStructT_data_v02}, + {sizeof(qmiLocWifiFixTimeStructT_v02), qmiLocWifiFixTimeStructT_data_v02}, + {sizeof(qmiLocWifiFixPosStructT_v02), qmiLocWifiFixPosStructT_data_v02}, + {sizeof(qmiLocWifiApInfoStructT_v02), qmiLocWifiApInfoStructT_data_v02}, + {sizeof(qmiLocWifiApSsidStructT_v02), qmiLocWifiApSsidStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleStructT_v02), qmiLoc3AxisSensorSampleStructT_data_v02}, + {sizeof(qmiLoc3AxisSensorSampleListStructT_v02), qmiLoc3AxisSensorSampleListStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleStructT_v02), qmiLocSensorTemperatureSampleStructT_data_v02}, + {sizeof(qmiLocSensorTemperatureSampleListStructT_v02), qmiLocSensorTemperatureSampleListStructT_data_v02}, + {sizeof(qmiLocApnProfilesStructT_v02), qmiLocApnProfilesStructT_data_v02}, + {sizeof(qmiLocCircularGeofenceArgsStructT_v02), qmiLocCircularGeofenceArgsStructT_data_v02}, + {sizeof(qmiLocGeofenceMotionStateConfigStructT_v02), qmiLocGeofenceMotionStateConfigStructT_data_v02}, + {sizeof(qmiLocMotionDataStructT_v02), qmiLocMotionDataStructT_data_v02}, + {sizeof(qmiLocGSMCellIdStructT_v02), qmiLocGSMCellIdStructT_data_v02}, + {sizeof(qmiLocWCDMACellIdStructT_v02), qmiLocWCDMACellIdStructT_data_v02}, + {sizeof(qmiLocTDSCDMACellIdStructT_v02), qmiLocTDSCDMACellIdStructT_data_v02}, + {sizeof(qmiLocBatchedReportStructT_v02), qmiLocBatchedReportStructT_data_v02}, + {sizeof(qmiLocWifiApDataStructT_v02), qmiLocWifiApDataStructT_data_v02}, + {sizeof(qmiLocVehicleSensorSampleStructT_v02), qmiLocVehicleSensorSampleStructT_data_v02}, + {sizeof(qmiLocVehicleSensorSampleListStructType_v02), qmiLocVehicleSensorSampleListStructType_data_v02}, + {sizeof(qmiLocVehicleOdometrySampleStructT_v02), qmiLocVehicleOdometrySampleStructT_data_v02}, + {sizeof(qmiLocVehicleOdometrySampleListStructT_v02), qmiLocVehicleOdometrySampleListStructT_data_v02}, + {sizeof(qmiLocRcvrClockFrequencyInfoStructT_v02), qmiLocRcvrClockFrequencyInfoStructT_data_v02}, + {sizeof(qmiLocLeapSecondInfoStructT_v02), qmiLocLeapSecondInfoStructT_data_v02}, + {sizeof(qmiLocInterSystemBiasStructT_v02), qmiLocInterSystemBiasStructT_data_v02}, + {sizeof(qmiLocGnssTimeStructT_v02), qmiLocGnssTimeStructT_data_v02}, + {sizeof(qmiLocGloTimeStructT_v02), qmiLocGloTimeStructT_data_v02}, + {sizeof(qmiLocGnssTimeExtStructT_v02), qmiLocGnssTimeExtStructT_data_v02}, + {sizeof(qmiLocSVTimeSpeedStructT_v02), qmiLocSVTimeSpeedStructT_data_v02}, + {sizeof(qmiLocSVMeasurementStructT_v02), qmiLocSVMeasurementStructT_data_v02}, + {sizeof(qmiLocWifiApMacAddressStructT_v02), qmiLocWifiApMacAddressStructT_data_v02}, + {sizeof(qmiLocIBeaconIdStructT_v02), qmiLocIBeaconIdStructT_data_v02} +}; + +/* Message Table */ +static const qmi_idl_message_table_entry loc_message_table_v02[] = { + {sizeof(qmiLocGenRespMsgT_v02), qmiLocGenRespMsgT_data_v02}, + {sizeof(qmiLocInformClientRevisionReqMsgT_v02), qmiLocInformClientRevisionReqMsgT_data_v02}, + {sizeof(qmiLocRegEventsReqMsgT_v02), qmiLocRegEventsReqMsgT_data_v02}, + {sizeof(qmiLocStartReqMsgT_v02), qmiLocStartReqMsgT_data_v02}, + {sizeof(qmiLocStopReqMsgT_v02), qmiLocStopReqMsgT_data_v02}, + {sizeof(qmiLocEventPositionReportIndMsgT_v02), qmiLocEventPositionReportIndMsgT_data_v02}, + {sizeof(qmiLocEventGnssSvInfoIndMsgT_v02), qmiLocEventGnssSvInfoIndMsgT_data_v02}, + {sizeof(qmiLocEventNmeaIndMsgT_v02), qmiLocEventNmeaIndMsgT_data_v02}, + {sizeof(qmiLocEventNiNotifyVerifyReqIndMsgT_v02), qmiLocEventNiNotifyVerifyReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectTimeReqIndMsgT_v02), qmiLocEventInjectTimeReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02), qmiLocEventInjectPredictedOrbitsReqIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectPositionReqIndMsgT_v02), qmiLocEventInjectPositionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventEngineStateIndMsgT_v02), qmiLocEventEngineStateIndMsgT_data_v02}, + {sizeof(qmiLocEventFixSessionStateIndMsgT_v02), qmiLocEventFixSessionStateIndMsgT_data_v02}, + {sizeof(qmiLocEventWifiReqIndMsgT_v02), qmiLocEventWifiReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSensorStreamingReadyStatusIndMsgT_v02), qmiLocEventSensorStreamingReadyStatusIndMsgT_data_v02}, + {sizeof(qmiLocEventTimeSyncReqIndMsgT_v02), qmiLocEventTimeSyncReqIndMsgT_data_v02}, + {sizeof(qmiLocEventSetSpiStreamingReportIndMsgT_v02), qmiLocEventSetSpiStreamingReportIndMsgT_data_v02}, + {sizeof(qmiLocEventLocationServerConnectionReqIndMsgT_v02), qmiLocEventLocationServerConnectionReqIndMsgT_data_v02}, + {sizeof(qmiLocEventNiGeofenceNotificationIndMsgT_v02), qmiLocEventNiGeofenceNotificationIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceGenAlertIndMsgT_v02), qmiLocEventGeofenceGenAlertIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceBreachIndMsgT_v02), qmiLocEventGeofenceBreachIndMsgT_data_v02}, + {sizeof(qmiLocEventPedometerControlIndMsgT_v02), qmiLocEventPedometerControlIndMsgT_data_v02}, + {sizeof(qmiLocEventMotionDataControlIndMsgT_v02), qmiLocEventMotionDataControlIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceBatchedBreachIndMsgT_v02), qmiLocEventGeofenceBatchedBreachIndMsgT_data_v02}, + {sizeof(qmiLocEventGeofenceProximityIndMsgT_v02), qmiLocEventGeofenceProximityIndMsgT_data_v02}, + {sizeof(qmiLocGetServiceRevisionReqMsgT_v02), 0}, + {sizeof(qmiLocGetServiceRevisionIndMsgT_v02), qmiLocGetServiceRevisionIndMsgT_data_v02}, + {sizeof(qmiLocGetFixCriteriaReqMsgT_v02), 0}, + {sizeof(qmiLocGetFixCriteriaIndMsgT_v02), qmiLocGetFixCriteriaIndMsgT_data_v02}, + {sizeof(qmiLocNiUserRespReqMsgT_v02), qmiLocNiUserRespReqMsgT_data_v02}, + {sizeof(qmiLocNiUserRespIndMsgT_v02), qmiLocNiUserRespIndMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataReqMsgT_v02), qmiLocInjectPredictedOrbitsDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectPredictedOrbitsDataIndMsgT_v02), qmiLocInjectPredictedOrbitsDataIndMsgT_data_v02}, + {sizeof(qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02), 0}, + {sizeof(qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02), qmiLocGetPredictedOrbitsDataSourceIndMsgT_data_v02}, + {sizeof(qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02), 0}, + {sizeof(qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02), qmiLocGetPredictedOrbitsDataValidityIndMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeReqMsgT_v02), qmiLocInjectUtcTimeReqMsgT_data_v02}, + {sizeof(qmiLocInjectUtcTimeIndMsgT_v02), qmiLocInjectUtcTimeIndMsgT_data_v02}, + {sizeof(qmiLocInjectPositionReqMsgT_v02), qmiLocInjectPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectPositionIndMsgT_v02), qmiLocInjectPositionIndMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockReqMsgT_v02), qmiLocSetEngineLockReqMsgT_data_v02}, + {sizeof(qmiLocSetEngineLockIndMsgT_v02), qmiLocSetEngineLockIndMsgT_data_v02}, + {sizeof(qmiLocGetEngineLockReqMsgT_v02), 0}, + {sizeof(qmiLocGetEngineLockIndMsgT_v02), qmiLocGetEngineLockIndMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigReqMsgT_v02), qmiLocSetSbasConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSbasConfigIndMsgT_v02), qmiLocSetSbasConfigIndMsgT_data_v02}, + {sizeof(qmiLocGetSbasConfigReqMsgT_v02), 0}, + {sizeof(qmiLocGetSbasConfigIndMsgT_v02), qmiLocGetSbasConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesReqMsgT_v02), qmiLocSetNmeaTypesReqMsgT_data_v02}, + {sizeof(qmiLocSetNmeaTypesIndMsgT_v02), qmiLocSetNmeaTypesIndMsgT_data_v02}, + {sizeof(qmiLocGetNmeaTypesReqMsgT_v02), 0}, + {sizeof(qmiLocGetNmeaTypesIndMsgT_v02), qmiLocGetNmeaTypesIndMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeReqMsgT_v02), qmiLocSetLowPowerModeReqMsgT_data_v02}, + {sizeof(qmiLocSetLowPowerModeIndMsgT_v02), qmiLocSetLowPowerModeIndMsgT_data_v02}, + {sizeof(qmiLocGetLowPowerModeReqMsgT_v02), 0}, + {sizeof(qmiLocGetLowPowerModeIndMsgT_v02), qmiLocGetLowPowerModeIndMsgT_data_v02}, + {sizeof(qmiLocSetServerReqMsgT_v02), qmiLocSetServerReqMsgT_data_v02}, + {sizeof(qmiLocSetServerIndMsgT_v02), qmiLocSetServerIndMsgT_data_v02}, + {sizeof(qmiLocGetServerReqMsgT_v02), qmiLocGetServerReqMsgT_data_v02}, + {sizeof(qmiLocGetServerIndMsgT_v02), qmiLocGetServerIndMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataReqMsgT_v02), qmiLocDeleteAssistDataReqMsgT_data_v02}, + {sizeof(qmiLocDeleteAssistDataIndMsgT_v02), qmiLocDeleteAssistDataIndMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlReqMsgT_v02), qmiLocSetXtraTSessionControlReqMsgT_data_v02}, + {sizeof(qmiLocSetXtraTSessionControlIndMsgT_v02), qmiLocSetXtraTSessionControlIndMsgT_data_v02}, + {sizeof(qmiLocGetXtraTSessionControlReqMsgT_v02), 0}, + {sizeof(qmiLocGetXtraTSessionControlIndMsgT_v02), qmiLocGetXtraTSessionControlIndMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionReqMsgT_v02), qmiLocInjectWifiPositionReqMsgT_data_v02}, + {sizeof(qmiLocInjectWifiPositionIndMsgT_v02), qmiLocInjectWifiPositionIndMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusReqMsgT_v02), qmiLocNotifyWifiStatusReqMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiStatusIndMsgT_v02), qmiLocNotifyWifiStatusIndMsgT_data_v02}, + {sizeof(qmiLocGetRegisteredEventsReqMsgT_v02), 0}, + {sizeof(qmiLocGetRegisteredEventsIndMsgT_v02), qmiLocGetRegisteredEventsIndMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeReqMsgT_v02), qmiLocSetOperationModeReqMsgT_data_v02}, + {sizeof(qmiLocSetOperationModeIndMsgT_v02), qmiLocSetOperationModeIndMsgT_data_v02}, + {sizeof(qmiLocGetOperationModeReqMsgT_v02), 0}, + {sizeof(qmiLocGetOperationModeIndMsgT_v02), qmiLocGetOperationModeIndMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusReqMsgT_v02), qmiLocSetSpiStatusReqMsgT_data_v02}, + {sizeof(qmiLocSetSpiStatusIndMsgT_v02), qmiLocSetSpiStatusIndMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataReqMsgT_v02), qmiLocInjectSensorDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectSensorDataIndMsgT_v02), qmiLocInjectSensorDataIndMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataReqMsgT_v02), qmiLocInjectTimeSyncDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectTimeSyncDataIndMsgT_v02), qmiLocInjectTimeSyncDataIndMsgT_data_v02}, + {sizeof(qmiLocGetCradleMountConfigReqMsgT_v02), 0}, + {sizeof(qmiLocGetCradleMountConfigIndMsgT_v02), qmiLocGetCradleMountConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigReqMsgT_v02), qmiLocSetCradleMountConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetCradleMountConfigIndMsgT_v02), qmiLocSetCradleMountConfigIndMsgT_data_v02}, + {sizeof(qmiLocGetExternalPowerConfigReqMsgT_v02), 0}, + {sizeof(qmiLocGetExternalPowerConfigIndMsgT_v02), qmiLocGetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigReqMsgT_v02), qmiLocSetExternalPowerConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetExternalPowerConfigIndMsgT_v02), qmiLocSetExternalPowerConfigIndMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusReqMsgT_v02), qmiLocInformLocationServerConnStatusReqMsgT_data_v02}, + {sizeof(qmiLocInformLocationServerConnStatusIndMsgT_v02), qmiLocInformLocationServerConnStatusIndMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersReqMsgT_v02), qmiLocSetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetProtocolConfigParametersIndMsgT_v02), qmiLocSetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersReqMsgT_v02), qmiLocGetProtocolConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetProtocolConfigParametersIndMsgT_v02), qmiLocGetProtocolConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigReqMsgT_v02), qmiLocSetSensorControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorControlConfigIndMsgT_v02), qmiLocSetSensorControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocGetSensorControlConfigReqMsgT_v02), 0}, + {sizeof(qmiLocGetSensorControlConfigIndMsgT_v02), qmiLocGetSensorControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesReqMsgT_v02), qmiLocSetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPropertiesIndMsgT_v02), qmiLocSetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocGetSensorPropertiesReqMsgT_v02), qmiLocGetSensorPropertiesReqMsgT_data_v02}, + {sizeof(qmiLocGetSensorPropertiesIndMsgT_v02), qmiLocGetSensorPropertiesIndMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigReqMsgT_v02), qmiLocSetSensorPerformanceControlConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetSensorPerformanceControlConfigIndMsgT_v02), qmiLocSetSensorPerformanceControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocGetSensorPerformanceControlConfigReqMsgT_v02), 0}, + {sizeof(qmiLocGetSensorPerformanceControlConfigIndMsgT_v02), qmiLocGetSensorPerformanceControlConfigIndMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateReqMsgT_v02), qmiLocInjectSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocInjectSuplCertificateIndMsgT_v02), qmiLocInjectSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateReqMsgT_v02), qmiLocDeleteSuplCertificateReqMsgT_data_v02}, + {sizeof(qmiLocDeleteSuplCertificateIndMsgT_v02), qmiLocDeleteSuplCertificateIndMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersReqMsgT_v02), qmiLocSetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocSetPositionEngineConfigParametersIndMsgT_v02), qmiLocSetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersReqMsgT_v02), qmiLocGetPositionEngineConfigParametersReqMsgT_data_v02}, + {sizeof(qmiLocGetPositionEngineConfigParametersIndMsgT_v02), qmiLocGetPositionEngineConfigParametersIndMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceReqMsgT_v02), qmiLocAddCircularGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocAddCircularGeofenceIndMsgT_v02), qmiLocAddCircularGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceReqMsgT_v02), qmiLocDeleteGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceIndMsgT_v02), qmiLocDeleteGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceReqMsgT_v02), qmiLocQueryGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocQueryGeofenceIndMsgT_v02), qmiLocQueryGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocSetGeofenceEngineConfigReqMsgT_v02), qmiLocSetGeofenceEngineConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetGeofenceEngineConfigIndMsgT_v02), qmiLocSetGeofenceEngineConfigIndMsgT_data_v02}, + {sizeof(qmiLocGetGeofenceEngineConfigReqMsgT_v02), qmiLocGetGeofenceEngineConfigReqMsgT_data_v02}, + {sizeof(qmiLocGetGeofenceEngineConfigIndMsgT_v02), qmiLocGetGeofenceEngineConfigIndMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceReqMsgT_v02), qmiLocEditGeofenceReqMsgT_data_v02}, + {sizeof(qmiLocEditGeofenceIndMsgT_v02), qmiLocEditGeofenceIndMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionReqMsgT_v02), qmiLocGetBestAvailablePositionReqMsgT_data_v02}, + {sizeof(qmiLocGetBestAvailablePositionIndMsgT_v02), qmiLocGetBestAvailablePositionIndMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataReqMsgT_v02), qmiLocInjectMotionDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectMotionDataIndMsgT_v02), qmiLocInjectMotionDataIndMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListReqMsgT_v02), qmiLocGetNiGeofenceIdListReqMsgT_data_v02}, + {sizeof(qmiLocGetNiGeofenceIdListIndMsgT_v02), qmiLocGetNiGeofenceIdListIndMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoReqMsgT_v02), qmiLocInjectGSMCellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectGSMCellInfoIndMsgT_v02), qmiLocInjectGSMCellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectWCDMACellInfoReqMsgT_v02), qmiLocInjectWCDMACellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectWCDMACellInfoIndMsgT_v02), qmiLocInjectWCDMACellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectTDSCDMACellInfoReqMsgT_v02), qmiLocInjectTDSCDMACellInfoReqMsgT_data_v02}, + {sizeof(qmiLocInjectTDSCDMACellInfoIndMsgT_v02), qmiLocInjectTDSCDMACellInfoIndMsgT_data_v02}, + {sizeof(qmiLocInjectSubscriberIDReqMsgT_v02), qmiLocInjectSubscriberIDReqMsgT_data_v02}, + {sizeof(qmiLocInjectSubscriberIDIndMsgT_v02), qmiLocInjectSubscriberIDIndMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageReqMsgT_v02), qmiLocInjectNetworkInitiatedMessageReqMsgT_data_v02}, + {sizeof(qmiLocInjectNetworkInitiatedMessageIndMsgT_v02), qmiLocInjectNetworkInitiatedMessageIndMsgT_data_v02}, + {sizeof(qmiLocWWANOutOfServiceNotificationReqMsgT_v02), 0}, + {sizeof(qmiLocWWANOutOfServiceNotificationIndMsgT_v02), qmiLocWWANOutOfServiceNotificationIndMsgT_data_v02}, + {sizeof(qmiLocPedometerReportReqMsgT_v02), qmiLocPedometerReportReqMsgT_data_v02}, + {sizeof(qmiLocPedometerReportIndMsgT_v02), qmiLocPedometerReportIndMsgT_data_v02}, + {sizeof(qmiLocGetBatchSizeReqMsgT_v02), qmiLocGetBatchSizeReqMsgT_data_v02}, + {sizeof(qmiLocGetBatchSizeIndMsgT_v02), qmiLocGetBatchSizeIndMsgT_data_v02}, + {sizeof(qmiLocStartBatchingReqMsgT_v02), qmiLocStartBatchingReqMsgT_data_v02}, + {sizeof(qmiLocStartBatchingIndMsgT_v02), qmiLocStartBatchingIndMsgT_data_v02}, + {sizeof(qmiLocEventBatchFullIndMsgT_v02), qmiLocEventBatchFullIndMsgT_data_v02}, + {sizeof(qmiLocEventLiveBatchedPositionReportIndMsgT_v02), qmiLocEventLiveBatchedPositionReportIndMsgT_data_v02}, + {sizeof(qmiLocReadFromBatchReqMsgT_v02), qmiLocReadFromBatchReqMsgT_data_v02}, + {sizeof(qmiLocReadFromBatchIndMsgT_v02), qmiLocReadFromBatchIndMsgT_data_v02}, + {sizeof(qmiLocStopBatchingReqMsgT_v02), qmiLocStopBatchingReqMsgT_data_v02}, + {sizeof(qmiLocStopBatchingIndMsgT_v02), qmiLocStopBatchingIndMsgT_data_v02}, + {sizeof(qmiLocReleaseBatchReqMsgT_v02), qmiLocReleaseBatchReqMsgT_data_v02}, + {sizeof(qmiLocReleaseBatchIndMsgT_v02), qmiLocReleaseBatchIndMsgT_data_v02}, + {sizeof(qmiLocEventInjectWifiApDataReqIndMsgT_v02), 0}, + {sizeof(qmiLocInjectWifiApDataReqMsgT_v02), qmiLocInjectWifiApDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectWifiApDataIndMsgT_v02), qmiLocInjectWifiApDataIndMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiAttachmentStatusReqMsgT_v02), qmiLocNotifyWifiAttachmentStatusReqMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiAttachmentStatusIndMsgT_v02), qmiLocNotifyWifiAttachmentStatusIndMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiEnabledStatusReqMsgT_v02), qmiLocNotifyWifiEnabledStatusReqMsgT_data_v02}, + {sizeof(qmiLocNotifyWifiEnabledStatusIndMsgT_v02), qmiLocNotifyWifiEnabledStatusIndMsgT_data_v02}, + {sizeof(qmiLocEventVehicleDataReadyIndMsgT_v02), qmiLocEventVehicleDataReadyIndMsgT_data_v02}, + {sizeof(qmiLocInjectVehicleSensorDataReqMsgT_v02), qmiLocInjectVehicleSensorDataReqMsgT_data_v02}, + {sizeof(qmiLocInjectVehicleSensorDataIndMsgT_v02), qmiLocInjectVehicleSensorDataIndMsgT_data_v02}, + {sizeof(qmiLocGetAvailWwanPositionReqMsgT_v02), qmiLocGetAvailWwanPositionReqMsgT_data_v02}, + {sizeof(qmiLocGetAvailWwanPositionIndMsgT_v02), qmiLocGetAvailWwanPositionIndMsgT_data_v02}, + {sizeof(qmiLocSetPremiumServicesCfgReqMsgT_v02), qmiLocSetPremiumServicesCfgReqMsgT_data_v02}, + {sizeof(qmiLocSetPremiumServicesCfgIndMsgT_v02), qmiLocSetPremiumServicesCfgIndMsgT_data_v02}, + {sizeof(qmiLocSetXtraVersionCheckReqMsgT_v02), qmiLocSetXtraVersionCheckReqMsgT_data_v02}, + {sizeof(qmiLocSetXtraVersionCheckIndMsgT_v02), qmiLocSetXtraVersionCheckIndMsgT_data_v02}, + {sizeof(qmiLocSetGNSSConstRepConfigReqMsgT_v02), qmiLocSetGNSSConstRepConfigReqMsgT_data_v02}, + {sizeof(qmiLocSetGNSSConstRepConfigIndMsgT_v02), qmiLocSetGNSSConstRepConfigIndMsgT_data_v02}, + {sizeof(qmiLocEventGnssSvMeasInfoIndMsgT_v02), qmiLocEventGnssSvMeasInfoIndMsgT_data_v02}, + {sizeof(qmiLocEventGnssSvPolyIndMsgT_v02), qmiLocEventGnssSvPolyIndMsgT_data_v02}, + {sizeof(qmiLocAddGeofenceContextReqMsgT_v02), qmiLocAddGeofenceContextReqMsgT_data_v02}, + {sizeof(qmiLocAddGeofenceContextIndMsgT_v02), qmiLocAddGeofenceContextIndMsgT_data_v02}, + {sizeof(qmiLocSetGeofenceEngineContextReqMsgT_v02), qmiLocSetGeofenceEngineContextReqMsgT_data_v02}, + {sizeof(qmiLocSetGeofenceEngineContextIndMsgT_v02), qmiLocSetGeofenceEngineContextIndMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceContextReqMsgT_v02), qmiLocDeleteGeofenceContextReqMsgT_data_v02}, + {sizeof(qmiLocDeleteGeofenceContextIndMsgT_v02), qmiLocDeleteGeofenceContextIndMsgT_data_v02} +}; + +/* Range Table */ +/* No Ranges Defined in IDL */ + +/* Predefine the Type Table Object */ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02; + +/*Referenced Tables Array*/ +static const qmi_idl_type_table_object *loc_qmi_idl_type_table_object_referenced_tables_v02[] = +{&loc_qmi_idl_type_table_object_v02, &common_qmi_idl_type_table_object_v01}; + +/*Type Table Object*/ +static const qmi_idl_type_table_object loc_qmi_idl_type_table_object_v02 = { + sizeof(loc_type_table_v02)/sizeof(qmi_idl_type_table_entry ), + sizeof(loc_message_table_v02)/sizeof(qmi_idl_message_table_entry), + 1, + loc_type_table_v02, + loc_message_table_v02, + loc_qmi_idl_type_table_object_referenced_tables_v02, + NULL +}; + +/*Arrays of service_message_table_entries for commands, responses and indications*/ +static const qmi_idl_service_message_table_entry loc_service_command_messages_v02[] = { + {QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02, QMI_IDL_TYPE16(1, 0), 0}, + {QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02, QMI_IDL_TYPE16(1, 2), 5}, + {QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 1), 7}, + {QMI_LOC_REG_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 2), 11}, + {QMI_LOC_START_REQ_V02, QMI_IDL_TYPE16(0, 3), 110}, + {QMI_LOC_STOP_REQ_V02, QMI_IDL_TYPE16(0, 4), 4}, + {QMI_LOC_GET_SERVICE_REVISION_REQ_V02, QMI_IDL_TYPE16(0, 26), 0}, + {QMI_LOC_GET_FIX_CRITERIA_REQ_V02, QMI_IDL_TYPE16(0, 28), 0}, + {QMI_LOC_NI_USER_RESPONSE_REQ_V02, QMI_IDL_TYPE16(0, 30), 1345}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02, QMI_IDL_TYPE16(0, 32), 1053}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02, QMI_IDL_TYPE16(0, 34), 0}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02, QMI_IDL_TYPE16(0, 36), 0}, + {QMI_LOC_INJECT_UTC_TIME_REQ_V02, QMI_IDL_TYPE16(0, 38), 18}, + {QMI_LOC_INJECT_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 40), 123}, + {QMI_LOC_SET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 42), 7}, + {QMI_LOC_GET_ENGINE_LOCK_REQ_V02, QMI_IDL_TYPE16(0, 44), 0}, + {QMI_LOC_SET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 46), 4}, + {QMI_LOC_GET_SBAS_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 48), 0}, + {QMI_LOC_SET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 50), 7}, + {QMI_LOC_GET_NMEA_TYPES_REQ_V02, QMI_IDL_TYPE16(0, 52), 0}, + {QMI_LOC_SET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 54), 4}, + {QMI_LOC_GET_LOW_POWER_MODE_REQ_V02, QMI_IDL_TYPE16(0, 56), 0}, + {QMI_LOC_SET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 58), 297}, + {QMI_LOC_GET_SERVER_REQ_V02, QMI_IDL_TYPE16(0, 60), 11}, + {QMI_LOC_DELETE_ASSIST_DATA_REQ_V02, QMI_IDL_TYPE16(0, 62), 1044}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 64), 4}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02, QMI_IDL_TYPE16(0, 66), 0}, + {QMI_LOC_INJECT_WIFI_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 68), 2353}, + {QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 70), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02, QMI_IDL_TYPE16(0, 72), 0}, + {QMI_LOC_SET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 74), 7}, + {QMI_LOC_GET_OPERATION_MODE_REQ_V02, QMI_IDL_TYPE16(0, 76), 0}, + {QMI_LOC_SET_SPI_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 78), 8}, + {QMI_LOC_INJECT_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 80), 2063}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02, QMI_IDL_TYPE16(0, 82), 21}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 86), 11}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 84), 0}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 90), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 88), 0}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 92), 129}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 94), 57}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 96), 11}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 98), 14}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 100), 0}, + {QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 102), 88}, + {QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02, QMI_IDL_TYPE16(0, 104), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 106), 42}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02, QMI_IDL_TYPE16(0, 108), 0}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 110), 2009}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02, QMI_IDL_TYPE16(0, 112), 4}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 114), 16}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02, QMI_IDL_TYPE16(0, 116), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 118), 52}, + {QMI_LOC_DELETE_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 120), 14}, + {QMI_LOC_QUERY_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 122), 14}, + {QMI_LOC_EDIT_GEOFENCE_REQ_V02, QMI_IDL_TYPE16(0, 128), 32}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 130), 7}, + {QMI_LOC_INJECT_MOTION_DATA_REQ_V02, QMI_IDL_TYPE16(0, 132), 19}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02, QMI_IDL_TYPE16(0, 134), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 136), 30}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02, QMI_IDL_TYPE16(0, 144), 1036}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02, QMI_IDL_TYPE16(0, 146), 0}, + {QMI_LOC_PEDOMETER_REPORT_REQ_V02, QMI_IDL_TYPE16(0, 148), 46}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 138), 36}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02, QMI_IDL_TYPE16(0, 140), 33}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02, QMI_IDL_TYPE16(0, 142), 22}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 124), 224}, + {QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 126), 7}, + {QMI_LOC_GET_BATCH_SIZE_REQ_V02, QMI_IDL_TYPE16(0, 150), 14}, + {QMI_LOC_START_BATCHING_REQ_V02, QMI_IDL_TYPE16(0, 152), 21}, + {QMI_LOC_READ_FROM_BATCH_REQ_V02, QMI_IDL_TYPE16(0, 156), 14}, + {QMI_LOC_STOP_BATCHING_REQ_V02, QMI_IDL_TYPE16(0, 158), 7}, + {QMI_LOC_RELEASE_BATCH_REQ_V02, QMI_IDL_TYPE16(0, 160), 7}, + {QMI_LOC_INJECT_WIFI_AP_DATA_REQ_V02, QMI_IDL_TYPE16(0, 163), 2454}, + {QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 165), 51}, + {QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_REQ_V02, QMI_IDL_TYPE16(0, 167), 7}, + {QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_REQ_V02, QMI_IDL_TYPE16(0, 170), 3360}, + {QMI_LOC_GET_AVAILABLE_WWAN_POSITION_REQ_V02, QMI_IDL_TYPE16(0, 172), 7}, + {QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_REQ_V02, QMI_IDL_TYPE16(0, 174), 14}, + {QMI_LOC_SET_XTRA_VERSION_CHECK_REQ_V02, QMI_IDL_TYPE16(0, 176), 7}, + {QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_V02, QMI_IDL_TYPE16(0, 178), 22}, + {QMI_LOC_ADD_GEOFENCE_CONTEXT_REQ_V02, QMI_IDL_TYPE16(0, 182), 2517}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_REQ_V02, QMI_IDL_TYPE16(0, 184), 25}, + {QMI_LOC_DELETE_GEOFENCE_CONTEXT_REQ_V02, QMI_IDL_TYPE16(0, 186), 21} +}; + +static const qmi_idl_service_message_table_entry loc_service_response_messages_v02[] = { + {QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02, QMI_IDL_TYPE16(1, 1), 8204}, + {QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02, QMI_IDL_TYPE16(1, 3), 115}, + {QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_REG_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_START_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_STOP_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVICE_REVISION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_FIX_CRITERIA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_NI_USER_RESPONSE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_UTC_TIME_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_ENGINE_LOCK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SBAS_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_NMEA_TYPES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SERVER_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_ASSIST_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WIFI_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_OPERATION_MODE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SPI_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_QUERY_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_EDIT_GEOFENCE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_MOTION_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_PEDOMETER_REPORT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_BATCH_SIZE_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_START_BATCHING_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_READ_FROM_BATCH_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_STOP_BATCHING_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_RELEASE_BATCH_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_WIFI_AP_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_GET_AVAILABLE_WWAN_POSITION_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_XTRA_VERSION_CHECK_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_ADD_GEOFENCE_CONTEXT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7}, + {QMI_LOC_DELETE_GEOFENCE_CONTEXT_RESP_V02, QMI_IDL_TYPE16(0, 0), 7} +}; + +static const qmi_idl_service_message_table_entry loc_service_indication_messages_v02[] = { + {QMI_LOC_EVENT_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 5), 392}, + {QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02, QMI_IDL_TYPE16(0, 6), 2248}, + {QMI_LOC_EVENT_NMEA_IND_V02, QMI_IDL_TYPE16(0, 7), 203}, + {QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02, QMI_IDL_TYPE16(0, 8), 1338}, + {QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02, QMI_IDL_TYPE16(0, 9), 776}, + {QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02, QMI_IDL_TYPE16(0, 10), 783}, + {QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02, QMI_IDL_TYPE16(0, 11), 40}, + {QMI_LOC_EVENT_ENGINE_STATE_IND_V02, QMI_IDL_TYPE16(0, 12), 7}, + {QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02, QMI_IDL_TYPE16(0, 13), 11}, + {QMI_LOC_EVENT_WIFI_REQ_IND_V02, QMI_IDL_TYPE16(0, 14), 12}, + {QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02, QMI_IDL_TYPE16(0, 15), 32}, + {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, 27), 532}, + {QMI_LOC_GET_FIX_CRITERIA_IND_V02, QMI_IDL_TYPE16(0, 29), 99}, + {QMI_LOC_NI_USER_RESPONSE_IND_V02, QMI_IDL_TYPE16(0, 31), 7}, + {QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02, QMI_IDL_TYPE16(0, 33), 12}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02, QMI_IDL_TYPE16(0, 35), 790}, + {QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02, QMI_IDL_TYPE16(0, 37), 20}, + {QMI_LOC_INJECT_UTC_TIME_IND_V02, QMI_IDL_TYPE16(0, 39), 7}, + {QMI_LOC_INJECT_POSITION_IND_V02, QMI_IDL_TYPE16(0, 41), 7}, + {QMI_LOC_SET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 43), 7}, + {QMI_LOC_GET_ENGINE_LOCK_IND_V02, QMI_IDL_TYPE16(0, 45), 14}, + {QMI_LOC_SET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 47), 7}, + {QMI_LOC_GET_SBAS_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 49), 11}, + {QMI_LOC_SET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 51), 7}, + {QMI_LOC_GET_NMEA_TYPES_IND_V02, QMI_IDL_TYPE16(0, 53), 14}, + {QMI_LOC_SET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 55), 7}, + {QMI_LOC_GET_LOW_POWER_MODE_IND_V02, QMI_IDL_TYPE16(0, 57), 11}, + {QMI_LOC_SET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 59), 7}, + {QMI_LOC_GET_SERVER_IND_V02, QMI_IDL_TYPE16(0, 61), 304}, + {QMI_LOC_DELETE_ASSIST_DATA_IND_V02, QMI_IDL_TYPE16(0, 63), 7}, + {QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 65), 7}, + {QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02, QMI_IDL_TYPE16(0, 67), 11}, + {QMI_LOC_INJECT_WIFI_POSITION_IND_V02, QMI_IDL_TYPE16(0, 69), 7}, + {QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 71), 7}, + {QMI_LOC_GET_REGISTERED_EVENTS_IND_V02, QMI_IDL_TYPE16(0, 73), 18}, + {QMI_LOC_SET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 75), 7}, + {QMI_LOC_GET_OPERATION_MODE_IND_V02, QMI_IDL_TYPE16(0, 77), 14}, + {QMI_LOC_SET_SPI_STATUS_IND_V02, QMI_IDL_TYPE16(0, 79), 7}, + {QMI_LOC_INJECT_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 81), 30}, + {QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02, QMI_IDL_TYPE16(0, 83), 7}, + {QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 87), 7}, + {QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 85), 18}, + {QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 91), 7}, + {QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 89), 14}, + {QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02, QMI_IDL_TYPE16(0, 93), 7}, + {QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 95), 18}, + {QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 97), 64}, + {QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 99), 7}, + {QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 101), 21}, + {QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 103), 14}, + {QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02, QMI_IDL_TYPE16(0, 105), 95}, + {QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 107), 14}, + {QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02, QMI_IDL_TYPE16(0, 109), 49}, + {QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 111), 7}, + {QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02, QMI_IDL_TYPE16(0, 113), 7}, + {QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 115), 14}, + {QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02, QMI_IDL_TYPE16(0, 117), 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, 119), 21}, + {QMI_LOC_DELETE_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 121), 21}, + {QMI_LOC_QUERY_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 123), 65}, + {QMI_LOC_EDIT_GEOFENCE_IND_V02, QMI_IDL_TYPE16(0, 129), 28}, + {QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02, QMI_IDL_TYPE16(0, 131), 391}, + {QMI_LOC_INJECT_MOTION_DATA_IND_V02, QMI_IDL_TYPE16(0, 133), 7}, + {QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02, QMI_IDL_TYPE16(0, 135), 82}, + {QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 137), 7}, + {QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02, QMI_IDL_TYPE16(0, 145), 7}, + {QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 147), 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, 149), 7}, + {QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 139), 7}, + {QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02, QMI_IDL_TYPE16(0, 141), 7}, + {QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02, QMI_IDL_TYPE16(0, 143), 7}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 125), 14}, + {QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 127), 39}, + {QMI_LOC_GET_BATCH_SIZE_IND_V02, QMI_IDL_TYPE16(0, 151), 21}, + {QMI_LOC_START_BATCHING_IND_V02, QMI_IDL_TYPE16(0, 153), 7}, + {QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 154), 7}, + {QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02, QMI_IDL_TYPE16(0, 155), 90}, + {QMI_LOC_READ_FROM_BATCH_IND_V02, QMI_IDL_TYPE16(0, 157), 460}, + {QMI_LOC_STOP_BATCHING_IND_V02, QMI_IDL_TYPE16(0, 159), 14}, + {QMI_LOC_RELEASE_BATCH_IND_V02, QMI_IDL_TYPE16(0, 161), 14}, + {QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_IND_V02, QMI_IDL_TYPE16(0, 162), 0}, + {QMI_LOC_INJECT_WIFI_AP_DATA_IND_V02, QMI_IDL_TYPE16(0, 164), 7}, + {QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_IND_V02, QMI_IDL_TYPE16(0, 166), 7}, + {QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_IND_V02, QMI_IDL_TYPE16(0, 168), 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, 169), 12}, + {QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02, QMI_IDL_TYPE16(0, 171), 7}, + {QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02, QMI_IDL_TYPE16(0, 173), 145}, + {QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 175), 7}, + {QMI_LOC_SET_XTRA_VERSION_CHECK_IND_V02, QMI_IDL_TYPE16(0, 177), 7}, + {QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02, QMI_IDL_TYPE16(0, 180), 1610}, + {QMI_LOC_EVENT_SV_POLYNOMIAL_REPORT_IND_V02, QMI_IDL_TYPE16(0, 181), 325}, + {QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02, QMI_IDL_TYPE16(0, 179), 7}, + {QMI_LOC_ADD_GEOFENCE_CONTEXT_IND_V02, QMI_IDL_TYPE16(0, 183), 28}, + {QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_IND_V02, QMI_IDL_TYPE16(0, 185), 14}, + {QMI_LOC_DELETE_GEOFENCE_CONTEXT_IND_V02, QMI_IDL_TYPE16(0, 187), 28}, + {QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02, QMI_IDL_TYPE16(0, 25), 21} +}; + +/*Service Object*/ +struct qmi_idl_service_object loc_qmi_idl_service_object_v02 = { + 0x06, + 0x02, + 0x10, + 8204, + { sizeof(loc_service_command_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + sizeof(loc_service_response_messages_v02)/sizeof(qmi_idl_service_message_table_entry), + 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, + 0x21, + NULL +}; + +/* Service Object Accessor */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){ + if ( LOC_V02_IDL_MAJOR_VERS != idl_maj_version || LOC_V02_IDL_MINOR_VERS != idl_min_version + || LOC_V02_IDL_TOOL_VERS != library_version) + { + return NULL; + } + return (qmi_idl_service_object_type)&loc_qmi_idl_service_object_v02; +} + diff --git a/gps/loc_api/loc_api_v02/location_service_v02.h b/gps/loc_api/loc_api_v02/location_service_v02.h new file mode 100644 index 0000000..83d910f --- /dev/null +++ b/gps/loc_api/loc_api_v02/location_service_v02.h @@ -0,0 +1,12915 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOC_SERVICE_02_H +#define LOC_SERVICE_02_H +/** + @file location_service_v02.h + + @brief This is the public header file which defines the loc service Data structures. + + This header file defines the types and structures that were defined in + loc. It contains the constant values defined, enums, structures, + messages, and service message IDs (in that order) Structures that were + defined in the IDL as messages contain mandatory elements, optional + elements, a combination of mandatory and optional elements (mandatory + always come before optionals in the structure), or nothing (null message) + + An optional element in a message is preceded by a uint8_t value that must be + set to true if the element is going to be included. When decoding a received + message, the uint8_t values will be set to true or false by the decode + routine, and should be checked before accessing the values that they + correspond to. + + Variable sized arrays are defined as static sized arrays with an unsigned + integer (32 bit) preceding it that must be set to the number of elements + in the array that are valid. For Example: + + uint32_t test_opaque_len; + uint8_t test_opaque[16]; + + If only 4 elements are added to test_opaque[] then test_opaque_len must be + set to 4 before sending the message. When decoding, the _len value is set + by the decode routine and should be checked so that the correct number of + elements in the array will be accessed. + +*/ +/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* + *THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY + *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ + +/* This file was generated with Tool version 6.10 + It was generated on: Tue Jul 29 2014 (Spin 0) + From IDL File: location_service_v02.idl */ + +/** @defgroup loc_qmi_consts Constant values defined in the IDL */ +/** @defgroup loc_qmi_msg_ids Constant values for QMI message IDs */ +/** @defgroup loc_qmi_enums Enumerated types used in QMI messages */ +/** @defgroup loc_qmi_messages Structures sent as QMI messages */ +/** @defgroup loc_qmi_aggregates Aggregate types used in QMI messages */ +/** @defgroup loc_qmi_accessor Accessor for QMI service object */ +/** @defgroup loc_qmi_version Constant values for versioning information */ + +#include +#include "qmi_idl_lib.h" +#include "common_v01.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup loc_qmi_version + @{ + */ +/** 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 0x21 +/** 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 0x008C +/** + @} + */ + + +/** @addtogroup loc_qmi_consts + @{ + */ + +/** Maximum string length for the Provider field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 24 + +/** Maximum string length for the Name field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 32 + +/** Maximum string length for the Version field in the application ID. */ +#define QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 8 + +/** Maximum length of the list containing the SVs that were used to generate + a position report. */ +#define QMI_LOC_MAX_SV_USED_LIST_LENGTH_V02 80 + +/** Maximum number of satellites in the satellite report. */ +#define QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02 80 + +/** Maximum NMEA string length. */ +#define QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 200 + +/** Maximum length of the requestor ID string. */ +#define QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02 200 + +/** Session ID byte length. */ +#define QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02 4 + +/** Maximum client name length allowed. */ +#define QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02 64 + +/** Maximum URL length accepted by the location engine. */ +#define QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 255 + +/** IPv6 address length in bytes. */ +#define QMI_LOC_IPV6_ADDR_LENGTH_V02 8 + +/** SUPL hash length. */ +#define QMI_LOC_NI_SUPL_HASH_LENGTH_V02 8 + +/** Maximum client address length allowed. */ +#define QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02 20 + +/** Maximum codeword length allowed. */ +#define QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02 20 + +/** Maximum number of NTP Servers sent out with this event. */ +#define QMI_LOC_MAX_NTP_SERVERS_V02 3 + +/** Maximum number of predicted orbits servers supported in the location + engine. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02 3 + +/** Maximum length of the list, where each element of the list contains the + continuous range of Geofences that were breached at a given position. */ +#define QMI_LOC_MAX_GEOFENCE_ID_CONTINUOUS_LIST_LENGTH_V02 80 + +/** Maximum length of the list that contains a discrete number Geofences that + were breached at a given position. */ +#define QMI_LOC_MAX_GEOFENCE_ID_DISCRETE_LIST_LENGTH_V02 80 + +/** Maximum GNSS Measurement Engine Firmware Version String length. */ +#define QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Hosted Software Version String length. */ +#define QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 127 + +/** Maximum GNSS Measurement Engine Full Version String length. */ +#define QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 255 + +/** Maximum part length that can be injected. The client should + also look at the maxPartSize field in the predicted orbits injection + request indication and pick the minimum of the two. */ +#define QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02 1024 + +/** Maximum length of the delete SV information list */ +#define QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02 128 + +/** Maximum length of the Delete BDS SV Information list. */ +#define QMI_LOC_DELETE_MAX_BDS_SV_INFO_LENGTH_V02 37 + +/** MAC address length in bytes. */ +#define QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02 6 + +/** Wifi SSID string max length. */ +#define QMI_LOC_MAX_WIFI_AP_SSID_STR_LENGTH_V02 32 + +/** Maximum number of APs that the sender can report. */ +#define QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02 50 + +/** Maximum number of samples that can be injected in a TLV. */ +#define QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02 50 + +/** Maximum APN string length allowed. */ +#define QMI_LOC_MAX_APN_NAME_LENGTH_V02 100 + +/** Maximum APN profiles supported. */ +#define QMI_LOC_MAX_APN_PROFILES_V02 6 + +/** Maximum length of the SUPL certificate. */ +#define QMI_LOC_MAX_SUPL_CERT_LENGTH_V02 2000 + +/** Maximum Motion States used by Geofencing engine. */ +#define QMI_LOC_GEOFENCE_MAX_MOTION_STATES_V02 20 + +/** Maximum length of the network-initiated Geofence ID + list. */ +#define QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02 16 + +/** Maximum value of WDMA frequency for injection of WCDMA cell + information. */ +#define QMI_LOC_MAX_WCDMA_FREQ_V02 16383 + +/** Maximum value of PSC for injection of WCDMA cell information. */ +#define QMI_LOC_MAX_WCDMA_PSC_V02 511 + +/** Maximum value of TDSCDMA frequency for injection of TDSCDMA cell + information. */ +#define QMI_LOC_MAX_TDSCDMA_FREQ_V02 16383 + +/** Maximum length of the injected network-initiated message. */ +#define QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02 1024 + +/** Maximum number of entries returned from a batch in each indication. */ +#define QMI_LOC_READ_FROM_BATCH_MAX_SIZE_V02 5 + +/** Maximum number of vehicle sensor samples that can be injected. */ +#define QMI_LOC_VEHICLE_SENSOR_DATA_MAX_SAMPLES_V02 65 + +/** Maximum number of axes that can be provided in each sample. */ +#define QMI_LOC_VEHICLE_SENSOR_DATA_MAX_AXES_V02 3 + +/** Maximum number of measurements from an odometer. */ +#define QMI_LOC_VEHICLE_ODOMETRY_MAX_MEASUREMENTS_V02 3 +#define QMI_LOC_MEAS_STATUS_DONT_USE_BITS_V02 0xFFC0000000000000 + +/** Maximum number of satellites in measurement block for given system. */ +#define QMI_LOC_SV_MEAS_LIST_MAX_SIZE_V02 16 +#define QMI_LOC_SV_POLY_VELOCITY_COEF_SIZE_V02 12 +#define QMI_LOC_SV_POLY_XYZ_0_TH_ORDER_COEFF_SIZE_V02 3 +#define QMI_LOC_SV_POLY_XYZ_N_TH_ORDER_COEFF_SIZE_V02 9 + +/** Number of SV polynomial velocity coefficients */ +#define QMI_LOC_SV_POLY_SV_CLKBIAS_COEFF_SIZE_V02 4 + +/** IBeacon string max length */ +#define QMI_LOC_MAX_IBEACON_UUID_STR_LENGTH_V02 32 + +/** Wifi area id list length */ +#define QMI_LOC_WIFI_AREA_ID_LIST_LENGTH_V02 20 + +/** CELL Id list length */ +#define QMI_LOC_CELL_ID_LIST_LENGTH_V02 20 + +/** IBeacon list length */ +#define QMI_LOC_IBEACON_LIST_LENGTH_V02 20 +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Response Message; Generic response definition. This message is used to tell + clients whether their message was accepted for further + processing or rejected. */ +typedef struct { + + /* Mandatory */ + /* Result Code */ + qmi_response_type_v01 resp; +}qmiLocGenRespMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Informs the service of the minor revision of the interface + definition that the control point implements. */ +typedef struct { + + /* Mandatory */ + /* Revision */ + uint32_t revision; + /**< Revision that the control point is using. */ +}qmiLocInformClientRevisionReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocEventRegMaskT_v02; +#define QMI_LOC_EVENT_MASK_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00000001ull) /**< The control point must enable this mask to receive position report + event indications. */ +#define QMI_LOC_EVENT_MASK_GNSS_SV_INFO_V02 ((qmiLocEventRegMaskT_v02)0x00000002ull) /**< The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NMEA_V02 ((qmiLocEventRegMaskT_v02)0x00000004ull) /**< The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. */ +#define QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000008ull) /**< The control point must enable this mask to receive NI Notify/Verify request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_TIME_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000010ull) /**< The control point must enable this mask to receive time injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000020ull) /**< The control point must enable this mask to receive predicted orbits request + event indications. */ +#define QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000040ull) /**< The control point must enable this mask to receive position injection request + event indications. */ +#define QMI_LOC_EVENT_MASK_ENGINE_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000080ull) /**< The control point must enable this mask to receive engine state report + event indications. */ +#define QMI_LOC_EVENT_MASK_FIX_SESSION_STATE_V02 ((qmiLocEventRegMaskT_v02)0x00000100ull) /**< The control point must enable this mask to receive fix session status report + event indications. */ +#define QMI_LOC_EVENT_MASK_WIFI_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000200ull) /**< The control point must enable this mask to receive Wi-Fi position request + event indications. */ +#define QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00000400ull) /**< The control point must enable this mask to receive notifications from the + location engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). */ +#define QMI_LOC_EVENT_MASK_TIME_SYNC_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00000800ull) /**< The control point must enable this mask to receive time sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. */ +#define QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00001000ull) /**< The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. */ +#define QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00002000ull) /**< The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. */ +#define QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00004000ull) /**< The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT_V02 ((qmiLocEventRegMaskT_v02)0x00008000ull) /**< The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect a Geofence, e.g., if GPS is turned off or if the network is + unavailable. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00010000ull) /**< The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when a UE enters + or leaves the perimeter of a Geofence. This breach report is for a single + Geofence . */ +#define QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00020000ull) /**< The control point must enable this mask to register for pedometer + control requests from the location engine. The location engine sends + this event to control the injection of pedometer reports. */ +#define QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL_V02 ((qmiLocEventRegMaskT_v02)0x00040000ull) /**< The control point must enable this mask to register for motion data + control requests from the location engine. The location engine sends + this event to control the injection of motion data. */ +#define QMI_LOC_EVENT_MASK_BATCH_FULL_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00080000ull) /**< The control point must enable this mask to receive notification when + a batch is full. The location engine sends this event to notify of Batch Full + for ongoing batching session. */ +#define QMI_LOC_EVENT_MASK_LIVE_BATCHED_POSITION_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x00100000ull) /**< The control point must enable this mask to receive position report + indications along with an ongoing batching session. The location engine sends + this event to notify the batched position report while a batching session + is ongoing. */ +#define QMI_LOC_EVENT_MASK_INJECT_WIFI_AP_DATA_REQ_V02 ((qmiLocEventRegMaskT_v02)0x00200000ull) /**< The control point must enable this mask to receive Wi-Fi AP data inject request + event indications. */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_BATCH_BREACH_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x00400000ull) /**< The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when a UE enters + or leaves the perimeter of a Geofence. This breach notification is for + multiple Geofences. Breaches from multiple Geofences are all batched and + sent in the same notification . */ +#define QMI_LOC_EVENT_MASK_VEHICLE_DATA_READY_STATUS_V02 ((qmiLocEventRegMaskT_v02)0x00800000ull) /**< The control point must enable this mask to receive notifications from the + location engine indicating its readiness to accept vehicle data (vehicle + accelerometer, vehicle angular rate, vehicle odometry, etc.). */ +#define QMI_LOC_EVENT_MASK_GNSS_MEASUREMENT_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x01000000ull) /**< The control point must enable this mask to receive system clock & satellite + measurement report events( system clock, SV time, doppler etc.). Reports are + generated for only the GNSS satellite constellations which are enabled using + QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG */ +#define QMI_LOC_EVENT_MASK_GNSS_SV_POLYNOMIAL_REPORT_V02 ((qmiLocEventRegMaskT_v02)0x02000000ull) /**< The control point must enable this mask to receive satellite position + reports as polynomial. Reports are generated for only the GNSS satellite + constellations which are enabled using QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG */ +#define QMI_LOC_EVENT_MASK_GEOFENCE_PROXIMITY_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x04000000ull) /**< The control point must enable this mask to receive notifications when a Geofence proximity is entered + and exited. The proximity of a geofence may be due to different contexts . These contexts are identified + using the context id in this indication. The context of a geofence may contain Wifi area ID lists, IBeacon lists, + Cell-Id list etc. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to register for events from the + location subsystem. */ +typedef struct { + + /* Mandatory */ + /* Event Registration Mask */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Specifies the events that the control point is interested in receiving. + Valid bitmasks: + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI Notify/Verify request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request + event indications. + - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report + event indications. + - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report + event indications. + - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive Wi-Fi position request + event indications. + - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the + location engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). + - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. + - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. + - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect a Geofence, e.g., if GPS is turned off or if the network is + unavailable. + - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when a UE enters + or leaves the perimeter of a Geofence. This breach report is for a single + Geofence . + - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for pedometer + control requests from the location engine. The location engine sends + this event to control the injection of pedometer reports. + - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data + control requests from the location engine. The location engine sends + this event to control the injection of motion data. + - QMI_LOC_EVENT_MASK_BATCH_FULL_NOTIFICATION (0x00080000) -- The control point must enable this mask to receive notification when + a batch is full. The location engine sends this event to notify of Batch Full + for ongoing batching session. + - QMI_LOC_EVENT_MASK_LIVE_BATCHED_POSITION_REPORT (0x00100000) -- The control point must enable this mask to receive position report + indications along with an ongoing batching session. The location engine sends + this event to notify the batched position report while a batching session + is ongoing. + - QMI_LOC_EVENT_MASK_INJECT_WIFI_AP_DATA_REQ (0x00200000) -- The control point must enable this mask to receive Wi-Fi AP data inject request + event indications. + - QMI_LOC_EVENT_MASK_GEOFENCE_BATCH_BREACH_NOTIFICATION (0x00400000) -- The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when a UE enters + or leaves the perimeter of a Geofence. This breach notification is for + multiple Geofences. Breaches from multiple Geofences are all batched and + sent in the same notification . + - QMI_LOC_EVENT_MASK_VEHICLE_DATA_READY_STATUS (0x00800000) -- The control point must enable this mask to receive notifications from the + location engine indicating its readiness to accept vehicle data (vehicle + accelerometer, vehicle angular rate, vehicle odometry, etc.). + - QMI_LOC_EVENT_MASK_GNSS_MEASUREMENT_REPORT (0x01000000) -- The control point must enable this mask to receive system clock & satellite + measurement report events( system clock, SV time, doppler etc.). Reports are + generated for only the GNSS satellite constellations which are enabled using + QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG + - QMI_LOC_EVENT_MASK_GNSS_SV_POLYNOMIAL_REPORT (0x02000000) -- The control point must enable this mask to receive satellite position + reports as polynomial. Reports are generated for only the GNSS satellite + constellations which are enabled using QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG + - QMI_LOC_EVENT_MASK_GEOFENCE_PROXIMITY_NOTIFICATION (0x04000000) -- The control point must enable this mask to receive notifications when a Geofence proximity is entered + and exited. The proximity of a geofence may be due to different contexts . These contexts are identified + using the context id in this indication. The context of a geofence may contain Wifi area ID lists, IBeacon lists, + Cell-Id list etc. + + 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. + */ +}qmiLocRegEventsReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXRECURRENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RECURRENCE_PERIODIC_V02 = 1, /**< Request periodic position fixes */ + eQMI_LOC_RECURRENCE_SINGLE_V02 = 2, /**< Request a single position fix */ + QMILOCFIXRECURRENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixRecurrenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCACCURACYLEVELENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ACCURACY_LOW_V02 = 1, /**< Low accuracy */ + eQMI_LOC_ACCURACY_MED_V02 = 2, /**< Medium accuracy */ + eQMI_LOC_ACCURACY_HIGH_V02 = 3, /**< High accuracy */ + QMILOCACCURACYLEVELENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAccuracyLevelEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINTERMEDIATEREPORTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INTERMEDIATE_REPORTS_ON_V02 = 1, /**< Intermediate reports are turned on */ + eQMI_LOC_INTERMEDIATE_REPORTS_OFF_V02 = 2, /**< Intermediate reports are turned off */ + QMILOCINTERMEDIATEREPORTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocIntermediateReportStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCCONFIGINCLUDEALTITUDEASSUMEDINGNSSSVINFOENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALTITUDE_ASSUMED_IN_GNSS_SV_INFO_ENABLED_V02 = 1, /**< Enable Altitude Assumed information in GNSS SV Info Event. */ + eQMI_LOC_ALTITUDE_ASSUMED_IN_GNSS_SV_INFO_DISABLED_V02 = 2, /**< Disable Altitude Assumed information in GNSS SV Info Event. */ + QMILOCCONFIGINCLUDEALTITUDEASSUMEDINGNSSSVINFOENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocConfigIncludeAltitudeAssumedInGnssSvInfoEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char applicationProvider[QMI_LOC_MAX_APP_ID_PROVIDER_LENGTH_V02 + 1]; + /**< Application provider. */ + + char applicationName[QMI_LOC_MAX_APP_ID_NAME_LENGTH_V02 + 1]; + /**< Application name. */ + + uint8_t applicationVersion_valid; + /**< Specifies whether the application version string contains + a valid value: \begin{itemize1} + \item 0x00 (FALSE) -- Application version string is invalid + \item 0x01 (TRUE) -- Application version string is valid + \vspace{-0.18in} \end{itemize1} */ + + char applicationVersion[QMI_LOC_MAX_APP_ID_VERSION_LENGTH_V02 + 1]; + /**< Application version. */ +}qmiLocApplicationIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to initiate a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session as identified by the control point. The session ID + is reported back in the position reports. The control point must + specify the same session ID in the QMI_LOC_STOP_REQ message. \n + - Range: 0 to 255 + */ + + /* Optional */ + /* Recurrence Type */ + uint8_t fixRecurrence_valid; /**< Must be set to true if fixRecurrence is being passed */ + qmiLocFixRecurrenceEnumT_v02 fixRecurrence; + /**< Specifies the type of session in which the control point is interested. + If this TLV is not specified, recurrence defaults to SINGLE. + + Valid values: \n + - eQMI_LOC_RECURRENCE_PERIODIC (1) -- Request periodic position fixes + - eQMI_LOC_RECURRENCE_SINGLE (2) -- Request a single position fix + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Specifies the horizontal accuracy level required by the control point. + If not specified, accuracy defaults to LOW. + + Valid values: \n + - eQMI_LOC_ACCURACY_LOW (1) -- Low accuracy + - eQMI_LOC_ACCURACY_MED (2) -- Medium accuracy + - eQMI_LOC_ACCURACY_HIGH (3) -- High accuracy + */ + + /* Optional */ + /* Enable/Disable Intermediate Reports */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Specifies if the control point is interested in receiving intermediate + reports. The control point must explicitly set this field to OFF if it + does not wish to receive intermediate position reports. Intermediate + position reports are generated at 1 Hz and are ON by default. If + intermediate reports are turned ON, the client receives position reports + even if the accuracy criteria are not met. The status in such a position + report is set to IN_PROGRESS in order for the control point to identify + intermediate reports. + + Valid values: \n + - eQMI_LOC_INTERMEDIATE_REPORTS_ON (1) -- Intermediate reports are turned on + - eQMI_LOC_INTERMEDIATE_REPORTS_OFF (2) -- Intermediate reports are turned off + */ + + /* Optional */ + /* Minimum Interval Between Position Reports */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Minimum time interval, specified by the control point, that must elapse between + position reports. \n + - Units: Milliseconds \n + - Default: 1000 ms + */ + + /* Optional */ + /* ID of the Application that Sent this Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \n Application provider, name, and version.*/ + + /* Optional */ + /* Configuration for Altitude Assumed Info in GNSS SV Info Event */ + uint8_t configAltitudeAssumed_valid; /**< Must be set to true if configAltitudeAssumed is being passed */ + qmiLocConfigIncludeAltitudeAssumedInGnssSvInfoEnumT_v02 configAltitudeAssumed; + /**< Specifies the configuration to include Altitude Assumed information in the GNSS SV Info Event. + When enabled, an additional GNSS SV Info event indication is sent to the control + point that also includes the altitude assumed information. + + If not specified, the configuration defaults to ENABLED. + + Valid values: \n + - eQMI_LOC_ALTITUDE_ASSUMED_IN_GNSS_SV_INFO_ENABLED (1) -- Enable Altitude Assumed information in GNSS SV Info Event. + - eQMI_LOC_ALTITUDE_ASSUMED_IN_GNSS_SV_INFO_DISABLED (2) -- Disable Altitude Assumed information in GNSS SV Info Event. + */ +}qmiLocStartReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to stop a GPS session. */ +typedef struct { + + /* Mandatory */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + (QMI_LOC_START_REQ).\n + - Range: 0 to 255 */ +}qmiLocStopReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPosTechMaskT_v02; +#define QMI_LOC_POS_TECH_MASK_SATELLITE_V02 ((qmiLocPosTechMaskT_v02)0x00000001) /**< Satellites were used to generate the fix */ +#define QMI_LOC_POS_TECH_MASK_CELLID_V02 ((qmiLocPosTechMaskT_v02)0x00000002) /**< Cell towers were used to generate the fix */ +#define QMI_LOC_POS_TECH_MASK_WIFI_V02 ((qmiLocPosTechMaskT_v02)0x00000004) /**< Wi-Fi access points were used to generate the fix */ +#define QMI_LOC_POS_TECH_MASK_SENSORS_V02 ((qmiLocPosTechMaskT_v02)0x00000008) /**< Sensors were used to generate the fix */ +#define QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION_V02 ((qmiLocPosTechMaskT_v02)0x00000010) /**< Reference Location was used to generate the fix */ +#define QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION_V02 ((qmiLocPosTechMaskT_v02)0x00000020) /**< Coarse position injected into the location engine was used to + generate the fix */ +#define QMI_LOC_POS_TECH_MASK_AFLT_V02 ((qmiLocPosTechMaskT_v02)0x00000040) /**< AFLT was used to generate the fix */ +#define QMI_LOC_POS_TECH_MASK_HYBRID_V02 ((qmiLocPosTechMaskT_v02)0x00000080) /**< GNSS and network-provided measurements were used to + generate the fix */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSESSIONSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SESS_STATUS_SUCCESS_V02 = 0, /**< Session was successful */ + eQMI_LOC_SESS_STATUS_IN_PROGRESS_V02 = 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_V02 = 2, /**< Session failed */ + eQMI_LOC_SESS_STATUS_TIMEOUT_V02 = 3, /**< Fix request failed because the session timed out */ + eQMI_LOC_SESS_STATUS_USER_END_V02 = 4, /**< Fix request failed because the session was ended by the user */ + eQMI_LOC_SESS_STATUS_BAD_PARAMETER_V02 = 5, /**< Fix request failed due to bad parameters in the request */ + eQMI_LOC_SESS_STATUS_PHONE_OFFLINE_V02 = 6, /**< Fix request failed because the phone is offline */ + eQMI_LOC_SESS_STATUS_ENGINE_LOCKED_V02 = 7, /**< Fix request failed because the engine is locked */ + QMILOCSESSIONSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSessionStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gpsWeek; + /**< Current GPS week as calculated from midnight, Jan. 6, 1980. \n + - Units: Weeks */ + + uint32_t gpsTimeOfWeekMs; + /**< Amount of time into the current GPS week. \n + - Units: Milliseconds */ +}qmiLocGPSTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + float PDOP; + /**< Position dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \item PDOP = square root of (HDOP^2 + VDOP^2) + \vspace{-0.18in} \end{itemize1} */ + + float HDOP; + /**< Horizontal dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ + + float VDOP; + /**< Vertical dilution of precision. + \begin{itemize1} + \item Range: 1 (highest accuracy) to 50 (lowest accuracy) + \vspace{-0.18in} \end{itemize1} */ +}qmiLocDOPStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocSensorUsageMaskT_v02; +#define QMI_LOC_SENSOR_MASK_USED_ACCEL_V02 ((qmiLocSensorUsageMaskT_v02)0x00000001) /**< Bitmask to specify whether an accelerometer was used. */ +#define QMI_LOC_SENSOR_MASK_USED_GYRO_V02 ((qmiLocSensorUsageMaskT_v02)0x00000002) /**< Bitmask to specify whether a gyroscope was used. */ +typedef uint32_t qmiLocSensorAidedMaskT_v02; +#define QMI_LOC_SENSOR_AIDED_MASK_HEADING_V02 ((qmiLocSensorAidedMaskT_v02)0x00000001) /**< Bitmask to specify whether a sensor was used to calculate heading. */ +#define QMI_LOC_SENSOR_AIDED_MASK_SPEED_V02 ((qmiLocSensorAidedMaskT_v02)0x00000002) /**< Bitmask to specify whether a sensor was used to calculate speed. */ +#define QMI_LOC_SENSOR_AIDED_MASK_POSITION_V02 ((qmiLocSensorAidedMaskT_v02)0x00000004) /**< Bitmask to specify whether a sensor was used to calculate position. */ +#define QMI_LOC_SENSOR_AIDED_MASK_VELOCITY_V02 ((qmiLocSensorAidedMaskT_v02)0x00000008) /**< Bitmask to specify whether a sensor was used to calculate velocity. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorUsageMaskT_v02 usageMask; + /**< Specifies which sensors were used in calculating the position in the + position report. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SENSOR_USED_ ACCEL + \item 0x00000002 -- SENSOR_USED_ GYRO + \vspace{-0.18in} \end{itemize1} */ + + qmiLocSensorAidedMaskT_v02 aidingIndicatorMask; + /**< Specifies which results were aided by sensors. + + Valid bitmasks: \n + - 0x00000001 -- AIDED_HEADING \n + - 0x00000002 -- AIDED_SPEED \n + - 0x00000004 -- AIDED_POSITION \n + - 0x00000008 -- AIDED_VELOCITY */ +}qmiLocSensorUsageIndicatorStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCTIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_TIME_SRC_INVALID_V02 = 0, /**< Invalid time. */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER_V02 = 1, /**< Time is set by the 1X system */ + eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING_V02 = 2, /**< Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time) */ + eQMI_LOC_TIME_SRC_EXTERNAL_INPUT_V02 = 3, /**< Time is set by an external injection */ + eQMI_LOC_TIME_SRC_TOW_DECODE_V02 = 4, /**< Time is set after decoding over-the-air GPS navigation data + from one GPS satellite */ + eQMI_LOC_TIME_SRC_TOW_CONFIRMED_V02 = 5, /**< Time is set after decoding over-the-air GPS navigation data + from multiple satellites */ + eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED_V02 = 6, /**< Both time of the week and the GPS week number are known */ + eQMI_LOC_TIME_SRC_NAV_SOLUTION_V02 = 7, /**< Time is set by the position engine after the fix is obtained */ + eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME_V02 = 8, /**< Time is set by the position engine after performing SFT; + this is done when the clock time uncertainty is large */ + eQMI_LOC_TIME_SRC_GLO_TOW_DECODE_V02 = 9, /**< Time is set after decoding GLO satellites */ + eQMI_LOC_TIME_SRC_TIME_TRANSFORM_V02 = 10, /**< Time is set after transforming the GPS to GLO time */ + eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING_V02 = 11, /**< Time is set by the sleep time tag provided by the WCDMA network */ + eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING_V02 = 12, /**< Time is set by the sleep time tag provided by the GSM network */ + eQMI_LOC_TIME_SRC_UNKNOWN_V02 = 13, /**< Source of the time is unknown */ + eQMI_LOC_TIME_SRC_SYSTEM_TIMETICK_V02 = 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_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 */ + QMILOCTIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCRELIABILITYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_RELIABILITY_NOT_SET_V02 = 0, /**< Location reliability is not set */ + eQMI_LOC_RELIABILITY_VERY_LOW_V02 = 1, /**< Location reliability is very low; use it at your own risk */ + eQMI_LOC_RELIABILITY_LOW_V02 = 2, /**< Location reliability is low; little or no cross-checking is possible */ + eQMI_LOC_RELIABILITY_MEDIUM_V02 = 3, /**< Location reliability is medium; limited cross-check passed */ + eQMI_LOC_RELIABILITY_HIGH_V02 = 4, /**< Location reliability is high; strong cross-check passed */ + QMILOCRELIABILITYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocReliabilityEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the position report to the control point. */ +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 */ + /* Session ID */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request + QMI_LOC_START_REQ. \n + - Range: 0 to 255 */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* Elliptical Horizontal Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal uncertainty confidence. + If both elliptical and horizontal uncertainties are specified in this message + then the confidence corresponds to the elliptical unc\n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + Valid values: \n + - eQMI_LOC_RELIABILITY_NOT_SET (0) -- Location reliability is not set + - eQMI_LOC_RELIABILITY_VERY_LOW (1) -- Location reliability is very low; use it at your own risk + - eQMI_LOC_RELIABILITY_LOW (2) -- Location reliability is low; little or no cross-checking is possible + - eQMI_LOC_RELIABILITY_MEDIUM (3) -- Location reliability is medium; limited cross-check passed + - eQMI_LOC_RELIABILITY_HIGH (4) -- Location reliability is high; strong cross-check passed + */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t speedHorizontal_valid; /**< Must be set to true if speedHorizontal is being passed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + /* 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 */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* 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 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + Valid values: \n + - eQMI_LOC_RELIABILITY_NOT_SET (0) -- Location reliability is not set + - eQMI_LOC_RELIABILITY_VERY_LOW (1) -- Location reliability is very low; use it at your own risk + - eQMI_LOC_RELIABILITY_LOW (2) -- Location reliability is low; little or no cross-checking is possible + - eQMI_LOC_RELIABILITY_MEDIUM (3) -- Location reliability is medium; limited cross-check passed + - eQMI_LOC_RELIABILITY_HIGH (4) -- Location reliability is high; strong cross-check passed + */ + + /* Optional */ + /* Vertical Speed */ + uint8_t speedVertical_valid; /**< Must be set to true if speedVertical is being passed */ + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* 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 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< 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. */ + + /* Optional */ + /* Technology Used */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + Valid bitmasks: \n + - QMI_LOC_POS_TECH_MASK_SATELLITE (0x00000001) -- Satellites were used to generate the fix + - QMI_LOC_POS_TECH_MASK_CELLID (0x00000002) -- Cell towers were used to generate the fix + - QMI_LOC_POS_TECH_MASK_WIFI (0x00000004) -- Wi-Fi access points were used to generate the fix + - QMI_LOC_POS_TECH_MASK_SENSORS (0x00000008) -- Sensors were used to generate the fix + - QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION (0x00000010) -- Reference Location was used to generate the fix + - QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION (0x00000020) -- Coarse position injected into the location engine was used to + generate the fix + - QMI_LOC_POS_TECH_MASK_AFLT (0x00000040) -- AFLT was used to generate the fix + - QMI_LOC_POS_TECH_MASK_HYBRID (0x00000080) -- GNSS and network-provided measurements were used to + generate the fix + */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + /**< \vspace{0.06in} \n Dilution of precision associated with this position. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds since Jan. 1, 1970 */ + + /* Optional */ + /* Leap Seconds */ + uint8_t leapSeconds_valid; /**< Must be set to true if leapSeconds is being passed */ + uint8_t leapSeconds; + /**< Leap second information. If leapSeconds is not available, + timestampUtc is calculated based on a hard-coded value + for leap seconds. \n + - Units: Seconds */ + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + /**< \vspace{0.06in} \n The number of weeks since Jan. 5, 1980, and + milliseconds into the current week. */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. Valid values: \n + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1X system + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time) + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection + - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data + from one GPS satellite + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained + - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT; + this is done when the clock time uncertainty is large + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - 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 */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + /**< \vspace{0.06in} \n Indicates whether sensor data was used in computing the position in this + position report. */ + + /* Optional */ + /* Fix Count for This Session */ + uint8_t fixId_valid; /**< Must be set to true if fixId is being passed */ + uint32_t fixId; + /**< Fix count for the session. Starts with 0 and increments by one + for each successive position report for a particular session. */ + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + 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 + */ + + /* Optional */ + /* Altitude Assumed */ + uint8_t altitudeAssumed_valid; /**< Must be set to true if altitudeAssumed is being passed */ + uint8_t altitudeAssumed; + /**< Indicates whether altitude is assumed or calculated: \begin{itemize1} + \item 0x00 (FALSE) -- Altitude is calculated + \item 0x01 (TRUE) -- Altitude is assumed; there may not be enough + satellites to determine the precise altitude + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocEventPositionReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSYSTEMENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_SYSTEM_GPS_V02 = 1, /**< GPS satellite */ + eQMI_LOC_SV_SYSTEM_GALILEO_V02 = 2, /**< GALILEO satellite */ + eQMI_LOC_SV_SYSTEM_SBAS_V02 = 3, /**< SBAS satellite */ + eQMI_LOC_SV_SYSTEM_COMPASS_V02 = 4, /**< COMPASS satellite */ + eQMI_LOC_SV_SYSTEM_GLONASS_V02 = 5, /**< GLONASS satellite */ + eQMI_LOC_SV_SYSTEM_BDS_V02 = 6, /**< BDS satellite */ + QMILOCSVSYSTEMENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvSystemEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSVSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SV_STATUS_IDLE_V02 = 1, /**< SV is not being actively processed */ + eQMI_LOC_SV_STATUS_SEARCH_V02 = 2, /**< The system is searching for this SV */ + eQMI_LOC_SV_STATUS_TRACK_V02 = 3, /**< SV is being tracked */ + QMILOCSVSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSvStatusEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSvInfoValidMaskT_v02; +#define QMI_LOC_SV_INFO_MASK_VALID_SYSTEM_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000001) /**< System field is valid in SV information */ +#define QMI_LOC_SV_INFO_MASK_VALID_GNSS_SVID_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000002) /**< gnssSvId field is valid in SV information */ +#define QMI_LOC_SV_INFO_MASK_VALID_HEALTH_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000004) /**< healthStatus field is valid in SV information */ +#define QMI_LOC_SV_INFO_MASK_VALID_PROCESS_STATUS_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000008) /**< processStatus field is valid in SV information */ +#define QMI_LOC_SV_INFO_MASK_VALID_SVINFO_MASK_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000010) /**< svInfoMask field is valid in SV information */ +#define QMI_LOC_SV_INFO_MASK_VALID_ELEVATION_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000020) /**< Elevation field is valid in SV information */ +#define QMI_LOC_SV_INFO_MASK_VALID_AZIMUTH_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000040) /**< Azimuth field is valid in SV information */ +#define QMI_LOC_SV_INFO_MASK_VALID_SNR_V02 ((qmiLocSvInfoValidMaskT_v02)0x00000080) /**< SNR field is valid in SV information */ +typedef uint8_t qmiLocSvInfoMaskT_v02; +#define QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS_V02 ((qmiLocSvInfoMaskT_v02)0x01) /**< Ephemeris is available for this SV */ +#define QMI_LOC_SVINFO_MASK_HAS_ALMANAC_V02 ((qmiLocSvInfoMaskT_v02)0x02) /**< Almanac is available for this SV */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSvInfoValidMaskT_v02 validMask; + /**< Bitmask indicating which of the fields in this TLV are valid. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- VALID_SYSTEM + \item 0x00000002 -- VALID_GNSS_SVID + \item 0x00000004 -- VALID_HEALTH_ STATUS + \item 0x00000008 -- VALID_PROCESS_ STATUS + \item 0x00000010 -- VALID_SVINFO_ MASK + \item 0x00000020 -- VALID_ELEVATION + \item 0x00000040 -- VALID_AZIMUTH + \item 0x00000080 -- VALID_SNR + \vspace{-0.18in} \end{itemize1} */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \n + - eQMI_LOC_SV_SYSTEM_GPS (1) -- GPS satellite + - eQMI_LOC_SV_SYSTEM_GALILEO (2) -- GALILEO satellite + - eQMI_LOC_SV_SYSTEM_SBAS (3) -- SBAS satellite + - eQMI_LOC_SV_SYSTEM_COMPASS (4) -- COMPASS satellite + - eQMI_LOC_SV_SYSTEM_GLONASS (5) -- GLONASS satellite + - eQMI_LOC_SV_SYSTEM_BDS (6) -- BDS satellite + */ + + uint16_t gnssSvId; + /**< GNSS SV ID. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For GLONASS: 1 to 32 + \item For SBAS: 120 to 151 + \item For BDS: 201 to 237 + \end{itemize1} \end{itemize1} + + The GPS and GLONASS SVs can be disambiguated using the system field. */ + + uint8_t healthStatus; + /**< Health status. + \begin{itemize1} + \item Range: 0 to 1; 0 = unhealthy, \n 1 = healthy + \vspace{-0.18in} \end{itemize1}*/ + + qmiLocSvStatusEnumT_v02 svStatus; + /**< SV processing status. + + Valid values: \n + - eQMI_LOC_SV_STATUS_IDLE (1) -- SV is not being actively processed + - eQMI_LOC_SV_STATUS_SEARCH (2) -- The system is searching for this SV + - eQMI_LOC_SV_STATUS_TRACK (3) -- SV is being tracked + */ + + qmiLocSvInfoMaskT_v02 svInfoMask; + /**< Indicates whether almanac and ephemeris information is available. \n + Valid bitmasks: + + - 0x01 -- SVINFO_HAS_EPHEMERIS \n + - 0x02 -- SVINFO_HAS_ALMANAC + */ + + float elevation; + /**< SV elevation angle.\n + - Units: Degrees \n + - Range: 0 to 90 */ + + float azimuth; + /**< SV azimuth angle.\n + - Units: Degrees \n + - Range: 0 to 360 */ + + float snr; + /**< SV signal-to-noise ratio. \n + - Units: dB-Hz */ +}qmiLocSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a satellite report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Altitude Assumed */ + uint8_t altitudeAssumed; + /**< Indicates whether altitude is assumed or calculated: \begin{itemize1} + \item 0x00 (FALSE) -- Valid altitude is calculated + \item 0x01 (TRUE) -- Valid altitude is assumed; there may not be + enough satellites to determine precise altitude + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Satellite Info */ + uint8_t svList_valid; /**< Must be set to true if svList is being passed */ + uint32_t svList_len; /**< Must be set to # of elements in svList */ + qmiLocSvInfoStructT_v02 svList[QMI_LOC_SV_INFO_LIST_MAX_SIZE_V02]; + /**< \vspace{0.06in} \n SV information list. */ +}qmiLocEventGnssSvInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends NMEA sentences to the control point */ +typedef struct { + + /* Mandatory */ + /* NMEA String */ + char nmea[QMI_LOC_NMEA_STRING_MAX_LENGTH_V02 + 1]; + /**< NMEA string. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 201 + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocEventNmeaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNINOTIFYVERIFYENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY_V02 = 1, /**< No notification and no verification required */ + eQMI_LOC_NI_USER_NOTIFY_ONLY_V02 = 2, /**< Notify only; no verification required */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP_V02 = 3, /**< Notify and verify, but no response required. */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP_V02 = 4, /**< Notify and verify, and require a response */ + eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE_V02 = 5, /**< Notify and verify; privacy override */ + QMILOCNINOTIFYVERIFYENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiNotifyVerifyEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXPOSMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_MS_ASSISTED_ONLY_V02 = 1, /**< MS-assisted only allowed */ + eQMI_LOC_NI_VX_MS_BASED_ONLY_V02 = 2, /**< MS-based only allowed */ + eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED_V02 = 3, /**< MS-assisted preferred, but MS-based allowed */ + eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED_V02 = 4, /**< MS-based preferred, but MS-assisted allowed */ + QMILOCNIVXPOSMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxPosModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_VX_OCTET_V02 = 0, /**< Encoding is Octet */ + eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG_V02 = 1, /**< Encoding is EXN protocol message */ + eQMI_LOC_NI_VX_ASCII_V02 = 2, /**< Encoding is ASCII */ + eQMI_LOC_NI_VX_IA5_V02 = 3, /**< Encoding is IA5 */ + eQMI_LOC_NI_VX_UNICODE_V02 = 4, /**< Encoding is Unicode */ + eQMI_LOC_NI_VX_SHIFT_JIS_V02 = 5, /**< Encoding is Shift JIS */ + eQMI_LOC_NI_VX_KOREAN_V02 = 6, /**< Encoding is Korean */ + eQMI_LOC_NI_VX_LATIN_HEBREW_V02 = 7, /**< Encoding is Latin Hebrew */ + eQMI_LOC_NI_VX_LATIN_V02 = 8, /**< Encoding is Latin */ + eQMI_LOC_NI_VX_GSM_V02 = 9, /**< Encoding is GSM */ + QMILOCNIVXREQUESTORIDENCODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t posQosIncl; + /**< Indicates whether quality of service is included:\n + - 0x01 (TRUE) -- QoS is included \n + - 0x00 (FALSE) -- QoS is not included */ + + uint8_t posQos; + /**< Position QoS timeout. \n + - Units: Seconds \n + - Range: 0 to 255 */ + + uint32_t numFixes; + /**< Number of fixes allowed. */ + + uint32_t timeBetweenFixes; + /**< Time between fixes. \n + - Units: Seconds */ + + qmiLocNiVxPosModeEnumT_v02 posMode; + /**< Position mode. + Valid values: + + - eQMI_LOC_NI_VX_MS_ASSISTED_ONLY (1) -- MS-assisted only allowed + - eQMI_LOC_NI_VX_MS_BASED_ONLY (2) -- MS-based only allowed + - eQMI_LOC_NI_VX_MS_ASSISTED_PREFERRED_MS_BASED_ALLOWED (3) -- MS-assisted preferred, but MS-based allowed + - eQMI_LOC_NI_VX_MS_BASED_PREFERRED_MS_ASSISTED_ALLOWED (4) -- MS-based preferred, but MS-assisted allowed + */ + + qmiLocNiVxRequestorIdEncodingSchemeEnumT_v02 encodingScheme; + /**< VX encoding scheme. + + Valid values: + + - eQMI_LOC_NI_VX_OCTET (0) -- Encoding is Octet + - eQMI_LOC_NI_VX_EXN_PROTOCOL_MSG (1) -- Encoding is EXN protocol message + - eQMI_LOC_NI_VX_ASCII (2) -- Encoding is ASCII + - eQMI_LOC_NI_VX_IA5 (3) -- Encoding is IA5 + - eQMI_LOC_NI_VX_UNICODE (4) -- Encoding is Unicode + - eQMI_LOC_NI_VX_SHIFT_JIS (5) -- Encoding is Shift JIS + - eQMI_LOC_NI_VX_KOREAN (6) -- Encoding is Korean + - eQMI_LOC_NI_VX_LATIN_HEBREW (7) -- Encoding is Latin Hebrew + - eQMI_LOC_NI_VX_LATIN (8) -- Encoding is Latin + - eQMI_LOC_NI_VX_GSM (9) -- Encoding is GSM + */ + + uint32_t requestorId_len; /**< Must be set to # of elements in requestorId */ + uint8_t requestorId[QMI_LOC_NI_MAX_REQUESTOR_ID_LENGTH_V02]; + /**< Requestor ID. \n + - Type: Array of bytes \n + - Maximum array length: 200 + */ + + uint16_t userRespTimerInSeconds; + /**< Time to wait for the user to respond. \n + - Units: Seconds */ +}qmiLocNiVxNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLPOSMETHODENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_V02 = 1, /**< Set assisted */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_V02 = 2, /**< Set based */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF_V02 = 3, /**< Set assisted preferred */ + eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF_V02 = 4, /**< Set based preferred */ + eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS_V02 = 5, /**< Standalone GPS */ + eQMI_LOC_NI_SUPL_POSMETHOD_AFLT_V02 = 6, /**< Advanced forward link trilateration */ + eQMI_LOC_NI_SUPL_POSMETHOD_ECID_V02 = 7, /**< Exclusive chip ID */ + eQMI_LOC_NI_SUPL_POSMETHOD_EOTD_V02 = 8, /**< Enhnaced observed time difference */ + eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA_V02 = 9, /**< Observed time delay of arrival */ + eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION_V02 = 10, /**< No position */ + QMILOCNISUPLPOSMETHODENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplPosMethodEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIDATACODINGSCHEMEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SS_GERMAN_V02 = 12, /**< Language is German */ + eQMI_LOC_NI_SS_ENGLISH_V02 = 13, /**< Language is English */ + eQMI_LOC_NI_SS_ITALIAN_V02 = 14, /**< Language is Italian */ + eQMI_LOC_NI_SS_FRENCH_V02 = 15, /**< Language is French */ + eQMI_LOC_NI_SS_SPANISH_V02 = 16, /**< Language is Spanish */ + eQMI_LOC_NI_SS_DUTCH_V02 = 17, /**< Language is Dutch */ + eQMI_LOC_NI_SS_SWEDISH_V02 = 18, /**< Language is Swedish */ + eQMI_LOC_NI_SS_DANISH_V02 = 19, /**< Language is Danish */ + eQMI_LOC_NI_SS_PORTUGUESE_V02 = 20, /**< Language is Portuguese */ + eQMI_LOC_NI_SS_FINNISH_V02 = 21, /**< Language is Finnish */ + eQMI_LOC_NI_SS_NORWEGIAN_V02 = 22, /**< Language is Norwegian */ + eQMI_LOC_NI_SS_GREEK_V02 = 23, /**< Language is Greek */ + eQMI_LOC_NI_SS_TURKISH_V02 = 24, /**< Language is Turkish */ + eQMI_LOC_NI_SS_HUNGARIAN_V02 = 25, /**< Language is Hungarian */ + eQMI_LOC_NI_SS_POLISH_V02 = 26, /**< Language is Polish */ + eQMI_LOC_NI_SS_LANGUAGE_UNSPEC_V02 = 27, /**< Language is unspecified */ + eQMI_LOC_NI_SUPL_UTF8_V02 = 28, /**< Encoding is UTF 8 */ + eQMI_LOC_NI_SUPL_UCS2_V02 = 29, /**< Encoding is UCS 2 */ + eQMI_LOC_NI_SUPL_GSM_DEFAULT_V02 = 30, /**< Encoding is GSM default */ + QMILOCNIDATACODINGSCHEMEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiDataCodingSchemeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLFORMATENUMTYPE_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME_V02 = 0, /**< SUPL logical name format */ + eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS_V02 = 1, /**< SUPL email address format */ + eQMI_LOC_NI_SUPL_FORMAT_MSISDN_V02 = 2, /**< SUPL MS-ISDN format */ + eQMI_LOC_NI_SUPL_FORMAT_URL_V02 = 3, /**< SUPL URL format */ + eQMI_LOC_NI_SUPL_FORMAT_SIP_URL_V02 = 4, /**< SUPL SIP URL format */ + eQMI_LOC_NI_SUPL_FORMAT_MIN_V02 = 5, /**< SUPL MIN format */ + eQMI_LOC_NI_SUPL_FORMAT_MDN_V02 = 6, /**< SUPL MDN format */ + eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY_V02 = 7, /**< SUPL IMS public identity */ + eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN_V02 = 2147483647, /**< SUPL unknown format */ + QMILOCNISUPLFORMATENUMTYPE_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplFormatEnumType_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplFormatEnumType_v02 formatType; + /**< Format of the formatted string. + + Valid values: \n + - eQMI_LOC_NI_SUPL_FORMAT_LOGICAL_NAME (0) -- SUPL logical name format + - eQMI_LOC_NI_SUPL_FORMAT_EMAIL_ADDRESS (1) -- SUPL email address format + - eQMI_LOC_NI_SUPL_FORMAT_MSISDN (2) -- SUPL MS-ISDN format + - eQMI_LOC_NI_SUPL_FORMAT_URL (3) -- SUPL URL format + - eQMI_LOC_NI_SUPL_FORMAT_SIP_URL (4) -- SUPL SIP URL format + - eQMI_LOC_NI_SUPL_FORMAT_MIN (5) -- SUPL MIN format + - eQMI_LOC_NI_SUPL_FORMAT_MDN (6) -- SUPL MDN format + - eQMI_LOC_NI_SUPL_FORMAT_IMSPUBLIC_IDENTITY (7) -- SUPL IMS public identity + - eQMI_LOC_NI_SUPL_FORMAT_OSS_UNKNOWN (2147483647) -- SUPL unknown format + */ + + uint32_t formattedString_len; /**< Must be set to # of elements in formattedString */ + uint8_t formattedString[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Formatted string. \n + - Type: Byte array \n + - Maximum string length: 64 + */ +}qmiLocNiSuplFormattedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocSuplQopValidMaskT_v02; +#define QMI_LOC_NI_SUPL_MASK_QOP_HORZ_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x01) /**< Horizontal accuracy is valid in the Quality of Position (QoP) */ +#define QMI_LOC_NI_SUPL_MASK_QOP_VER_ACC_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x02) /**< Vertical accuracy is valid in the QoP */ +#define QMI_LOC_NI_SUPL_MASK_QOP_MAXAGE_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x04) /**< Vertical accuracy is valid in the QoP */ +#define QMI_LOC_NI_SUPL_MASK_QOP_DELAY_VALID_V02 ((qmiLocSuplQopValidMaskT_v02)0x08) /**< Vertical accuracy is valid in the QoP */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSuplQopValidMaskT_v02 validMask; + /**< Bit field indicating which fields are valid in this value. + + Valid bitmasks: \n + - 0x01 -- QOP_HORZ_ACC_VALID \n + - 0x02 -- QOP_VER_ACC_VALID \n + - 0x04 -- QOP_MAXAGE_VALID \n + - 0x08 -- QOP_DELAY_VALID*/ + + uint8_t horizontalAccuracy; + /**< Horizontal accuracy. \n + - Units: Meters */ + + uint8_t verticalAccuracy; + /**< Vertical accuracy. \n + - Units: Meters */ + + uint16_t maxLocAge; + /**< Maximum age of the location if the engine sends a previously + computed position. \n + - Units: Seconds */ + + uint8_t delay; + /**< Delay the server is willing to tolerate for the fix. \n + - Units: Seconds */ +}qmiLocNiSuplQopStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocServerAddrTypeMaskT_v02; +#define QMI_LOC_SERVER_ADDR_TYPE_IPV4_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x01) /**< IPv4 server address type */ +#define QMI_LOC_SERVER_ADDR_TYPE_IPV6_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x02) /**< IPv6 server address type */ +#define QMI_LOC_SERVER_ADDR_TYPE_URL_MASK_V02 ((qmiLocServerAddrTypeMaskT_v02)0x04) /**< URL server address type */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t addr; + /**< IPv4 address. */ + + uint16_t port; + /**< IPv4 port. */ +}qmiLocIpV4AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t addr[QMI_LOC_IPV6_ADDR_LENGTH_V02]; + /**< IPv6 address. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 8 */ + + uint32_t port; + /**< IPv6 port. */ +}qmiLocIpV6AddrStructType_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerAddrTypeMaskT_v02 suplServerAddrTypeMask; + /**< Mask specifying the valid fields in this value. + + Valid bitmasks: \n + - 0x01 -- IPv4 \n + - 0x02 -- IPv6 \n + - 0x04 -- URL + */ + + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< IPv4 address and port. */ + + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< IPv6 address and port. */ + + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocNiSuplServerInfoStructT_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocNiSuplNotifyVerifyValidMaskT_v02; +#define QMI_LOC_SUPL_SERVER_INFO_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000001) /**< Mask to denote that the server information + is present in an NI SUPL Notify/Verify request event. This mask is set in + the valid_flags field of a Notify/Verify structure. */ +#define QMI_LOC_SUPL_SESSION_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000002) /**< Mask to denote that the SUPL session ID + is present in an NI SUPL Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_HASH_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000004) /**< Mask to denote that the SUPL hash is present + in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_POS_METHOD_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000008) /**< Mask to denote that the position method is present + in an NI SUPL Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000010) /**< Mask to denote that the data coding scheme + is present in an NI SUPL Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_REQUESTOR_ID_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000020) /**< Mask to denote that the requestor ID + is present in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_CLIENT_NAME_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000040) /**< Mask to denote that the requestor ID + is present in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_QOP_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000080) /**< Mask to denote that the quality of position + is present in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +#define QMI_LOC_SUPL_USER_RESP_TIMER_MASK_V02 ((qmiLocNiSuplNotifyVerifyValidMaskT_v02)0x00000100) /**< Mask to denote that the user response timer + is present in an NI Notify/Verify request event. + This mask is set in the valid_flags field of a + Notify/Verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplNotifyVerifyValidMaskT_v02 valid_flags; + /**< Indicates which of the following fields are present in this value. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- SUPL_SERVER_INFO + \item 0x00000002 -- SUPL_SESSION_ID + \item 0x00000004 -- SUPL_HASH + \item 0x00000008 -- SUPL_POS_METHOD + \item 0x00000010 -- SUPL_DATA_ CODING_SCHEME + \item 0x00000020 -- SUPL_REQUESTOR_ ID + \item 0x00000040 -- SUPL_CLIENT_ NAME + \item 0x00000080 -- SUPL_QOP + \item 0x00000100 -- SUPL_USER_RESP_ TIMER + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplServerInfoStructT_v02 suplServerInfo; + /**< SUPL server information. */ + + uint8_t suplSessionId[QMI_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH_V02]; + /**< SUPL session ID. \n + - Type: Array of unsigned integers \n + - Maximum length of the array: 4 */ + + uint8_t suplHash[QMI_LOC_NI_SUPL_HASH_LENGTH_V02]; + /**< Hash for SUPL_INIT; used to validate that the message was not + corrupted. \n + - Type: Array of unsigned integers \n + - Length of the array: 8 */ + + qmiLocNiSuplPosMethodEnumT_v02 posMethod; + /**< GPS mode to be used for the fix. + Valid values: + + - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED (1) -- Set assisted + - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED (2) -- Set based + - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETASSISTED_PREF (3) -- Set assisted preferred + - eQMI_LOC_NI_SUPL_POSMETHOD_AGPS_SETBASED_PREF (4) -- Set based preferred + - eQMI_LOC_NI_SUPL_POSMETHOD_AUTONOMOUS_GPS (5) -- Standalone GPS + - eQMI_LOC_NI_SUPL_POSMETHOD_AFLT (6) -- Advanced forward link trilateration + - eQMI_LOC_NI_SUPL_POSMETHOD_ECID (7) -- Exclusive chip ID + - eQMI_LOC_NI_SUPL_POSMETHOD_EOTD (8) -- Enhnaced observed time difference + - eQMI_LOC_NI_SUPL_POSMETHOD_OTDOA (9) -- Observed time delay of arrival + - eQMI_LOC_NI_SUPL_POSMETHOD_NO_POSITION (10) -- No position + */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Data coding scheme applies to both the requestor ID and the client + name. + + Valid values: \n + - eQMI_LOC_NI_SS_GERMAN (12) -- Language is German + - eQMI_LOC_NI_SS_ENGLISH (13) -- Language is English + - eQMI_LOC_NI_SS_ITALIAN (14) -- Language is Italian + - eQMI_LOC_NI_SS_FRENCH (15) -- Language is French + - eQMI_LOC_NI_SS_SPANISH (16) -- Language is Spanish + - eQMI_LOC_NI_SS_DUTCH (17) -- Language is Dutch + - eQMI_LOC_NI_SS_SWEDISH (18) -- Language is Swedish + - eQMI_LOC_NI_SS_DANISH (19) -- Language is Danish + - eQMI_LOC_NI_SS_PORTUGUESE (20) -- Language is Portuguese + - eQMI_LOC_NI_SS_FINNISH (21) -- Language is Finnish + - eQMI_LOC_NI_SS_NORWEGIAN (22) -- Language is Norwegian + - eQMI_LOC_NI_SS_GREEK (23) -- Language is Greek + - eQMI_LOC_NI_SS_TURKISH (24) -- Language is Turkish + - eQMI_LOC_NI_SS_HUNGARIAN (25) -- Language is Hungarian + - eQMI_LOC_NI_SS_POLISH (26) -- Language is Polish + - eQMI_LOC_NI_SS_LANGUAGE_UNSPEC (27) -- Language is unspecified + - eQMI_LOC_NI_SUPL_UTF8 (28) -- Encoding is UTF 8 + - eQMI_LOC_NI_SUPL_UCS2 (29) -- Encoding is UCS 2 + - eQMI_LOC_NI_SUPL_GSM_DEFAULT (30) -- Encoding is GSM default + */ + + qmiLocNiSuplFormattedStringStructT_v02 requestorId; + /**< Requestor ID. The encoding scheme for requestor_id is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplFormattedStringStructT_v02 clientName; + /**< Client name. The encoding scheme for client_name is specified in + the dataCodingScheme field. */ + + qmiLocNiSuplQopStructT_v02 suplQop; + /**< SUPL QoP. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Units: Seconds*/ +}qmiLocNiSuplNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNILOCATIONTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION_V02 = 1, /**< Current location */ + eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION_V02 = 2, /**< Last known location; may be the current location */ + eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION_V02 = 3, /**< Initial location */ + QMILOCNILOCATIONTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiLocationTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Identifies the coding scheme of the coded string. + + Valid values: \n + - eQMI_LOC_NI_SS_GERMAN (12) -- Language is German + - eQMI_LOC_NI_SS_ENGLISH (13) -- Language is English + - eQMI_LOC_NI_SS_ITALIAN (14) -- Language is Italian + - eQMI_LOC_NI_SS_FRENCH (15) -- Language is French + - eQMI_LOC_NI_SS_SPANISH (16) -- Language is Spanish + - eQMI_LOC_NI_SS_DUTCH (17) -- Language is Dutch + - eQMI_LOC_NI_SS_SWEDISH (18) -- Language is Swedish + - eQMI_LOC_NI_SS_DANISH (19) -- Language is Danish + - eQMI_LOC_NI_SS_PORTUGUESE (20) -- Language is Portuguese + - eQMI_LOC_NI_SS_FINNISH (21) -- Language is Finnish + - eQMI_LOC_NI_SS_NORWEGIAN (22) -- Language is Norwegian + - eQMI_LOC_NI_SS_GREEK (23) -- Language is Greek + - eQMI_LOC_NI_SS_TURKISH (24) -- Language is Turkish + - eQMI_LOC_NI_SS_HUNGARIAN (25) -- Language is Hungarian + - eQMI_LOC_NI_SS_POLISH (26) -- Language is Polish + - eQMI_LOC_NI_SS_LANGUAGE_UNSPEC (27) -- Language is unspecified + - eQMI_LOC_NI_SUPL_UTF8 (28) -- Encoding is UTF 8 + - eQMI_LOC_NI_SUPL_UCS2 (29) -- Encoding is UCS 2 + - eQMI_LOC_NI_SUPL_GSM_DEFAULT (30) -- Encoding is GSM default + */ + + uint32_t codedString_len; /**< Must be set to # of elements in codedString */ + uint8_t codedString[QMI_LOC_NI_CODEWORD_MAX_LENGTH_V02]; + /**< Coded string. \n + - Type: Array of bytes \n + - Maximum string length: 20 */ +}qmiLocNiUmtsCpCodedStringStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02; +#define QMI_LOC_UMTS_CP_INVOKE_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0001) /**< Mask to denote that the invoke ID + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_DATA_CODING_SCHEME_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0002) /**< Mask to denote that the data coding scheme + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_NOTIFICATION_TEXT_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0004) /**< Mask to denote that the notification text + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_CLIENT_ADDRESS_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0008) /**< Mask to denote that the client address + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_LOCATION_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0010) /**< Mask to denote that the location type + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_REQUESTOR_ID_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0020) /**< Mask to denote that the requestor ID + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_CODEWORD_STRING_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0040) /**< Mask to denote that the code word string + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_SERVICE_TYPE_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0080) /**< Mask to denote that the service type + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +#define QMI_LOC_UMTS_CP_USER_RESP_TIMER_MASK_V02 ((qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02)0x0100) /**< Mask to denote that the user response timer + is present in an NI Notify/Verify request event. + This mask is set in the valid flags field of a + Notify/Verify structure. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiUmtsCpNotifyVerifyValidMaskT_v02 valid_flags; + /**< Fields that are valid in this value. + + Valid bitmasks: \begin{itemize1} + \item 0x0001 -- INVOKE_ID_MASK + \item 0x0002 -- DATA_CODING_ SCHEME_MASK + \item 0x0004 -- NOTIFICATION_TEXT_ MASK + \item 0x0008 -- CLIENT_ADDRESS_ MASK + \item 0x0010 -- LOCATION_TYPE_ MASK + \item 0x0020 -- REQUESTOR_ID_MASK + \item 0x0040 -- CODEWORD_STRING_ MASK + \item 0x0080 -- SERVICE_TYPE_MASK + \item 0x0100 -- USER_RESP_TIMER_ MASK + \vspace{-0.18in} \end{itemize1} + */ + + uint8_t invokeId; + /**< Supplementary Services invoke ID. */ + + qmiLocNiDataCodingSchemeEnumT_v02 dataCodingScheme; + /**< Type of data encoding scheme for the text. + Applies to both the notification text and the client address. + + Valid values: \n + - eQMI_LOC_NI_SS_GERMAN (12) -- Language is German + - eQMI_LOC_NI_SS_ENGLISH (13) -- Language is English + - eQMI_LOC_NI_SS_ITALIAN (14) -- Language is Italian + - eQMI_LOC_NI_SS_FRENCH (15) -- Language is French + - eQMI_LOC_NI_SS_SPANISH (16) -- Language is Spanish + - eQMI_LOC_NI_SS_DUTCH (17) -- Language is Dutch + - eQMI_LOC_NI_SS_SWEDISH (18) -- Language is Swedish + - eQMI_LOC_NI_SS_DANISH (19) -- Language is Danish + - eQMI_LOC_NI_SS_PORTUGUESE (20) -- Language is Portuguese + - eQMI_LOC_NI_SS_FINNISH (21) -- Language is Finnish + - eQMI_LOC_NI_SS_NORWEGIAN (22) -- Language is Norwegian + - eQMI_LOC_NI_SS_GREEK (23) -- Language is Greek + - eQMI_LOC_NI_SS_TURKISH (24) -- Language is Turkish + - eQMI_LOC_NI_SS_HUNGARIAN (25) -- Language is Hungarian + - eQMI_LOC_NI_SS_POLISH (26) -- Language is Polish + - eQMI_LOC_NI_SS_LANGUAGE_UNSPEC (27) -- Language is unspecified + - eQMI_LOC_NI_SUPL_UTF8 (28) -- Encoding is UTF 8 + - eQMI_LOC_NI_SUPL_UCS2 (29) -- Encoding is UCS 2 + - eQMI_LOC_NI_SUPL_GSM_DEFAULT (30) -- Encoding is GSM default + */ + + uint32_t notificationText_len; /**< Must be set to # of elements in notificationText */ + uint8_t notificationText[QMI_LOC_NI_MAX_CLIENT_NAME_LENGTH_V02]; + /**< Notification text; the encoding method is specified in + dataCodingScheme. \n + - Type: Array of bytes \n + - Maximum array length: 64 */ + + uint32_t clientAddress_len; /**< Must be set to # of elements in clientAddress */ + uint8_t clientAddress[QMI_LOC_NI_MAX_EXT_CLIENT_ADDRESS_V02]; + /**< Client address; the encoding method is specified in + dataCodingScheme. \n + - Maximum array length: 20 */ + + qmiLocNiLocationTypeEnumT_v02 locationType; + /**< Location type. + + Valid values: \n + - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_LOCATION (1) -- Current location + - eQMI_LOC_NI_LOCATIONTYPE_CURRENT_OR_LAST_KNOWN_LOCATION (2) -- Last known location; may be the current location + - eQMI_LOC_NI_LOCATIONTYPE_INITIAL_LOCATION (3) -- Initial location + */ + + qmiLocNiUmtsCpCodedStringStructT_v02 requestorId; + /**< Requestor ID; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + qmiLocNiUmtsCpCodedStringStructT_v02 codewordString; + /**< Codeword string; the encoding method is specified in the + qmiLocNiUmtsCpCodedStringStructT.dataCodingScheme field. */ + + uint8_t lcsServiceTypeId; + /**< Service type ID. */ + + uint16_t userResponseTimer; + /**< Time to wait for the user to respond. \n + - Units: Seconds */ +}qmiLocNiUmtsCpNotifyVerifyStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISERVICEINTERACTIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO_V02 = 1, /**< Service interaction between ongoing NI and incoming MO sessions. */ + QMILOCNISERVICEINTERACTIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiServiceInteractionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiVxNotifyVerifyStructT_v02 niVxReq; + /**< Ongoing NI session request; this information is currently not filled. */ + + qmiLocNiServiceInteractionEnumT_v02 serviceInteractionType; + /**< Service interaction type specified in qmiLocNiServiceInteractionEnumT. + + Valid values: \n + - eQMI_LOC_NI_SERVICE_INTERACTION_ONGOING_NI_INCOMING_MO (1) -- Service interaction between ongoing NI and incoming MO sessions. + */ +}qmiLocNiVxServiceInteractionStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WLAN_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0001) /**< Denotes that WLAN measurements are allowed as part of location ID + and multiple location IDs in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_GSM_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0002) /**< Denotes that GSM measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WCDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0004) /**< Denotes that WCDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_CDMA_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0008) /**< Denotes that CDMA measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HRDP_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0010) /**< Denotes that HRDP measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_UMB_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0020) /**< Denotes that UMB measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_LTE_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0040) /**< Denotes that LTE measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_WIMAX_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0080) /**< Denotes that WIMAX measurements are allowed as part of location ID + and multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_HISTORIC_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0100) /**< Denotes that historical information is allowed as part of + multiple location ID in the SUPL_POS_INIT message. */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_SUPPORTED_NETWORK_NONSVRV_V02 ((qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02)0x0200) /**< Denotes that information about nonserving cells is allowed + as part of multiple location ID in the SUPL_POS_INIT message. */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT_V02 = -1, /**< SUPL INIT message indicates a request for a single shot + triggered session */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC_V02 = 0, /**< SUPL INIT message indicates a request for a periodic + triggered session */ + eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT_V02 = 1, /**< SUPL INIT message indicates a request for an area event + triggered session */ + QMILOCNISUPLVER2EXTTRIGGERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02; +/** + @} + */ + +typedef uint16_t qmiLocNiSuplVer2ExtGnssTypeMaskT_v02; +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0001) /**< GPS is allowed to be used as the positioning technology */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GLONASS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0002) /**< GLONASS is allowed to be used as the positioning technology */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_GALILEO_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0004) /**< Galileo is allowed to be used as the positioning technology */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_SBAS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0008) /**< SBAS is allowed to be used as the positioning technology */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_QZSS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0010) /**< QZSS is allowed to be used as the positioning technology */ +#define QMI_LOC_SUPL_VER_2_EXT_MASK_GNSS_MODERN_GPS_V02 ((qmiLocNiSuplVer2ExtGnssTypeMaskT_v02)0x0020) /**< Modern GPS is allowed to be used as the positioning technology */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocNiSuplVer2ExtSupportedNetworksMaskT_v02 supportedNetworksMask; + /**< Specifies which type of network measurements are allowed to be sent as + part of the Location ID or Multiple Location IDs parameter in the + SUPL_POS_INIT message (see \hyperref[S4]{[S4]}). + + Valid bitmasks: \begin{itemize1} + \item 0x0001 -- SUPPORTED_NETWORK_ WLAN + \item 0x0002 -- SUPPORTED_NETWORK_ GSM + \item 0x0004 -- SUPPORTED_NETWORK_ WCDMA + \item 0x0008 -- SUPPORTED_NETWORK_ CDMA + \item 0x0010 -- SUPPORTED_NETWORK_ HRDP + \item 0x0020 -- SUPPORTED_NETWORK_ UMB + \item 0x0040 -- SUPPORTED_NETWORK_ LTE + \item 0x0080 -- SUPPORTED_NETWORK_ WIMAX + \item 0x0100 -- SUPPORTED_NETWORK_ HISTORIC + \item 0x0200 -- SUPPORTED_NETWORK_ NONSVRV + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocNiSuplVer2ExtTriggerTypeEnumT_v02 triggerType; + /**< Specifies the type of session trigger requested in the + SUPL_POS_INIT message (refer to \hyperref[S4]{[S4]}). + + Valid values: \n + - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_SINGLE_SHOT (-1) -- SUPL INIT message indicates a request for a single shot + triggered session + - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_PERIODIC (0) -- SUPL INIT message indicates a request for a periodic + triggered session + - eQMI_LOC_SUPL_VER_2_EXT_TRIGGER_TYPE_AREA_EVENT (1) -- SUPL INIT message indicates a request for an area event + triggered session + */ + + qmiLocNiSuplVer2ExtGnssTypeMaskT_v02 gnssType; + /**< Specifies which GNSS technologies are allowed as positioning + technologies. + + Valid bitmasks: \n + - 0x0001 -- GNSS_GPS \n + - 0x0002 -- GNSS_GLONASS \n + - 0x0004 -- GNSS_GALILEO \n + - 0x0008 -- GNSS_SBAS \n + - 0x0010 -- GNSS_QZSS \n + - 0x0020 -- GNSS_MODERN_GPS + */ +}qmiLocNiSuplVer2ExtStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char eslpUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< ESLP URL. \n + Maximum length: 255 bytes */ +}qmiLocEmergencyNotificationStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Indicates an NI Notify/Verify request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \n + - eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY (1) -- No notification and no verification required + - eQMI_LOC_NI_USER_NOTIFY_ONLY (2) -- Notify only; no verification required + - eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP (3) -- Notify and verify, but no response required. + - eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP (4) -- Notify and verify, and require a response + - eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE (5) -- Notify and verify; privacy override + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxInd_valid; /**< Must be set to true if NiVxInd is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxInd; + /**< \vspace{0.06in} \n Optional NI Vx request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplInd_valid; /**< Must be set to true if NiSuplInd is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplInd; + /**< \vspace{0.06in} \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpInd_valid; /**< Must be set to true if NiUmtsCpInd is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpInd; + /**< \vspace{0.06in} \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionInd_valid; /**< Must be set to true if NiVxServiceInteractionInd is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionInd; + /**< \vspace{0.06in} \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtInd_valid; /**< Must be set to true if NiSuplVer2ExtInd is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtInd; + /**< \vspace{0.06in} \n Optional NI SUPL Version 2 Extension payload. When present, + this payload is to be used in conjunction with the SUPL + indication payload. */ + + /* Optional */ + /* SUPL Emergency Notification */ + uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ + qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; + /**< \vspace{0.06in} \n This specifies that the corresponding NI notification is an + emergency notification. Emergency notification + can be given even without an Emergency SUPL Location Platform (ESLP) + address. */ +}qmiLocEventNiNotifyVerifyReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char serverUrl[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< Assistance server URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocAssistanceServerUrlStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t delayThreshold; + /**< The time server is to be skipped if a one-way delay to the server + exceeds this threshold. \n + - Units: Milliseconds */ + + uint32_t timeServerList_len; /**< Must be set to # of elements in timeServerList */ + qmiLocAssistanceServerUrlStructT_v02 timeServerList[QMI_LOC_MAX_NTP_SERVERS_V02]; + /**< List of Time Server URL's that are recommended by the service for time + information, the list is ordered, the client is to use the first + server specified in the list as the primary URL to fetch NTP time, + the second one as secondary, and so on. \n + - Maximum server list items: 3 */ +}qmiLocTimeServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject time information. */ +typedef struct { + + /* Optional */ + /* Time Server Info */ + uint8_t timeServerInfo_valid; /**< Must be set to true if timeServerInfo is being passed */ + qmiLocTimeServerListStructT_v02 timeServerInfo; + /**< \vspace{0.06in} \n Contains information about the time servers recommended by the + location service for NTP time. */ +}qmiLocEventInjectTimeReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t maxFileSizeInBytes; + /**< Maximum allowable predicted orbits file size (in bytes). */ + + uint32_t maxPartSize; + /**< Maximum allowable predicted orbits file chunk size (in bytes). */ +}qmiLocPredictedOrbitsAllowedSizesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t serverList_len; /**< Must be set to # of elements in serverList */ + qmiLocAssistanceServerUrlStructT_v02 serverList[QMI_LOC_MAX_PREDICTED_ORBITS_SERVERS_V02]; + /**< List of predicted orbits URLs. The list is ordered, so the client + must use the first server specified in the list as the primary URL + from which to download predicted orbits data, the second one as + secondary, and so on. \n + - Maximum number of servers that can be specified: 3 */ +}qmiLocPredictedOrbitsServerListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Allowed Sizes */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \vspace{0.06in} \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \vspace{0.06in} \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to inject a position. */ +typedef struct { + + /* Mandatory */ + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Mandatory */ + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Mandatory */ + /* Circular Horizontal Uncertainty */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Mandatory */ + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEventInjectPositionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCENGINESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ENGINE_STATE_ON_V02 = 1, /**< Location engine is on */ + eQMI_LOC_ENGINE_STATE_OFF_V02 = 2, /**< Location engine is off */ + QMILOCENGINESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEngineStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the engine state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Engine State */ + qmiLocEngineStateEnumT_v02 engineState; + /**< Location engine state. + + Valid values: \n + - eQMI_LOC_ENGINE_STATE_ON (1) -- Location engine is on + - eQMI_LOC_ENGINE_STATE_OFF (2) -- Location engine is off + */ +}qmiLocEventEngineStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCFIXSESSIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_FIX_SESSION_STARTED_V02 = 1, /**< Location fix session has started */ + eQMI_LOC_FIX_SESSION_FINISHED_V02 = 2, /**< Location fix session has ended */ + QMILOCFIXSESSIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocFixSessionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the fix session state to the control point. */ +typedef struct { + + /* Mandatory */ + /* Session State */ + qmiLocFixSessionStateEnumT_v02 sessionState; + /**< LOC fix session state. + + Valid values: \n + - eQMI_LOC_FIX_SESSION_STARTED (1) -- Location fix session has started + - eQMI_LOC_FIX_SESSION_FINISHED (2) -- Location fix session has ended + */ + + /* Optional */ + /* Session ID */ + uint8_t sessionId_valid; /**< Must be set to true if sessionId is being passed */ + uint8_t sessionId; + /**< ID of the session that was specified in the Start request. + This may not be specified for a fix session corresponding to + a network-initiated request. \n + - Range: 0 to 255 */ +}qmiLocEventFixSessionStateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES_V02 = 0, /**< Start periodic fixes with high frequency */ + eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM_V02 = 1, /**< Keep warm for low frequency fixes without data downloads */ + eQMI_LOC_WIFI_STOP_PERIODIC_FIXES_V02 = 2, /**< Stop periodic fixes request */ + QMILOCWIFIREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a Wi-Fi request to the control point. */ +typedef struct { + + /* Mandatory */ + /* Request Type */ + qmiLocWifiRequestEnumT_v02 requestType; + /**< Request type. + + Valid values: \n + - eQMI_LOC_WIFI_START_PERIODIC_HI_FREQ_FIXES (0) -- Start periodic fixes with high frequency + - eQMI_LOC_WIFI_START_PERIODIC_KEEP_WARM (1) -- Keep warm for low frequency fixes without data downloads + - eQMI_LOC_WIFI_STOP_PERIODIC_FIXES (2) -- Stop periodic fixes request + */ + + /* Optional */ + /* Time Between Fixes */ + uint8_t tbfInMs_valid; /**< Must be set to true if tbfInMs is being passed */ + uint16_t tbfInMs; + /**< Time between fixes for a periodic request.\n + - Units: Milliseconds */ +}qmiLocEventWifiReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t samplesPerBatch; + /**< Specifies the number of samples per batch the GNSS location engine is to + receive. The sensor sampling frequency can be computed as follows: \vspace{-0.06in} \n + + samplingFrequency = samplesPerBatch * batchesPerSecond \vspace{-0.06in} \n + + samplesPerBatch must be a nonzero positive value. + */ + + uint16_t batchesPerSecond; + /**< Number of sensor-data batches the GNSS location engine is to receive + per second. The rate is specified in an integral number of batches per + second (Hz). \vspace{-0.06in} \n + + batchesPerSecond must be a nonzero positive value. + */ +}qmiLocSensorControlConfigSamplingSpecStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t injectEnable; + /**< Indicates whether the GNSS location engine is ready to accept data from this + sensor. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is ready to accept sensor + data + \item 0x00 (FALSE) -- GNSS location engine is not ready to accept + sensor data + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocSensorControlConfigSamplingSpecStructT_v02 dataFrequency; + /**< Rate at which the GNSS engine would like the sensor to be sampled. \n + The rate is specified in integral number of samples per second (Hz)\n + and batches per second. + */ +}qmiLocSensorReadyStatusStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point if the GNSS location engine is + ready to accept sensor data. */ +typedef struct { + + /* Optional */ + /* Accelerometer Accept Ready */ + uint8_t accelReady_valid; /**< Must be set to true if accelReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelReady; + /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready + to accept accelerometer sensor data. + */ + + /* Optional */ + /* Gyroscope Accept Ready */ + uint8_t gyroReady_valid; /**< Must be set to true if gyroReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroReady; + /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready + to accept gyroscope sensor data. + */ + + /* Optional */ + /* Accelerometer Temperature Accept Ready */ + uint8_t accelTemperatureReady_valid; /**< Must be set to true if accelTemperatureReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 accelTemperatureReady; + /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready + to accept accelerometer temperature data. + */ + + /* Optional */ + /* Gyroscope Temperature Accept Ready */ + uint8_t gyroTemperatureReady_valid; /**< Must be set to true if gyroTemperatureReady is being passed */ + qmiLocSensorReadyStatusStructT_v02 gyroTemperatureReady; + /**< \vspace{0.06in} \n Indicates whether the GNSS location engine is ready + to accept gyroscope temperature data. + */ +}qmiLocEventSensorStreamingReadyStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point to inject time synchronization + data. */ +typedef struct { + + /* Mandatory */ + /* Opaque Time Sync Reference Counter */ + uint32_t refCounter; + /**< This TLV is sent to registered control points. It is sent by + the location engine when it needs to synchronize location engine and + control point (sensor processor) times. + This TLV must be echoed back in the Time Sync Inject request. */ +}qmiLocEventTimeSyncReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the control point to enable Stationary Position + Indicator (SPI) streaming reports. */ +typedef struct { + + /* Mandatory */ + /* Enable/Disable SPI Requests */ + uint8_t enable; + /**< Indicates whether the client is to start or stop sending an SPI status stream. + \begin{itemize1} + \item 0x01 (TRUE) -- Client is to start sending an SPI status stream + \item 0x00 (FALSE) -- Client is to stop sending an SPI status stream + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocEventSetSpiStreamingReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWWANTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WWAN_TYPE_INTERNET_V02 = 0, /**< Bring up the WWAN type used for an Internet connection */ + eQMI_LOC_WWAN_TYPE_AGNSS_V02 = 1, /**< Bring up the WWAN type used for AGNSS connections */ + eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02 = 2, /**< Bring up the WWAN type used for AGNSS Emergency connections */ + QMILOCWWANTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWWANTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQUESTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQUEST_OPEN_V02 = 1, /**< Open a connection to the location server */ + eQMI_LOC_SERVER_REQUEST_CLOSE_V02 = 2, /**< Close a connection to the location server */ + QMILOCSERVERREQUESTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerRequestEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Requests the client to open or close a connection + to the assisted GPS location server. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Identifies a connection across Open and Close request events. */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Open or close a connection to the location server. + + Valid values: \n + - eQMI_LOC_SERVER_REQUEST_OPEN (1) -- Open a connection to the location server + - eQMI_LOC_SERVER_REQUEST_CLOSE (2) -- Close a connection to the location server + */ + + /* Mandatory */ + /* WWAN Type */ + qmiLocWWANTypeEnumT_v02 wwanType; + /**< Identifies the WWAN type for this request. + Valid values: \n + - eQMI_LOC_WWAN_TYPE_INTERNET (0) -- Bring up the WWAN type used for an Internet connection + - eQMI_LOC_WWAN_TYPE_AGNSS (1) -- Bring up the WWAN type used for AGNSS connections + - eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY (2) -- Bring up the WWAN type used for AGNSS Emergency connections + */ +}qmiLocEventLocationServerConnectionReqIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIGEOFENCEOPERATIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_GEOFENCE_ADDED_V02 = 1, /**< An NI Geofence was added */ + eQMI_LOC_NI_GEOFENCE_DELETED_V02 = 2, /**< An NI Geofence was deleted */ + eQMI_LOC_NI_GEOFENCE_EDITED_V02 = 3, /**< An NI Geofence was edited; the control point can query the + Geofence to find the its current state */ + QMILOCNIGEOFENCEOPERATIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiGeofenceOperationEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Informs the control point about + network-initiated Geofences. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Operation Type */ + qmiLocNiGeofenceOperationEnumT_v02 operationType; + /**< Operation for which this notification was generated. + + Valid values: \n + - eQMI_LOC_NI_GEOFENCE_ADDED (1) -- An NI Geofence was added + - eQMI_LOC_NI_GEOFENCE_DELETED (2) -- An NI Geofence was deleted + - eQMI_LOC_NI_GEOFENCE_EDITED (3) -- An NI Geofence was edited; the control point can query the + Geofence to find the its current state + */ +}qmiLocEventNiGeofenceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEGENALERTENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE_V02 = 1, /**< GNSS is unavailable and GNSS position fixes + cannot be used to monitor Geofences */ + eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE_V02 = 2, /**< GNSS is now available and GNSS postion fixes can + be used to monitor Geofences */ + eQMI_LOC_GEOFENCE_GEN_ALERT_OOS_V02 = 3, /**< The engine is out of service and no cell ID coverage + information is available */ + eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID_V02 = 4, /**< The engine has an invalid time */ + QMILOCGEOFENCEGENALERTENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceGenAlertEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of the + Geofence status. */ +typedef struct { + + /* Mandatory */ + /* Geofence General Alert */ + qmiLocGeofenceGenAlertEnumT_v02 geofenceAlert; + /**< Specifies the Geofence general alert type. + + Valid values: \n + - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_UNAVAILABLE (1) -- GNSS is unavailable and GNSS position fixes + cannot be used to monitor Geofences + - eQMI_LOC_GEOFENCE_GEN_ALERT_GNSS_AVAILABLE (2) -- GNSS is now available and GNSS postion fixes can + be used to monitor Geofences + - eQMI_LOC_GEOFENCE_GEN_ALERT_OOS (3) -- The engine is out of service and no cell ID coverage + information is available + - eQMI_LOC_GEOFENCE_GEN_ALERT_TIME_INVALID (4) -- The engine has an invalid time + */ +}qmiLocEventGeofenceGenAlertIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEBREACHTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING_V02 = 1, /**< Denotes that a client entered the Geofence */ + eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING_V02 = 2, /**< Denotes that a client left the Geofence */ + QMILOCGEOFENCEBREACHTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceBreachTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + /* UTC Timestamp */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Latitude */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Longitude */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Horizontal Elliptical Uncertainty (Semi-Minor Axis) */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Horizontal Elliptical Uncertainty (Semi-Major Axis) */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty.\n + - Units: Meters */ + + /* Elliptical Horizontal Uncertainty Azimuth */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation.\n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Horizontal Speed validity bit */ + uint8_t speedHorizontal_valid; + /**< Indicates whether the Horizontal speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Horizontal speed is valid + \item 0x00 (FALSE) -- Horizontal speed is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Horizontal Speed */ + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + /* Altitude validity bit */ + uint8_t altitudeWrtEllipsoid_valid; + /**< Indicates whether the altitude field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Altitude field is valid + \item 0x00 (FALSE) -- Altitude field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} + */ + + /* Altitude With Respect to Ellipsoid */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Vertical Uncertainty validity bit */ + uint8_t vertUnc_valid; + /**< Indicates whether the Vertical Uncertainty field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Uncertainty field is valid + \item 0x00 (FALSE) -- Vertical Uncertainty field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Uncertainty */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Vertical Speed validity bit */ + uint8_t speedVertical_valid; + /**< Indicates whether the Vertical Speed field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Vertical Speed field is valid + \item 0x00 (FALSE) -- Vertical Speed field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Vertical Speed */ + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + /* heading validity bit */ + uint8_t heading_valid; + /**< Indicates whether the Heading field contains valid + information. + \begin{itemize1} + \item 0x01 (TRUE) -- Heading field is valid + \item 0x00 (FALSE) -- Heading field is invalid + and is to be ignored + \vspace{-0.18in} \end{itemize1} */ + + /* Heading */ + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ +}qmiLocGeofencePositionStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCECONFIDENCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_CONFIDENCE_LOW_V02 = 0x01, /**< Geofence engine indicates a breach with + low confidence; this setting results in lower + power usage, and it can impact the yield because + incorrect breach events may be sent */ + eQMI_LOC_GEOFENCE_CONFIDENCE_MED_V02 = 0x02, /**< (Default) Geofence engine indicates a breach with + medium confidence */ + eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH_V02 = 0x03, /**< Geofence engine indicates a breach with + high confidence; this setting results in higher + power usage */ + QMILOCGEOFENCECONFIDENCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceConfidenceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of + a Geofence breach event. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< ID of the Geofence for which this + notification was generated. */ + + /* Mandatory */ + /* Geofence Breach Type */ + qmiLocGeofenceBreachTypeEnumT_v02 breachType; + /**< The type of breach that generated this event. + + Valid values: \n + - eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING (1) -- Denotes that a client entered the Geofence + - eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING (2) -- Denotes that a client left the Geofence + */ + + /* Optional */ + /* Geofence Position */ + uint8_t geofencePosition_valid; /**< Must be set to true if geofencePosition is being passed */ + qmiLocGeofencePositionStructT_v02 geofencePosition; + /**< \vspace{0.06in} \n Position of the client when it breached the Geofence. + This TLV is included if the client configures the + Geofence to report position. The position is reported + at the same confidence level that was specified in the + Add Circular Geofence request. */ + + /* Optional */ + /* Geofence Breach Confidence */ + uint8_t breachConfidence_valid; /**< Must be set to true if breachConfidence is being passed */ + qmiLocGeofenceConfidenceEnumT_v02 breachConfidence; + /**< \vspace{0.06in} \n + Given a breach event, the confidence determines the probability + that the breach happened at the Geofence boundary. + Valid values: \n + - eQMI_LOC_GEOFENCE_CONFIDENCE_LOW (0x01) -- Geofence engine indicates a breach with + low confidence; this setting results in lower + power usage, and it can impact the yield because + incorrect breach events may be sent + - eQMI_LOC_GEOFENCE_CONFIDENCE_MED (0x02) -- (Default) Geofence engine indicates a breach with + medium confidence + - eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH (0x03) -- Geofence engine indicates a breach with + high confidence; this setting results in higher + power usage + */ +}qmiLocEventGeofenceBreachIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Recommends how pedometer reports are to be + sent to the location engine. */ +typedef struct { + + /* Mandatory */ + /* Request Pedometer Data */ + uint8_t requestPedometerData; + /**< Indicates whether the GNSS location engine is requesting the client to + send pedometer data. + \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is requesting + pedometer data + \item 0x00 (FALSE) -- GNSS location engine is not requesting + pedometer data + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Reset Step Count */ + uint8_t resetStepCount_valid; /**< Must be set to true if resetStepCount is being passed */ + uint8_t resetStepCount; + /**< Indicates whether the location engine is to reset the step count. + \begin{itemize1} + \item 0x01 (TRUE) -- Pedometer step count is to be reset + \item 0x00 (FALSE) -- Pedometer step count is not to be reset + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Step Count Threshold */ + uint8_t stepCountThreshold_valid; /**< Must be set to true if stepCountThreshold is being passed */ + uint32_t stepCountThreshold; + /**< Specifies the number of steps to be sampled in a pedometer report, + as recommended by the the location engine. If the threshold is set to 0, + the location engine wants a pedometer report at every step event. + */ +}qmiLocEventPedometerControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Recommends how motion data reports are to be + sent to the location engine. */ +typedef struct { + + /* Mandatory */ + /* Request Motion Data */ + uint8_t requestMotionData; + /**< Indicates whether the GNSS location engine is requesting + the client to send motion data. + \begin{itemize1} + \item 0x01 (TRUE) -- GNSS location engine is requesting + motion data + \item 0x00 (FALSE) -- GNSS location engine is not requesting + motion data + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocEventMotionDataControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + /* Low Geofence ID */ + uint32_t idLow; + /**< Contains the starting ID of the Geofence in the range of the continuous + range of Geofences that were breached at the same position. */ + + /* High Geofence ID */ + uint32_t idHigh; + /**< Contains the ending ID of the Geofence in the range of the continuous + range of Geofences that were breached at the same position. */ +}qmiLocGeofenceIdContinuousStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of a Geofence breach event by + batching all the Geofences that were breached. */ +typedef struct { + + /* Mandatory */ + /* Geofence Breach Type */ + qmiLocGeofenceBreachTypeEnumT_v02 breachType; + /**< Type of breach that generated this event. + + Valid values: \n + - eQMI_LOC_GEOFENCE_BREACH_TYPE_ENTERING (1) -- Denotes that a client entered the Geofence + - eQMI_LOC_GEOFENCE_BREACH_TYPE_LEAVING (2) -- Denotes that a client left the Geofence + */ + + /* Optional */ + /* Geofence ID Continuous */ + 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]; + /**< \vspace{0.06in} \n Each entry in the list contains the continuous range of Geofence IDs that were breached + at the same position. This list does not overlap with the discrete Geofence ID list. */ + + /* Optional */ + /* Geofence ID Discrete */ + 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 breached at the same position. + 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; + /**< \vspace{0.06in} \n Position of the client when it breached the Geofence. + This TLV is included if the client configures the + Geofence to report its position. The position is reported + at the same confidence level that was specified in the + Add Circular Geofence request. */ + + /* Optional */ + /* Geofence Breach Confidence */ + uint8_t breachConfidence_valid; /**< Must be set to true if breachConfidence is being passed */ + qmiLocGeofenceConfidenceEnumT_v02 breachConfidence; + /**< \vspace{0.06in} \n + Given a breach event, the confidence determines the probability + that the breach happened at the Geofence boundary. + Valid values: \n + - eQMI_LOC_GEOFENCE_CONFIDENCE_LOW (0x01) -- Geofence engine indicates a breach with + low confidence; this setting results in lower + power usage, and it can impact the yield because + incorrect breach events may be sent + - eQMI_LOC_GEOFENCE_CONFIDENCE_MED (0x02) -- (Default) Geofence engine indicates a breach with + medium confidence + - eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH (0x03) -- Geofence engine indicates a breach with + high confidence; this setting results in higher + power usage + */ + + /* 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 */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* 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 */ + + /* 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 */ + + /* 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 */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + /**< \vspace{0.06in} \n Dilution of precision associated with this position. */ + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + 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 + */ +}qmiLocEventGeofenceBatchedBreachIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEPROXIMITYTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_PROXIMITY_TYPE_IN_V02 = 1, /**< Denotes that a client is in proximity of the geofence. */ + eQMI_LOC_GEOFENCE_PROXIMITY_TYPE_OUT_V02 = 2, /**< Denotes that a client is out of proximity of geofence. */ + QMILOCGEOFENCEPROXIMITYTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceProximityTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point of a Geofence proximity event. */ +typedef struct { + + /* Mandatory */ + /* Geofence Breach Type */ + qmiLocGeofenceProximityTypeEnumT_v02 proximityType; + /**< Valid values: \n + - eQMI_LOC_GEOFENCE_PROXIMITY_TYPE_IN (1) -- Denotes that a client is in proximity of the geofence. + - eQMI_LOC_GEOFENCE_PROXIMITY_TYPE_OUT (2) -- Denotes that a client is out of proximity of geofence. + */ + + /* Mandatory */ + /* Geofence Id */ + uint32_t geofenceId; + /**< The identifier of the geofence which is in proximity to the handset. \n + */ + + /* Optional */ + /* Geofence Context Id */ + uint8_t contextId_valid; /**< Must be set to true if contextId is being passed */ + uint32_t contextId; + /**< The identifier for the context of the geofence to wich the handset is in proximity. + A single geofence maybe associated with different contexts. \n + */ +}qmiLocEventGeofenceProximityIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUCCESS_V02 = 0, /**< Request was completed successfully */ + eQMI_LOC_GENERAL_FAILURE_V02 = 1, /**< Request failed because of a general failure */ + eQMI_LOC_UNSUPPORTED_V02 = 2, /**< Request failed because it is not supported */ + eQMI_LOC_INVALID_PARAMETER_V02 = 3, /**< Request failed because it contained invalid parameters */ + eQMI_LOC_ENGINE_BUSY_V02 = 4, /**< Request failed because the engine is busy */ + eQMI_LOC_PHONE_OFFLINE_V02 = 5, /**< Request failed because the phone is offline */ + eQMI_LOC_TIMEOUT_V02 = 6, /**< Request failed because it timed out */ + eQMI_LOC_CONFIG_NOT_SUPPORTED_V02 = 7, /**< Request failed because an undefined configuration was requested */ + eQMI_LOC_INSUFFICIENT_MEMORY_V02 = 8, /**< Request failed because the engine could not allocate sufficient memory for the request */ + eQMI_LOC_MAX_GEOFENCE_PROGRAMMED_V02 = 9, /**< Request failed because the maximum number of Geofences are already programmed */ + eQMI_LOC_XTRA_VERSION_CHECK_FAILURE_V02 = 10, /**< Location service failed because of an XTRA version-based file format check failure */ + QMILOCSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocStatusEnumT_v02; +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetServiceRevisionReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Client can query the service revision using this message. */ +typedef struct { + + /* Mandatory */ + /* Get Revision Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Revision request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Mandatory */ + /* Interface Definition Minor Revision */ + uint32_t revision; + /**< Revision of the service. This is the minor revision of the interface that + the service implements. Minor revision updates of the service are always + backward compatible. */ + + /* Optional */ + /* GNSS Measurement Engine Firmware Version String */ + uint8_t gnssMeFWVerString_valid; /**< Must be set to true if gnssMeFWVerString is being passed */ + char gnssMeFWVerString[QMI_LOC_GNSS_ME_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS measurement engine software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in} \end{itemize1} + + \textbf{Note:} This string is only provided on platforms that have + a measurement engine that supports this version string. On all other + platforms, this optional TLV is not provided. */ + + /* Optional */ + /* GNSS Hosted Software Version String */ + uint8_t gnssHostSWVerString_valid; /**< Must be set to true if gnssHostSWVerString is being passed */ + char gnssHostSWVerString[QMI_LOC_GNSS_HOSTED_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Version of the GNSS hosted software running under the LOC API. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 128 + \vspace{0.1in}\end{itemize1} + + \textbf{Note:} This string is only provided on hosted architectures + (measurement and position engine running on different processors) that + support this version string. On all other platforms, this optional TLV + is not provided. */ + + /* Optional */ + /* GNSS Software Version String */ + uint8_t gnssSWVerString_valid; /**< Must be set to true if gnssSWVerString is being passed */ + char gnssSWVerString[QMI_LOC_GNSS_SW_VERSION_STRING_MAX_LENGTH_V02 + 1]; + /**< Aggregate version of the GNSS software. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} */ +}qmiLocGetServiceRevisionIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetFixCriteriaReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the fix criteria from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Fix Criteria Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Fix Criteria request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Horizontal Accuracy */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Horizontal accuracy level. + + Valid values: \n + - eQMI_LOC_ACCURACY_LOW (1) -- Low accuracy + - eQMI_LOC_ACCURACY_MED (2) -- Medium accuracy + - eQMI_LOC_ACCURACY_HIGH (3) -- High accuracy + */ + + /* Optional */ + /* Enable/Disable Intermediate Fixes */ + uint8_t intermediateReportState_valid; /**< Must be set to true if intermediateReportState is being passed */ + qmiLocIntermediateReportStateEnumT_v02 intermediateReportState; + /**< Intermediate Report state (ON, OFF).\n + The client must explicitly set this field to OFF to stop receiving + intermediate position reports. Intermediate position reports are + generated at 1 Hz and are ON by default. If intermediate reports + are turned ON, the client receives position reports even if the + accuracy criteria is not met. The status in the position report is + set to IN_PROGRESS for intermediate reports. + + Valid values: \n + - eQMI_LOC_INTERMEDIATE_REPORTS_ON (1) -- Intermediate reports are turned on + - eQMI_LOC_INTERMEDIATE_REPORTS_OFF (2) -- Intermediate reports are turned off + */ + + /* Optional */ + /* Minimum Interval Between Fixes */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Time that must elapse before alerting the client. \n + - Units: Milliseconds */ + + /* Optional */ + /* ID of the Application that Sent the Position Request */ + uint8_t applicationId_valid; /**< Must be set to true if applicationId is being passed */ + qmiLocApplicationIdStructT_v02 applicationId; + /**< \vspace{0.06in} \n Application provider, name, and version.*/ +}qmiLocGetFixCriteriaIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCNIUSERRESPENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT_V02 = 1, /**< User accepted the Notify/Verify request */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY_V02 = 2, /**< User denied the Notify/Verify request */ + eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP_V02 = 3, /**< User did not respond to the Notify/Verify request */ + QMILOCNIUSERRESPENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocNiUserRespEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* User Response */ + qmiLocNiUserRespEnumT_v02 userResp; + /**< User accepted or denied. + + Valid values: \n + - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT (1) -- User accepted the Notify/Verify request + - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_DENY (2) -- User denied the Notify/Verify request + - eQMI_LOC_NI_LCS_NOTIFY_VERIFY_NORESP (3) -- User did not respond to the Notify/Verify request + */ + + /* Mandatory */ + /* Notification Type */ + qmiLocNiNotifyVerifyEnumT_v02 notificationType; + /**< Type of notification/verification performed. + + Valid values: \n + - eQMI_LOC_NI_USER_NO_NOTIFY_NO_VERIFY (1) -- No notification and no verification required + - eQMI_LOC_NI_USER_NOTIFY_ONLY (2) -- Notify only; no verification required + - eQMI_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP (3) -- Notify and verify, but no response required. + - eQMI_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP (4) -- Notify and verify, and require a response + - eQMI_LOC_NI_USER_NOTIFY_VERIFY_PRIVACY_OVERRIDE (5) -- Notify and verify; privacy override + */ + + /* Optional */ + /* Network Initiated Vx Request */ + uint8_t NiVxPayload_valid; /**< Must be set to true if NiVxPayload is being passed */ + qmiLocNiVxNotifyVerifyStructT_v02 NiVxPayload; + /**< \vspace{0.06in} \n Optional NI VX request payload. */ + + /* Optional */ + /* Network Initiated SUPL Request */ + uint8_t NiSuplPayload_valid; /**< Must be set to true if NiSuplPayload is being passed */ + qmiLocNiSuplNotifyVerifyStructT_v02 NiSuplPayload; + /**< \vspace{0.06in} \n Optional NI SUPL request payload. */ + + /* Optional */ + /* Network Initiated UMTS Control Plane Request */ + uint8_t NiUmtsCpPayload_valid; /**< Must be set to true if NiUmtsCpPayload is being passed */ + qmiLocNiUmtsCpNotifyVerifyStructT_v02 NiUmtsCpPayload; + /**< \vspace{0.06in} \n Optional NI UMTS-CP request payload. */ + + /* Optional */ + /* Network Initiated Service Interaction Request */ + uint8_t NiVxServiceInteractionPayload_valid; /**< Must be set to true if NiVxServiceInteractionPayload is being passed */ + qmiLocNiVxServiceInteractionStructT_v02 NiVxServiceInteractionPayload; + /**< \vspace{0.06in} \n Optional NI service interaction payload. */ + + /* Optional */ + /* Network Initiated SUPL Version 2 Extension */ + uint8_t NiSuplVer2ExtPayload_valid; /**< Must be set to true if NiSuplVer2ExtPayload is being passed */ + qmiLocNiSuplVer2ExtStructT_v02 NiSuplVer2ExtPayload; + /**< \vspace{0.06in} \n Optional SUPL Version 2 Extension payload. */ + + /* Optional */ + /* SUPL Emergency Notification */ + uint8_t suplEmergencyNotification_valid; /**< Must be set to true if suplEmergencyNotification is being passed */ + qmiLocEmergencyNotificationStructT_v02 suplEmergencyNotification; + /**< \vspace{0.06in} \n SUPL emergency notification payload. Emergency notification + can be given even without an ESLP address */ +}qmiLocNiUserRespReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends the NI user response back to the engine; success or + failure is reported in a separate indication. */ +typedef struct { + + /* Mandatory */ + /* NI User Response Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the NI User Response request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocNiUserRespIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PREDICTED_ORBITS_XTRA_V02 = 0, /**< Default is QCOM-XTRA format. */ + QMILOCPREDICTEDORBITSDATAFORMATENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPredictedOrbitsDataFormatEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Total Size */ + uint32_t totalSize; + /**< Total size of the predicted orbits data to be injected. \n + - Units: Bytes */ + + /* Mandatory */ + /* Total Parts */ + uint16_t totalParts; + /**< Total number of parts into which the predicted orbits data is + divided. */ + + /* Mandatory */ + /* Part Number */ + uint16_t partNum; + /**< Number of the current predicted orbits data part; starts at 1. */ + + /* Mandatory */ + /* Data */ + uint32_t partData_len; /**< Must be set to # of elements in partData */ + char partData[QMI_LOC_MAX_PREDICTED_ORBITS_PART_LEN_V02]; + /**< Predicted orbits data. \n + - Type: Array of bytes \n + - Maximum length of the array: 1024 + */ + + /* Optional */ + /* Format Type */ + uint8_t formatType_valid; /**< Must be set to true if formatType is being passed */ + qmiLocPredictedOrbitsDataFormatEnumT_v02 formatType; + /**< Predicted orbits data format. \n + Valid values: \n + - eQMI_LOC_PREDICTED_ORBITS_XTRA (0) -- Default is QCOM-XTRA format. + */ +}qmiLocInjectPredictedOrbitsDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects predicted orbits data. */ +typedef struct { + + /* Mandatory */ + /* Data Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Data Injection request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Part Number */ + uint8_t partNum_valid; /**< Must be set to true if partNum is being passed */ + uint16_t partNum; + /**< Number of the predicted orbits data part for which this indication + is sent; starts at 1. */ +}qmiLocInjectPredictedOrbitsDataIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetPredictedOrbitsDataSourceReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data source. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Source Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for a predicted orbits data source. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Allowed Sizes */ + uint8_t allowedSizes_valid; /**< Must be set to true if allowedSizes is being passed */ + qmiLocPredictedOrbitsAllowedSizesStructT_v02 allowedSizes; + /**< \n Maximum part and file size allowed to be injected in the engine. */ + + /* Optional */ + /* Server List */ + uint8_t serverList_valid; /**< Must be set to true if serverList is being passed */ + qmiLocPredictedOrbitsServerListStructT_v02 serverList; + /**< \n List of servers that can be used by the client to download + predicted orbits data. */ +}qmiLocGetPredictedOrbitsDataSourceIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetPredictedOrbitsDataValidityReqMsgT_v02; + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint64_t startTimeInUTC; + /**< Predicted orbits data is valid starting from this time. \n + - Units: Seconds (since Jan. 1, 1970) + */ + + uint16_t durationHours; + /**< Duration from the start time for which the data is valid.\n + - Units: Hours + */ +}qmiLocPredictedOrbitsDataValidityStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the predicted orbits data validity. */ +typedef struct { + + /* Mandatory */ + /* Predicted Orbits Data Validity Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the query request for predicted orbits data validity. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Validity Info */ + uint8_t validityInfo_valid; /**< Must be set to true if validityInfo is being passed */ + qmiLocPredictedOrbitsDataValidityStructT_v02 validityInfo; +}qmiLocGetPredictedOrbitsDataValidityIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time */ + uint64_t timeUtc; + /**< UTC time since Jan. 1, 1970.\n + - Units: Milliseconds */ + + /* Mandatory */ + /* Time Uncertainty */ + uint32_t timeUnc; + /**< Time uncertainty.\n + - Units: Milliseconds */ +}qmiLocInjectUtcTimeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects UTC time in the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Time Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Time Injection request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocInjectUtcTimeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_UNKNOWN_V02 = 0, /**< Source is unknown */ + eQMI_LOC_ALT_SRC_GPS_V02 = 1, /**< GPS is the source */ + eQMI_LOC_ALT_SRC_CELL_ID_V02 = 2, /**< Cell ID provided the source */ + eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID_V02 = 3, /**< Source is enhanced cell ID */ + eQMI_LOC_ALT_SRC_WIFI_V02 = 4, /**< Wi-Fi is the source */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_V02 = 5, /**< Terrestrial source */ + eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID_V02 = 6, /**< Hybrid terrestrial source */ + eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE_V02 = 7, /**< Altitude database is the source */ + eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER_V02 = 8, /**< Barometric altimeter is the source */ + eQMI_LOC_ALT_SRC_OTHER_V02 = 9, /**< Other sources */ + QMILOCALTSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCLINKAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED_V02 = 0, /**< Not specified */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT_V02 = 1, /**< Fully interdependent */ + eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG_V02 = 2, /**< Depends on latitude and longitude */ + eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT_V02 = 3, /**< Fully independent */ + QMILOCALTSRCLINKAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcLinkageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED_V02 = 0, /**< Not specified */ + eQMI_LOC_ALT_UNCERTAINTY_POINT_V02 = 1, /**< Altitude uncertainty is valid at the injected horizontal + position coordinates only */ + eQMI_LOC_ALT_UNCERTAINTY_FULL_V02 = 2, /**< Altitude uncertainty applies to the position of the device + regardless of horizontal position (within the horizontal + uncertainty region, if provided) */ + QMILOCALTSRCUNCERTAINTYCOVERAGEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocAltSrcUncertaintyCoverageEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocAltSrcEnumT_v02 source; + /**< Specifies the source of the altitude. + + Valid values: \n + - eQMI_LOC_ALT_SRC_UNKNOWN (0) -- Source is unknown + - eQMI_LOC_ALT_SRC_GPS (1) -- GPS is the source + - eQMI_LOC_ALT_SRC_CELL_ID (2) -- Cell ID provided the source + - eQMI_LOC_ALT_SRC_ENHANCED_CELL_ID (3) -- Source is enhanced cell ID + - eQMI_LOC_ALT_SRC_WIFI (4) -- Wi-Fi is the source + - eQMI_LOC_ALT_SRC_TERRESTRIAL (5) -- Terrestrial source + - eQMI_LOC_ALT_SRC_TERRESTRIAL_HYBRID (6) -- Hybrid terrestrial source + - eQMI_LOC_ALT_SRC_ALTITUDE_DATABASE (7) -- Altitude database is the source + - eQMI_LOC_ALT_SRC_BAROMETRIC_ALTIMETER (8) -- Barometric altimeter is the source + - eQMI_LOC_ALT_SRC_OTHER (9) -- Other sources + */ + + qmiLocAltSrcLinkageEnumT_v02 linkage; + /**< Specifies the dependency between the horizontal and + altitude position components. + + Valid values: \n + - eQMI_LOC_ALT_SRC_LINKAGE_NOT_SPECIFIED (0) -- Not specified + - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INTERDEPENDENT (1) -- Fully interdependent + - eQMI_LOC_ALT_SRC_LINKAGE_DEPENDS_ON_LAT_LONG (2) -- Depends on latitude and longitude + - eQMI_LOC_ALT_SRC_LINKAGE_FULLY_INDEPENDENT (3) -- Fully independent + */ + + qmiLocAltSrcUncertaintyCoverageEnumT_v02 coverage; + /**< Specifies the region of uncertainty. + + Valid values: \n + - eQMI_LOC_ALT_UNCERTAINTY_NOT_SPECIFIED (0) -- Not specified + - eQMI_LOC_ALT_UNCERTAINTY_POINT (1) -- Altitude uncertainty is valid at the injected horizontal + position coordinates only + - eQMI_LOC_ALT_UNCERTAINTY_FULL (2) -- Altitude uncertainty applies to the position of the device + regardless of horizontal position (within the horizontal + uncertainty region, if provided) + */ +}qmiLocAltitudeSrcInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPOSITIONSRCENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_POSITION_SRC_GNSS_V02 = 0, /**< Position source is GNSS */ + eQMI_LOC_POSITION_SRC_CELLID_V02 = 1, /**< Position source is Cell ID */ + eQMI_LOC_POSITION_SRC_ENH_CELLID_V02 = 2, /**< Position source is Enhanced Cell ID */ + eQMI_LOC_POSITION_SRC_WIFI_V02 = 3, /**< Position source is Wi-Fi */ + eQMI_LOC_POSITION_SRC_TERRESTRIAL_V02 = 4, /**< Position source is Terrestrial */ + eQMI_LOC_POSITION_SRC_GNSS_TERRESTRIAL_HYBRID_V02 = 5, /**< Position source is GNSS Terrestrial Hybrid */ + eQMI_LOC_POSITION_SRC_OTHER_V02 = 6, /**< Other sources */ + QMILOCPOSITIONSRCENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPositionSrcEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a position to the location engine. */ +typedef struct { + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} + */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} + */ + + /* Optional */ + /* Circular Horizontal Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Horizontal Confidence */ + uint8_t horConfidence_valid; /**< Must be set to true if horConfidence is being passed */ + uint8_t horConfidence; + /**< Horizontal confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (1 to 99) + \item 0, 101 to 255 -- invalid value + \item If 100 is received, reinterpret to 99 + \end{itemize1} + This field must be specified together with horizontal uncertainty. + If not specified when horUncCircular is set, the default value will be 50. */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - eQMI_LOC_RELIABILITY_NOT_SET (0) -- Location reliability is not set + - eQMI_LOC_RELIABILITY_VERY_LOW (1) -- Location reliability is very low; use it at your own risk + - eQMI_LOC_RELIABILITY_LOW (2) -- Location reliability is low; little or no cross-checking is possible + - eQMI_LOC_RELIABILITY_MEDIUM (3) -- Location reliability is medium; limited cross-check passed + - eQMI_LOC_RELIABILITY_HIGH (4) -- Location reliability is high; strong cross-check passed + */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid. + \begin{itemize1} + \item Units: Meters \begin{itemize1} + \item Positive = height + \item Negative = depth + \vspace{-0.18in} \end{itemize1} \end{itemize1}*/ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty. This is mandatory if either altitudeWrtEllipsoid + or altitudeWrtMeanSeaLevel is specified.\n + - Units: Meters */ + + /* Optional */ + /* Vertical Confidence */ + uint8_t vertConfidence_valid; /**< Must be set to true if vertConfidence is being passed */ + uint8_t vertConfidence; + /**< Vertical confidence, as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (0-99) + \item 0 -- invalid value + \item 100 to 256 -- not used + \item If 100 is received, reinterpret to 99 + \end{itemize1} + This field must be specified together with the vertical uncertainty. + If not specified, the default value will be 50. */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \n + - eQMI_LOC_RELIABILITY_NOT_SET (0) -- Location reliability is not set + - eQMI_LOC_RELIABILITY_VERY_LOW (1) -- Location reliability is very low; use it at your own risk + - eQMI_LOC_RELIABILITY_LOW (2) -- Location reliability is low; little or no cross-checking is possible + - eQMI_LOC_RELIABILITY_MEDIUM (3) -- Location reliability is medium; limited cross-check passed + - eQMI_LOC_RELIABILITY_HIGH (4) -- Location reliability is high; strong cross-check passed + */ + + /* Optional */ + /* Altitude Source Info */ + uint8_t altSourceInfo_valid; /**< Must be set to true if altSourceInfo is being passed */ + qmiLocAltitudeSrcInfoStructT_v02 altSourceInfo; + /**< \vspace{0.06in} \n Specifies information regarding the altitude source. */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds (since Jan. 1, 1970) */ + + /* Optional */ + /* Position Age */ + uint8_t timestampAge_valid; /**< Must be set to true if timestampAge is being passed */ + int32_t timestampAge; + /**< Position age, which is an estimate of how long ago this fix was made. \n + - Units: Milliseconds */ + + /* 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 + + If altitude is specified and the altitude source is not specified, the engine + assumes that the altitude was obtained using the specified position source. \n + If both altitude and altitude source are specified, the engine assumes + that only latitude and longitude were obtained using the specified position + source. + */ + + /* Optional */ + /* Raw Circular Horizontal Uncertainty */ + uint8_t rawHorUncCircular_valid; /**< Must be set to true if rawHorUncCircular is being passed */ + float rawHorUncCircular; + /**< Horizontal position uncertainty (circular) without any optimization.\n + - Units: Meters */ + + /* Optional */ + /* Raw Horizontal Confidence */ + uint8_t rawHorConfidence_valid; /**< Must be set to true if rawHorConfidence is being passed */ + uint8_t rawHorConfidence; + /**< Horizontal confidence associated with raw horizontal uncertainty, + as defined by ETSI TS 101 109 (\hyperref[S4]{[S4]}). + \begin{itemize1} + \item Units: Percent (1 to 99) + \item 0, 101 to 255 -- invalid value + \item If 100 is received, reinterpret to 99 + \end{itemize1} + This field must be specified together with raw horizontal uncertainty. + If not specified when rawHorUncCircular is set, the default value will be 50. */ +}qmiLocInjectPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a position to the location engine. */ +typedef struct { + + /* Mandatory */ + /* UTC Position Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the UTC Position Injection request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocInjectPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCLOCKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_LOCK_NONE_V02 = 1, /**< Do not lock any position sessions */ + eQMI_LOC_LOCK_MI_V02 = 2, /**< Lock mobile-initiated position sessions */ + eQMI_LOC_LOCK_MT_V02 = 3, /**< Lock mobile-terminated position sessions */ + eQMI_LOC_LOCK_ALL_V02 = 4, /**< Lock all position sessions */ + QMILOCLOCKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocLockEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Lock Type */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - eQMI_LOC_LOCK_NONE (1) -- Do not lock any position sessions + - eQMI_LOC_LOCK_MI (2) -- Lock mobile-initiated position sessions + - eQMI_LOC_LOCK_MT (3) -- Lock mobile-terminated position sessions + - eQMI_LOC_LOCK_ALL (4) -- Lock all position sessions + */ +}qmiLocSetEngineLockReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Set Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Engine Lock request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetEngineLockReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location engine lock. */ +typedef struct { + + /* Mandatory */ + /* Get Engine Lock Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Engine Lock request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Lock Type */ + uint8_t lockType_valid; /**< Must be set to true if lockType is being passed */ + qmiLocLockEnumT_v02 lockType; + /**< Type of lock. + + Valid values: \n + - eQMI_LOC_LOCK_NONE (1) -- Do not lock any position sessions + - eQMI_LOC_LOCK_MI (2) -- Lock mobile-initiated position sessions + - eQMI_LOC_LOCK_MT (3) -- Lock mobile-terminated position sessions + - eQMI_LOC_LOCK_ALL (4) -- Lock all position sessions + */ +}qmiLocGetEngineLockIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* SBAS Config */ + uint8_t sbasConfig; + /**< Indicates whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocSetSbasConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the SBAS configuration. */ +typedef struct { + + /* Mandatory */ + /* Set SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set SBAS Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetSbasConfigReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the SBAS configuration from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get SBAS Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get SBAS Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* SBAS Config */ + uint8_t sbasConfig_valid; /**< Must be set to true if sbasConfig is being passed */ + uint8_t sbasConfig; + /**< Indicates whether SBAS configuration is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SBAS configuration is enabled + \item 0x00 (FALSE) -- SBAS configuration is disabled + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocGetSbasConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocNmeaSentenceMaskT_v02; +#define QMI_LOC_NMEA_MASK_GGA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000001) /**< Enable GGA type */ +#define QMI_LOC_NMEA_MASK_RMC_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000002) /**< Enable RMC type */ +#define QMI_LOC_NMEA_MASK_GSV_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000004) /**< Enable GSV type */ +#define QMI_LOC_NMEA_MASK_GSA_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000008) /**< Enable GSA type */ +#define QMI_LOC_NMEA_MASK_VTG_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000010) /**< Enable VTG type */ +#define QMI_LOC_NMEA_MASK_PQXFI_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000020) /**< Enable PQXFI type */ +#define QMI_LOC_NMEA_MASK_PSTIS_V02 ((qmiLocNmeaSentenceMaskT_v02)0x00000040) /**< Enable PSTIS type */ +#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 */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* NMEA Sentence Types */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< Bitmasks of NMEA types to enable. + + Valid bitmasks: \n + - QMI_LOC_NMEA_MASK_GGA (0x00000001) -- Enable GGA type + - QMI_LOC_NMEA_MASK_RMC (0x00000002) -- Enable RMC type + - QMI_LOC_NMEA_MASK_GSV (0x00000004) -- Enable GSV type + - QMI_LOC_NMEA_MASK_GSA (0x00000008) -- Enable GSA type + - QMI_LOC_NMEA_MASK_VTG (0x00000010) -- Enable VTG type + - QMI_LOC_NMEA_MASK_PQXFI (0x00000020) -- Enable PQXFI type + - QMI_LOC_NMEA_MASK_PSTIS (0x00000040) -- Enable PSTIS type + - 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 + */ +}qmiLocSetNmeaTypesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the NMEA types. */ +typedef struct { + + /* Mandatory */ + /* Set NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of Set NMEA Types request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetNmeaTypesReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the NMEA types from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get NMEA Types Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NMEA Types request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* NMEA Sentence Types */ + uint8_t nmeaSentenceType_valid; /**< Must be set to true if nmeaSentenceType is being passed */ + qmiLocNmeaSentenceMaskT_v02 nmeaSentenceType; + /**< NMEA types to enable. + + Valid bitmasks: \n + - QMI_LOC_NMEA_MASK_GGA (0x00000001) -- Enable GGA type + - QMI_LOC_NMEA_MASK_RMC (0x00000002) -- Enable RMC type + - QMI_LOC_NMEA_MASK_GSV (0x00000004) -- Enable GSV type + - QMI_LOC_NMEA_MASK_GSA (0x00000008) -- Enable GSA type + - QMI_LOC_NMEA_MASK_VTG (0x00000010) -- Enable VTG type + - QMI_LOC_NMEA_MASK_PQXFI (0x00000020) -- Enable PQXFI type + - QMI_LOC_NMEA_MASK_PSTIS (0x00000040) -- Enable PSTIS type + - 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 + */ +}qmiLocGetNmeaTypesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Enable Low Power Mode */ + uint8_t lowPowerMode; + /**< Indicates whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocSetLowPowerModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables Low Power Mode (LPM) configuration. */ +typedef struct { + + /* Mandatory */ + /* Set LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Low Power Mode request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetLowPowerModeReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the LPM status from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get LPM Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get LPM request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Enable/Disable LPM */ + uint8_t lowPowerMode_valid; /**< Must be set to true if lowPowerMode is being passed */ + uint8_t lowPowerMode; + /**< Indicates whether to enable Low Power mode:\n + - 0x01 (TRUE) -- Enable LPM \n + - 0x00 (FALSE) -- Disable LPM */ +}qmiLocGetLowPowerModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_TYPE_CDMA_PDE_V02 = 1, /**< Server type is CDMA PDE */ + eQMI_LOC_SERVER_TYPE_CDMA_MPC_V02 = 2, /**< Server type is CDMA MPC */ + eQMI_LOC_SERVER_TYPE_UMTS_SLP_V02 = 3, /**< Server type is UMTS SLP */ + eQMI_LOC_SERVER_TYPE_CUSTOM_PDE_V02 = 4, /**< Server type is custom PDE */ + QMILOCSERVERTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server. + + Valid values: \n + - eQMI_LOC_SERVER_TYPE_CDMA_PDE (1) -- Server type is CDMA PDE + - eQMI_LOC_SERVER_TYPE_CDMA_MPC (2) -- Server type is CDMA MPC + - eQMI_LOC_SERVER_TYPE_UMTS_SLP (3) -- Server type is UMTS SLP + - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE (4) -- Server type is custom PDE + */ + + /* Optional */ + /* IPv4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \vspace{0.06in} \n IPv4 address and port. */ + + /* Optional */ + /* IPv6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \vspace{0.06in} \n IPv6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL address. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Specifies the A-GPS server type and address. */ +typedef struct { + + /* Mandatory */ + /* Set Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Server request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server. + + Valid values: \n + - eQMI_LOC_SERVER_TYPE_CDMA_PDE (1) -- Server type is CDMA PDE + - eQMI_LOC_SERVER_TYPE_CDMA_MPC (2) -- Server type is CDMA MPC + - eQMI_LOC_SERVER_TYPE_UMTS_SLP (3) -- Server type is UMTS SLP + - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE (4) -- Server type is custom PDE + */ + + /* Optional */ + /* Server Address Type */ + uint8_t serverAddrTypeMask_valid; /**< Must be set to true if serverAddrTypeMask is being passed */ + qmiLocServerAddrTypeMaskT_v02 serverAddrTypeMask; + /**< Type of address the client wants. If unspecified, the + indication will contain all the types of addresses + it has for the specified server type. + + Valid bitmasks: \n + - 0x01 -- IPv4 \n + - 0x02 -- IPv6 \n + - 0x04 -- URL + */ +}qmiLocGetServerReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the location server from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Server Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Server request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Mandatory */ + /* Server Type */ + qmiLocServerTypeEnumT_v02 serverType; + /**< Type of server. + + Valid values: \n + - eQMI_LOC_SERVER_TYPE_CDMA_PDE (1) -- Server type is CDMA PDE + - eQMI_LOC_SERVER_TYPE_CDMA_MPC (2) -- Server type is CDMA MPC + - eQMI_LOC_SERVER_TYPE_UMTS_SLP (3) -- Server type is UMTS SLP + - eQMI_LOC_SERVER_TYPE_CUSTOM_PDE (4) -- Server type is custom PDE + */ + + /* Optional */ + /* IPv4 Address */ + uint8_t ipv4Addr_valid; /**< Must be set to true if ipv4Addr is being passed */ + qmiLocIpV4AddrStructType_v02 ipv4Addr; + /**< \vspace{0.06in} \n IPv4 address and port. */ + + /* Optional */ + /* IPv6 Address */ + uint8_t ipv6Addr_valid; /**< Must be set to true if ipv6Addr is being passed */ + qmiLocIpV6AddrStructType_v02 ipv6Addr; + /**< \vspace{0.06in} \n IPv6 address and port. */ + + /* Optional */ + /* Uniform Resource Locator */ + uint8_t urlAddr_valid; /**< Must be set to true if urlAddr is being passed */ + char urlAddr[QMI_LOC_MAX_SERVER_ADDR_LENGTH_V02 + 1]; + /**< URL. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 256 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocGetServerIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocDeleteGnssDataMaskT_v02; +#define QMI_LOC_MASK_DELETE_GPS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000001ull) /**< Mask to delete GPS SVDIR */ +#define QMI_LOC_MASK_DELETE_GPS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000002ull) /**< Mask to delete GPS SVSTEER */ +#define QMI_LOC_MASK_DELETE_GPS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000004ull) /**< Mask to delete GPS time */ +#define QMI_LOC_MASK_DELETE_GPS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000008ull) /**< Mask to delete almanac correlation */ +#define QMI_LOC_MASK_DELETE_GLO_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000010ull) /**< Mask to delete GLONASS SVDIR */ +#define QMI_LOC_MASK_DELETE_GLO_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000020ull) /**< Mask to delete GLONASS SVSTEER */ +#define QMI_LOC_MASK_DELETE_GLO_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000040ull) /**< Mask to delete GLONASS time */ +#define QMI_LOC_MASK_DELETE_GLO_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000080ull) /**< Mask to delete GLONASS almanac correlation */ +#define QMI_LOC_MASK_DELETE_SBAS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000100ull) /**< Mask to delete SBAS SVDIR */ +#define QMI_LOC_MASK_DELETE_SBAS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000200ull) /**< Mask to delete SBAS SVSTEER */ +#define QMI_LOC_MASK_DELETE_POSITION_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000400ull) /**< Mask to delete position estimate */ +#define QMI_LOC_MASK_DELETE_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00000800ull) /**< Mask to delete time estimate */ +#define QMI_LOC_MASK_DELETE_IONO_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00001000ull) /**< Mask to delete IONO */ +#define QMI_LOC_MASK_DELETE_UTC_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00002000ull) /**< Mask to delete UTC estimate */ +#define QMI_LOC_MASK_DELETE_HEALTH_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00004000ull) /**< Mask to delete SV health record */ +#define QMI_LOC_MASK_DELETE_SADATA_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00008000ull) /**< Mask to delete SADATA */ +#define QMI_LOC_MASK_DELETE_RTI_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00010000ull) /**< Mask to delete RTI */ +#define QMI_LOC_MASK_DELETE_SV_NO_EXIST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00020000ull) /**< Mask to delete SV_NO_EXIST */ +#define QMI_LOC_MASK_DELETE_FREQ_BIAS_EST_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00040000ull) /**< Mask to delete frequency bias estimate */ +#define QMI_LOC_MASK_DELETE_BDS_SVDIR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00080000ull) /**< Mask to delete BDS SVDIR */ +#define QMI_LOC_MASK_DELETE_BDS_SVSTEER_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00100000ull) /**< Mask to delete BDS SVSTEER */ +#define QMI_LOC_MASK_DELETE_BDS_TIME_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00200000ull) /**< Mask to delete BDS time */ +#define QMI_LOC_MASK_DELETE_BDS_ALM_CORR_V02 ((qmiLocDeleteGnssDataMaskT_v02)0x00400000ull) /**< Mask to delete BDS almanac correlation */ +#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 */ +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 */ +#define QMI_LOC_MASK_DELETE_CELLDB_OTA_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000004) /**< Mask to delete cell database OTA position */ +#define QMI_LOC_MASK_DELETE_CELLDB_EXT_REF_POS_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000008) /**< Mask to delete cell database external reference position */ +#define QMI_LOC_MASK_DELETE_CELLDB_TIMETAG_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000010) /**< Mask to delete cell database time tag */ +#define QMI_LOC_MASK_DELETE_CELLDB_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000020) /**< Mask to delete cell database cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_CACHED_CELLID_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000040) /**< Mask to delete cell database cached cell ID */ +#define QMI_LOC_MASK_DELETE_CELLDB_LAST_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000080) /**< Mask to delete cell database last service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_CUR_SRV_CELL_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000100) /**< Mask to delete cell database current service cell */ +#define QMI_LOC_MASK_DELETE_CELLDB_NEIGHBOR_INFO_V02 ((qmiLocDeleteCelldbDataMaskT_v02)0x00000200) /**< Mask to delete cell database neighbor information */ +typedef uint32_t qmiLocDeleteClockInfoMaskT_v02; +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000001) /**< Mask to delete time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000002) /**< Mask to delete frequency estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000004) /**< Mask to delete week number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000008) /**< Mask to delete RTC time from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000010) /**< Mask to delete time transfer from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000020) /**< Mask to delete GPS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000040) /**< Mask to delete GLONASS time estimate from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000080) /**< Mask to delete GLONASS day number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000100) /**< Mask to delete GLONASS four year number from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000200) /**< Mask to delete GLONASS RF GRP delay from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000400) /**< Mask to delete disable TT from clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GG_LEAPSEC_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00000800) /**< Mask to delete a BDS time estimate from the clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GG_GGTB_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00001000) /**< Mask to delete a BDS time estimate from the clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_BDSTIME_EST_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00002000) /**< Mask to delete a BDS time estimate from the clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_GB_GBTB_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00004000) /**< Mask to delete Glonass-to-BDS time bias-related information from the + clock information */ +#define QMI_LOC_MASK_DELETE_CLOCK_INFO_BG_BGTB_V02 ((qmiLocDeleteClockInfoMaskT_v02)0x00008000) /**< Mask to delete BDS-to-GLONASS time bias-related information from the + 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 */ +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 */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< SV ID of the satellite whose data is to be deleted. + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \item For SBAS: 33 to 64 + \item For GLONASS: 65 to 96 + \vspace{-0.18in} \end{itemize1} \end{itemize1} */ + + qmiLocSvSystemEnumT_v02 system; + /**< Indicates to which constellation this SV belongs. + + Valid values: \n + - eQMI_LOC_SV_SYSTEM_GPS (1) -- GPS satellite + - eQMI_LOC_SV_SYSTEM_GALILEO (2) -- GALILEO satellite + - eQMI_LOC_SV_SYSTEM_SBAS (3) -- SBAS satellite + - eQMI_LOC_SV_SYSTEM_COMPASS (4) -- COMPASS satellite + - eQMI_LOC_SV_SYSTEM_GLONASS (5) -- GLONASS satellite + - eQMI_LOC_SV_SYSTEM_BDS (6) -- BDS satellite + */ + + qmiLocDeleteSvInfoMaskT_v02 deleteSvInfoMask; + /**< Indicates if the ephemeris or almanac for a satellite + is to be deleted. \n + Valid values: \n + - 0x01 -- DELETE_EPHEMERIS \n + - 0x02 -- DELETE_ALMANAC + */ +}qmiLocDeleteSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< SV ID of the satellite whose data is to be deleted. \n + Range for BDS: 201 to 237 */ + + 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 + */ +}qmiLocDeleteBDSSvInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete All */ + uint8_t deleteAllFlag; + /**< Indicates whether all assistance data is to be deleted. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- All assistance data is to be deleted; if + this flag is set, all the other information + contained in the optional fields for this + message are ignored + \item 0x00 (FALSE) -- The optional fields in the message are to be + used to determine which data is to be deleted + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Delete SV Info */ + uint8_t deleteSvInfoList_valid; /**< Must be set to true if deleteSvInfoList is being passed */ + uint32_t deleteSvInfoList_len; /**< Must be set to # of elements in deleteSvInfoList */ + qmiLocDeleteSvInfoStructT_v02 deleteSvInfoList[QMI_LOC_DELETE_MAX_SV_INFO_LENGTH_V02]; + /**< \vspace{0.06in} \n List of satellites for which the assistance data is to be deleted. + */ + + /* Optional */ + /* Delete GNSS Data */ + uint8_t deleteGnssDataMask_valid; /**< Must be set to true if deleteGnssDataMask is being passed */ + qmiLocDeleteGnssDataMaskT_v02 deleteGnssDataMask; + /**< Mask for the GNSS data that is to be deleted. + + Valid values: \n + - QMI_LOC_MASK_DELETE_GPS_SVDIR (0x00000001) -- Mask to delete GPS SVDIR + - QMI_LOC_MASK_DELETE_GPS_SVSTEER (0x00000002) -- Mask to delete GPS SVSTEER + - QMI_LOC_MASK_DELETE_GPS_TIME (0x00000004) -- Mask to delete GPS time + - QMI_LOC_MASK_DELETE_GPS_ALM_CORR (0x00000008) -- Mask to delete almanac correlation + - QMI_LOC_MASK_DELETE_GLO_SVDIR (0x00000010) -- Mask to delete GLONASS SVDIR + - QMI_LOC_MASK_DELETE_GLO_SVSTEER (0x00000020) -- Mask to delete GLONASS SVSTEER + - QMI_LOC_MASK_DELETE_GLO_TIME (0x00000040) -- Mask to delete GLONASS time + - QMI_LOC_MASK_DELETE_GLO_ALM_CORR (0x00000080) -- Mask to delete GLONASS almanac correlation + - QMI_LOC_MASK_DELETE_SBAS_SVDIR (0x00000100) -- Mask to delete SBAS SVDIR + - QMI_LOC_MASK_DELETE_SBAS_SVSTEER (0x00000200) -- Mask to delete SBAS SVSTEER + - QMI_LOC_MASK_DELETE_POSITION (0x00000400) -- Mask to delete position estimate + - QMI_LOC_MASK_DELETE_TIME (0x00000800) -- Mask to delete time estimate + - QMI_LOC_MASK_DELETE_IONO (0x00001000) -- Mask to delete IONO + - QMI_LOC_MASK_DELETE_UTC (0x00002000) -- Mask to delete UTC estimate + - QMI_LOC_MASK_DELETE_HEALTH (0x00004000) -- Mask to delete SV health record + - QMI_LOC_MASK_DELETE_SADATA (0x00008000) -- Mask to delete SADATA + - QMI_LOC_MASK_DELETE_RTI (0x00010000) -- Mask to delete RTI + - QMI_LOC_MASK_DELETE_SV_NO_EXIST (0x00020000) -- Mask to delete SV_NO_EXIST + - QMI_LOC_MASK_DELETE_FREQ_BIAS_EST (0x00040000) -- Mask to delete frequency bias estimate + - QMI_LOC_MASK_DELETE_BDS_SVDIR (0x00080000) -- Mask to delete BDS SVDIR + - QMI_LOC_MASK_DELETE_BDS_SVSTEER (0x00100000) -- Mask to delete BDS SVSTEER + - QMI_LOC_MASK_DELETE_BDS_TIME (0x00200000) -- Mask to delete BDS time + - QMI_LOC_MASK_DELETE_BDS_ALM_CORR (0x00400000) -- Mask to delete BDS almanac correlation + - 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 + */ + + /* Optional */ + /* Delete Cell Database */ + uint8_t deleteCellDbDataMask_valid; /**< Must be set to true if deleteCellDbDataMask is being passed */ + qmiLocDeleteCelldbDataMaskT_v02 deleteCellDbDataMask; + /**< Mask for the cell database assistance data that is to be deleted. + + Valid values: \begin{itemize1} + \item 0x00000001 -- DELETE_CELLDB_ POS + \item 0x00000002 -- DELETE_CELLDB_ LATEST_GPS_POS + \item 0x00000004 -- DELETE_CELLDB_ OTA_POS + \item 0x00000008 -- DELETE_CELLDB_ EXT_REF_POS + \item 0x00000010 -- DELETE_CELLDB_ TIMETAG + \item 0x00000020 -- DELETE_CELLDB_ CELLID + \item 0x00000040 -- DELETE_CELLDB_ CACHED_CELLID + \item 0x00000080 -- DELETE_CELLDB_ LAST_SRV_CELL + \item 0x00000100 -- DELETE_CELLDB_ CUR_SRV_CELL + \item 0x00000200 -- DELETE_CELLDB_ NEIGHBOR_INFO + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Delete Clock Info */ + uint8_t deleteClockInfoMask_valid; /**< Must be set to true if deleteClockInfoMask is being passed */ + qmiLocDeleteClockInfoMaskT_v02 deleteClockInfoMask; + /**< Mask for the clock information assistance data that is to be deleted. + + Valid bitmasks: \n + - QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_EST (0x00000001) -- Mask to delete time estimate from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_FREQ_EST (0x00000002) -- Mask to delete frequency estimate from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_WEEK_NUMBER (0x00000004) -- Mask to delete week number from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_RTC_TIME (0x00000008) -- Mask to delete RTC time from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_TIME_TRANSFER (0x00000010) -- Mask to delete time transfer from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GPSTIME_EST (0x00000020) -- Mask to delete GPS time estimate from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GLOTIME_EST (0x00000040) -- Mask to delete GLONASS time estimate from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GLODAY_NUMBER (0x00000080) -- Mask to delete GLONASS day number from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO4YEAR_NUMBER (0x00000100) -- Mask to delete GLONASS four year number from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GLO_RF_GRP_DELAY (0x00000200) -- Mask to delete GLONASS RF GRP delay from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_DISABLE_TT (0x00000400) -- Mask to delete disable TT from clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GG_LEAPSEC (0x00000800) -- Mask to delete a BDS time estimate from the clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GG_GGTB (0x00001000) -- Mask to delete a BDS time estimate from the clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_BDSTIME_EST (0x00002000) -- Mask to delete a BDS time estimate from the clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_GB_GBTB (0x00004000) -- Mask to delete Glonass-to-BDS time bias-related information from the + clock information + - QMI_LOC_MASK_DELETE_CLOCK_INFO_BG_BGTB (0x00008000) -- Mask to delete BDS-to-GLONASS time bias-related information from the + 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 + */ + + /* Optional */ + /* Delete BDS SV Info */ + uint8_t deleteBdsSvInfoList_valid; /**< Must be set to true if deleteBdsSvInfoList is being passed */ + uint32_t deleteBdsSvInfoList_len; /**< Must be set to # of elements in deleteBdsSvInfoList */ + 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. + */ +}qmiLocDeleteAssistDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; This command is used to delete the location engine + assistance data */ +typedef struct { + + /* Mandatory */ + /* Delete Assist Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Assist Data request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocDeleteAssistDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Enable XTRA-T */ + uint8_t xtraTSessionControl; + /**< Indicates whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocSetXtraTSessionControlReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Enables/disables XTRA-T session control. */ +typedef struct { + + /* Mandatory */ + /* Set XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set XTRA-T Session Control request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetXtraTSessionControlReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the XTRA-T session control value from the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Get XTRA-T Session Control Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get XTRA-T Session Control request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Enable/Disable XTRA-T */ + uint8_t xtraTSessionControl_valid; /**< Must be set to true if xtraTSessionControl is being passed */ + uint8_t xtraTSessionControl; + /**< Indicates whether to enable XTRA-T:\n + - 0x01 (TRUE) -- Enable XTRA-T \n + - 0x00 (FALSE) -- Disable XTRA-T */ +}qmiLocGetXtraTSessionControlIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t wifiPositionTime; + /**< Common counter (typically, the number of milliseconds since bootup). + This field is only to be provided if the modem and host processors are + synchronized. */ +}qmiLocWifiFixTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIFIXERRORCODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_FIX_ERROR_SUCCESS_V02 = 0, /**< Wi-Fi fix is successful. */ + eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE_V02 = 1, /**< Wi-Fi fix failed because Wi-Fi is not available on the device. */ + eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND_V02 = 2, /**< Wi-Fi fix failed because no access points were found. */ + eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED_V02 = 3, /**< Wi-Fi fix failed because the server denied access due to bad authorization + code. */ + eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE_V02 = 4, /**< Wi-Fi fix failed because the Wi-Fi server was unavailable. */ + eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED_V02 = 5, /**< Wi-Fi fix failed even though APs were found and the server could be reached. + This may be because the APs found are not in the database. */ + eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN_V02 = 6, /**< Wi-Fi fix failed, but the cause could not be determined. */ + QMILOCWIFIFIXERRORCODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiFixErrorCodeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double lat; + /**< Wi-Fi position latitude. \n + - Type: Floating point \n + - Units: Degrees */ + + double lon; + /**< Wi-Fi position longitude. \n + - Type: Floating point \n + - Units: Degrees */ + + uint16_t hepe; + /**< Wi-Fi position HEPE.\n + - Units: Meters */ + + uint8_t numApsUsed; + /**< Number of Access Points (AP) used to generate a fix. */ + + qmiLocWifiFixErrorCodeEnumT_v02 fixErrorCode; + /**< Wi-Fi position error code; set to 0 if the fix succeeds. This position + is only used by a module if the value is 0. If there was a failure, + the error code provided by the Wi-Fi positioning system can be provided + here. + + Valid values: \n + - eQMI_LOC_WIFI_FIX_ERROR_SUCCESS (0) -- Wi-Fi fix is successful. + - eQMI_LOC_WIFI_FIX_ERROR_WIFI_NOT_AVAILABLE (1) -- Wi-Fi fix failed because Wi-Fi is not available on the device. + - eQMI_LOC_WIFI_FIX_ERROR_NO_AP_FOUND (2) -- Wi-Fi fix failed because no access points were found. + - eQMI_LOC_WIFI_FIX_ERROR_UNAUTHORIZED (3) -- Wi-Fi fix failed because the server denied access due to bad authorization + code. + - eQMI_LOC_WIFI_FIX_ERROR_SERVER_UNAVAILABLE (4) -- Wi-Fi fix failed because the Wi-Fi server was unavailable. + - eQMI_LOC_WIFI_FIX_ERROR_LOCATION_CANNOT_BE_DETERMINED (5) -- Wi-Fi fix failed even though APs were found and the server could be reached. + This may be because the APs found are not in the database. + - eQMI_LOC_WIFI_FIX_ERROR_UNKNOWN (6) -- Wi-Fi fix failed, but the cause could not be determined. + */ +}qmiLocWifiFixPosStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocWifiApQualifierMaskT_v02; +#define QMI_LOC_WIFI_AP_QUALIFIER_BEING_USED_V02 ((qmiLocWifiApQualifierMaskT_v02)0x01) /**< Access point is being used by the WPS. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_HIDDEN_SSID_V02 ((qmiLocWifiApQualifierMaskT_v02)0x02) /**< AP does not broadcast SSID. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_PRIVATE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x04) /**< AP has encryption turned on. */ +#define QMI_LOC_WIFI_AP_QUALIFIER_INFRASTRUCTURE_MODE_V02 ((qmiLocWifiApQualifierMaskT_v02)0x08) /**< AP is in infrastructure mode and not in ad-hoc/unknown mode. */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t macAddr[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< Associated MAC address of the AP. \n + - Type: Array of unsigned integers \n + - Address length: 6 + */ + + int32_t rssi; + /**< Receive signal strength indicator.\n + - Units: dBm (offset with +100 dB) */ + + uint16_t channel; + /**< Wi-Fi channel on which a beacon was received. */ + + qmiLocWifiApQualifierMaskT_v02 apQualifier; + /**< A bitmask of Boolean qualifiers for APs. + All unused bits in this mask must be set to 0. + + Valid values: \n + - 0x01 -- BEING_USED \n + - 0x02 -- HIDDEN_SSID \n + - 0x04 -- PRIVATE \n + - 0x08 -- INFRASTRUCTURE_MODE + */ +}qmiLocWifiApInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char ssid[QMI_LOC_MAX_WIFI_AP_SSID_STR_LENGTH_V02 + 1]; + /**< The NULL terminated SSID string of the Wifi AP. Its max length according to the ASCII standard is 32 octets*/ +}qmiLocWifiApSsidStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the Wi-Fi position. */ +typedef struct { + + /* Optional */ + /* Wi-Fi Fix Time */ + uint8_t wifiFixTime_valid; /**< Must be set to true if wifiFixTime is being passed */ + qmiLocWifiFixTimeStructT_v02 wifiFixTime; + /**< \vspace{0.06in} \n Time of Wi-Fi position fix. */ + + /* Optional */ + /* Wi-Fi Position */ + uint8_t wifiFixPosition_valid; /**< Must be set to true if wifiFixPosition is being passed */ + qmiLocWifiFixPosStructT_v02 wifiFixPosition; + /**< \vspace{0.06in} \n Wi-Fi position fix. */ + + /* Optional */ + /* Wi-Fi Access Point Information */ + uint8_t apInfo_valid; /**< Must be set to true if apInfo is being passed */ + uint32_t apInfo_len; /**< Must be set to # of elements in apInfo */ + qmiLocWifiApInfoStructT_v02 apInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; + /**< \vspace{0.06in} \n AP scan list. + The SSID of the Wifi AP. + The ordering of Wifi AP SSID list should match with the Wifi AP MAC address list, if both are provided. + i.e the the first element of Wifi AP SSID list must be the SSID of the AP whose MAC + address is in the first element in the Wifi AP Info MAC Address and so on.*/ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horizontalReliability_valid; /**< Must be set to true if horizontalReliability is being passed */ + qmiLocReliabilityEnumT_v02 horizontalReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - eQMI_LOC_RELIABILITY_NOT_SET (0) -- Location reliability is not set + - eQMI_LOC_RELIABILITY_VERY_LOW (1) -- Location reliability is very low; use it at your own risk + - eQMI_LOC_RELIABILITY_LOW (2) -- Location reliability is low; little or no cross-checking is possible + - eQMI_LOC_RELIABILITY_MEDIUM (3) -- Location reliability is medium; limited cross-check passed + - eQMI_LOC_RELIABILITY_HIGH (4) -- Location reliability is high; strong cross-check passed + */ + + /* Optional */ + /* Raw Hepe */ + uint8_t rawHepe_valid; /**< Must be set to true if rawHepe is being passed */ + uint16_t rawHepe; + /**< Wi-Fi position raw HEPE, which has no optimization.\n + - Units: Meters */ + + /* Optional */ + /* Wifi AP SSID string */ + uint8_t wifiApSsidInfo_valid; /**< Must be set to true if wifiApSsidInfo is being passed */ + uint32_t wifiApSsidInfo_len; /**< Must be set to # of elements in wifiApSsidInfo */ + qmiLocWifiApSsidStructT_v02 wifiApSsidInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; + /**< The SSID of the Wifi AP. + The ordering of Wifi AP SSID list should match with the Wifi AP MAC address list, if both are provided. + i.e the the first element of Wifi AP SSID list must be the SSID of the AP whose MAC + address is in the first element in the Wifi AP Info MAC Address and so on.*/ +}qmiLocInjectWifiPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the Wi-Fi position. */ +typedef struct { + + /* Mandatory */ + /* Inject Wi-Fi Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Wi-Fi Position request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocInjectWifiPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFISTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_STATUS_AVAILABLE_V02 = 1, /**< Wi-Fi is available */ + eQMI_LOC_WIFI_STATUS_UNAVAILABLE_V02 = 2, /**< Wi-Fi is not available */ + QMILOCWIFISTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Notifies the location engine of the Wi-Fi status. */ +typedef struct { + + /* Mandatory */ + /* Availablility of Wi-Fi */ + qmiLocWifiStatusEnumT_v02 wifiStatus; + /**< Wi-Fi status information. + + Valid values: \n + - eQMI_LOC_WIFI_STATUS_AVAILABLE (1) -- Wi-Fi is available + - eQMI_LOC_WIFI_STATUS_UNAVAILABLE (2) -- Wi-Fi is not available + */ +}qmiLocNotifyWifiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the location engine of the Wi-Fi status. */ +typedef struct { + + /* Mandatory */ + /* Status of Notify Wi-Fi Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify Wi-Fi Status request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocNotifyWifiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetRegisteredEventsReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the mask of the events for which a client has + registered. */ +typedef struct { + + /* Mandatory */ + /* Get Registered Events Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Registered Events request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Event Registration Mask */ + uint8_t eventRegMask_valid; /**< Must be set to true if eventRegMask is being passed */ + qmiLocEventRegMaskT_v02 eventRegMask; + /**< Event registration mask. + Valid bitmasks: \n + - QMI_LOC_EVENT_MASK_POSITION_REPORT (0x00000001) -- The control point must enable this mask to receive position report + event indications. + - QMI_LOC_EVENT_MASK_GNSS_SV_INFO (0x00000002) -- The control point must enable this mask to receive satellite report + event indications. These reports are sent at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NMEA (0x00000004) -- The control point must enable this mask to receive NMEA reports for + position and satellites in view. The report is at a 1 Hz rate. + - QMI_LOC_EVENT_MASK_NI_NOTIFY_VERIFY_REQ (0x00000008) -- The control point must enable this mask to receive NI Notify/Verify request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_TIME_REQ (0x00000010) -- The control point must enable this mask to receive time injection request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_PREDICTED_ORBITS_REQ (0x00000020) -- The control point must enable this mask to receive predicted orbits request + event indications. + - QMI_LOC_EVENT_MASK_INJECT_POSITION_REQ (0x00000040) -- The control point must enable this mask to receive position injection request + event indications. + - QMI_LOC_EVENT_MASK_ENGINE_STATE (0x00000080) -- The control point must enable this mask to receive engine state report + event indications. + - QMI_LOC_EVENT_MASK_FIX_SESSION_STATE (0x00000100) -- The control point must enable this mask to receive fix session status report + event indications. + - QMI_LOC_EVENT_MASK_WIFI_REQ (0x00000200) -- The control point must enable this mask to receive Wi-Fi position request + event indications. + - QMI_LOC_EVENT_MASK_SENSOR_STREAMING_READY_STATUS (0x00000400) -- The control point must enable this mask to receive notifications from the + location engine indicating its readiness to accept data from the + sensors (accelerometer, gyroscope, etc.). + - QMI_LOC_EVENT_MASK_TIME_SYNC_REQ (0x00000800) -- The control point must enable this mask to receive time sync requests + from the GPS engine. Time sync enables the GPS engine to synchronize + its clock with the sensor processor's clock. + - QMI_LOC_EVENT_MASK_SET_SPI_STREAMING_REPORT (0x00001000) -- The control point must enable this mask to receive Stationary Position + Indicator (SPI) streaming report indications. + - QMI_LOC_EVENT_MASK_LOCATION_SERVER_CONNECTION_REQ (0x00002000) -- The control point must enable this mask to receive location server + requests. These requests are generated when the service wishes to + establish a connection with a location server. + - QMI_LOC_EVENT_MASK_NI_GEOFENCE_NOTIFICATION (0x00004000) -- The control point must enable this mask to receive notifications + related to network-initiated Geofences. These events notify the client + when a network-initiated Geofence is added, deleted, or edited. + - QMI_LOC_EVENT_MASK_GEOFENCE_GEN_ALERT (0x00008000) -- The control point must enable this mask to receive Geofence alerts. + These alerts are generated to inform the client of the changes that may + affect a Geofence, e.g., if GPS is turned off or if the network is + unavailable. + - QMI_LOC_EVENT_MASK_GEOFENCE_BREACH_NOTIFICATION (0x00010000) -- The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when a UE enters + or leaves the perimeter of a Geofence. This breach report is for a single + Geofence . + - QMI_LOC_EVENT_MASK_PEDOMETER_CONTROL (0x00020000) -- The control point must enable this mask to register for pedometer + control requests from the location engine. The location engine sends + this event to control the injection of pedometer reports. + - QMI_LOC_EVENT_MASK_MOTION_DATA_CONTROL (0x00040000) -- The control point must enable this mask to register for motion data + control requests from the location engine. The location engine sends + this event to control the injection of motion data. + - QMI_LOC_EVENT_MASK_BATCH_FULL_NOTIFICATION (0x00080000) -- The control point must enable this mask to receive notification when + a batch is full. The location engine sends this event to notify of Batch Full + for ongoing batching session. + - QMI_LOC_EVENT_MASK_LIVE_BATCHED_POSITION_REPORT (0x00100000) -- The control point must enable this mask to receive position report + indications along with an ongoing batching session. The location engine sends + this event to notify the batched position report while a batching session + is ongoing. + - QMI_LOC_EVENT_MASK_INJECT_WIFI_AP_DATA_REQ (0x00200000) -- The control point must enable this mask to receive Wi-Fi AP data inject request + event indications. + - QMI_LOC_EVENT_MASK_GEOFENCE_BATCH_BREACH_NOTIFICATION (0x00400000) -- The control point must enable this mask to receive notifications when + a Geofence is breached. These events are generated when a UE enters + or leaves the perimeter of a Geofence. This breach notification is for + multiple Geofences. Breaches from multiple Geofences are all batched and + sent in the same notification . + - QMI_LOC_EVENT_MASK_VEHICLE_DATA_READY_STATUS (0x00800000) -- The control point must enable this mask to receive notifications from the + location engine indicating its readiness to accept vehicle data (vehicle + accelerometer, vehicle angular rate, vehicle odometry, etc.). + - QMI_LOC_EVENT_MASK_GNSS_MEASUREMENT_REPORT (0x01000000) -- The control point must enable this mask to receive system clock & satellite + measurement report events( system clock, SV time, doppler etc.). Reports are + generated for only the GNSS satellite constellations which are enabled using + QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG + - QMI_LOC_EVENT_MASK_GNSS_SV_POLYNOMIAL_REPORT (0x02000000) -- The control point must enable this mask to receive satellite position + reports as polynomial. Reports are generated for only the GNSS satellite + constellations which are enabled using QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG + - QMI_LOC_EVENT_MASK_GEOFENCE_PROXIMITY_NOTIFICATION (0x04000000) -- The control point must enable this mask to receive notifications when a Geofence proximity is entered + and exited. The proximity of a geofence may be due to different contexts . These contexts are identified + using the context id in this indication. The context of a geofence may contain Wifi area ID lists, IBeacon lists, + Cell-Id list etc. + */ +}qmiLocGetRegisteredEventsIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCOPERATIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_OPER_MODE_DEFAULT_V02 = 1, /**< Use the default engine mode */ + eQMI_LOC_OPER_MODE_MSB_V02 = 2, /**< Use the MS-based mode */ + eQMI_LOC_OPER_MODE_MSA_V02 = 3, /**< Use the MS-assisted mode */ + eQMI_LOC_OPER_MODE_STANDALONE_V02 = 4, /**< Use Standalone mode */ + eQMI_LOC_OPER_MODE_CELL_ID_V02 = 5, /**< Use cell ID; this mode is only valid for GSM/UMTS networks */ + eQMI_LOC_OPER_MODE_WWAN_V02 = 6, /**< Use WWAN measurements to calculate the position; if this mode is + set, AFLT will be used for 1X networks and OTDOA will be used + for LTE networks */ + QMILOCOPERATIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocOperationModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Tells the engine to use the specified operation mode while + making the position fixes. */ +typedef struct { + + /* Mandatory */ + /* Operation Mode */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Preferred operation mode. + + Valid values: \n + - eQMI_LOC_OPER_MODE_DEFAULT (1) -- Use the default engine mode + - eQMI_LOC_OPER_MODE_MSB (2) -- Use the MS-based mode + - eQMI_LOC_OPER_MODE_MSA (3) -- Use the MS-assisted mode + - eQMI_LOC_OPER_MODE_STANDALONE (4) -- Use Standalone mode + - eQMI_LOC_OPER_MODE_CELL_ID (5) -- Use cell ID; this mode is only valid for GSM/UMTS networks + - eQMI_LOC_OPER_MODE_WWAN (6) -- Use WWAN measurements to calculate the position; if this mode is + set, AFLT will be used for 1X networks and OTDOA will be used + for LTE networks + */ +}qmiLocSetOperationModeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Tells the engine to use the specified operation mode while + making the position fixes. */ +typedef struct { + + /* Mandatory */ + /* Set Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Operation Mode request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetOperationModeReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Gets the current operation mode from the engine. */ +typedef struct { + + /* Mandatory */ + /* Get Operation Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Operation Mode request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Operation Mode */ + uint8_t operationMode_valid; /**< Must be set to true if operationMode is being passed */ + qmiLocOperationModeEnumT_v02 operationMode; + /**< Current operation mode. + + Valid values: \n + - eQMI_LOC_OPER_MODE_DEFAULT (1) -- Use the default engine mode + - eQMI_LOC_OPER_MODE_MSB (2) -- Use the MS-based mode + - eQMI_LOC_OPER_MODE_MSA (3) -- Use the MS-assisted mode + - eQMI_LOC_OPER_MODE_STANDALONE (4) -- Use Standalone mode + - eQMI_LOC_OPER_MODE_CELL_ID (5) -- Use cell ID; this mode is only valid for GSM/UMTS networks + - eQMI_LOC_OPER_MODE_WWAN (6) -- Use WWAN measurements to calculate the position; if this mode is + set, AFLT will be used for 1X networks and OTDOA will be used + for LTE networks + */ +}qmiLocGetOperationModeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Stationary Status */ + uint8_t stationary; + /**< Indicates whether the device is stationary: + \begin{itemize1} + \item 0x00 (FALSE) -- Device is not stationary + \item 0x01 (TRUE) -- Device is stationary + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Confidence */ + uint8_t confidenceStationary_valid; /**< Must be set to true if confidenceStationary is being passed */ + uint8_t confidenceStationary; + /**< Confidence in the Stationary state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocSetSpiStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the SPI status, which + indicates whether the device is stationary. */ +typedef struct { + + /* Mandatory */ + /* Status of SPI Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the SPI Status request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetSpiStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocSensorDataFlagMaskT_v02; +#define QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL_V02 ((qmiLocSensorDataFlagMaskT_v02)0x01) /**< Bitmask to specify that a sign reversal is required while interpreting + the sensor data; only applies to the accelerometer samples */ +#define QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME_V02 ((qmiLocSensorDataFlagMaskT_v02)0x02) /**< Bitmask to specify that the sensor time stamp is the same as the modem + time stamp */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORDATATIMESOURCEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED_V02 = 0, /**< Sensor time source is unspecified */ + eQMI_LOC_SENSOR_TIME_SOURCE_COMMON_V02 = 1, /**< Time source is common between the sensors and + the location engine */ + QMILOCSENSORDATATIMESOURCEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorDataTimeSourceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor data sample.\n + - Units: Milliseconds */ + + float xAxis; + /**< Sensor x-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ + + float yAxis; + /**< Sensor y-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ + + float zAxis; + /**< Sensor z-axis sample. \n + - Units Accelerometer: ( (meters)/(seconds^2) ) \n + - Units Gyroscope: ( (rads)/(seconds) ) */ +}qmiLoc3AxisSensorSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message.The timestamp is in the time reference scale that is + used by the sensor time source.\n + - Units: Milliseconds */ + + qmiLocSensorDataFlagMaskT_v02 flags; + /**< Flags to indicate any deviation from the default measurement + assumptions. All unused bits in this field must be set to 0. + + Valid bitmasks: + - QMI_LOC_SENSOR_DATA_FLAG_SIGN_REVERSAL (0x01) -- Bitmask to specify that a sign reversal is required while interpreting + the sensor data; only applies to the accelerometer samples + - QMI_LOC_SENSOR_DATA_FLAG_SENSOR_TIME_IS_MODEM_TIME (0x02) -- Bitmask to specify that the sensor time stamp is the same as the modem + time stamp */ + + uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ + qmiLoc3AxisSensorSampleStructT_v02 sensorData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor samples. \n + - Maximum length of the array: 50 */ +}qmiLoc3AxisSensorSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the timestamp of the first sensor sample.\n + - Units: Milliseconds */ + + float temperature; + /**< Sensor temperature. \n + - Type: Floating point \n + - Units: Degrees Celsius \n + - Range: -50 to +100.00 */ +}qmiLocSensorTemperatureSampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSensorDataTimeSourceEnumT_v02 timeSource; + /**< Denotes the time source of the sensor data. Location service will use + this field to identify the time reference used in the + sensor data timestamps. + + Valid values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- Sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- Time source is common between the sensors and + the location engine + */ + + uint32_t timeOfFirstSample; + /**< Denotes a full 32-bit timestamp of the first (oldest) sample in this + message. The timestamp is in the time reference scale that is + used by the sensor time source.\n + - Units: Milliseconds */ + + uint32_t temperatureData_len; /**< Must be set to # of elements in temperatureData */ + qmiLocSensorTemperatureSampleStructT_v02 temperatureData[QMI_LOC_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify sensor temperature samples. \n + - Maximum length of the array: 50 */ +}qmiLocSensorTemperatureSampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< An opaque identifier that is sent in by the client that will be echoed + in the indication so the client can relate the indication to the + request. */ + + /* Optional */ + /* 3-Axis Accelerometer Data */ + uint8_t threeAxisAccelData_valid; /**< Must be set to true if threeAxisAccelData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisAccelData; + /**< \vspace{0.06in} \n Accelerometer sensor samples. */ + + /* Optional */ + /* 3-Axis Gyroscope Data */ + uint8_t threeAxisGyroData_valid; /**< Must be set to true if threeAxisGyroData is being passed */ + qmiLoc3AxisSensorSampleListStructT_v02 threeAxisGyroData; + /**< \vspace{0.06in} \n Gyroscope sensor samples. */ + + /* Optional */ + /* 3-Axis Accelerometer Data Time Source */ + uint8_t threeAxisAccelDataTimeSource_valid; /**< Must be set to true if threeAxisAccelDataTimeSource is being passed */ + qmiLocSensorDataTimeSourceEnumT_v02 threeAxisAccelDataTimeSource; + /**< Time source for the 3-axis accelerometer data. The location service uses + this field to identify the time reference used in the accelerometer data + timestamps. If not specified, the location service assumes that the + time source for the accelereometer data is unknown. \n + Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- Sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- Time source is common between the sensors and + the location engine + */ + + /* Optional */ + /* 3-Axis Gyroscope Data Time Source */ + uint8_t threeAxisGyroDataTimeSource_valid; /**< Must be set to true if threeAxisGyroDataTimeSource is being passed */ + qmiLocSensorDataTimeSourceEnumT_v02 threeAxisGyroDataTimeSource; + /**< Time source for the 3-axis gyroscope data. The location service uses + this field to identify the time reference used in the gyroscope data + timestamps. If not specified, the location service assumes that the + time source for the gyroscope data is unknown. \n + Values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- Sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- Time source is common between the sensors and + the location engine + */ + + /* Optional */ + /* Accelerometer Temperature Data */ + uint8_t accelTemperatureData_valid; /**< Must be set to true if accelTemperatureData is being passed */ + qmiLocSensorTemperatureSampleListStructT_v02 accelTemperatureData; + /**< \vspace{0.06in} \nAccelerometer temperature samples. This data is optional and does not + have to be included in the message along with accelerometer data. */ + + /* Optional */ + /* Gyroscope Temperature Data */ + uint8_t gyroTemperatureData_valid; /**< Must be set to true if gyroTemperatureData is being passed */ + qmiLocSensorTemperatureSampleListStructT_v02 gyroTemperatureData; + /**< \vspace{0.06in} \n Gyroscope temperature samples. This data is optional and does not + have to be included in the message along with gyroscope data. */ +}qmiLocInjectSensorDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject sensor data into the + GNSS location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Sensor Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Sensor Data request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Opaque Identifier */ + uint8_t opaqueIdentifier_valid; /**< Must be set to true if opaqueIdentifier is being passed */ + uint32_t opaqueIdentifier; + /**< Opaque identifier that was sent in by the client echoed + so the client can relate the indication to the request. */ + + /* Optional */ + /* Accelerometer Samples Accepted */ + uint8_t threeAxisAccelSamplesAccepted_valid; /**< Must be set to true if threeAxisAccelSamplesAccepted is being passed */ + uint8_t threeAxisAccelSamplesAccepted; + /**< Lets the client know how many 3-axis accelerometer samples + were accepted. This field is present only if the accelerometer + samples were sent in the request. */ + + /* Optional */ + /* Gyroscope Samples Accepted */ + uint8_t threeAxisGyroSamplesAccepted_valid; /**< Must be set to true if threeAxisGyroSamplesAccepted is being passed */ + uint8_t threeAxisGyroSamplesAccepted; + /**< Lets the client know how many 3-axis gyroscope samples were + accepted. This field is present only if the gyroscope + samples were sent in the request. */ + + /* Optional */ + /* Accelerometer Temperature Samples Accepted */ + uint8_t accelTemperatureSamplesAccepted_valid; /**< Must be set to true if accelTemperatureSamplesAccepted is being passed */ + uint8_t accelTemperatureSamplesAccepted; + /**< Lets the client know how many accelerometer temperature + samples were accepted. This field is present only if the accelerometer + temperature samples were sent in the request. */ + + /* Optional */ + /* Gyroscope Temperature Samples Accepted */ + uint8_t gyroTemperatureSamplesAccepted_valid; /**< Must be set to true if gyroTemperatureSamplesAccepted is being passed */ + uint8_t gyroTemperatureSamplesAccepted; + /**< Lets the client know how many gyroscope temperature samples + were accepted. This field is present only if the gyroscope + temperature samples were sent in the request. */ +}qmiLocInjectSensorDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Reference Time Sync Counter */ + uint32_t refCounter; + /**< Must be set to the value that was sent to the control point when the + GNSS location engine requested time sync injection. */ + + /* Mandatory */ + /* Sensor Receive Time */ + uint32_t sensorProcRxTime; + /**< Value of the sensor time when the control point received the + Time Sync Inject request from the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Units: Milliseconds */ + + /* Mandatory */ + /* Sensor Transmit Time */ + uint32_t sensorProcTxTime; + /**< Value of the sensor time when the control point injects this message + for use by the GNSS location engine. + + Must be monotonically increasing, jitter @latexonly $\leq$ @endlatexonly 1 + millisecond, never stopping until the process is rebooted.\n + - Units: Milliseconds */ +}qmiLocInjectTimeSyncDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject time sync data. */ +typedef struct { + + /* Mandatory */ + /* Inject Time Sync Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Time Sync Data request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocInjectTimeSyncDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCCRADLEMOUNTSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_CRADLE_STATE_NOT_MOUNTED_V02 = 0, /**< Device is mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_MOUNTED_V02 = 1, /**< Device is not mounted on the cradle */ + eQMI_LOC_CRADLE_STATE_UNKNOWN_V02 = 2, /**< Unknown cradle mount state */ + QMILOCCRADLEMOUNTSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocCradleMountStateEnumT_v02; +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetCradleMountConfigReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Cradle Mount Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Cradle Mount State */ + uint8_t cradleMountState_valid; /**< Must be set to true if cradleMountState is being passed */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \n + - eQMI_LOC_CRADLE_STATE_NOT_MOUNTED (0) -- Device is mounted on the cradle + - eQMI_LOC_CRADLE_STATE_MOUNTED (1) -- Device is not mounted on the cradle + - eQMI_LOC_CRADLE_STATE_UNKNOWN (2) -- Unknown cradle mount state + */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence of the Cradle Mount state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocGetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Cradle Mount State */ + qmiLocCradleMountStateEnumT_v02 cradleMountState; + /**< Cradle Mount state set by the control point. + + Valid values: \n + - eQMI_LOC_CRADLE_STATE_NOT_MOUNTED (0) -- Device is mounted on the cradle + - eQMI_LOC_CRADLE_STATE_MOUNTED (1) -- Device is not mounted on the cradle + - eQMI_LOC_CRADLE_STATE_UNKNOWN (2) -- Unknown cradle mount state + */ + + /* Optional */ + /* Cradle Mount Confidence */ + uint8_t confidenceCradleMountState_valid; /**< Must be set to true if confidenceCradleMountState is being passed */ + uint8_t confidenceCradleMountState; + /**< Confidence in the Cradle Mount state expressed as a percentage.\n + - Range: 0 to 100 */ +}qmiLocSetCradleMountConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + cradle mount configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Cradle Mount Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Cradle Mount Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetCradleMountConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEXTERNALPOWERCONFIGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED_V02 = 0, /**< Device is not connected to an external power source */ + eQMI_LOC_EXTERNAL_POWER_CONNECTED_V02 = 1, /**< Device is connected to an external power source */ + eQMI_LOC_EXTERNAL_POWER_UNKNOWN_V02 = 2, /**< Unknown external power state */ + QMILOCEXTERNALPOWERCONFIGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocExternalPowerConfigEnumT_v02; +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetExternalPowerConfigReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get External Power Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* External Power State */ + uint8_t externalPowerState_valid; /**< Must be set to true if externalPowerState is being passed */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \n + - eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED (0) -- Device is not connected to an external power source + - eQMI_LOC_EXTERNAL_POWER_CONNECTED (1) -- Device is connected to an external power source + - eQMI_LOC_EXTERNAL_POWER_UNKNOWN (2) -- Unknown external power state + */ +}qmiLocGetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* External Power State */ + qmiLocExternalPowerConfigEnumT_v02 externalPowerState; + /**< Power state; injected by the control point. + + Valid values: \n + - eQMI_LOC_EXTERNAL_POWER_NOT_CONNECTED (0) -- Device is not connected to an external power source + - eQMI_LOC_EXTERNAL_POWER_CONNECTED (1) -- Device is connected to an external power source + - eQMI_LOC_EXTERNAL_POWER_UNKNOWN (2) -- Unknown external power state + */ +}qmiLocSetExternalPowerConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the current + external power configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Ext Power Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set External Power Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetExternalPowerConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERPDNENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02 = 0x01, /**< IPv4 PDN type */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6_V02 = 0x02, /**< IPv6 PDN type */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6_V02 = 0x03, /**< IPv4v6 PDN type */ + eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP_V02 = 0x04, /**< PPP PDN type */ + QMILOCSERVERPDNENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerPDNEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocServerPDNEnumT_v02 pdnType; + /**< PDN type of the APN profile. + + Valid values: \n + - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4 (0x01) -- IPv4 PDN type + - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV6 (0x02) -- IPv6 PDN type + - eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4V6 (0x03) -- IPv4v6 PDN type + - eQMI_LOC_APN_PROFILE_PDN_TYPE_PPP (0x04) -- PPP PDN type + */ + + char apnName[QMI_LOC_MAX_APN_NAME_LENGTH_V02 + 1]; + /**< APN name. + \begin{itemize1} + \item Type: NULL-terminated string + \item Maximum string length (including NULL terminator): 101 + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocApnProfilesStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSERVERREQSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SERVER_REQ_STATUS_SUCCESS_V02 = 1, /**< Location server request was successful */ + eQMI_LOC_SERVER_REQ_STATUS_FAILURE_V02 = 2, /**< Location server request failed */ + QMILOCSERVERREQSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocServerReqStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Connection Handle */ + uint32_t connHandle; + /**< Connection handle that the service specified in the + Location Server Connection request event. */ + + /* Mandatory */ + /* Request Type */ + qmiLocServerRequestEnumT_v02 requestType; + /**< Type of connection request service that was specified in the + Location Server Connection Request event. + + Valid values: \n + - eQMI_LOC_SERVER_REQUEST_OPEN (1) -- Open a connection to the location server + - eQMI_LOC_SERVER_REQUEST_CLOSE (2) -- Close a connection to the location server + */ + + /* Mandatory */ + /* Connection Status */ + qmiLocServerReqStatusEnumT_v02 statusType; + /**< Status of the Connection request. + + Valid values: \n + - eQMI_LOC_SERVER_REQ_STATUS_SUCCESS (1) -- Location server request was successful + - eQMI_LOC_SERVER_REQ_STATUS_FAILURE (2) -- Location server request failed + */ + + /* Optional */ + /* APN Profile */ + uint8_t apnProfile_valid; /**< Must be set to true if apnProfile is being passed */ + qmiLocApnProfilesStructT_v02 apnProfile; + /**< \vspace{0.06in} \n Access Point Name (APN) profile information is present only when + requestType is OPEN and statusType is SUCCESS. */ +}qmiLocInformLocationServerConnStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inform the service about the + status of the location server connection request that the + service may have sent via the + QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND event. */ +typedef struct { + + /* Mandatory */ + /* Status of Inform Loc Server Conn Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inform Location Server Connection Status request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocInformLocationServerConnStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCVXVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_VX_VERSION_V1_ONLY_V02 = 1, /**< V1 VX version */ + eQMI_LOC_VX_VERSION_V2_ONLY_V02 = 2, /**< V2 VX version */ + QMILOCVXVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocVxVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_VERSION_1_0_V02 = 1, /**< SUPL version 1.0 */ + eQMI_LOC_SUPL_VERSION_2_0_V02 = 2, /**< SUPL version 2.0 */ + QMILOCSUPLVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplVersionEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocLppConfigMaskT_v02; +#define QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000001) /**< Enable user plane configuration for LTE Positioning Profile (LPP) */ +#define QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE_V02 ((qmiLocLppConfigMaskT_v02)0x00000002) /**< Enable control plane configuration for LPP */ +typedef uint32_t qmiLocAssistedGlonassProtocolMaskT_v02; +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000001) /**< Assisted GLONASS is supported over RRC in the control plane */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000002) /**< Assisted GLONASS is supported over RRLP in the user plane */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000004) /**< Assisted GLONASS is supported over LPP in the user plane; + QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE must be set + in the LPP configuration for this to take effect */ +#define QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_CP_V02 ((qmiLocAssistedGlonassProtocolMaskT_v02)0x00000008) /**< Assisted GLONASS is supported over LPP in the control plane; + QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE must be set + in the LPP configuration for this to take effect */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLHASHALGOENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_HASH_ALGO_SHA1_V02 = 0, /**< SHA-1 hash algorithm for SUPL version 2.0 or later */ + eQMI_LOC_SUPL_HASH_ALGO_SHA256_V02 = 1, /**< SHA-256 hash algorithm for SUPL version 2.0 or later */ + QMILOCSUPLHASHALGOENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplHashAlgoEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSUPLTLSVERSIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SUPL_TLS_VERSION_1_0_V02 = 0, /**< SUPL TLS version 1.0 */ + eQMI_LOC_SUPL_TLS_VERSION_1_1_V02 = 1, /**< SUPL TLS version 1.1 */ + QMILOCSUPLTLSVERSIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSuplTlsVersionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCEMERGENCYPROTOCOLENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP_V02 = 0, /**< Use Control Plane Protocol during an emergency while on WCDMA */ + eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP_V02 = 1, /**< Use SUPL 2.0 emergency services during an emergency while on WCDMA */ + QMILOCEMERGENCYPROTOCOLENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocEmergencyProtocolEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \n + - eQMI_LOC_VX_VERSION_V1_ONLY (1) -- V1 VX version + - eQMI_LOC_VX_VERSION_V2_ONLY (2) -- V2 VX version + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - eQMI_LOC_SUPL_VERSION_1_0 (1) -- SUPL version 1.0 + - eQMI_LOC_SUPL_VERSION_2_0 (2) -- SUPL version 2.0 + */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Configures the protocols that the location service supports + for assisted GLONASS. + + Valid bitmasks: \n + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane; + QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE must be set + in the LPP configuration for this to take effect + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_CP (0x00000008) -- Assisted GLONASS is supported over LPP in the control plane; + QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE must be set + in the LPP configuration for this to take effect + */ + + /* Optional */ + /* SUPL Hash Algorithm */ + uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ + qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; + /**< SUPL hash algorithm to be used. + + Valid values: \n + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA-1 hash algorithm for SUPL version 2.0 or later + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 hash algorithm for SUPL version 2.0 or later + */ + + /* Optional */ + /* SUPL TLS Version */ + uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ + qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; + /**< SUPL Transport Layer Security (TLS) version. This configuration is only + applicable to SUPL 2.0 or later, as SUPL 1.0 always uses TLS version 1.0. + + Valid values: \n + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS version 1.0 + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS version 1.1 + */ + + /* Optional */ + /* Emergency Protocol */ + uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ + qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; + /**< Configures the protocol to be used during an emergency. \n + \textbf{Note:} Currently, this can only be selected on WCDMA. For GSM + and 1X, the UE only allows a control plane NI trigger for positioning. + For LTE, the UE allows either a SUPL or a control plane NI trigger. + + Valid values: \n + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- Use Control Plane Protocol during an emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- Use SUPL 2.0 emergency services during an emergency while on WCDMA + */ + + /* Optional */ + /* Wi-Fi Scan Injection Timeout Period */ + uint8_t wifiScanInjectTimeout_valid; /**< Must be set to true if wifiScanInjectTimeout is being passed */ + uint8_t wifiScanInjectTimeout; + /**< Configures the timeout duration that the service waits for scan results + injection from the control point after the event notification is sent. \n + \textbf{Note:} The timeout value is in seconds. \n + Values: \n + 0 to 10 seconds \n + The minimum value (0 seconds) is the default. At this value, the service + disables sending the Wi-Fi scan injection notification and ignores any + scan results injection request. + */ +}qmiLocSetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocProtocolConfigParamMaskT_v02; +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000001ull) /**< Mask for the SUPL security configuration parameter */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000002ull) /**< Mask for the VX version configuration parameter */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000004ull) /**< Mask for the SUPL version configuration parameter */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000008ull) /**< Mask for the LPP configuration parameter */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000010ull) /**< Mask for the assisted GLONASS configuration parameter */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000020ull) /**< Mask for the SUPL hash algorithm configuration parameter */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000040ull) /**< Mask for the SUPL TLS version configuration parameter */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000080ull) /**< Mask for the emergency protocol configuration parameter */ +#define QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_WIFI_SCAN_INJECT_TIMEOUT_V02 ((qmiLocProtocolConfigParamMaskT_v02)0x0000000000000100ull) /**< Mask for the Wi-Fi scan injection timeout configuration parameter */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure parameters stored + in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Set Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedProtocolConfigParamMask_valid; /**< Must be set to true if failedProtocolConfigParamMask is being passed */ + qmiLocProtocolConfigParamMaskT_v02 failedProtocolConfigParamMask; + /**< Identifies parameters that were not set successfully. This field + is sent only if the status is not SUCCESS. + + Valid bitmasks: \n + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted GLONASS configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL hash algorithm configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_WIFI_SCAN_INJECT_TIMEOUT (0x0000000000000100) -- Mask for the Wi-Fi scan injection timeout configuration parameter + */ +}qmiLocSetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocProtocolConfigParamMaskT_v02 getProtocolConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: \n + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_SECURITY (0x0000000000000001) -- Mask for the SUPL security configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_VX_VERSION (0x0000000000000002) -- Mask for the VX version configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_VERSION (0x0000000000000004) -- Mask for the SUPL version configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_LPP_CONFIG (0x0000000000000008) -- Mask for the LPP configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_ASSISTED_GLONASS_PROTOCOL (0x0000000000000010) -- Mask for the assisted GLONASS configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_HASH_ALGO (0x0000000000000020) -- Mask for the SUPL hash algorithm configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_SUPL_TLS_VERSION (0x0000000000000040) -- Mask for the SUPL TLS version configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_EMERGENCY_PROTOCOL (0x0000000000000080) -- Mask for the emergency protocol configuration parameter + - QMI_LOC_PROTOCOL_CONFIG_PARAM_MASK_WIFI_SCAN_INJECT_TIMEOUT (0x0000000000000100) -- Mask for the Wi-Fi scan injection timeout configuration parameter + */ +}qmiLocGetProtocolConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the configuration + parameters stored in the nonvolatile memory. */ +typedef struct { + + /* Mandatory */ + /* Get Config Params Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* SUPL Security */ + uint8_t suplSecurity_valid; /**< Must be set to true if suplSecurity is being passed */ + uint8_t suplSecurity; + /**< Indicates whether SUPL security is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- SUPL security is enabled + \item 0x00 (FALSE) -- SUPL security is disabled + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* VX Version */ + uint8_t vxVersion_valid; /**< Must be set to true if vxVersion is being passed */ + qmiLocVxVersionEnumT_v02 vxVersion; + /**< VX version. + + Valid values: \n + - eQMI_LOC_VX_VERSION_V1_ONLY (1) -- V1 VX version + - eQMI_LOC_VX_VERSION_V2_ONLY (2) -- V2 VX version + */ + + /* Optional */ + /* SUPL Version */ + uint8_t suplVersion_valid; /**< Must be set to true if suplVersion is being passed */ + qmiLocSuplVersionEnumT_v02 suplVersion; + /**< SUPL version. + + Valid values: \n + - eQMI_LOC_SUPL_VERSION_1_0 (1) -- SUPL version 1.0 + - eQMI_LOC_SUPL_VERSION_2_0 (2) -- SUPL version 2.0 + */ + + /* Optional */ + /* LPP Configuration */ + uint8_t lppConfig_valid; /**< Must be set to true if lppConfig is being passed */ + qmiLocLppConfigMaskT_v02 lppConfig; + /**< LTE Positioning Profile (LPP) configuration. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- LPP_CONFIG_ ENABLE_USER_PLANE + \item 0x00000002 -- LPP_CONFIG_ ENABLE_CONTROL_PLANE + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* Assisted GLONASS Protocol Mask */ + uint8_t assistedGlonassProtocolMask_valid; /**< Must be set to true if assistedGlonassProtocolMask is being passed */ + qmiLocAssistedGlonassProtocolMaskT_v02 assistedGlonassProtocolMask; + /**< Assisted GLONASS Protocol mask. + + Valid bitmasks: \n + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP (0x00000001) -- Assisted GLONASS is supported over RRC in the control plane + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP (0x00000002) -- Assisted GLONASS is supported over RRLP in the user plane + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP (0x00000004) -- Assisted GLONASS is supported over LPP in the user plane; + QMI_LOC_LPP_CONFIG_ENABLE_USER_PLANE must be set + in the LPP configuration for this to take effect + - QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_CP (0x00000008) -- Assisted GLONASS is supported over LPP in the control plane; + QMI_LOC_LPP_CONFIG_ENABLE_CONTROL_PLANE must be set + in the LPP configuration for this to take effect + */ + + /* Optional */ + /* SUPL Hash Algorithm */ + uint8_t suplHashAlgo_valid; /**< Must be set to true if suplHashAlgo is being passed */ + qmiLocSuplHashAlgoEnumT_v02 suplHashAlgo; + /**< SUPL hash algorithm to be used. + + Valid values: \n + - eQMI_LOC_SUPL_HASH_ALGO_SHA1 (0) -- SHA-1 hash algorithm for SUPL version 2.0 or later + - eQMI_LOC_SUPL_HASH_ALGO_SHA256 (1) -- SHA-256 hash algorithm for SUPL version 2.0 or later + */ + + /* Optional */ + /* SUPL TLS Version */ + uint8_t suplTlsVersion_valid; /**< Must be set to true if suplTlsVersion is being passed */ + qmiLocSuplTlsVersionEnumT_v02 suplTlsVersion; + /**< SUPL TLS version. This configuration is only + applicable to SUPL 2.0 or later, as SUPL 1.0 always uses TLS version 1.0. + + Valid values: \n + - eQMI_LOC_SUPL_TLS_VERSION_1_0 (0) -- SUPL TLS version 1.0 + - eQMI_LOC_SUPL_TLS_VERSION_1_1 (1) -- SUPL TLS version 1.1 + */ + + /* Optional */ + /* Emergency Protocol */ + uint8_t emergencyProtocol_valid; /**< Must be set to true if emergencyProtocol is being passed */ + qmiLocEmergencyProtocolEnumT_v02 emergencyProtocol; + /**< Protocol to be used during emergency. + + Valid values: \n + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_CP (0) -- Use Control Plane Protocol during an emergency while on WCDMA + - eQMI_LOC_EMERGENCY_PROTOCOL_WCDMA_UP (1) -- Use SUPL 2.0 emergency services during an emergency while on WCDMA + */ + + /* Optional */ + /* Wi-Fi Scan Injection Timeout Period */ + uint8_t wifiScanInjectTimeout_valid; /**< Must be set to true if wifiScanInjectTimeout is being passed */ + uint8_t wifiScanInjectTimeout; + /**< Timeout duration that the service waits for a scan results + injection from the control point after the event notification is sent. \n + Values: \n + 0 to 10 seconds + */ +}qmiLocGetProtocolConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE_V02 = 0, /**< Sensors data should be requested whenever a position request is + received. If sensor data are injected, the positioning engine + attempts to improve the heading and positioning performance using sensors. + This is the default. + */ + eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE_V02 = 1, /**< Inertial sensors are not to be used to aid heading and position + improvement. */ + QMILOCSENSORSCONTROLCONFIGSENSORUSEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorsControlConfigSensorUseEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORSCONTROLCONFIGSENSORPROVIDERENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_CONFIG_USE_PROVIDER_SSC_V02 = 0, /**< Sensors data provider is Snapdragon Sensor Core (SSC); + this is the default + */ + eQMI_LOC_SENSOR_CONFIG_USE_PROVIDER_NATIVE_V02 = 1, /**< Sensors data provider is on the host processor */ + QMILOCSENSORSCONTROLCONFIGSENSORPROVIDERENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorsControlConfigSensorProviderEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the sensor control configuration. */ +typedef struct { + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid heading and positioning + performance. + + Valid values: \n + - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE (0) -- Sensors data should be requested whenever a position request is + received. If sensor data are injected, the positioning engine + attempts to improve the heading and positioning performance using sensors. + This is the default. + + - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE (1) -- Inertial sensors are not to be used to aid heading and position + improvement. + */ + + /* Optional */ + /* Sensors Provider */ + uint8_t sensorProvider_valid; /**< Must be set to true if sensorProvider is being passed */ + qmiLocSensorsControlConfigSensorProviderEnumT_v02 sensorProvider; + /**< Controls which sensors data provider is to be used. + + Valid values: \n + - eQMI_LOC_SENSOR_CONFIG_USE_PROVIDER_SSC (0) -- Sensors data provider is Snapdragon Sensor Core (SSC); + this is the default + + - eQMI_LOC_SENSOR_CONFIG_USE_PROVIDER_NATIVE (1) -- Sensors data provider is on the host processor + */ +}qmiLocSetSensorControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Control Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetSensorControlConfigReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor control configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Control Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Sensors Usage */ + uint8_t sensorsUsage_valid; /**< Must be set to true if sensorsUsage is being passed */ + qmiLocSensorsControlConfigSensorUseEnumT_v02 sensorsUsage; + /**< Controls how sensors are used to aid the heading and positioning + performance. + + Valid values: \n + - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_ENABLE (0) -- Sensors data should be requested whenever a position request is + received. If sensor data are injected, the positioning engine + attempts to improve the heading and positioning performance using sensors. + This is the default. + + - eQMI_LOC_SENSOR_CONFIG_SENSOR_USE_DISABLE (1) -- Inertial sensors are not to be used to aid heading and position + improvement. + */ + + /* Optional */ + /* Sensors Provider */ + uint8_t sensorProvider_valid; /**< Must be set to true if sensorProvider is being passed */ + qmiLocSensorsControlConfigSensorProviderEnumT_v02 sensorProvider; + /**< Controls which sensors data provider to be used. + + Valid values: \n + - eQMI_LOC_SENSOR_CONFIG_USE_PROVIDER_SSC (0) -- Sensors data provider is Snapdragon Sensor Core (SSC); + this is the default + + - eQMI_LOC_SENSOR_CONFIG_USE_PROVIDER_NATIVE (1) -- Sensors data provider is on the host processor + */ +}qmiLocGetSensorControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPropertiesMaskT_v02; +#define QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000001) /**< Denotes the gyro bias variance random walk parameter */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000002) /**< Denotes the velocity random walk spectral density parameter */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000004) /**< Denotes the acceleration random walk spectral density parameter */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000008) /**< Denotes the angle random walk spectral density parameter */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000010) /**< Denotes the rate random walk spectral density parameter */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_DATA_USE_CONTROL_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000020) /**< Denotes the vehicle data use control parameter */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_VELOCITY_RWSD_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000040) /**< Denotes the vehicle velocity random walk spectral density */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ACCEL_RWSD_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000080) /**< Denotes the vehicle accelerometer random walk spectral density */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ANGLE_RWSD_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000100) /**< Denotes the vehicle angle random walk spectral density */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ANGULAR_RATE_RWSD_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000200) /**< Denotes the vehicle angular rate random walk spectral density */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ODOMETRY_SCALE_RWSD_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000400) /**< Denotes the vehicle odometry scale random walk spectral density */ +#define QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ODOMETRY_VARIANCE_V02 ((qmiLocSensorPropertiesMaskT_v02)0x00000800) /**< Denotes the vehicle odometry variance */ +typedef uint64_t qmiLocVehicleDataUseControlMaskT_v02; +#define QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ACCEL_X_AXIS_V02 ((qmiLocVehicleDataUseControlMaskT_v02)0x0000000000000001ull) /**< Enable use of X-axis vehicle acceleration sensor data */ +#define QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ACCEL_Y_AXIS_V02 ((qmiLocVehicleDataUseControlMaskT_v02)0x0000000000000002ull) /**< Enable use of Y-axis vehicle acceleration sensor data */ +#define QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ACCEL_Z_AXIS_V02 ((qmiLocVehicleDataUseControlMaskT_v02)0x0000000000000004ull) /**< Enable use of Z-axis vehicle acceleration sensor data */ +#define QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_GYRO_X_AXIS_V02 ((qmiLocVehicleDataUseControlMaskT_v02)0x0000000000000010ull) /**< Enable use of X-axis vehicle gyroscope data */ +#define QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_GYRO_Y_AXIS_V02 ((qmiLocVehicleDataUseControlMaskT_v02)0x0000000000000020ull) /**< Enable use of Y-axis vehicle gyroscope data */ +#define QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_GYRO_Z_AXIS_V02 ((qmiLocVehicleDataUseControlMaskT_v02)0x0000000000000040ull) /**< Enable use of Z-axis vehicle gyroscope data */ +#define QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ODOMETRY_V02 ((qmiLocVehicleDataUseControlMaskT_v02)0x0000000000000100ull) /**< Enable use of odometry data */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Optional */ + /* Gyro Bias Random Walk Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Vehicle Data Use Control */ + uint8_t vehicleDataUse_valid; /**< Must be set to true if vehicleDataUse is being passed */ + qmiLocVehicleDataUseControlMaskT_v02 vehicleDataUse; + /**< Identifies which portions of the vehicle data to use in location + estimation (information provided by the message + QMI_LOC_INJECT_VEHICLE_SENSOR_DATA). Valid bitmasks: \n + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ACCEL_X_AXIS (0x0000000000000001) -- Enable use of X-axis vehicle acceleration sensor data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ACCEL_Y_AXIS (0x0000000000000002) -- Enable use of Y-axis vehicle acceleration sensor data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ACCEL_Z_AXIS (0x0000000000000004) -- Enable use of Z-axis vehicle acceleration sensor data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_GYRO_X_AXIS (0x0000000000000010) -- Enable use of X-axis vehicle gyroscope data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_GYRO_Y_AXIS (0x0000000000000020) -- Enable use of Y-axis vehicle gyroscope data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_GYRO_Z_AXIS (0x0000000000000040) -- Enable use of Z-axis vehicle gyroscope data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ODOMETRY (0x0000000000000100) -- Enable use of odometry data + \b Note: All other bits are reserved for future use and are to be set to 0. */ + + /* Optional */ + /* Vehicle Velocity Random Walk Spectral Density */ + uint8_t vehicleVelocityRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleVelocityRandomWalkSpectralDensity is being passed */ + float vehicleVelocityRandomWalkSpectralDensity; + /**< Vehicle velocity random walk spectral density. \n + - Type: 32-bit float \n + - Units: Meters/seconds^2/Hz^0.5 \n + - Valid values: Positive values \n + - Default: None + */ + + /* Optional */ + /* Vehicle Acceleration Random Walk Spectral Density */ + uint8_t vehicleAccelRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleAccelRandomWalkSpectralDensity is being passed */ + float vehicleAccelRandomWalkSpectralDensity; + /**< Vehicle accelerometer random walk spectral density. \n + - Type: 32-bit float \n + - Units: Meters/seconds^3/Hz^0.5 \n + - Valid values: Positive values \n + - Default: None + */ + + /* Optional */ + /* Vehicle Angle Random Walk Spectral Density */ + uint8_t vehicleAngleRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleAngleRandomWalkSpectralDensity is being passed */ + float vehicleAngleRandomWalkSpectralDensity; + /**< Vehicle angle random walk spectral density. \n + - Type: 32-bit float \n + - Units: Radians/seconds/Hz^0.5 \n + - Valid values: Positive values \n + - Default: None + */ + + /* Optional */ + /* Vehicle Angular Rate Random Walk Spectral Density */ + uint8_t vehicleAngularRateRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleAngularRateRandomWalkSpectralDensity is being passed */ + float vehicleAngularRateRandomWalkSpectralDensity; + /**< Vehicle angular rate random walk spectral density. \n + - Type: 32-bit float \n + - Units: Radians/seconds^2/Hz^0.5 \n + - Valid values: Positive values \n + - Default: None + */ + + /* Optional */ + /* Vehicle Odometry Scale Factor Random Walk Spectral Density */ + uint8_t vehicleOdometryScaleFactorRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleOdometryScaleFactorRandomWalkSpectralDensity is being passed */ + float vehicleOdometryScaleFactorRandomWalkSpectralDensity; + /**< Vehicle odometry scale factor random walk spectral density. \n + - Type: 32-bit float \n + - Units: (1/seconds)/Hz^0.5 \n + - Range: Approximately 0.0001 to 0.001 \n + - Default: 0.001 (actual calibration recommended) + */ + + /* Optional */ + /* Vehicle Odometry Variance */ + uint8_t vehicleOdometryVariance_valid; /**< Must be set to true if vehicleOdometryVariance is being passed */ + float vehicleOdometryVariance; + /**< Vehicle odometry variance of each odometry sample + (coarseness of measurement). \n + - Type: 32-bit float \n + - Units: Meters^2 \n + - Valid values: Positive values \n + - Default: None + */ +}qmiLocSetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets the properties specific to the type of sensor used. + The control point must set sensor properties before they can be + used to aid in heading and positioning performance improvement. + */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Properties request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ + + /* Optional */ + /* Failed Set Sensor Properties */ + uint8_t failedSensorPropertiesMask_valid; /**< Must be set to true if failedSensorPropertiesMask is being passed */ + qmiLocSensorPropertiesMaskT_v02 failedSensorPropertiesMask; + /**< This field is sent only if the status is not SUCCESS. + Identifies the parameters that were not set successfully. + + Valid bitmasks: + - QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK (0x00000001) -- Denotes the gyro bias variance random walk parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY (0x00000002) -- Denotes the velocity random walk spectral density parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY (0x00000004) -- Denotes the acceleration random walk spectral density parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY (0x00000008) -- Denotes the angle random walk spectral density parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY (0x00000010) -- Denotes the rate random walk spectral density parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_DATA_USE_CONTROL (0x00000020) -- Denotes the vehicle data use control parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_VELOCITY_RWSD (0x00000040) -- Denotes the vehicle velocity random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ACCEL_RWSD (0x00000080) -- Denotes the vehicle accelerometer random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ANGLE_RWSD (0x00000100) -- Denotes the vehicle angle random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ANGULAR_RATE_RWSD (0x00000200) -- Denotes the vehicle angular rate random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ODOMETRY_SCALE_RWSD (0x00000400) -- Denotes the vehicle odometry scale random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ODOMETRY_VARIANCE (0x00000800) -- Denotes the vehicle odometry variance + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Sensor Properties Config Parameters */ + qmiLocSensorPropertiesMaskT_v02 getSensorPropertiesMask; + /**< Mask denoting the sensor properties parameters to be retrieved. + + Valid bitmasks: + - QMI_LOC_SENSOR_PROPERTIES_MASK_GYRO_BIAS_VARIANCE_RANDOM_WALK (0x00000001) -- Denotes the gyro bias variance random walk parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY (0x00000002) -- Denotes the velocity random walk spectral density parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_ACCELERATION_RANDOM_WALK_SPECTRAL_DENSITY (0x00000004) -- Denotes the acceleration random walk spectral density parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_ANGLE_RANDOM_WALK_SPECTRAL_DENSITY (0x00000008) -- Denotes the angle random walk spectral density parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_RATE_RANDOM_WALK_SPECTRAL_DENSITY (0x00000010) -- Denotes the rate random walk spectral density parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_DATA_USE_CONTROL (0x00000020) -- Denotes the vehicle data use control parameter + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_VELOCITY_RWSD (0x00000040) -- Denotes the vehicle velocity random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ACCEL_RWSD (0x00000080) -- Denotes the vehicle accelerometer random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ANGLE_RWSD (0x00000100) -- Denotes the vehicle angle random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ANGULAR_RATE_RWSD (0x00000200) -- Denotes the vehicle angular rate random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ODOMETRY_SCALE_RWSD (0x00000400) -- Denotes the vehicle odometry scale random walk spectral density + - QMI_LOC_SENSOR_PROPERTIES_MASK_VEHICLE_ODOMETRY_VARIANCE (0x00000800) -- Denotes the vehicle odometry variance + */ +}qmiLocGetSensorPropertiesReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor properties. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Properties Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensors Properties request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Gyro Bias Random Walk Variance */ + uint8_t gyroBiasVarianceRandomWalk_valid; /**< Must be set to true if gyroBiasVarianceRandomWalk is being passed */ + float gyroBiasVarianceRandomWalk; + /**< Specifies the gyro bias random walk variance parameter as a positive + floating-point value. This value has internal default value 1.0e-5 radian^2/second^4. + The gyro bias variance random walk parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians^2/seconds^4 + + */ + + /* Optional */ + /* Velocity Random Walk Spectral Density */ + uint8_t velocityRandomWalkSpectralDensity_valid; /**< Must be set to true if velocityRandomWalkSpectralDensity is being passed */ + float velocityRandomWalkSpectralDensity; + /**< Specifies the velocity random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The velocity random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Acceleration Random Walk Spectral Density */ + uint8_t accelerationRandomWalkSpectralDensity_valid; /**< Must be set to true if accelerationRandomWalkSpectralDensity is being passed */ + float accelerationRandomWalkSpectralDensity; + /**< Specifies the acceleration random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The acceleration random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Meters/seconds^3/Hertz^0.5 + + */ + + /* Optional */ + /* Angle Random Walk Spectral Density */ + uint8_t angleRandomWalkSpectralDensity_valid; /**< Must be set to true if angleRandomWalkSpectralDensity is being passed */ + float angleRandomWalkSpectralDensity; + /**< Specifies the angle random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The angle random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds/Hertz^0.5 + + */ + + /* Optional */ + /* Rate Random Walk Spectral Density */ + uint8_t rateRandomWalkSpectralDensity_valid; /**< Must be set to true if rateRandomWalkSpectralDensity is being passed */ + float rateRandomWalkSpectralDensity; + /**< Specifies the rate random walk spectral density parameter as a positive + floating-point value. This value does not have any internal defaults. + The rate random walk spectral density parameter is derived from either the + sensors data sheet or a sensors conformance test. \n + - Units: Radians/seconds^2/Hertz^0.5 + + */ + + /* Optional */ + /* Vehicle Data Use Control */ + uint8_t vehicleDataUse_valid; /**< Must be set to true if vehicleDataUse is being passed */ + qmiLocVehicleDataUseControlMaskT_v02 vehicleDataUse; + /**< Identifies which portions of the vehicle data to use in location + estimation (information provided by message + QMI_LOC_INJECT_VEHICLE_SENSOR_DATA). Valid bitmasks: \n + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ACCEL_X_AXIS (0x0000000000000001) -- Enable use of X-axis vehicle acceleration sensor data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ACCEL_Y_AXIS (0x0000000000000002) -- Enable use of Y-axis vehicle acceleration sensor data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ACCEL_Z_AXIS (0x0000000000000004) -- Enable use of Z-axis vehicle acceleration sensor data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_GYRO_X_AXIS (0x0000000000000010) -- Enable use of X-axis vehicle gyroscope data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_GYRO_Y_AXIS (0x0000000000000020) -- Enable use of Y-axis vehicle gyroscope data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_GYRO_Z_AXIS (0x0000000000000040) -- Enable use of Z-axis vehicle gyroscope data + - QMI_LOC_VEHICLE_DATA_ENABLE_USE_MASK_ODOMETRY (0x0000000000000100) -- Enable use of odometry data + @note1 All other bits are reserved for future use and are to be set to 0. */ + + /* Optional */ + /* Vehicle Velocity Random Walk Spectral Density */ + uint8_t vehicleVelocityRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleVelocityRandomWalkSpectralDensity is being passed */ + float vehicleVelocityRandomWalkSpectralDensity; + /**< Vehicle velocity random walk spectral density. \n + - Type: 32-bit float \n + - Units: Meters/seconds^2/Hz^0.5 \n + - Valid values: Positive values \n + - Default: None + */ + + /* Optional */ + /* Vehicle Acceleration Random Walk Spectral Density */ + uint8_t vehicleAccelRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleAccelRandomWalkSpectralDensity is being passed */ + float vehicleAccelRandomWalkSpectralDensity; + /**< Vehicle accelerometer random walk spectral density. \n + - Type: 32-bit float \n + - Units: Meters/seconds^3/Hz^0.5 \n + - Valid values: Positive values \n + - Default: None + */ + + /* Optional */ + /* Vehicle Angle Random Walk Spectral Density */ + uint8_t vehicleAngleRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleAngleRandomWalkSpectralDensity is being passed */ + float vehicleAngleRandomWalkSpectralDensity; + /**< Vehicle angle random walk spectral density. \n + - Type: 32-bit float \n + - Units: Radians/seconds/Hz^0.5 \n + - Valid values: Positive values \n + - Default: None + */ + + /* Optional */ + /* Vehicle Angular Rate Random Walk Spectral Density */ + uint8_t vehicleAngularRateRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleAngularRateRandomWalkSpectralDensity is being passed */ + float vehicleAngularRateRandomWalkSpectralDensity; + /**< Vehicle angular rate random walk spectral density. \n + - Type: 32-bit float \n + - Units: Radians/seconds^2/Hz^0.5 \n + - Valid values: Positive values \n + - Default: None + */ + + /* Optional */ + /* Vehicle Odometry Scale Factor Random Walk Spectral Density */ + uint8_t vehicleOdometryScaleFactorRandomWalkSpectralDensity_valid; /**< Must be set to true if vehicleOdometryScaleFactorRandomWalkSpectralDensity is being passed */ + float vehicleOdometryScaleFactorRandomWalkSpectralDensity; + /**< Vehicle odometry scale factor random walk spectral density. \n + - Type: 32-bit float \n + - Units: (1/seconds)/Hz^0.5 \n + - Range: Approximately 0.0001 to 0.001 \n + - Default: 0.001 (actual calibration recommended) + */ + + /* Optional */ + /* Vehicle Odometry Variance */ + uint8_t vehicleOdometryVariance_valid; /**< Must be set to true if vehicleOdometryVariance is being passed */ + float vehicleOdometryVariance; + /**< Vehicle odometry variance of each odometry sample + (coarseness of measurement). \n + - Type: 32-bit float \n + - Units: Meters^2 \n + - Valid values: Positive values \n + - Default: None + */ +}qmiLocGetSensorPropertiesIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO_V02 = 0, /**< Sensors usage is to be determined by the GNSS location engine. + This mode can optimize power consumption and give a + power-balanced positioning and heading enhancement using + inertial sensors */ + eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED_V02 = 1, /**< Sensors usage is to be forced ON. + This mode can be requested by the control point when + power consumption is not a restriction to the use of + inertial sensors. */ + QMILOCSENSORPERFORMANCECONTROLMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSensorPerformanceControlModeEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocSensorAlgorithmMaskT_v02; +#define QMI_LOC_SENSOR_ALGORITHM_MASK_DISABLE_INS_POSITIONING_FILTER_V02 ((qmiLocSensorAlgorithmMaskT_v02)0x00000001) /**< Inertial sensors are not to be used in Accelerometer-integrated fashion with + GNSS. They can still be used for aiding in heading improvements. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Provides fine-grained control of sensor based positioning + performance. */ +typedef struct { + + /* Optional */ + /* Sensor Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensors data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensors control configuration. + + Valid values: \n + - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO (0) -- Sensors usage is to be determined by the GNSS location engine. + This mode can optimize power consumption and give a + power-balanced positioning and heading enhancement using + inertial sensors + - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED (1) -- Sensors usage is to be forced ON. + This mode can be requested by the control point when + power consumption is not a restriction to the use of + inertial sensors. + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location + engine is to request acceleration data to be used by the low data rate + filter. The sensor data rate is specified in terms of the nominal number + of samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location + engine is to request gyro data to be used by the high data rate filter. + The sensor data rate is specified in terms of the nominal number of + samples per batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Sets which sensor algorithms are to be used when processing sensor data. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ +}qmiLocSetSensorPerformanceControlConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocSensorPerformanceControlConfigFailureMaskT_v02; +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_PERFORMANCE_MODE_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000001) /**< Failed to set the performance mode */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000002) /**< Failed to set the accelerometer sampling specification */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000004) /**< Failed to set the gyroscope sampling specification */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ALGORITHM_CONFIG_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000008) /**< Failed to set the algorithm configuration */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_ACCEL_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000010) /**< Failed to set the accelerometer sampling specification */ +#define QMI_LOC_SENSOR_PERFORMANCE_CONTROL_CONFIG_PARAM_MASK_GYRO_SAMPLING_SPEC_HIGH_V02 ((qmiLocSensorPerformanceControlConfigFailureMaskT_v02)0x00000020) /**< Failed to set the gyroscope sampling specification */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Provides fine-grained control of sensor based positioning + performance. */ +typedef struct { + + /* Mandatory */ + /* Set Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Sensor Performance Control Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Failed Configuration */ + uint8_t failedConfiguration_valid; /**< Must be set to true if failedConfiguration is being passed */ + qmiLocSensorPerformanceControlConfigFailureMaskT_v02 failedConfiguration; + /**< Identifies parameters that were not configured successfully. This field + is sent only if the status is not a success. + + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- PERFORMANCE_ MODE + \item 0x00000002 -- ACCEL_SAMPLING_ SPEC + \item 0x00000004 -- GYRO_SAMPLING_ SPEC + \item 0x00000008 -- ALGORITHM_ CONFIG + \item 0x00000010 -- ACCEL_SAMPLING_ SPEC_HIGH + \item 0x00000020 -- GYRO_SAMPLING_ SPEC_HIGH + \vspace{-0.18in} \end{itemize1} + */ +}qmiLocSetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocGetSensorPerformanceControlConfigReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Retrieves the current sensor performance control + configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Sensor Perf Control Config Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Sensor Performance Control Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Performance Control Mode */ + uint8_t performanceControlMode_valid; /**< Must be set to true if performanceControlMode is being passed */ + qmiLocSensorPerformanceControlModeEnumT_v02 performanceControlMode; + /**< Controls when sensor data is requested during GNSS fix processing. + This field is relevant only when sensors have been enabled using the + sensor control configuration. + + Valid values: \n + - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_AUTO (0) -- Sensors usage is to be determined by the GNSS location engine. + This mode can optimize power consumption and give a + power-balanced positioning and heading enhancement using + inertial sensors + - eQMI_LOC_SENSOR_PERFORMANCE_CONTROL_MODE_FORCED (1) -- Sensors usage is to be forced ON. + This mode can be requested by the control point when + power consumption is not a restriction to the use of + inertial sensors. + */ + + /* Optional */ + /* Accelerometer Sampling Specification */ + uint8_t accelSamplingSpec_valid; /**< Must be set to true if accelSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpec; + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2Hz batching rate. + */ + + /* Optional */ + /* Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpec_valid; /**< Must be set to true if gyroSamplingSpec is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpec; + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data + rate is specified in terms of the nominal number of samples per batch + and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 10 Hz sampling rate and 2 Hz batching rate. + */ + + /* Optional */ + /* Algorithm Configuration */ + uint8_t algorithmConfig_valid; /**< Must be set to true if algorithmConfig is being passed */ + qmiLocSensorAlgorithmMaskT_v02 algorithmConfig; + /**< Informs which sensor algorithms are currently set. + + Valid bitmasks: \begin{itemize1} + \item 0x00000001 -- DISABLE_INS_ POSITIONING_FILTER + \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* High Data Rate Filter Accelerometer Sampling Specification */ + uint8_t accelSamplingSpecHigh_valid; /**< Must be set to true if accelSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 accelSamplingSpecHigh; + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + acceleration data to be used by the high data rate filter. The sensor + data rate is specified in terms of the nominal number of samples per + batch and the number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ + + /* Optional */ + /* High Data Rate Filter Gyroscope Sampling Specification */ + uint8_t gyroSamplingSpecHigh_valid; /**< Must be set to true if gyroSamplingSpecHigh is being passed */ + qmiLocSensorControlConfigSamplingSpecStructT_v02 gyroSamplingSpecHigh; + /**< \vspace{0.06in} \n Sets the nominal rate at which the GNSS location engine is to request + gyro data to be used by the high data rate filter. The sensor data rate + is specified in terms of the nominal number of samples per batch and the + number of batches per second. + However, the final control of the actual requested rate resides with + the Sensors Manager Module/GNSS location engine. \n + Default: 100 Hz sampling rate and 4 Hz batching rate. + */ +}qmiLocGetSensorPerformanceControlConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate ID */ + uint8_t suplCertId; + /**< Certificate ID of the SUPL certificate. \n + - Units: Bytes \n + - Range: 0 to 9 */ + + /* Mandatory */ + /* SUPL Certificate Data */ + uint32_t suplCertData_len; /**< Must be set to # of elements in suplCertData */ + uint8_t suplCertData[QMI_LOC_MAX_SUPL_CERT_LENGTH_V02]; + /**< SUPL certificate contents. \n + - Type: Array of bytes \n + - Maximum certificate size: 2000 bytes */ +}qmiLocInjectSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a SUPL certificate to be used in AGNSS sessions. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject SUPL Certificate request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocInjectSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Deletes a SUPL certificate. */ +typedef struct { + + /* Optional */ + /* SUPL Certificate ID */ + uint8_t suplCertId_valid; /**< Must be set to true if suplCertId is being passed */ + uint8_t suplCertId; + /**< Certificate ID of the SUPL certificate to be deleted. \n + - Units: Bytes \n + - Range: 0 to 9 \n + If suplCertId is not specified, + all SUPL certificates are deleted. */ +}qmiLocDeleteSuplCertificateReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Deletes a SUPL certificate. */ +typedef struct { + + /* Mandatory */ + /* SUPL Certificate Deletion Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete SUPL Certificate request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocDeleteSuplCertificateIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocPositionEngineConfigParamMaskT_v02; +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000001) /**< Denotes whether the position engine uses the + injected position in a direct position calculation. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000002) /**< Denotes whether the position engine filters the + SV usage in the fix. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000004) /**< Denotes whether the position engine stores assistance data + in persistent memory. */ +#define QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_ENABLE_FASTER_TTFF_V02 ((qmiLocPositionEngineConfigParamMaskT_v02)0x00000008) /**< Denotes whether the position engine stays on to optimize + the TTFF for the subsequent position fix. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Controls how the injected position is used in the position engine. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Use the injected position in a direct position + calculation + \item 0x00 (FALSE) -- Do not use the injected position in a direct + position calculation + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Controls whether SV usage is filtered in a position fix. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Filter the usage of SVs in the fix + \item 0x00 (FALSE) -- Do not filter the usage of SVs in the fix + \end{itemize1} + The default value is FALSE. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Controls whether assistance data is to be stored in + persistent memory. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Store assistance data in persistent memory + \item 0x00 (FALSE) -- Do not store assistance data in persistent memory + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Enable Faster TTFF */ + uint8_t enableFasterTTFF_valid; /**< Must be set to true if enableFasterTTFF is being passed */ + uint8_t enableFasterTTFF; + /**< Allows the receiver to stay on after a position session in order to + collect information that will help reduce the Time To First Fix (TTFF) + when the next position request is made. The receiver will stay + on only if the engine determines that it needs to collect some + information. The receiver will stay on for the duration needed to + collect the information. + If enabled, the clients may see a delay in receiving the Engine Off + event after the position session ends. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Allow the engine to stay on for reduced TTFF + \item 0x00 (FALSE) -- Do not allow the engine to stay on for reduced + TTFF + \end{itemize1} + The default value is TRUE.*/ +}qmiLocSetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to configure position engine + functionality. */ +typedef struct { + + /* Mandatory */ + /* Set Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Configuration Parameters request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedPositionEngineConfigParamMask_valid; /**< Must be set to true if failedPositionEngineConfigParamMask is being passed */ + qmiLocPositionEngineConfigParamMaskT_v02 failedPositionEngineConfigParamMask; + /**< Identifies the parameters that were not set successfully. + This field is sent only if the status is other than SUCCESS. + + Valid bitmasks:\n + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL (0x00000001) -- Denotes whether the position engine uses the + injected position in a direct position calculation. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE (0x00000002) -- Denotes whether the position engine filters the + SV usage in the fix. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA (0x00000004) -- Denotes whether the position engine stores assistance data + in persistent memory. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_ENABLE_FASTER_TTFF (0x00000008) -- Denotes whether the position engine stays on to optimize + the TTFF for the subsequent position fix. + */ +}qmiLocSetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Config Parameters */ + qmiLocPositionEngineConfigParamMaskT_v02 getPositionEngineConfigParamMask; + /**< Mask denoting the configuration parameters to be retrieved. + + Valid bitmasks: + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_INJECTED_POSITION_CONTROL (0x00000001) -- Denotes whether the position engine uses the + injected position in a direct position calculation. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_FILTER_SV_USAGE (0x00000002) -- Denotes whether the position engine filters the + SV usage in the fix. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_STORE_ASSIST_DATA (0x00000004) -- Denotes whether the position engine stores assistance data + in persistent memory. + - QMI_LOC_POSITION_ENGINE_CONFIG_PARAM_MASK_ENABLE_FASTER_TTFF (0x00000008) -- Denotes whether the position engine stays on to optimize + the TTFF for the subsequent position fix. + */ +}qmiLocGetPositionEngineConfigParametersReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the position engine + configuration parameters. */ +typedef struct { + + /* Mandatory */ + /* Get Position Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Configuration Parameters request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Injected Position Control */ + uint8_t injectedPositionControl_valid; /**< Must be set to true if injectedPositionControl is being passed */ + uint8_t injectedPositionControl; + /**< Specifies whether the injected position is used for a direct calculation + in the position engine. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- The injected position is used in a direct + position calculation + \item 0x00 (FALSE) -- The injected position is not used in a direct + position calculation + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Filter SV Usage */ + uint8_t filterSvUsage_valid; /**< Must be set to true if filterSvUsage is being passed */ + uint8_t filterSvUsage; + /**< Specifies whether SV usage is filtered in a position fix. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- SV usage is filtered in the fix + \item 0x00 (FALSE) -- SV usage is not filtered in the fix + \end{itemize1} + The default value is FALSE. + */ + + /* Optional */ + /* Store Assist Data */ + uint8_t storeAssistData_valid; /**< Must be set to true if storeAssistData is being passed */ + uint8_t storeAssistData; + /**< Specifies whether assistance data is stored in persistent memory. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Assistance data is stored in persistent memory + \item 0x00 (FALSE) -- Assistance data is not stored in persistent + memory + \end{itemize1} + The default value is TRUE. + */ + + /* Optional */ + /* Enable Faster TTFF */ + uint8_t enableFasterTTFF_valid; /**< Must be set to true if enableFasterTTFF is being passed */ + uint8_t enableFasterTTFF; + /**< Allows the receiver to stay on after a position session in order to + collect information that will help reduce the TTFF + when the next position request is made. The receiver will stay + on only if the engine determines that it needs to collect some + information. The receiver will stay on for the duration needed to + collect the information. + If enabled, the clients may see a delay in receiving the Engine Off + event after the position session ends. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Allow the engine to stay on for reduced TTFF + \item 0x00 (FALSE) -- Do not allow the engine to stay on for reduced + TTFF + \end{itemize1} + The default value is TRUE.*/ +}qmiLocGetPositionEngineConfigParametersIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint8_t qmiLocGeofenceBreachMaskT_v02; +#define QMI_LOC_GEOFENCE_BREACH_ENTERING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x01) /**< If this mask is set, a breach event is reported + when the Geofence is entered */ +#define QMI_LOC_GEOFENCE_BREACH_LEAVING_MASK_V02 ((qmiLocGeofenceBreachMaskT_v02)0x02) /**< If this mask is set, a breach event is reported + when the Geofence is exited */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCERESPONSIVENESSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW_V02 = 0x01, /**< The Geofence is monitored for a breach at a + low rate of 15 minutes. The gap between the actual breach and + the time it is reported is higher. This + setting results in lower power usage. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED_V02 = 0x02, /**< The Geofence is monitored for a breach at a + medium rate of 2 minutes. This is the default setting. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH_V02 = 0x03, /**< The Geofence is monitored for a breach at a + high rate of 10 seconds. The gap between the actual breach and + the time it is reported is low. This results + in higher power usage. */ + eQMI_LOC_GEOFENCE_RESPONSIVENESS_ULTRA_HIGH_V02 = 0x04, /**< The Geofence is monitored for a breach at a + very high rate of 1 second. The gap between the actual breach and + the time it is reported is very low. This results + in very high power usage. This setting must be avoided whenever + possible because of the drastic power implications. */ + QMILOCGEOFENCERESPONSIVENESSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceResponsivenessEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + double latitude; + /**< Latitude of the center of the Geofence.*/ + + double longitude; + /**< Longitude of the center of the Geofence.*/ + + uint32_t radius; + /**< Radius of the circular Geofence in meters. */ +}qmiLocCircularGeofenceArgsStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEPOSITIONENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_POSITION_INSIDE_V02 = 0x01, /**< Position is inside a Geofence */ + eQMI_LOC_GEOFENCE_POSITION_OUTSIDE_V02 = 0x02, /**< Position is outside a Geofence */ + QMILOCGEOFENCEPOSITIONENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofencePositionEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Add Circular Geofence + indication. */ + + /* Mandatory */ + /* Circular Geofence Arguments */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Mandatory */ + /* Breach Event Mask */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ + + /* Mandatory */ + /* Include Position in Breach Event */ + uint8_t includePosition; + /**< Specifies whether the Geofence engine is to include the position + in a breach event. + + Valid values: \begin{itemize1} + \item 0x01 (TRUE) -- Position will be reported with the breach event + \item 0x00 (FALSE) -- Position will not be reported with the breach + event + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Responsiveness */ + uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ + qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; + /**< Specifies the rate of detection for a Geofence breach. + This may impact the time lag between the actual breach event and + when it is reported. This parameter has power implications + and is to be fine-tuned to optimize power savings. + + Valid values: \n + - eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW (0x01) -- The Geofence is monitored for a breach at a + low rate of 15 minutes. The gap between the actual breach and + the time it is reported is higher. This + setting results in lower power usage. + - eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED (0x02) -- The Geofence is monitored for a breach at a + medium rate of 2 minutes. This is the default setting. + - eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH (0x03) -- The Geofence is monitored for a breach at a + high rate of 10 seconds. The gap between the actual breach and + the time it is reported is low. This results + in higher power usage. + - eQMI_LOC_GEOFENCE_RESPONSIVENESS_ULTRA_HIGH (0x04) -- The Geofence is monitored for a breach at a + very high rate of 1 second. The gap between the actual breach and + the time it is reported is very low. This results + in very high power usage. This setting must be avoided whenever + possible because of the drastic power implications. + */ + + /* Optional */ + /* Confidence */ + uint8_t confidence_valid; /**< Must be set to true if confidence is being passed */ + qmiLocGeofenceConfidenceEnumT_v02 confidence; + /**< Given a breach event, the confidence determines the probability + that the breach happened at the Geofence boundary. + This parameter has power implications and + is to be fine-tuned to optimize power savings. + + Valid values: \n + - eQMI_LOC_GEOFENCE_CONFIDENCE_LOW (0x01) -- Geofence engine indicates a breach with + low confidence; this setting results in lower + power usage, and it can impact the yield because + incorrect breach events may be sent + - eQMI_LOC_GEOFENCE_CONFIDENCE_MED (0x02) -- (Default) Geofence engine indicates a breach with + medium confidence + - eQMI_LOC_GEOFENCE_CONFIDENCE_HIGH (0x03) -- Geofence engine indicates a breach with + high confidence; this setting results in higher + power usage + */ +}qmiLocAddCircularGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to add a circular Geofence. */ +typedef struct { + + /* Mandatory */ + /* Add Circular Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Add Circular Geofence request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - 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; + /**< Transaction ID that was specified in the Add Circular + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Geofence identifier allocated by the engine. + The client must include this identifier in all transactions + pertaining to this Geofence. */ +}qmiLocAddCircularGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be deleted. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Delete Geofence + indication. */ +}qmiLocDeleteGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to delete a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Delete Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Delete Geofence request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was deleted. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Delete + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ +}qmiLocDeleteGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEORIGINENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_ORIGIN_NETWORK_V02 = 1, /**< Geofence was initiated by a network-initiated client */ + eQMI_LOC_GEOFENCE_ORIGIN_DEVICE_V02 = 2, /**< Geofence was initiated by the device */ + QMILOCGEOFENCEORIGINENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceOriginEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCESTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_STATE_ACTIVE_V02 = 1, /**< Geofence is being actively monitored */ + eQMI_LOC_GEOFENCE_STATE_SUSPEND_V02 = 2, /**< Geofence monitoring is suspended */ + QMILOCGEOFENCESTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence that is to be queried. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned with the Query Geofence + indication. */ +}qmiLocQueryGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to query a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Query Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Query Geofence request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was queried. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Query + Geofence request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence Origin */ + uint8_t geofenceOrigin_valid; /**< Must be set to true if geofenceOrigin is being passed */ + qmiLocGeofenceOriginEnumT_v02 geofenceOrigin; + /**< Originator of the Geofence. + + Valid values: \n + - eQMI_LOC_GEOFENCE_ORIGIN_NETWORK (1) -- Geofence was initiated by a network-initiated client + - eQMI_LOC_GEOFENCE_ORIGIN_DEVICE (2) -- Geofence was initiated by the device + */ + + /* Optional */ + /* Position with Respect to Geofence */ + uint8_t posWrtGeofence_valid; /**< Must be set to true if posWrtGeofence is being passed */ + qmiLocGeofencePositionEnumT_v02 posWrtGeofence; + /**< Indicates if the client is currently inside or outside + the Geofence. + + Valid values: \n + - eQMI_LOC_GEOFENCE_POSITION_INSIDE (0x01) -- Position is inside a Geofence + - eQMI_LOC_GEOFENCE_POSITION_OUTSIDE (0x02) -- Position is outside a Geofence + */ + + /* Optional */ + /* Circular Geofence Parameters */ + uint8_t circularGeofenceArgs_valid; /**< Must be set to true if circularGeofenceArgs is being passed */ + qmiLocCircularGeofenceArgsStructT_v02 circularGeofenceArgs; + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: \n + - eQMI_LOC_GEOFENCE_STATE_ACTIVE (1) -- Geofence is being actively monitored + - eQMI_LOC_GEOFENCE_STATE_SUSPEND (2) -- Geofence monitoring is suspended + */ +}qmiLocQueryGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocMotionDetectionSourceMaskT_v02; +#define QMI_LOC_MOTION_DETECTION_SOURCE_SENSORS_V02 ((qmiLocMotionDetectionSourceMaskT_v02)0x00000001) /**< Sensors are used for motion detection */ +#define QMI_LOC_MOTION_DETECTION_SOURCE_WIFI_V02 ((qmiLocMotionDetectionSourceMaskT_v02)0x00000002) /**< Wi-Fi is used for motion detection */ +#define QMI_LOC_MOTION_DETECTION_SOURCE_WWAN_V02 ((qmiLocMotionDetectionSourceMaskT_v02)0x00000004) /**< Wireless WAN is used for motion detection */ +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCGEOFENCEMOTIONSTATESENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_GEOFENCE_MOTION_STATE_STATIONARY_V02 = 0, /**< Motion State Stationary: when handset is completely stationary */ + eQMI_LOC_GEOFENCE_MOTION_STATE_FIDDLE_V02 = 1, /**< Motion State Fiddle: when handset is not in motion but is being fiddled with */ + eQMI_LOC_GEOFENCE_MOTION_STATE_WALK_V02 = 2, /**< Motion State Walk: when walking with the handset */ + eQMI_LOC_GEOFENCE_MOTION_STATE_RUN_V02 = 3, /**< Motion State Run: when running with the handset */ + eQMI_LOC_GEOFENCE_MOTION_STATE_DRIVE_V02 = 4, /**< Motion State Drive: when driving with the handset */ + QMILOCGEOFENCEMOTIONSTATESENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocGeofenceMotionStatesEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocGeofenceMotionStatesEnumT_v02 motionState; + + /* Motion State whose information is being configured */ + float motionStateSpeed; +}qmiLocGeofenceMotionStateConfigStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the Geofence engine configuration. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned with the Set Geofence Configuration + indication. */ + + /* Optional */ + /* GNSS Unavailable Indication Timeout */ + uint8_t gnssUnavailableIndicationTimeout_valid; /**< Must be set to true if gnssUnavailableIndicationTimeout is being passed */ + uint32_t gnssUnavailableIndicationTimeout; + /**< In a bad GNSS environment, this is the timeout after which the Geofence + engine sends out a GNSS Unavailable indication. The GNSS Unavailable + indication is sent under the following conditions: \begin{itemize1} + \item If gnssUnavailableIndicationTimeout is less than + gnssPositionSessionTimeout, the GNSS + Unavailable timeout indication is sent after + gnssPositionSessionTimeout expires + \item If gnssPositionSessionTimeout is less than + gnssUnavailableIndicationTimeout, the + GNSS Unavailable timeout indication is sent after + gnssUnavailableIndicationTimeout expires + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Max Geofences */ + uint8_t maxGeofences_valid; /**< Must be set to true if maxGeofences is being passed */ + uint32_t maxGeofences; + /**< Identifies the maximum number of Geofences that can be supported by + the Geofence engine. If this number is less than the currently deployed + Geofences, this command fails. + + If the command succeeds, the engine supports the maximum number of + Geofences requested, provided there is enough memory to support that + many Geofences. Increasing this value to a very large number in a + constrained memory environment might affect other modules negatively. + This value is determined by phone manufacturers. The default value + is 200. */ + + /* Optional */ + /* Enable Motion Detection Sources */ + uint8_t enableMotionDetectionSources_valid; /**< Must be set to true if enableMotionDetectionSources is being passed */ + qmiLocMotionDetectionSourceMaskT_v02 enableMotionDetectionSources; + /**< Identifies the sources that can be enabled for motion detection by + the Geofence engine. The sources of motion detection that are enabled + by the Geofence engine are dependent on the platform. + These sources can only be set once at boot time and they are not expected to be changed after that. + Any attempt to set the value of the motion detection sources at runtime would result in an undefined behaviour. + Valid values: \n + - QMI_LOC_MOTION_DETECTION_SOURCE_SENSORS (0x00000001) -- Sensors are used for motion detection + - QMI_LOC_MOTION_DETECTION_SOURCE_WIFI (0x00000002) -- Wi-Fi is used for motion detection + - QMI_LOC_MOTION_DETECTION_SOURCE_WWAN (0x00000004) -- Wireless WAN is used for motion detection */ + + /* Optional */ + /* Enable Coarse Position Injection Usage */ + uint8_t enableCpiUsage_valid; /**< Must be set to true if enableCpiUsage is being passed */ + uint8_t enableCpiUsage; + /**< Indicates whether external Coarse Position Injection (CPI) is used + by the Geofence engine. + \begin{itemize1} + \item 0x01 (TRUE) -- CPI is enabled (default) + \item 0x00 (FALSE) -- CPI is disabled + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* GNSS Position QOS Session Timeout */ + uint8_t gnssPositionSessionTimeout_valid; /**< Must be set to true if gnssPositionSessionTimeout is being passed */ + uint32_t gnssPositionSessionTimeout; + /**< Identifies the session timeout value (in seconds) for requesting a + position in a bad GNSS environment. + + Valid values: \begin{itemize1} + \item If the gnssUnavailableIndicationTimeout value is less than + gnssPositionSessionTimeout, in a bad GNSS environment, the GNSS + Unavailable timeout indication is sent after + gnssPositionSessionTimeout expires. + \item If gnssPositionSessionTimeout is less than gnssUnavailableIndicationTimeout, + in a bad GNSS environment, the GNSS Unavailable timeout indication + is sent after gnssUnavailableIndicationTimeout expires. \vspace{-0.18in} \end{itemize1} + */ + + /* Optional */ + /* GNSS Position Maximum Position Uncertainity Acceptable */ + uint8_t gnssPositionMaxPuncAcceptable_valid; /**< Must be set to true if gnssPositionMaxPuncAcceptable is being passed */ + uint32_t gnssPositionMaxPuncAcceptable; + /**< Identifies the GNSS Maximum Position Uncertainity in meters acceptable by + Geofencing engine. + + Valid values: positive values\n + */ + + /* Optional */ + /* Medium Responsiveness Value */ + uint8_t mediumResponsivenessValue_valid; /**< Must be set to true if mediumResponsivenessValue is being passed */ + uint32_t mediumResponsivenessValue; + /**< Identifies the medium responsiveness value is seconds that Geofencing engine + will use for all medium responsiveness Geofences in Geofencing engine. + + Valid values: in seconds: positive values + If the value is configured less than 30 seconds, the value will be + taken as 30 seconds. + If the value is configured more than 600 seconds, the value will be + taken as 600 seconds. + + Default: by default Geofencing engine shall use 120 seconds as Medium + Responsiveness value + + If the medium responsiveness value is changed then the responsiveness + of existing medium responsiveness Geofence wont change until the next + position fix which would be based on previous medium responsiveness + setting. + */ + + /* Optional */ + /* Challenging GNSS Environment Minimmum CPI Wait Interval */ + uint8_t chalGnssEnvMinCpiWaitInterval_valid; /**< Must be set to true if chalGnssEnvMinCpiWaitInterval is being passed */ + uint32_t chalGnssEnvMinCpiWaitInterval; + /**< Identifies number of seconds that Geofencing engine shall wait between + CPI requests in challenging GNSS environment + + Valid values: In seconds: Positive Values + */ + + /* Optional */ + uint8_t motionStateInfo_valid; /**< Must be set to true if motionStateInfo is being passed */ + uint32_t motionStateInfo_len; /**< Must be set to # of elements in motionStateInfo */ + qmiLocGeofenceMotionStateConfigStructT_v02 motionStateInfo[QMI_LOC_GEOFENCE_MAX_MOTION_STATES_V02]; + /**< Identifies the Motion State Informatino like Motion State Speed that + Geofencing engine shall use. + */ +}qmiLocSetGeofenceEngineConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the Geofence engine configuration. */ +typedef struct { + + /* Mandatory */ + /* Set Geofence Engine Configuration Status. */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Geofence Engine Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - 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; + /**< Transaction ID that was specified in the Set Geofence Configuration + request. This parameter is always present if the status + field is set to SUCCESS. */ +}qmiLocSetGeofenceEngineConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the Geofence engine configuration. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned with the Get Geofence Engine Configuration + indication. */ +}qmiLocGetGeofenceEngineConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the Geofence engine configuration. */ +typedef struct { + + /* Mandatory */ + /* Get Geofence Engine Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Geofence Engine Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - 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; + /**< Transaction ID that was specified in the Get Geofence Engine Configuration + request. This parameter is always present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* GPS Unavailable Indication Timeout */ + uint8_t gnssUnavailableIndicationTimeout_valid; /**< Must be set to true if gnssUnavailableIndicationTimeout is being passed */ + uint32_t gnssUnavailableIndicationTimeout; + /**< In a bad GNSS environment, the timeout after which the Geofence engine + sends out a GNSS unavailable indication. */ + + /* Optional */ + /* Max Geofences */ + uint8_t maxGeofences_valid; /**< Must be set to true if maxGeofences is being passed */ + uint32_t maxGeofences; + /**< Identifies the maximum number of Geofences that are currently supported + in the Geofence engine. */ + + /* Optional */ + /* Enabled Motion Detection Sources */ + uint8_t enabledMotionDetectionSources_valid; /**< Must be set to true if enabledMotionDetectionSources is being passed */ + qmiLocMotionDetectionSourceMaskT_v02 enabledMotionDetectionSources; + /**< Identifies the sources that are currently enabled for motion detection + by the Geofence engine. + + Valid values: \n + - QMI_LOC_MOTION_DETECTION_SOURCE_SENSORS (0x00000001) -- Sensors are used for motion detection + - QMI_LOC_MOTION_DETECTION_SOURCE_WIFI (0x00000002) -- Wi-Fi is used for motion detection + - QMI_LOC_MOTION_DETECTION_SOURCE_WWAN (0x00000004) -- Wireless WAN is used for motion detection */ + + /* Optional */ + /* Enabled for CPI Position Injection Usage */ + uint8_t enabledCpiUsage_valid; /**< Must be set to true if enabledCpiUsage is being passed */ + uint8_t enabledCpiUsage; + /**< Indicates whether CPI usage is enabled. + \begin{itemize1} + \item 0x01 (TRUE) -- CPI usage is enabled + \item 0x00 (FALSE) -- CPI usage is disabled + \vspace{-0.18in} \end{itemize1}*/ +}qmiLocGetGeofenceEngineConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifier for the Geofence to be edited. */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Edit Geofence + request. This parameter will always be present if the + status field is set to SUCCESS. + */ + + /* Optional */ + /* Geofence State */ + uint8_t geofenceState_valid; /**< Must be set to true if geofenceState is being passed */ + qmiLocGeofenceStateEnumT_v02 geofenceState; + /**< Specifies whether the Geofence is to be actively monitored. + + Valid values: \n + - eQMI_LOC_GEOFENCE_STATE_ACTIVE (1) -- Geofence is being actively monitored + - eQMI_LOC_GEOFENCE_STATE_SUSPEND (2) -- Geofence monitoring is suspended + */ + + /* Optional */ + /* Breach Event Mask */ + uint8_t breachMask_valid; /**< Must be set to true if breachMask is being passed */ + qmiLocGeofenceBreachMaskT_v02 breachMask; + /**< Specifies the breach events in which the client is interested. + + Valid values: \begin{itemize1} + \item 0x01 -- GEOFENCE_BREACH_ ENTERING_MASK + \item 0x02 -- GEOFENCE_BREACH_ LEAVING_MASK + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Responsiveness */ + uint8_t responsiveness_valid; /**< Must be set to true if responsiveness is being passed */ + qmiLocGeofenceResponsivenessEnumT_v02 responsiveness; + /**< Specifies the rate of detection for a Geofence breach. + This may impact the time lag between the actual breach event and + when it is reported. This parameter has power implications + and is to be fine-tuned to optimize power savings. + + Valid values: \n + - eQMI_LOC_GEOFENCE_RESPONSIVENESS_LOW (0x01) -- The Geofence is monitored for a breach at a + low rate of 15 minutes. The gap between the actual breach and + the time it is reported is higher. This + setting results in lower power usage. + - eQMI_LOC_GEOFENCE_RESPONSIVENESS_MED (0x02) -- The Geofence is monitored for a breach at a + medium rate of 2 minutes. This is the default setting. + - eQMI_LOC_GEOFENCE_RESPONSIVENESS_HIGH (0x03) -- The Geofence is monitored for a breach at a + high rate of 10 seconds. The gap between the actual breach and + the time it is reported is low. This results + in higher power usage. + - eQMI_LOC_GEOFENCE_RESPONSIVENESS_ULTRA_HIGH (0x04) -- The Geofence is monitored for a breach at a + very high rate of 1 second. The gap between the actual breach and + the time it is reported is very low. This results + in very high power usage. This setting must be avoided whenever + possible because of the drastic power implications. + */ +}qmiLocEditGeofenceReqMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint32_t qmiLocGeofenceConfigParamMaskT_v02; +#define QMI_LOC_GEOFENCE_PARAM_MASK_GEOFENCE_STATE_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000001) /**< Mask for the Geofence state parameter. */ +#define QMI_LOC_GEOFENCE_PARAM_MASK_BREACH_MASK_V02 ((qmiLocGeofenceConfigParamMaskT_v02)0x00000002) /**< Mask for Geofence breach mask parameter. */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to edit a Geofence. */ +typedef struct { + + /* Mandatory */ + /* Edit Geofence Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Edit Geofence request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence that was edited. */ + + /* Optional */ + /* Transaction ID */ + uint8_t transactionId_valid; /**< Must be set to true if transactionId is being passed */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is specified in the Edit Geofence request. */ + + /* Optional */ + /* Failed Parameters */ + uint8_t failedParams_valid; /**< Must be set to true if failedParams is being passed */ + qmiLocGeofenceConfigParamMaskT_v02 failedParams; + /**< Specified only when the status is not set to SUCCESS. If + the mask corresponding to a field is set, it indicates that + the Geofence parameter could not be edited. + + Valid values: \begin{itemize1} + \item 0x00000001 -- GEOFENCE_PARAM_ MASK_GEOFENCE_STATE + \item 0x00000002 -- GEOFENCE_PARAM_ MASK_BREACH_MASK + \vspace{-0.18in} \end{itemize1} */ +}qmiLocEditGeofenceIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Get Best Available Position indication. */ +}qmiLocGetBestAvailablePositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the best available + position estimate from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Best Available Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Best Available Position request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - 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; + /**< Transaction ID that was specified in the Get Best + Available Position request. This parameter will + always be present if the status field is set to + SUCCESS. */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. + \begin{itemize1} + \item Units: Milliseconds since Jan. 1, 1970 + \vspace{-0.18in} \end{itemize1} */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Major Axis */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation. \n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Circular Confidence */ + uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ + uint8_t horCircularConfidence; + /**< Horizontal circular uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Elliptical Confidence */ + uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ + uint8_t horEllipticalConfidence; + /**< Horizontal elliptical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + + Valid values: \n + - eQMI_LOC_RELIABILITY_NOT_SET (0) -- Location reliability is not set + - eQMI_LOC_RELIABILITY_VERY_LOW (1) -- Location reliability is very low; use it at your own risk + - eQMI_LOC_RELIABILITY_LOW (2) -- Location reliability is low; little or no cross-checking is possible + - eQMI_LOC_RELIABILITY_MEDIUM (3) -- Location reliability is medium; limited cross-check passed + - eQMI_LOC_RELIABILITY_HIGH (4) -- Location reliability is high; strong cross-check passed + */ + + /* Optional */ + /* Horizontal Speed */ + uint8_t horSpeed_valid; /**< Must be set to true if horSpeed is being passed */ + float horSpeed; + /**< Horizontal speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Horizontal Speed Uncertainty */ + uint8_t horSpeedUnc_valid; /**< Must be set to true if horSpeedUnc is being passed */ + float horSpeedUnc; + /**< Horizontal speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level. \n + - Units: Meters */ + + /* 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 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \n + - eQMI_LOC_RELIABILITY_NOT_SET (0) -- Location reliability is not set + - eQMI_LOC_RELIABILITY_VERY_LOW (1) -- Location reliability is very low; use it at your own risk + - eQMI_LOC_RELIABILITY_LOW (2) -- Location reliability is low; little or no cross-checking is possible + - eQMI_LOC_RELIABILITY_MEDIUM (3) -- Location reliability is medium; limited cross-check passed + - eQMI_LOC_RELIABILITY_HIGH (4) -- Location reliability is high; strong cross-check passed + */ + + /* Optional */ + /* Vertical Speed */ + uint8_t vertSpeed_valid; /**< Must be set to true if vertSpeed is being passed */ + float vertSpeed; + /**< Vertical speed. \n + - Units: Meters/second */ + + /* Optional */ + /* Vertical Speed Uncertainty */ + uint8_t vertSpeedUnc_valid; /**< Must be set to true if vertSpeedUnc is being passed */ + float vertSpeedUnc; + /**< Vertical speed uncertainty. \n + - Units: Meters/second */ + + /* Optional */ + /* Heading */ + uint8_t heading_valid; /**< Must be set to true if heading is being passed */ + float heading; + /**< Heading. \n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Heading Uncertainty */ + uint8_t headingUnc_valid; /**< Must be set to true if headingUnc is being passed */ + float headingUnc; + /**< Heading uncertainty. \n + - Type: Floating point \n + - Range: 0 to 359.999 */ + + /* Optional */ + /* Magnetic Deviation */ + uint8_t magneticDeviation_valid; /**< Must be set to true if magneticDeviation is being passed */ + float magneticDeviation; + /**< 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. */ + + /* Optional */ + /* Technology Used Mask */ + uint8_t technologyMask_valid; /**< Must be set to true if technologyMask is being passed */ + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + Valid bitmasks: \n + - QMI_LOC_POS_TECH_MASK_SATELLITE (0x00000001) -- Satellites were used to generate the fix + - QMI_LOC_POS_TECH_MASK_CELLID (0x00000002) -- Cell towers were used to generate the fix + - QMI_LOC_POS_TECH_MASK_WIFI (0x00000004) -- Wi-Fi access points were used to generate the fix + - QMI_LOC_POS_TECH_MASK_SENSORS (0x00000008) -- Sensors were used to generate the fix + - QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION (0x00000010) -- Reference Location was used to generate the fix + - QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION (0x00000020) -- Coarse position injected into the location engine was used to + generate the fix + - QMI_LOC_POS_TECH_MASK_AFLT (0x00000040) -- AFLT was used to generate the fix + - QMI_LOC_POS_TECH_MASK_HYBRID (0x00000080) -- GNSS and network-provided measurements were used to + generate the fix + */ + + /* Optional */ + /* Dilution of Precision */ + uint8_t DOP_valid; /**< Must be set to true if DOP is being passed */ + qmiLocDOPStructT_v02 DOP; + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + Valid values: \n + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1X system + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time) + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection + - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data + from one GPS satellite + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained + - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT; + this is done when the clock time uncertainty is large + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - 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 + */ + + /* Optional */ + /* Sensor Data Usage */ + uint8_t sensorDataUsage_valid; /**< Must be set to true if sensorDataUsage is being passed */ + qmiLocSensorUsageIndicatorStructT_v02 sensorDataUsage; + + /* Optional */ + /* SVs Used to Calculate the Fix */ + uint8_t gnssSvUsedList_valid; /**< Must be set to true if gnssSvUsedList is being passed */ + 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 + */ +}qmiLocGetBestAvailablePositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONSTATEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_STATE_UNKNOWN_V02 = 0, /**< Device state is not known. */ + eQMI_LOC_MOTION_STATE_STATIONARY_V02 = 1, /**< Device state is Stationary. */ + eQMI_LOC_MOTION_STATE_IN_MOTION_V02 = 2, /**< Device state is In Motion. */ + QMILOCMOTIONSTATEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionStateEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCMOTIONMODEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_MOTION_MODE_UNKNOWN_V02 = 0, /**< Device movement is not known. */ + eQMI_LOC_MOTION_MODE_STATIONARY_V02 = 1, /**< Device is not moving. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN_V02 = 200, /**< Device movement is in Pedestrian mode; nothing else is known about the movement. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING_V02 = 201, /**< Device movement is in pedestrian Walking mode. */ + eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING_V02 = 202, /**< Device movement is in pedestrian Running mode. */ + eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN_V02 = 300, /**< Device movement is in Vehicular mode; nothing else is known about the movement. */ + QMILOCMOTIONMODEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocMotionModeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocMotionStateEnumT_v02 motion_state; + /**< Current motion state of the user. + + Valid values: \n + - eQMI_LOC_MOTION_STATE_UNKNOWN (0) -- Device state is not known. + - eQMI_LOC_MOTION_STATE_STATIONARY (1) -- Device state is Stationary. + - eQMI_LOC_MOTION_STATE_IN_MOTION (2) -- Device state is In Motion. + */ + + qmiLocMotionModeEnumT_v02 motion_mode; + /**< Modes of user motion. + + Valid values: \n + - eQMI_LOC_MOTION_MODE_UNKNOWN (0) -- Device movement is not known. + - eQMI_LOC_MOTION_MODE_STATIONARY (1) -- Device is not moving. + - eQMI_LOC_MOTION_MODE_PEDESTRIAN_UNKNOWN (200) -- Device movement is in Pedestrian mode; nothing else is known about the movement. + - eQMI_LOC_MOTION_MODE_PEDESTRIAN_WALKING (201) -- Device movement is in pedestrian Walking mode. + - eQMI_LOC_MOTION_MODE_PEDESTRIAN_RUNNING (202) -- Device movement is in pedestrian Running mode. + - eQMI_LOC_MOTION_MODE_VEHICLE_UNKNOWN (300) -- Device movement is in Vehicular mode; nothing else is known about the movement. + */ + + float probability_of_state; + /**< Probability that the device is actually undergoing the motion state + specified by the combination of the values of motion_state, motion_mode, + and motion_sub_mode. \vspace{0.1in} + + This value is a floating point number in the range of 0 to 100, in + units of percent probability. Any value greater than 99.9999 is + applied as 99.9999. \vspace{0.1in} + + It is recommended that if a particular combination of motion_state and + motion_mode cannot be determined with more than 50 percent confidence, + that a more general statement of user motion be made. + For example, if the mode of In-Motion + Pedestrian-Running can only be + determined with 50 percent probability, and the simpler statement of In-Motion + can be determined with 90 percent probability, it is recommended that this field + be used to simply state In-Motion with 90 percent probability. \vspace{0.1in} + + If the motion_state is not known, the value in this field is not used. + */ + + uint16_t age; + /**< Age of the motion data in milliseconds at the time of injection. + */ + + uint16_t timeout; + /**< If the age of the motion data input exceeds the timeout value, the data + will no longer be used. The timeout value is in units of milliseconds. + Values in the range of 0 to 10000 are accepted. If 65535 is provided, + the motion data input is applied until the next input is + received. \n + + If the determination of motion data is an instantaneous observation + and no notice is guaranteed to be given via the QMI on a change in the + state of the motion data, it is recommended that this field be set to 0. \vspace{0.1in} + + If the determination of motion data is continuously monitored + external to the QMI and an update is always applied to the QMI upon any + change in state, a value of 65535 is used for this field. + Note that in this case, if a certain mode is set and is not later + unset (e.g., by sending in the request message with a user motion + state of Unknown), the value is applied indefinitely. + */ +}qmiLocMotionDataStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Motion Data */ + qmiLocMotionDataStructT_v02 motion_data; +}qmiLocInjectMotionDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects motion data for MSM GPS service use. */ +typedef struct { + + /* Mandatory */ + /* Inject Motion Data Request Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Motion Data request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocInjectMotionDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to retrieve the list of network + initiated Geofence IDs. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The same transaction ID + will be returned in the Get NI Geofence ID List indication. */ +}qmiLocGetNiGeofenceIdListReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to retrieve the list of network + initiated Geofence IDs. */ +typedef struct { + + /* Mandatory */ + /* Get NI Geofence ID List Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get NI Geofence ID List request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - 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; + /**< Transaction ID that was specified in the Get NI + Geofence ID List request. */ + + /* Optional */ + /* NI Geofence ID List */ + uint8_t niGeofenceIdList_valid; /**< Must be set to true if niGeofenceIdList is being passed */ + uint32_t niGeofenceIdList_len; /**< Must be set to # of elements in niGeofenceIdList */ + uint32_t niGeofenceIdList[QMI_LOC_MAX_NI_GEOFENCE_ID_LIST_LENGTH_V02]; + /**< List containing the NI Geofence IDs. + - Type: Array of unsigned 32-bit integers \n + - Maximum NI Geofence ID List length: 16 */ +}qmiLocGetNiGeofenceIdListIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t MCC; + /**< GSM mobile country code. Refer to ITU-T E.212 \hyperref[S6]{[S6]}. */ + + uint32_t MNC; + /**< GSM mobile network code. Refer to \hyperref[S6]{[S6]}. */ + + uint32_t LAC; + /**< GSM location area code. Refer to \hyperref[S6]{[S6]}. */ + + uint32_t CID; + /**< GSM cell identification. Refer to \hyperref[S6]{[S6]}. */ +}qmiLocGSMCellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects GSM cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* GSM Cell ID */ + qmiLocGSMCellIdStructT_v02 gsmCellId; + /**< \vspace{0.06in} \n Identifies the GSM cell on which the device is currently camped. */ + + /* Mandatory */ + /* Roaming Status */ + uint8_t roamingStatus; + /**< Indicates whether the device is roaming. + \begin{itemize1} + \item 0x01 (TRUE) -- Device is roaming + \item 0x00 (FALSE) -- Device is not roaming + \vspace{-0.18in} \end{itemize1}*/ + + /* Optional */ + /* Timing Advance */ + uint8_t timingAdvance_valid; /**< Must be set to true if timingAdvance is being passed */ + uint32_t timingAdvance; + /**< Round trip delay between the MS and the BS, in units of 3.69 microseconds. + Refer to 3GPP TS 05.10 and TS 45.010. */ +}qmiLocInjectGSMCellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects GSM cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject GSM Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject GSM Cell Info request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocInjectGSMCellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCROAMINGSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PHONE_NOT_ROAMING_V02 = 1, /**< Modem is camped on a home network */ + eQMI_LOC_PHONE_ROAMING_V02 = 2, /**< Modem is camped on a roaming network */ + QMILOCROAMINGSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocRoamingStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t mcc; + /**< WCDMA mobile country code. Refer to ITU-T E.212 \hyperref[S6]{[S6]}. */ + + uint32_t mnc; + /**< WCDMA mobile network code. Refer to \hyperref[S6]{[S6]}. */ + + uint32_t cid; + /**< WCDMA cell identity. Refer to \hyperref[S6]{[S6]}. */ +}qmiLocWCDMACellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects WCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* WCDMA Cell ID */ + qmiLocWCDMACellIdStructT_v02 wcdmaCellId; + /**< \n Identifies the WCDMA cell on which the device is currently camped. */ + + /* Mandatory */ + /* Roaming Status */ + qmiLocRoamingStatusEnumT_v02 roamingStatus; + /**< Indicates whether the device is roaming. + + Valid values: \n + - eQMI_LOC_PHONE_NOT_ROAMING (1) -- Modem is camped on a home network + - eQMI_LOC_PHONE_ROAMING (2) -- Modem is camped on a roaming network + */ + + /* Optional */ + /* Cell Frequency */ + uint8_t freq_valid; /**< Must be set to true if freq is being passed */ + uint32_t freq; + /**< Frequency information of the serving cell. \n + Valid range: 0 to 16383 \n + Refer to TS 25.331 \hyperref[S7]{[S7]}. */ + + /* Optional */ + /* Primary Scrambling Code */ + uint8_t psc_valid; /**< Must be set to true if psc is being passed */ + uint32_t psc; + /**< Primary scrambling code of the serving cell. \n + Valid range: 0 to 511 \n + Refer to \hyperref[S7]{[S7]}. */ +}qmiLocInjectWCDMACellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects WCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject WCDMA Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject WCDMA Cell Info request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocInjectWCDMACellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t mcc; + /**< TDSCDMA mobile country code. Refer to ITU-T E.212 \hyperref[S6]{[S6]}. */ + + uint32_t mnc; + /**< TDSCDMA mobile network code. Refer to \hyperref[S6]{[S6]}. */ + + uint32_t cid; + /**< TDSCDMA cell identity. Refer to TS 25.331 \hyperref[S7]{[S7]}. */ + + uint32_t lac; + /**< TDSCDMA location area code. Refer to \hyperref[S6]{[S6]}. */ +}qmiLocTDSCDMACellIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects TDSCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* TDSCDMA Cell ID */ + qmiLocTDSCDMACellIdStructT_v02 tdscdmaCellId; + /**< \n Identifies the TDSCDMA cell on which the device is currently camped. */ + + /* Mandatory */ + /* Roaming Status */ + qmiLocRoamingStatusEnumT_v02 roamingStatus; + /**< Indicates whether the device is roaming. + + Valid values: \n + - eQMI_LOC_PHONE_NOT_ROAMING (1) -- Modem is camped on a home network + - eQMI_LOC_PHONE_ROAMING (2) -- Modem is camped on a roaming network + */ + + /* Optional */ + /* Cell Frequency */ + uint8_t freq_valid; /**< Must be set to true if freq is being passed */ + uint32_t freq; + /**< Frequency information of the serving cell. \n + Valid range: 0 to 16383 \n + Refer to \hyperref[S7]{[S7]}. */ +}qmiLocInjectTDSCDMACellInfoReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects TDSCDMA cell information into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject TDSCDMA Cell Info Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject TDSCDMA Cell Info request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocInjectTDSCDMACellInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects the phone's subscriber ID into the location engine. */ +typedef struct { + + /* Optional */ + /* Preferred IMSI */ + uint8_t preferredIMSI_valid; /**< Must be set to true if preferredIMSI is being passed */ + uint64_t preferredIMSI; + /**< IMSI number of the preferred RAT. Refer to \hyperref[S6]{[S6]}.*/ + + /* Optional */ + /* Preferred MSISDN */ + uint8_t preferredMSISDN_valid; /**< Must be set to true if preferredMSISDN is being passed */ + uint64_t preferredMSISDN; + /**< MSISDN number of the preferred RAT. Refer to \hyperref[S6]{[S6]}.*/ +}qmiLocInjectSubscriberIDReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects the phone's subscriber ID into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Subscriber ID Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Subscriber ID request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocInjectSubscriberIDIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL_V02 = 0, /**< SUPL network-initiated message is being injected. */ + QMILOCINJECTEDNETWORKINITIATEDMESSAGETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects a network-initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Injected Network Initiated Message Type */ + qmiLocInjectedNetworkInitiatedMessageTypeEnumT_v02 injectedNIMessageType; + /**< Type of the network-initiated message being injected. + + Valid values: \n + - eQMI_LOC_INJECTED_NETWORK_INITIATED_MESSAGE_TYPE_SUPL (0) -- SUPL network-initiated message is being injected. */ + + /* Mandatory */ + /* Injected Network Initiated Message */ + uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */ + uint8_t injectedNIMessage[QMI_LOC_MAX_INJECTED_NETWORK_INITIATED_MESSAGE_LENGTH_V02]; + /**< Network-initiated message body. + If the inject NI message type is TYPE_SUPL, the message contains + a SUPL INIT message as defined in OMA-TS-ULP-V2_0-20110527-C \hyperref[S5]{[S5]}. */ +}qmiLocInjectNetworkInitiatedMessageReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects a network-initiated message into the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Network Initiated Message Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Network Initiated Message request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocInjectNetworkInitiatedMessageIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocWWANOutOfServiceNotificationReqMsgT_v02; + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the location engine that the device is out of + service. */ +typedef struct { + + /* Mandatory */ + /* Notify WWAN Out of Service Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Notify WWAN Out of Service request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocWWANOutOfServiceNotificationIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject pedometer data + into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Time Source */ + qmiLocSensorDataTimeSourceEnumT_v02 timeSource; + /**< Time source for the pedometer. The location service uses + this field to identify the time reference used in the + pedometer data time stamp. + + Valid values: \n + - eQMI_LOC_SENSOR_TIME_SOURCE_UNSPECIFIED (0) -- Sensor time source is unspecified + - eQMI_LOC_SENSOR_TIME_SOURCE_COMMON (1) -- Time source is common between the sensors and + the location engine + */ + + /* Mandatory */ + /* Pedometer Report Timestamp */ + uint32_t timestamp; + /**< Time stamp of the last step event in this report, i.e., the time stamp + of the step event that caused this report to be generated. + The time stamp is in the time reference scale that is + used by the pedometer time source. \n + - Units: Milliseconds */ + + /* Mandatory */ + /* Time Interval */ + uint32_t timeInterval; + /**< Time interval during which the step count was calculated. Subtracting + timeInterval from the timestamp field yields the time when + the step detection for the first step in this report started. \n + - Units: Milliseconds */ + + /* Mandatory */ + /* Step Count */ + uint32_t stepCount; + /**< Number of steps counted during the time interval. */ + + /* Optional */ + /* Step Confidence */ + uint8_t stepConfidence_valid; /**< Must be set to true if stepConfidence is being passed */ + uint8_t stepConfidence; + /**< Confidence associated with the step. This field is only applicable + for a single step report, i.e., if the step count is one. \n + - Range: 0 to 100 \n + \textbf{Note:} The report is ignored if confidence is 0. */ + + /* Optional */ + /* Step Count Uncertainty */ + uint8_t stepCountUncertainty_valid; /**< Must be set to true if stepCountUncertainty is being passed */ + float stepCountUncertainty; + /**< Uncertainty (in steps) associated with the step count. */ + + /* Optional */ + /* Step Rate */ + uint8_t stepRate_valid; /**< Must be set to true if stepRate is being passed */ + float stepRate; + /**< Current estimate for the rate of steps per second. \n + - Units: steps/second \n + - Range: >= 0.0 */ +}qmiLocPedometerReportReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject pedometer data + into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Status of Pedometer Report Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Pedometer Report request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocPedometerReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the batching size. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID is returned in the Get + Batch Size indication. */ + + /* Mandatory */ + /* Requested Batch Size */ + uint32_t batchSize; + /**< Request the service with the number of location fixes to be batched. */ +}qmiLocGetBatchSizeReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the batching size. */ +typedef struct { + + /* Mandatory */ + /* Get Batch Size Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Batch Size request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Get Batch + Size request. + */ + + /* Mandatory */ + /* Batch Size Supported */ + uint32_t batchSize; + /**< Number of location fixes that the service is able to batch. + The batch size value is returned as 0 in the case of a failure status. + */ +}qmiLocGetBatchSizeIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to initiate a batching session. */ +typedef struct { + + /* Optional */ + /* Minimum Interval Between Position Reports */ + uint8_t minInterval_valid; /**< Must be set to true if minInterval is being passed */ + uint32_t minInterval; + /**< Minimum time interval, specified by the control point, that must elapse between + position reports. \n + - Units: milliseconds \n + - Default: 60000 ms + */ + + /* Optional */ + /* Horizontal Accuracy Level */ + uint8_t horizontalAccuracyLevel_valid; /**< Must be set to true if horizontalAccuracyLevel is being passed */ + qmiLocAccuracyLevelEnumT_v02 horizontalAccuracyLevel; + /**< Specifies the horizontal accuracy level required by the control point. + If not specified, accuracy defaults to LOW. + + Valid values: \n + - eQMI_LOC_ACCURACY_LOW (1) -- Low accuracy + - eQMI_LOC_ACCURACY_MED (2) -- Medium accuracy + - eQMI_LOC_ACCURACY_HIGH (3) -- High accuracy + */ + + /* Optional */ + /* Fix Session Timeout Period */ + uint8_t fixSessionTimeout_valid; /**< Must be set to true if fixSessionTimeout is being passed */ + uint32_t fixSessionTimeout; + /**< Configures the fix session timeout duration. \n + - Units: Milliseconds \n + - Default: 20,000 ms + */ +}qmiLocStartBatchingReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to initiate a batching session. */ +typedef struct { + + /* Mandatory */ + /* Start Batching Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Start Batching request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocStartBatchingIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to notify the control point that the batched buffer is full. */ +typedef struct { + + /* Mandatory */ + /* Number of Entries in the Batch During Full Event */ + uint32_t batchCount; + /**< Number of entries in the batch during a full event. + */ +}qmiLocEventBatchFullIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocBatchedReportValidFieldsMaskT_v02; +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_LATITUDE_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000001ull) /**< Latitude field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_LONGITUDE_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000002ull) /**< Longitude field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_HOR_CIR_UNC_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000004ull) /**< Horizontal circular uncertainty field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_SPEED_HOR_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000008ull) /**< Horizontal speed field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_SPEED_UNC_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000010ull) /**< Speed uncertainty field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_ALT_WRT_ELP_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000020ull) /**< Altitude with respect to ellipsoid field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_SPEED_VER_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000040ull) /**< Vertical speed field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_HEADING_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000080ull) /**< Heading field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_HEADING_UNC_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000100ull) /**< Heading uncertainty field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_TECH_MASK_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000200ull) /**< Technology source mask field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_TIMESTAMP_UTC_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000400ull) /**< UTC timestamp field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_TIME_UNC_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00000800ull) /**< Time uncertainty field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_MAGNETIC_DEV_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00001000ull) /**< Magnetic deviation field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_VERT_UNC_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00002000ull) /**< Vertical uncertainty field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_HOR_CONF_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00004000ull) /**< Horizontal confidence field is valid for this fix */ +#define QMI_LOC_BATCHED_REPORT_MASK_VALID_TIMESTAMP_GPS_V02 ((qmiLocBatchedReportValidFieldsMaskT_v02)0x00008000ull) /**< GPS timestamp field is valid for this fix */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t fixId; + /**< Fix count for the session. The count starts at 0 and increments by one for + each successive batched position report for a particular session. */ + + qmiLocBatchedReportValidFieldsMaskT_v02 validFields; + /**< Mask of all valid fields for this fix. + Valid bitmasks: \n + - QMI_LOC_BATCHED_REPORT_MASK_VALID_LATITUDE (0x00000001) -- Latitude field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_LONGITUDE (0x00000002) -- Longitude field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_HOR_CIR_UNC (0x00000004) -- Horizontal circular uncertainty field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_SPEED_HOR (0x00000008) -- Horizontal speed field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_SPEED_UNC (0x00000010) -- Speed uncertainty field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_ALT_WRT_ELP (0x00000020) -- Altitude with respect to ellipsoid field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_SPEED_VER (0x00000040) -- Vertical speed field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_HEADING (0x00000080) -- Heading field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_HEADING_UNC (0x00000100) -- Heading uncertainty field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_TECH_MASK (0x00000200) -- Technology source mask field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_TIMESTAMP_UTC (0x00000400) -- UTC timestamp field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_TIME_UNC (0x00000800) -- Time uncertainty field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_MAGNETIC_DEV (0x00001000) -- Magnetic deviation field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_VERT_UNC (0x00002000) -- Vertical uncertainty field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_HOR_CONF (0x00004000) -- Horizontal confidence field is valid for this fix + - QMI_LOC_BATCHED_REPORT_MASK_VALID_TIMESTAMP_GPS (0x00008000) -- GPS timestamp field is valid for this fix + */ + + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + float speedHorizontal; + /**< Horizontal speed.\n + - Units: Meters/second */ + + float speedUnc; + /**< 3-D Speed uncertainty.\n + - Units: Meters/second */ + + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + float speedVertical; + /**< Vertical speed.\n + - Units: Meters/second */ + + float heading; + /**< Heading.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + float headingUnc; + /**< Heading uncertainty.\n + - Units: Degrees \n + - Range: 0 to 359.999 */ + + qmiLocPosTechMaskT_v02 technologyMask; + /**< Technology used in computing this fix. + Valid bitmasks: \n + - QMI_LOC_POS_TECH_MASK_SATELLITE (0x00000001) -- Satellites were used to generate the fix + - QMI_LOC_POS_TECH_MASK_CELLID (0x00000002) -- Cell towers were used to generate the fix + - QMI_LOC_POS_TECH_MASK_WIFI (0x00000004) -- Wi-Fi access points were used to generate the fix + - QMI_LOC_POS_TECH_MASK_SENSORS (0x00000008) -- Sensors were used to generate the fix + - QMI_LOC_POS_TECH_MASK_REFERENCE_LOCATION (0x00000010) -- Reference Location was used to generate the fix + - QMI_LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION (0x00000020) -- Coarse position injected into the location engine was used to + generate the fix + - QMI_LOC_POS_TECH_MASK_AFLT (0x00000040) -- AFLT was used to generate the fix + - QMI_LOC_POS_TECH_MASK_HYBRID (0x00000080) -- GNSS and network-provided measurements were used to + generate the fix + */ + + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds since Jan. 1, 1970 */ + + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + float magneticDeviation; + /**< 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. */ + + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + uint8_t horConfidence; + /**< Horizontal confidence. + - Units: Percent + - Range: 0 to 99 */ + + qmiLocGPSTimeStructT_v02 gpsTime; + /**< Number of weeks since Jan. 5, 1980, and milliseconds into the current week. */ +}qmiLocBatchedReportStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used to notify the control point with the live batched + position report. */ +typedef struct { + + /* Mandatory */ + /* Batched Position Report */ + qmiLocBatchedReportStructT_v02 liveBatchedReport; + /**< Live position report that is also batched. */ +}qmiLocEventLiveBatchedPositionReportIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to retrieve fixes from the batch. */ +typedef struct { + + /* Mandatory */ + /* Number of Fix Entries to be Retrieved from the Batch */ + uint32_t numberOfEntries; + /**< Number of fix entries to be retrieved from the batch. \n + Maximum limit -- QMI_LOC_READ_FROM_BATCH_MAX_SIZE. + */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID is returned in the Read + from Batch indication. */ +}qmiLocReadFromBatchReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to retrieve fixes from the batch. */ +typedef struct { + + /* Mandatory */ + /* Read from Batch Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Read from Batch request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Read from Batch + request. + */ + + /* Optional */ + /* Number of Fix Entries Returned from the Batch */ + uint8_t numberOfEntries_valid; /**< Must be set to true if numberOfEntries is being passed */ + uint32_t numberOfEntries; + /**< Number of fix entries returned from the batch. */ + + /* Optional */ + /* List of Batched Position Reports Returned */ + uint8_t batchedReportList_valid; /**< Must be set to true if batchedReportList is being passed */ + uint32_t batchedReportList_len; /**< Must be set to # of elements in batchedReportList */ + qmiLocBatchedReportStructT_v02 batchedReportList[QMI_LOC_READ_FROM_BATCH_MAX_SIZE_V02]; + /**< \n List of fix reports returned from the batch. */ +}qmiLocReadFromBatchIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to stop an ongoing batching session. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID of the request. */ +}qmiLocStopBatchingReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to stop an ongoing batching session. */ +typedef struct { + + /* Mandatory */ + /* Stop Batching Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Stop Batching request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Stop Batching request. + */ +}qmiLocStopBatchingIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to release the batching buffer. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. */ +}qmiLocReleaseBatchReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to release the batching buffer. */ +typedef struct { + + /* Mandatory */ + /* Release Batch Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Release Batch request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Transaction ID that was specified in the Release Batch request. + */ +}qmiLocReleaseBatchIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef struct { + /* This element is a placeholder to prevent the declaration of + an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */ + char __placeholder; +}qmiLocEventInjectWifiApDataReqIndMsgT_v02; + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIAPDATADEVICETYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_AP_DATA_DEVICE_TYPE_WLAN_802_11_A_V02 = 0, /**< Wi-Fi AP device is 802.11a. */ + eQMI_LOC_WIFI_AP_DATA_DEVICE_TYPE_WLAN_802_11_B_V02 = 1, /**< Wi-Fi AP device is 802.11b. */ + eQMI_LOC_WIFI_AP_DATA_DEVICE_TYPE_WLAN_802_11_G_V02 = 2, /**< Wi-Fi AP device is 802.11g. */ + QMILOCWIFIAPDATADEVICETYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiApDataDeviceTypeEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIAPDATARTDUNITTYPEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_AP_DATA_RTD_UNIT_MICROSEC_V02 = 0, /**< Wi-Fi AP data Round-trip Delay (RTD) is in microseconds. */ + eQMI_LOC_WIFI_AP_DATA_RTD_UNIT_HUNDREDS_OF_NANOSEC_V02 = 1, /**< Wi-Fi AP data RTD is in hundreds of nanoseconds. */ + eQMI_LOC_WIFI_AP_DATA_RTD_UNIT_TENS_OF_NANOSEC_V02 = 2, /**< Wi-Fi AP data RTD is in tens of nanoseconds. */ + eQMI_LOC_WIFI_AP_DATA_RTD_UNIT_NANOSEC_V02 = 3, /**< Wi-Fi AP data RTD is in nanoseconds. */ + eQMI_LOC_WIFI_AP_DATA_RTD_UNIT_TENTH_OF_NANOSEC_V02 = 4, /**< Wi-Fi AP data RTD is in tenths of nanoseconds. */ + QMILOCWIFIAPDATARTDUNITTYPEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiApDataRtdUnitTypeEnumT_v02; +/** + @} + */ + +typedef uint32_t qmiLocWifiApDataMaskT_v02; +#define QMI_LOC_WIFI_APDATA_MASK_AP_TRANSMIT_POWER_V02 ((qmiLocWifiApDataMaskT_v02)0x00000001) /**< AP transmit power is valid */ +#define QMI_LOC_WIFI_APDATA_MASK_AP_ANTENNA_GAIN_V02 ((qmiLocWifiApDataMaskT_v02)0x00000002) /**< AP antenna gain is valid */ +#define QMI_LOC_WIFI_APDATA_MASK_AP_SNR_V02 ((qmiLocWifiApDataMaskT_v02)0x00000004) /**< AP signal-to-noise ratio is valid */ +#define QMI_LOC_WIFI_APDATA_MASK_AP_DEVICE_TYPE_V02 ((qmiLocWifiApDataMaskT_v02)0x00000008) /**< AP device type is valid */ +#define QMI_LOC_WIFI_APDATA_MASK_AP_RSSI_V02 ((qmiLocWifiApDataMaskT_v02)0x00000010) /**< AP RSSI is valid */ +#define QMI_LOC_WIFI_APDATA_MASK_AP_CHANNEL_V02 ((qmiLocWifiApDataMaskT_v02)0x00000020) /**< AP channel is valid */ +#define QMI_LOC_WIFI_APDATA_MASK_AP_ROUNDTRIP_DELAY_V02 ((qmiLocWifiApDataMaskT_v02)0x00000040) /**< AP roundtrip delay is valid */ +#define QMI_LOC_WIFI_APDATA_MASK_AP_ROUNDTRIP_DELAY_ACCURACY_V02 ((qmiLocWifiApDataMaskT_v02)0x00000080) /**< AP roundtrip delay accuracy is valid */ +#define QMI_LOC_WIFI_APDATA_MASK_MOBILE_SNR_V02 ((qmiLocWifiApDataMaskT_v02)0x00000100) /**< Mobile signal-to-noise ratio is valid */ +#define QMI_LOC_WIFI_APDATA_MASK_MOBILE_RSSI_V02 ((qmiLocWifiApDataMaskT_v02)0x00000200) /**< Mobile RSSI is valid */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocWifiApDataMaskT_v02 wifiApDataMask; + /**< Specifies which Wi-Fi AP scan information types are being used. + + Valid values: \n + - QMI_LOC_WIFI_APDATA_MASK_AP_TRANSMIT_POWER (0x00000001) -- AP transmit power is valid + - QMI_LOC_WIFI_APDATA_MASK_AP_ANTENNA_GAIN (0x00000002) -- AP antenna gain is valid + - QMI_LOC_WIFI_APDATA_MASK_AP_SNR (0x00000004) -- AP signal-to-noise ratio is valid + - QMI_LOC_WIFI_APDATA_MASK_AP_DEVICE_TYPE (0x00000008) -- AP device type is valid + - QMI_LOC_WIFI_APDATA_MASK_AP_RSSI (0x00000010) -- AP RSSI is valid + - QMI_LOC_WIFI_APDATA_MASK_AP_CHANNEL (0x00000020) -- AP channel is valid + - QMI_LOC_WIFI_APDATA_MASK_AP_ROUNDTRIP_DELAY (0x00000040) -- AP roundtrip delay is valid + - QMI_LOC_WIFI_APDATA_MASK_AP_ROUNDTRIP_DELAY_ACCURACY (0x00000080) -- AP roundtrip delay accuracy is valid + - QMI_LOC_WIFI_APDATA_MASK_MOBILE_SNR (0x00000100) -- Mobile signal-to-noise ratio is valid + - QMI_LOC_WIFI_APDATA_MASK_MOBILE_RSSI (0x00000200) -- Mobile RSSI is valid */ + + uint8_t macAddress[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< MAC address. \n + Each address is of length QMI_LOC_WIFI_MAC_ADDR_LENGTH. \n + */ + + int32_t apTransmitPower; + /**< AP transmit power in dBm. */ + + int32_t apAntennaGain; + /**< AP antenna gain in dBI. */ + + int32_t apSignalToNoise; + /**< AP SNR received at the mobile device. */ + + qmiLocWifiApDataDeviceTypeEnumT_v02 apDeviceType; + /**< List of AP device types. */ + + int32_t apRssi; + /**< AP signal strength indicator in dBm. */ + + uint16_t apChannel; + /**< AP Wi-Fi channel on which a beacon was received. */ + + uint32_t apRoundTripDelay; + /**< Round trip delay between the mobile device and the AP, in units of + apRoundTripDelayUnit. */ + + qmiLocWifiApDataRtdUnitTypeEnumT_v02 apRoundTripDelayUnit; + /**< Units of apRoundTripDelay and its accuracy; mandatory if apRoundTripDelay + is present. */ + + uint8_t apRoundTripDelayAccuracy; + /**< AP's accuracy of round trip delay apRoundTripDelay, in units of + apRoundTripDelayUnit. */ + + int32_t mobileSignalToNoise; + /**< Mobile SNR received at the AP. */ + + int32_t mobileRssi; + /**< Mobile signal strength at the AP. */ +}qmiLocWifiApDataStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects Wi-Fi AP data. */ +typedef struct { + + /* Mandatory */ + /* Wi-Fi AP Scan Data */ + uint32_t wifiApInfo_len; /**< Must be set to # of elements in wifiApInfo */ + qmiLocWifiApDataStructT_v02 wifiApInfo[QMI_LOC_WIFI_MAX_REPORTED_APS_PER_MSG_V02]; + /**< \n List of Wi-Fi AP scan information entered by the control point. */ +}qmiLocInjectWifiApDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects Wi-Fi AP data. */ +typedef struct { + + /* Mandatory */ + /* Wi-Fi AP Scan Information Injection Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Wi-Fi AP Scan Information request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocInjectWifiApDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIACCESSPOINTATTACHSTATESENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_ACCESS_POINT_ATTACHED_V02 = 0, /**< Attached to an access point */ + eQMI_LOC_WIFI_ACCESS_POINT_DETACHED_V02 = 1, /**< Detached from an access point */ + eQMI_LOC_WIFI_ACCESS_POINT_HANDOVER_V02 = 2, /**< Handed over to another access point */ + QMILOCWIFIACCESSPOINTATTACHSTATESENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiAccessPointAttachStatesEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject the Wi-Fi attachment status. */ +typedef struct { + + /* Mandatory */ + /* Attach State */ + qmiLocWifiAccessPointAttachStatesEnumT_v02 attachState; + /**< Wi.Fi access point attach state. + + Valid values: \n + - eQMI_LOC_WIFI_ACCESS_POINT_ATTACHED (0) -- Attached to an access point + - eQMI_LOC_WIFI_ACCESS_POINT_DETACHED (1) -- Detached from an access point + - eQMI_LOC_WIFI_ACCESS_POINT_HANDOVER (2) -- Handed over to another access point */ + + /* Optional */ + /* Access Point MAC Address */ + uint8_t accessPointMacAddress_valid; /**< Must be set to true if accessPointMacAddress is being passed */ + uint8_t accessPointMacAddress[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< MAC address of the access point to which the Wi-Fi is attached. + This must always be specified if the attach state is Handover. + */ + + /* Optional */ + /* Wifi AP SSID string */ + uint8_t wifiApSsid_valid; /**< Must be set to true if wifiApSsid is being passed */ + char wifiApSsid[QMI_LOC_MAX_WIFI_AP_SSID_STR_LENGTH_V02 + 1]; + /**< The NULL terminated SSID of the Wifi AP. Its max length according to the ASCII standard is 32 octets*/ +}qmiLocNotifyWifiAttachmentStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject the Wi-Fi attachment status. */ +typedef struct { + + /* Mandatory */ + /* Status of Wi-Fi Attachment Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of Wi-Fi Attachment Status request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocNotifyWifiAttachmentStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCWIFIENABLEDSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_WIFI_ENABLED_FALSE_V02 = 0, /**< Wi-Fi is disabled on the device */ + eQMI_LOC_WIFI_ENABLED_TRUE_V02 = 1, /**< Wi-Fi is enabled on the device */ + QMILOCWIFIENABLEDSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocWifiEnabledStatusEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to inject the Wi-Fi enabled status. */ +typedef struct { + + /* Mandatory */ + /* Enabled Status */ + qmiLocWifiEnabledStatusEnumT_v02 enabledStatus; + /**< Wi-Fi enabled status on the device. + + Valid values: \n + - eQMI_LOC_WIFI_ENABLED_FALSE (0) -- Wi-Fi is disabled on the device + - eQMI_LOC_WIFI_ENABLED_TRUE (1) -- Wi-Fi is enabled on the device */ +}qmiLocNotifyWifiEnabledStatusReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject the Wi-Fi enabled status. */ +typedef struct { + + /* Mandatory */ + /* Status of Wi-Fi Enabled Status Request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Wi-Fi Enabled Status request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocNotifyWifiEnabledStatusIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Notifies the control point whether the GNSS location engine is + ready to accept vehicle data. */ +typedef struct { + + /* Optional */ + /* Vehicle Accelerometer Ready Status */ + uint8_t vehicleAccelReadyStatus_valid; /**< Must be set to true if vehicleAccelReadyStatus is being passed */ + uint8_t vehicleAccelReadyStatus; + /**< The location service uses this TLV to let a control point know when it is + ready or not ready to receive vehicle accelerometer data input. + Values: \n + - 0x00 -- Not ready \n + - 0x01 -- Ready */ + + /* Optional */ + /* Vehicle Angular Rate Ready Status */ + uint8_t vehicleAngularRateReadyStatus_valid; /**< Must be set to true if vehicleAngularRateReadyStatus is being passed */ + uint8_t vehicleAngularRateReadyStatus; + /**< The location service uses this TLV to let a control point know when it is + ready or not ready to receive vehicle angular rate data input. + Values: \n + - 0x00 -- Not ready \n + - 0x01 -- Ready */ + + /* Optional */ + /* Vehicle Odometry Ready Status */ + uint8_t vehicleOdometryReadyStatus_valid; /**< Must be set to true if vehicleOdometryReadyStatus is being passed */ + uint8_t vehicleOdometryReadyStatus; + /**< The location service uses this TLV to let a control point know when it is + ready or not ready to receive vehicle odometry data input. + Values: \n + - 0x00 -- Not ready \n + - 0x01 -- Ready*/ +}qmiLocEventVehicleDataReadyIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the vehicle sensor time of the first sample. \n + - Units: Microseconds \n + - Range: Up to over 4000 seconds */ + + uint32_t axisSample_len; /**< Must be set to # of elements in axisSample */ + float axisSample[QMI_LOC_VEHICLE_SENSOR_DATA_MAX_AXES_V02]; + /**< Sensor axis sample. \n + - Type: Floating point \n + - Units accelerometer: Meters/Seconds^2 \n + - Units gyroscope: Radians/Seconds \vspace{0.06in} + + Note: The axes samples must be in the following order: \n + 1. X-Axis \n + 2. Y-Axis \n + 3. Z-Axis */ +}qmiLocVehicleSensorSampleStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocAxesMaskT_v02; +#define QMI_LOC_MASK_X_AXIS_V02 ((qmiLocAxesMaskT_v02)0x01) /**< X-axis is valid */ +#define QMI_LOC_MASK_Y_AXIS_V02 ((qmiLocAxesMaskT_v02)0x02) /**< Y-axis is valid */ +#define QMI_LOC_MASK_Z_AXIS_V02 ((qmiLocAxesMaskT_v02)0x04) /**< Z-axis is valid */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t sampleTimeBase; + /**< Denotes a 32-bit time tag of the reference time from which + all samples in this message are offset. This time must + be the same as or (slightly) earlier than the first (oldest) + sample in this message. \n + - Units: Milliseconds \n + - Range: ~4 million seconds, or almost 50 days between rollovers */ + + qmiLocAxesMaskT_v02 axesValidity; + /**< Identifies the axes that are valid for all sensor samples. + + Valid values: \n + - QMI_LOC_MASK_X_AXIS (0x01) -- X-axis is valid + - QMI_LOC_MASK_Y_AXIS (0x02) -- Y-axis is valid + - QMI_LOC_MASK_Z_AXIS (0x04) -- Z-axis is valid */ + + uint32_t sensorData_len; /**< Must be set to # of elements in sensorData */ + qmiLocVehicleSensorSampleStructT_v02 sensorData[QMI_LOC_VEHICLE_SENSOR_DATA_MAX_SAMPLES_V02]; +}qmiLocVehicleSensorSampleListStructType_v02; /* Type */ +/** + @} + */ + +typedef uint32_t qmiLocVehicleOdometryMeasDeviationMaskType_v02; +#define QMI_LOC_MASK_VEHICLE_ODOMETRY_REVERSE_MOVEMENT_V02 ((qmiLocVehicleOdometryMeasDeviationMaskType_v02)0x00000001) /**< Odometry data in this message includes at least some data where + the vehicle may have been moving in the reverse direction; this + bit must be set if odometry data may be in reverse, and should + not be set if odometry data is all in the forward direction */ +#define QMI_LOC_MASK_VEHICLE_ODOMETRY_AFFECTED_BY_ERRORS_V02 ((qmiLocVehicleOdometryMeasDeviationMaskType_v02)0x00000002) /**< Odometry data in this message includes at least some data affected + by a major error source affecting distance-travelled accuracy, + such as wheel slippage due to skidding, gravel, snow, or ice, as + detected by the vehicle, e.g., via an ABS or other system */ +#define QMI_LOC_MASK_VEHICLE_ODOMETRY_ABSOLUTE_MEASUREMENT_V02 ((qmiLocVehicleOdometryMeasDeviationMaskType_v02)0x00000004) /**< Odometry data in this message is an absolute amount since the vehicle + began service, and is the same vehicle that is regularly used with + this device (so that the offset of this value, since the last time + this measurement was used by the location engine, can safely be used + as a likely correct estimate of distance travelled since last + use) */ +typedef uint32_t qmiLocVehicleOdometryWheelFlagsMaskT_v02; +#define QMI_LOC_MASK_VEHICLE_ODOMETRY_LEFT_AND_RIGHT_AVERAGE_V02 ((qmiLocVehicleOdometryWheelFlagsMaskT_v02)0x00000001) /**< Average of left and right non-turning wheels */ +#define QMI_LOC_MASK_VEHICLE_ODOMETRY_LEFT_V02 ((qmiLocVehicleOdometryWheelFlagsMaskT_v02)0x00000002) /**< Left side, non-turning wheel */ +#define QMI_LOC_MASK_VEHICLE_ODOMETRY_RIGHT_V02 ((qmiLocVehicleOdometryWheelFlagsMaskT_v02)0x00000004) /**< Right side, non-turning wheel */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t timeOffset; + /**< Sample time offset. This time offset must be + relative to the sensor time of the first sample. \n + - Units: Microseconds + - Range: Up to over 4000 seconds */ + + uint32_t distanceTravelled_len; /**< Must be set to # of elements in distanceTravelled */ + uint32_t distanceTravelled[QMI_LOC_VEHICLE_ODOMETRY_MAX_MEASUREMENTS_V02]; + /**< Distance travelled (odometry) sample offset. \n + - Units of accumulated distance: Millimeters + - Range: Over 4000 kilometers + + This measurement (with units in millimeters) is added to + the distance_travelled_base measurement (in meters) to + get the total distance travelled sample value. + + Note: The order of measurements must be as follows: \n + 1. Left and right average \n + 2. Left \n + 3. Right + */ +}qmiLocVehicleOdometrySampleStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t sampleTimeBase; + /**< Denotes a 32-bit time tag of a reference time, from which + all samples in this message are offset. Note this time must + be the same or (slightly) earlier than the first (oldest) + sample in this message. \n + - Units: 1 millisecond \n + - Range: ~4 million seconds, or almost 50 days between rollovers */ + + qmiLocVehicleOdometryMeasDeviationMaskType_v02 flags; + /**< Flags to indicate any deviation from the default measurement + assumptions. Valid bitmasks: \n + - QMI_LOC_MASK_VEHICLE_ODOMETRY_REVERSE_MOVEMENT (0x00000001) -- Odometry data in this message includes at least some data where + the vehicle may have been moving in the reverse direction; this + bit must be set if odometry data may be in reverse, and should + not be set if odometry data is all in the forward direction + - QMI_LOC_MASK_VEHICLE_ODOMETRY_AFFECTED_BY_ERRORS (0x00000002) -- Odometry data in this message includes at least some data affected + by a major error source affecting distance-travelled accuracy, + such as wheel slippage due to skidding, gravel, snow, or ice, as + detected by the vehicle, e.g., via an ABS or other system + - QMI_LOC_MASK_VEHICLE_ODOMETRY_ABSOLUTE_MEASUREMENT (0x00000004) -- Odometry data in this message is an absolute amount since the vehicle + began service, and is the same vehicle that is regularly used with + this device (so that the offset of this value, since the last time + this measurement was used by the location engine, can safely be used + as a likely correct estimate of distance travelled since last + use) */ + + qmiLocVehicleOdometryWheelFlagsMaskT_v02 wheelFlags; + /**< Delineates for which wheels measurements are being provided + in the following samples, where one or more of the following + bits must be set, and data samples aligned with these axes must + appear in groups, in this order. + + Valid bitmasks: \n + - QMI_LOC_MASK_VEHICLE_ODOMETRY_LEFT_AND_RIGHT_AVERAGE (0x00000001) -- Average of left and right non-turning wheels + - QMI_LOC_MASK_VEHICLE_ODOMETRY_LEFT (0x00000002) -- Left side, non-turning wheel + - QMI_LOC_MASK_VEHICLE_ODOMETRY_RIGHT (0x00000004) -- Right side, non-turning wheel */ + + uint32_t distanceTravelledBase; + /**< Distance traveled base. \n + - Units of accumulated distance: Meters \n + - Range: Over 4,000,0000 kilometers \vspace{0.06in} \n + + Distance travelled (odometry) is to be reported in a continuously + accumulating way from device power up. It may be incremental distance + starting at 0, or another arbitrary point, from device power up, or the + absolute distance traveled by the vehicle + (and if so, set QMI_LOC_MASK_VEHICLE_ODOMETRY_ABSOLUTE_MEASUREMENT), + as long as it grows incrementally from device power up. + + This distance_travelled_base is added to the distrance_travelled_offset + of each sample (below) to get the absolute distance of each sample + point. + + Distance travelled errors are expected to be primarily due to the + scale factor, with some allowance for noise due to minor slippage + events (e.g., gravel.) + Major wheel slippage events that affect odometry + must be flagged -- see the flags field. + + Note that other events, such as a vehicle travelling in reverse, may + also affect the available accuracy of this information, and notification + of those events must be provided -- see the flags field. */ + + uint32_t odometryData_len; /**< Must be set to # of elements in odometryData */ + qmiLocVehicleOdometrySampleStructT_v02 odometryData[QMI_LOC_VEHICLE_SENSOR_DATA_MAX_SAMPLES_V02]; + /**< Variable length array to specify the odometry samples. + Maximum length of the array is 50. */ +}qmiLocVehicleOdometrySampleListStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Injects on-vehicle sensor data into the location engine. */ +typedef struct { + + /* Optional */ + /* On-Vehicle Accelerometer Data */ + uint8_t accelData_valid; /**< Must be set to true if accelData is being passed */ + qmiLocVehicleSensorSampleListStructType_v02 accelData; + /**< \vspace{0.06in} \n Vehicle accelerometer sensor samples. */ + + /* Optional */ + /* On-Vehicle Angular Rotation Data */ + uint8_t angRotationData_valid; /**< Must be set to true if angRotationData is being passed */ + qmiLocVehicleSensorSampleListStructType_v02 angRotationData; + /**< \vspace{0.06in} \n Vehicle angular rotation data sensor samples. */ + + /* Optional */ + /* Odometry Data */ + uint8_t odometryData_valid; /**< Must be set to true if odometryData is being passed */ + qmiLocVehicleOdometrySampleListStructT_v02 odometryData; + /**< \vspace{0.06in} \n Odometer sensor samples. */ + + /* Optional */ + /* External Time Sync Information */ + uint8_t changeInTimeScales_valid; /**< Must be set to true if changeInTimeScales is being passed */ + int32_t changeInTimeScales; + /**< This field is to be used in conjunction with an external + time-sync mechanism that is aligning the vehicle sensor time scale + with the on-device sensor time scale to ensure that updates in + that time offset do not appear as jumps in the relative sensor time + of the samples provided in this message. If there is no such sync + mechanism, e.g., if only the vehicle time is provided, this field + may be left at 0. + + This field is defined as the change from the previously-sent QMI + message with similar TLVs 0x10, 0x11, or 0x12 in it, to this QMI + message in the amount that the sensor_time is ahead of an + external vehicle time. \n + + - Units: Microseconds \n + - Range: Approximately -2100 seconds to + 2100 seconds, where + full-scale (minimum and maximum value) is interpreted + as equal to or greater than this value of an offset change + (unlikely to be reached in practice, unless there is a + startup, major resync, or some other rollover event). */ +}qmiLocInjectVehicleSensorDataReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Injects on-vehicle sensor data into the location engine. */ +typedef struct { + + /* Mandatory */ + /* Inject Vehicle Sensor Data Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Inject Vehicle Sensor Data request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocInjectVehicleSensorDataIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to get the first available WWAN + position from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Get Available WWAN Position indication. */ +}qmiLocGetAvailWwanPositionReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to get the first available WWAN + position from the location engine. */ +typedef struct { + + /* Mandatory */ + /* Get Available WWAN Position Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Get Available WWAN Position request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - 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; + /**< Transaction ID that was specified in the Get Available + WWAN Position request. This parameter will + always be present if the status field is set to + SUCCESS. */ + + /* Optional */ + /* Latitude */ + uint8_t latitude_valid; /**< Must be set to true if latitude is being passed */ + double latitude; + /**< Latitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Optional */ + /* Longitude */ + uint8_t longitude_valid; /**< Must be set to true if longitude is being passed */ + double longitude; + /**< Longitude (specified in WGS84 datum). + \begin{itemize1} + \item Type: Floating point + \item Units: Degrees + \item 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} */ + + /* Optional */ + /* Circular Horizontal Position Uncertainty */ + uint8_t horUncCircular_valid; /**< Must be set to true if horUncCircular is being passed */ + float horUncCircular; + /**< Horizontal position uncertainty (circular).\n + - Units: Meters */ + + /* Optional */ + /* Altitude With Respect to Ellipsoid */ + uint8_t altitudeWrtEllipsoid_valid; /**< Must be set to true if altitudeWrtEllipsoid is being passed */ + float altitudeWrtEllipsoid; + /**< Altitude with respect to the WGS84 ellipsoid.\n + - Units: Meters \n + - Range: -500 to 15883 */ + + /* Optional */ + /* Vertical Uncertainty */ + uint8_t vertUnc_valid; /**< Must be set to true if vertUnc is being passed */ + float vertUnc; + /**< Vertical uncertainty.\n + - Units: Meters */ + + /* Optional */ + /* UTC Timestamp */ + uint8_t timestampUtc_valid; /**< Must be set to true if timestampUtc is being passed */ + uint64_t timestampUtc; + /**< UTC timestamp. \n + - Units: Milliseconds since Jan. 1, 1970 */ + + /* Optional */ + /* Time Uncertainty */ + uint8_t timeUnc_valid; /**< Must be set to true if timeUnc is being passed */ + float timeUnc; + /**< Time uncertainty. \n + - Units: Milliseconds */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Minor Axis */ + uint8_t horUncEllipseSemiMinor_valid; /**< Must be set to true if horUncEllipseSemiMinor is being passed */ + float horUncEllipseSemiMinor; + /**< Semi-minor axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Semi-Major Axis */ + uint8_t horUncEllipseSemiMajor_valid; /**< Must be set to true if horUncEllipseSemiMajor is being passed */ + float horUncEllipseSemiMajor; + /**< Semi-major axis of horizontal elliptical uncertainty. \n + - Units: Meters */ + + /* Optional */ + /* Horizontal Elliptical Uncertainty Azimuth */ + uint8_t horUncEllipseOrientAzimuth_valid; /**< Must be set to true if horUncEllipseOrientAzimuth is being passed */ + float horUncEllipseOrientAzimuth; + /**< Elliptical horizontal uncertainty azimuth of orientation. \n + - Units: Decimal degrees \n + - Range: 0 to 180 */ + + /* Optional */ + /* Horizontal Circular Confidence */ + uint8_t horCircularConfidence_valid; /**< Must be set to true if horCircularConfidence is being passed */ + uint8_t horCircularConfidence; + /**< Horizontal circular uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Elliptical Confidence */ + uint8_t horEllipticalConfidence_valid; /**< Must be set to true if horEllipticalConfidence is being passed */ + uint8_t horEllipticalConfidence; + /**< Horizontal elliptical uncertainty confidence. \n + - Units: Percent \n + - Range: 0 to 99 */ + + /* Optional */ + /* Horizontal Reliability */ + uint8_t horReliability_valid; /**< Must be set to true if horReliability is being passed */ + qmiLocReliabilityEnumT_v02 horReliability; + /**< Specifies the reliability of the horizontal position. + Valid values: \n + - eQMI_LOC_RELIABILITY_NOT_SET (0) -- Location reliability is not set + - eQMI_LOC_RELIABILITY_VERY_LOW (1) -- Location reliability is very low; use it at your own risk + - eQMI_LOC_RELIABILITY_LOW (2) -- Location reliability is low; little or no cross-checking is possible + - eQMI_LOC_RELIABILITY_MEDIUM (3) -- Location reliability is medium; limited cross-check passed + - eQMI_LOC_RELIABILITY_HIGH (4) -- Location reliability is high; strong cross-check passed + */ + + /* Optional */ + /* Altitude With Respect to Sea Level */ + uint8_t altitudeWrtMeanSeaLevel_valid; /**< Must be set to true if altitudeWrtMeanSeaLevel is being passed */ + float altitudeWrtMeanSeaLevel; + /**< Altitude with respect to mean sea level. \n + - Units: Meters */ + + /* 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 */ + + /* Optional */ + /* Vertical Reliability */ + uint8_t vertReliability_valid; /**< Must be set to true if vertReliability is being passed */ + qmiLocReliabilityEnumT_v02 vertReliability; + /**< Specifies the reliability of the vertical position. + + Valid values: \n + - eQMI_LOC_RELIABILITY_NOT_SET (0) -- Location reliability is not set + - eQMI_LOC_RELIABILITY_VERY_LOW (1) -- Location reliability is very low; use it at your own risk + - eQMI_LOC_RELIABILITY_LOW (2) -- Location reliability is low; little or no cross-checking is possible + - eQMI_LOC_RELIABILITY_MEDIUM (3) -- Location reliability is medium; limited cross-check passed + - eQMI_LOC_RELIABILITY_HIGH (4) -- Location reliability is high; strong cross-check passed + */ + + /* Optional */ + /* GPS Time */ + uint8_t gpsTime_valid; /**< Must be set to true if gpsTime is being passed */ + qmiLocGPSTimeStructT_v02 gpsTime; + + /* Optional */ + /* Time Source */ + uint8_t timeSrc_valid; /**< Must be set to true if timeSrc is being passed */ + qmiLocTimeSourceEnumT_v02 timeSrc; + /**< Time source. + + Valid values: \n + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1X system + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time) + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection + - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data + from one GPS satellite + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained + - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT; + this is done when the clock time uncertainty is large + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - 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 + */ +}qmiLocGetAvailWwanPositionIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPREMIUMSERVICEENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PREMIUM_SERVICE_GTP_CELL_V02 = 0, /**< Premium service -- Global terrestrial positioning for the cell */ + eQMI_LOC_PREMIUM_SERVICE_SAP_V02 = 1, /**< Premium service -- Sensor-assisted positioning */ + QMILOCPREMIUMSERVICEENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPremiumServiceEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCPREMIUMSERVICECFGENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_PREMIUM_SERVICE_DISABLED_V02 = 0, /**< Premium service disabled */ + eQMI_LOC_PREMIUM_SERVICE_ENABLED_BASIC_V02 = 1, /**< Premium service enabled for basic */ + eQMI_LOC_PREMIUM_SERVICE_ENABLED_PREMIUM_V02 = 2, /**< Premium service enabled for premium */ + QMILOCPREMIUMSERVICECFGENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocPremiumServiceCfgEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to set the configuration + information for all iZat premium services to the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Set Premium Service Type */ + qmiLocPremiumServiceEnumT_v02 premiumServiceType; + /**< Specifies the premium service to configure. + + Valid values: \n + - eQMI_LOC_PREMIUM_SERVICE_GTP_CELL (0) -- Premium service -- Global terrestrial positioning for the cell + - eQMI_LOC_PREMIUM_SERVICE_SAP (1) -- Premium service -- Sensor-assisted positioning + */ + + /* Mandatory */ + /* Set Premium Service Configuration */ + qmiLocPremiumServiceCfgEnumT_v02 premiumServiceCfg; + /**< Specifies the premium service configuration mode. + + Valid values: \n + - eQMI_LOC_PREMIUM_SERVICE_DISABLED (0) -- Premium service disabled + - eQMI_LOC_PREMIUM_SERVICE_ENABLED_BASIC (1) -- Premium service enabled for basic + - eQMI_LOC_PREMIUM_SERVICE_ENABLED_PREMIUM (2) -- Premium service enabled for premium + */ +}qmiLocSetPremiumServicesCfgReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to set the configuration + information for all iZat premium services to the location + engine. */ +typedef struct { + + /* Mandatory */ + /* Set Premium Service Configuration Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set Premium Services Configuration request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocSetPremiumServicesCfgIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCXTRAVERSIONCHECKENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_XTRA_VERSION_CHECK_DISABLE_V02 = 0, /**< XTRA file version check is not required */ + 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 */ + QMILOCXTRAVERSIONCHECKENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocXtraVersionCheckEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Used by the control point to enable or disable XTRA version + verification. */ +typedef struct { + + /* Mandatory */ + /* Set XTRA Version Check Mode */ + qmiLocXtraVersionCheckEnumT_v02 xtraVersionCheckMode; + /**< Specifies XTRA version check mode. + + Valid values: \n + - eQMI_LOC_XTRA_VERSION_CHECK_DISABLE (0) -- XTRA file version check is not required + - 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 + */ +}qmiLocSetXtraVersionCheckReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to enable or disable XTRA version + verification. */ +typedef struct { + + /* Mandatory */ + /* Set XTRA Version Check Mode Status */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set XTRA version check request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure */ +}qmiLocSetXtraVersionCheckIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint64_t qmiLocGNSSConstellEnumT_v02; +#define eQMI_SYSTEM_GPS_V02 ((qmiLocGNSSConstellEnumT_v02)0x01ull) /**< Enable GPS */ +#define eQMI_SYSTEM_GLO_V02 ((qmiLocGNSSConstellEnumT_v02)0x02ull) /**< Enable GLONASS */ +#define eQMI_SYSTEM_BDS_V02 ((qmiLocGNSSConstellEnumT_v02)0x04ull) /**< Enable BDS */ +#define eQMI_SYSTEM_GAL_V02 ((qmiLocGNSSConstellEnumT_v02)0x08ull) /**< Enable Galileo */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Request Message; Sets Satellite constellations of interest for reporting */ +typedef struct { + + /* Optional */ + /* GNSS measurement report constellation control */ + uint8_t measReportConfig_valid; /**< Must be set to true if measReportConfig is being passed */ + qmiLocGNSSConstellEnumT_v02 measReportConfig; + /**< GNSS measurement report constellation control \n + Valid values: \n + - eQMI_SYSTEM_GPS (0x01) -- Enable GPS + - eQMI_SYSTEM_GLO (0x02) -- Enable GLONASS + - eQMI_SYSTEM_BDS (0x04) -- Enable BDS + - eQMI_SYSTEM_GAL (0x08) -- Enable Galileo + */ + + /* Optional */ + /* SV Polynomial Report constellation control */ + uint8_t svPolyReportConfig_valid; /**< Must be set to true if svPolyReportConfig is being passed */ + qmiLocGNSSConstellEnumT_v02 svPolyReportConfig; + /**< SV Polynomial Report constellation control \n + Valid values: \n + - eQMI_SYSTEM_GPS (0x01) -- Enable GPS + - eQMI_SYSTEM_GLO (0x02) -- Enable GLONASS + - eQMI_SYSTEM_BDS (0x04) -- Enable BDS + - eQMI_SYSTEM_GAL (0x08) -- Enable Galileo + */ +}qmiLocSetGNSSConstRepConfigReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sets Satellite constellations of interest for reporting */ +typedef struct { + + /* Mandatory */ + /* Set GNSS Constellation status */ + qmiLocStatusEnumT_v02 status; + /**< Status of GNSS Constellation + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - eQMI_LOC_XTRA_VERSION_CHECK_FAILURE (10) -- Location service failed because of an XTRA version-based file format check failure + */ +}qmiLocSetGNSSConstRepConfigIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_enums + @{ + */ +typedef enum { + QMILOCSOURCEOFFREQENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/ + eQMI_LOC_FREQ_SOURCE_INVALID_V02 = 0, /**< Source of the frequency is invalid */ + eQMI_LOC_FREQ_SOURCE_EXTERNAL_V02 = 1, /**< Source of the frequency is from external injection */ + eQMI_LOC_FREQ_SOURCE_PE_CLK_REPORT_V02 = 2, /**< Source of the frequency is from GNSS Navigation engine */ + eQMI_LOC_FREQ_SOURCE_UNKNOWN_V02 = 3, /**< Source of the frequency is unknown */ + QMILOCSOURCEOFFREQENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/ +}qmiLocSourceofFreqEnumT_v02; +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + float clockDrift; + /**< Receiver clock Drift \n + - Units: meter per sec \n + */ + + float clockDriftUnc; + /**< Receiver clock Drift uncertainty \n + - Units: meter per sec \n + */ + + qmiLocSourceofFreqEnumT_v02 sourceOfFreq; + /**< Source of the clock frequency information\n + - eQMI_LOC_FREQ_SOURCE_INVALID (0) -- Source of the frequency is invalid + - eQMI_LOC_FREQ_SOURCE_EXTERNAL (1) -- Source of the frequency is from external injection + - eQMI_LOC_FREQ_SOURCE_PE_CLK_REPORT (2) -- Source of the frequency is from GNSS Navigation engine + - eQMI_LOC_FREQ_SOURCE_UNKNOWN (3) -- Source of the frequency is unknown \n + */ +}qmiLocRcvrClockFrequencyInfoStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t leapSec; + /**< GPS time leap second delta to UTC time \n + For non-zero values of leapSecUnc, leapSec shall be treated as unknown \n + - Units: sec \n + */ + + uint8_t leapSecUnc; + /**< Uncertainty for GPS leap second \n + - Units: sec \n + */ +}qmiLocLeapSecondInfoStructT_v02; /* Type */ +/** + @} + */ + +typedef uint8_t qmiLocInterSystemBiasValidMaskT_v02; +#define QMI_LOC_SYS_TIME_BIAS_VALID_V02 ((qmiLocInterSystemBiasValidMaskT_v02)0x01) /**< System time bias valid */ +#define QMI_LOC_SYS_TIME_BIAS_UNC_VALID_V02 ((qmiLocInterSystemBiasValidMaskT_v02)0x02) /**< System time bias uncertainty valid */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocInterSystemBiasValidMaskT_v02 validMask; + /**< Fields that are valid. + - QMI_LOC_SYS_TIME_BIAS_VALID (0x01) -- System time bias valid + - QMI_LOC_SYS_TIME_BIAS_UNC_VALID (0x02) -- System time bias uncertainty valid \n + */ + + float timeBias; + /**< System-1 to System-2 Time Bias \n + - Units: msec \n + */ + + float timeBiasUnc; + /**< System-1 to System-2 Time Bias uncertainty \n + - Units: msec \n + */ +}qmiLocInterSystemBiasStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + qmiLocSvSystemEnumT_v02 system; + + uint16_t systemWeek; + /**< Current system week + For GPS: Calculated from midnight, Jan. 6, 1980 \n + For BDS: Calculated from 00:00:00 on January 1, 2006 of Coordinated Universal Time (UTC) \n + For GAL: Calculated from 00:00 UT on Sunday 22nd August 1999 (midnight between 21st and 22nd August) \n + If week is unknown shall be set to 65535 + - Units: Weeks */ + + uint32_t systemMsec; + /**< Amount of time into the current week. \n + - Units: Milliseconds */ + + float systemClkTimeBias; + /**< System clock time bias (sub-millisecond) \n + - Units: msec \n + System time = systemMsec - systemClkTimeBias \n + */ + + float systemClkTimeUncMs; + /**< Single sided maximum time bias uncertainty \n + - Units: msec \n + */ +}qmiLocGnssTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t gloFourYear; + /**< GLONASS four year number from 1996. Refer to GLONASS ICD.\n + Applicable only for GLONASS and shall be ignored for other constellations. \n + If unknown shall be set to 255 + */ + + uint16_t gloDays; + /**< GLONASS day number in four years. Refer to GLONASS ICD. + Applicable only for GLONASS and shall be ignored for other constellations. \n + If unknown shall be set to 65535 + */ + + uint32_t gloMsec; + /**< GLONASS time of day in msec. Refer to GLONASS ICD. + - Units: msec \n + */ + + float gloClkTimeBias; + /**< System clock time bias (sub-millisecond) \n + - Units: msec \n + System time = systemMsec - systemClkTimeBias \n + */ + + float gloClkTimeUncMs; + /**< Single sided maximum time bias uncertainty \n + - Units: msec \n + */ +}qmiLocGloTimeStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t refFCount; + /**< Receiver frame counter value at reference tick */ + + uint8_t systemRtc_valid; + /**< Validity indicator for System RTC */ + + uint64_t systemRtcMs; + /**< Platform system RTC value \n + - Units: msec \n + */ + + qmiLocTimeSourceEnumT_v02 sourceOfTime; + /**< Source of time information \n + - eQMI_LOC_TIME_SRC_INVALID (0) -- Invalid time. + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TRANSFER (1) -- Time is set by the 1X system + - eQMI_LOC_TIME_SRC_NETWORK_TIME_TAGGING (2) -- Time is set by WCDMA/GSM time tagging (i.e., + associating network time with GPS time) + - eQMI_LOC_TIME_SRC_EXTERNAL_INPUT (3) -- Time is set by an external injection + - eQMI_LOC_TIME_SRC_TOW_DECODE (4) -- Time is set after decoding over-the-air GPS navigation data + from one GPS satellite + - eQMI_LOC_TIME_SRC_TOW_CONFIRMED (5) -- Time is set after decoding over-the-air GPS navigation data + from multiple satellites + - eQMI_LOC_TIME_SRC_TOW_AND_WEEK_CONFIRMED (6) -- Both time of the week and the GPS week number are known + - eQMI_LOC_TIME_SRC_NAV_SOLUTION (7) -- Time is set by the position engine after the fix is obtained + - eQMI_LOC_TIME_SRC_SOLVE_FOR_TIME (8) -- Time is set by the position engine after performing SFT; + this is done when the clock time uncertainty is large + - eQMI_LOC_TIME_SRC_GLO_TOW_DECODE (9) -- Time is set after decoding GLO satellites + - eQMI_LOC_TIME_SRC_TIME_TRANSFORM (10) -- Time is set after transforming the GPS to GLO time + - eQMI_LOC_TIME_SRC_WCDMA_SLEEP_TIME_TAGGING (11) -- Time is set by the sleep time tag provided by the WCDMA network + - eQMI_LOC_TIME_SRC_GSM_SLEEP_TIME_TAGGING (12) -- Time is set by the sleep time tag provided by the GSM network + - eQMI_LOC_TIME_SRC_UNKNOWN (13) -- Source of the time is unknown + - 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 \n + */ +}qmiLocGnssTimeExtStructT_v02; /* Type */ +/** + @} + */ + +typedef uint64_t qmiLocSvMeasStatusValidMaskT_v02; +#define QMI_LOC_MASK_MEAS_STATUS_SM_STAT_BIT_VALID_V02 ((qmiLocSvMeasStatusValidMaskT_v02)0x00000001ull) +#define QMI_LOC_MASK_MEAS_STATUS_SB_STAT_BIT_VALID_V02 ((qmiLocSvMeasStatusValidMaskT_v02)0x00000002ull) +#define QMI_LOC_MASK_MEAS_STATUS_MS_STAT_BIT_VALID_V02 ((qmiLocSvMeasStatusValidMaskT_v02)0x00000004ull) +#define QMI_LOC_MASK_MEAS_STATUS_BE_CONFIRM_STAT_BIT_VALID_V02 ((qmiLocSvMeasStatusValidMaskT_v02)0x00000008ull) +#define QMI_LOC_MASK_MEAS_STATUS_VEL_STAT_BIT_VALID_V02 ((qmiLocSvMeasStatusValidMaskT_v02)0x00000010ull) +#define QMI_LOC_MASK_MEAS_STATUS_VEL_FINE_STAT_BIT_VALID_V02 ((qmiLocSvMeasStatusValidMaskT_v02)0x00000020ull) +#define QMI_LOC_MASK_MEAS_STATUS_FROM_RNG_DIFF_STAT_BIT_VALID_V02 ((qmiLocSvMeasStatusValidMaskT_v02)0x00000200ull) +#define QMI_LOC_MASK_MEAS_STATUS_FROM_VE_DIFF_STAT_BIT_VALID_V02 ((qmiLocSvMeasStatusValidMaskT_v02)0x00000400ull) +typedef uint64_t qmiLocSvMeasStatusMaskT_v02; +#define QMI_LOC_MASK_MEAS_STATUS_SM_VALID_V02 ((qmiLocSvMeasStatusMaskT_v02)0x00000001ull) /**< Satellite time sub-millisecond (code-phase) is known */ +#define QMI_LOC_MASK_MEAS_STATUS_SB_VALID_V02 ((qmiLocSvMeasStatusMaskT_v02)0x00000002ull) /**< Sub-bit time is known */ +#define QMI_LOC_MASK_MEAS_STATUS_MS_VALID_V02 ((qmiLocSvMeasStatusMaskT_v02)0x00000004ull) /**< Satellite time millisecond is known */ +#define QMI_LOC_MASK_MEAS_STATUS_BE_CONFIRM_V02 ((qmiLocSvMeasStatusMaskT_v02)0x00000008ull) /**< Bit edge is confirmed from signal */ +#define QMI_LOC_MASK_MEAS_STATUS_VELOCITY_VALID_V02 ((qmiLocSvMeasStatusMaskT_v02)0x00000010ull) /**< Satellite Doppler measured */ +#define QMI_LOC_MASK_MEAS_STATUS_VELOCITY_FINE_V02 ((qmiLocSvMeasStatusMaskT_v02)0x00000020ull) /**< TRUE: Fine Doppler measured, FALSE: Coarse Doppler measured */ +#define QMI_LOC_MASK_MEAS_STATUS_FROM_RNG_DIFF_V02 ((qmiLocSvMeasStatusMaskT_v02)0x00000200ull) /**< Range update from Satellite differences */ +#define QMI_LOC_MASK_MEAS_STATUS_FROM_VE_DIFF_V02 ((qmiLocSvMeasStatusMaskT_v02)0x00000400ull) /**< Doppler update from Satellite differences */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint32_t svTimeMs; + /**< Satellite time millisecond.\n + For GPS, BDS, GAL range of 0 thru (604800000-1) \n + For GLONASS range of 0 thru (86400000-1) \n + Valid when QMI_LOC_MEAS_STATUS_MS_VALID bit is set in measurement status \n + Note: All SV times in the current measurement block are alredy propagated to common reference time epoch. \n + - Units: msec \n + */ + + float svTimeSubMs; + /**< Satellite time sub-millisecond. \n + Total SV Time = svMs + svSubMs \n + - Units: msec \n + */ + + float svTimeUncMs; + /**< Satellite Time uncertainty \n + - Units: msec \n + */ + + float dopplerShift; + /**< Satellite Doppler \n + - Units: meter per sec \n + */ + + float dopplerShiftUnc; + /**< Satellite Doppler uncertainty\n + - Units: meter per sec \n + */ + + uint8_t dopplerAccel_valid; + /**< Validity for Doppler acceleration */ + + float dopplerAccel; + /**< Satellite Doppler Acceleration\n + - Units: Hz/s \n + */ +}qmiLocSVTimeSpeedStructT_v02; /* Type */ +/** + @} + */ + +typedef uint16_t qmiLocMeasFieldsValidMaskT_v02; +#define QMI_LOC_SV_HEALTH_VALID_V02 ((qmiLocMeasFieldsValidMaskT_v02)0x01) /**< SV health information is valid */ +#define QMI_LOC_SV_MULTIPATH_EST_VALID_V02 ((qmiLocMeasFieldsValidMaskT_v02)0x02) /**< Multipath estimate for SV is valid */ +#define QMI_LOC_SV_FINE_SPEED_VALID_V02 ((qmiLocMeasFieldsValidMaskT_v02)0x04) /**< Fine speed for SV is valid */ +#define QMI_LOC_SV_FINE_SPEED_UNC_VALID_V02 ((qmiLocMeasFieldsValidMaskT_v02)0x08) /**< Fine speed unc for SV is valid */ +#define QMI_LOC_SV_CARRIER_PHASE_VALID_V02 ((qmiLocMeasFieldsValidMaskT_v02)0x10) /**< Carrier phase for SV is valid */ +#define QMI_LOC_SV_SV_DIRECTION_VALID_V02 ((qmiLocMeasFieldsValidMaskT_v02)0x20) /**< SV direction information for SV is valid */ +#define QMI_LOC_SV_CYCLESLIP_COUNT_VALID_V02 ((qmiLocMeasFieldsValidMaskT_v02)0x40) /**< Cycle slip count information is valid */ +#define QMI_LOC_SV_LOSSOFLOCK_VALID_V02 ((qmiLocMeasFieldsValidMaskT_v02)0x80) /**< Loss of lock information is valid */ +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint16_t gnssSvId; + /**< GNSS SV ID + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \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} */ + + uint8_t gloFrequency; + /**< GLONASS frequency number + 7 \n + Valid only for GLONASS System \n + Shall be ignored for all other systems \n + - Range: 1 to 14 \n + */ + + qmiLocSvStatusEnumT_v02 svStatus; + /**< Satellite search state \n + - eQMI_LOC_SV_STATUS_IDLE (1) -- SV is not being actively processed + - eQMI_LOC_SV_STATUS_SEARCH (2) -- The system is searching for this SV + - eQMI_LOC_SV_STATUS_TRACK (3) -- SV is being tracked + */ + + qmiLocMeasFieldsValidMaskT_v02 validMask; + /**< Validity mask \n + - 0: Not valid \n + - 1: Valid \n + - QMI_LOC_SV_HEALTH_VALID (0x01) -- SV health information is valid + - QMI_LOC_SV_MULTIPATH_EST_VALID (0x02) -- Multipath estimate for SV is valid + - QMI_LOC_SV_FINE_SPEED_VALID (0x04) -- Fine speed for SV is valid + - QMI_LOC_SV_FINE_SPEED_UNC_VALID (0x08) -- Fine speed unc for SV is valid + - QMI_LOC_SV_CARRIER_PHASE_VALID (0x10) -- Carrier phase for SV is valid + - QMI_LOC_SV_SV_DIRECTION_VALID (0x20) -- SV direction information for SV is valid + - QMI_LOC_SV_CYCLESLIP_COUNT_VALID (0x40) -- Cycle slip count information is valid + - QMI_LOC_SV_LOSSOFLOCK_VALID (0x80) -- Loss of lock information is valid + */ + + uint8_t healthStatus; + /**< Health status. + \begin{itemize1} + \item Range: 0 to 1; 0 = unhealthy, \n 1 = healthy + \vspace{-0.18in} \end{itemize1} + */ + + qmiLocSvInfoMaskT_v02 svInfoMask; + /**< Indicates whether almanac and ephemeris information is available. \n + + - QMI_LOC_SVINFO_MASK_HAS_EPHEMERIS (0x01) -- Ephemeris is available for this SV + - QMI_LOC_SVINFO_MASK_HAS_ALMANAC (0x02) -- Almanac is available for this SV + */ + + qmiLocSvMeasStatusValidMaskT_v02 validMeasStatusMask; + /**< Validity mask for measurementStatus information \n + A set bit in validMeasStatusMask indicates corresponding bit \n + in measurementStatus having valid status information \n + - QMI_LOC_MASK_MEAS_STATUS_SM_STAT_BIT_VALID (0x00000001) -- + - QMI_LOC_MASK_MEAS_STATUS_SB_STAT_BIT_VALID (0x00000002) -- + - QMI_LOC_MASK_MEAS_STATUS_MS_STAT_BIT_VALID (0x00000004) -- + - QMI_LOC_MASK_MEAS_STATUS_BE_CONFIRM_STAT_BIT_VALID (0x00000008) -- + - QMI_LOC_MASK_MEAS_STATUS_VEL_STAT_BIT_VALID (0x00000010) -- + - QMI_LOC_MASK_MEAS_STATUS_VEL_FINE_STAT_BIT_VALID (0x00000020) -- + - QMI_LOC_MASK_MEAS_STATUS_FROM_RNG_DIFF_STAT_BIT_VALID (0x00000200) -- + - QMI_LOC_MASK_MEAS_STATUS_FROM_VE_DIFF_STAT_BIT_VALID (0x00000400) -- + + Additionally MSB 0xFFC0000000000000 bits indicate validity of DONT_USE bits \n + + */ + + qmiLocSvMeasStatusMaskT_v02 measurementStatus; + /**< Bitmask indicating SV measurement status. + Bitmasks: \n + - QMI_LOC_MASK_MEAS_STATUS_SM_VALID (0x00000001) -- Satellite time sub-millisecond (code-phase) is known + - QMI_LOC_MASK_MEAS_STATUS_SB_VALID (0x00000002) -- Sub-bit time is known + - QMI_LOC_MASK_MEAS_STATUS_MS_VALID (0x00000004) -- Satellite time millisecond is known + - QMI_LOC_MASK_MEAS_STATUS_BE_CONFIRM (0x00000008) -- Bit edge is confirmed from signal + - QMI_LOC_MASK_MEAS_STATUS_VELOCITY_VALID (0x00000010) -- Satellite Doppler measured + - QMI_LOC_MASK_MEAS_STATUS_VELOCITY_FINE (0x00000020) -- TRUE: Fine Doppler measured, FALSE: Coarse Doppler measured + - QMI_LOC_MASK_MEAS_STATUS_FROM_RNG_DIFF (0x00000200) -- Range update from Satellite differences + - QMI_LOC_MASK_MEAS_STATUS_FROM_VE_DIFF (0x00000400) -- Doppler update from Satellite differences + + If any of MSB 0xFFC0000000000000 DONT_USE bit set, measurement \n + shall not be used by client \n + */ + + uint16_t CNo; + /**< Carrier to Noise ratio \n + - Units: dBHz, Scale: 0.1 \n + */ + + uint16_t gloRfLoss; + /**< GLONASS Rf loss reference to Antenna. \n + - Units: dB, Scale: 0.1 \n + */ + + int32_t measLatency; + /**< Age of the measurement. Positive value means measurement precedes ref time. \n + - Units: msec \n + */ + + qmiLocSVTimeSpeedStructT_v02 svTimeSpeed; + /**< SV Time and Speed information */ + + uint8_t lossOfLock; + /**< Loss of signal lock indicator \n + - 0: Signal in continuous track \n + - 1: Signal not in track \n + */ + + float multipathEstimate; + /**< Estimate of multipath in measurement\n + - Units: Meter \n + */ + + float fineSpeed; + /**< Carrier phase derived speed \n + - Units: Meter per sec \n + */ + + float fineSpeedUnc; + /**< Carrier phase derived speed uncertainty \n + - Units: Meter per sec \n + */ + + double carrierPhase; + /**< Carrier phase measurement [L1 cycles] \n + */ + + uint8_t cycleSlipCount; + /**< Increments when a Cycle Slip is detected */ + + float svAzimuth; + /**< Satellite Azimuth + - Units: radians \n + - Range: 0 to 2*pi() \n + */ + + float svElevation; + /**< Satellite Elevation + - Units: radians \n + - Range: 0 to pi()/2 \n + */ +}qmiLocSVMeasurementStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a satellite measurement report to the control point. */ +typedef struct { + + /* Mandatory */ + /* Current message sequence number. Used for segmentation/assembly of measurement reports. */ + uint8_t seqNum; + /**< Current message Number */ + + /* Mandatory */ + /* Maximum number of message that will be sent for present time epoch. */ + uint8_t maxMessageNum; + /**< Maximum number of message that will be sent for present time epoch. */ + + /* Mandatory */ + /* Specifies Satellite system constellation of this report */ + qmiLocSvSystemEnumT_v02 system; + /**< Specifies Satellite system constellation of this report + Valid values: \n + - eQMI_LOC_SV_SYSTEM_GPS (1) -- GPS satellite + - eQMI_LOC_SV_SYSTEM_GALILEO (2) -- GALILEO satellite + - eQMI_LOC_SV_SYSTEM_SBAS (3) -- SBAS satellite + - eQMI_LOC_SV_SYSTEM_COMPASS (4) -- COMPASS satellite + - eQMI_LOC_SV_SYSTEM_GLONASS (5) -- GLONASS satellite + - eQMI_LOC_SV_SYSTEM_BDS (6) -- BDS satellite + */ + + /* Optional */ + /* GNSS Receiver Clock Frequency Information */ + uint8_t rcvrClockFrequencyInfo_valid; /**< Must be set to true if rcvrClockFrequencyInfo is being passed */ + qmiLocRcvrClockFrequencyInfoStructT_v02 rcvrClockFrequencyInfo; + /**< Receiver Clock Frequency information */ + + /* Optional */ + /* Leap Second Information */ + uint8_t leapSecondInfo_valid; /**< Must be set to true if leapSecondInfo is being passed */ + qmiLocLeapSecondInfoStructT_v02 leapSecondInfo; + /**< Leap Second information \n + */ + + /* Optional */ + /* GPS to GLONASS Inter-system Time Bias. + Reported if both GPS and GLONASS system information reporting is enabled. + System-1: GPS, System-2: GLONASS */ + uint8_t gpsGloInterSystemBias_valid; /**< Must be set to true if gpsGloInterSystemBias is being passed */ + qmiLocInterSystemBiasStructT_v02 gpsGloInterSystemBias; + /**< GPS to GLONASS Inter-system Time Bias \n + Reported if both GPS and GLONASS system \n + information reporting is enabled \n + System-1: GPS \n + System-2: GLONASS \n + */ + + /* Optional */ + /* GPS to BDS Inter-system Time Bias. + Reported if both GPS and BDS system information reporting is enabled. + System-1: GPS, System-2: BDS */ + uint8_t gpsBdsInterSystemBias_valid; /**< Must be set to true if gpsBdsInterSystemBias is being passed */ + qmiLocInterSystemBiasStructT_v02 gpsBdsInterSystemBias; + /**< GPS to BDS Inter-system Time Bias \n + Reported if both GPS and BDS system \n + information reporting is enabled \n + System-1: GPS \n + System-2: BDS \n + */ + + /* Optional */ + /* GPS to GALILEO Inter-system Time Bias. + Reported if both GPS and GALILEO system information reporting is enabled. + System-1: GPS, System-2: GALILEO */ + uint8_t gpsGalInterSystemBias_valid; /**< Must be set to true if gpsGalInterSystemBias is being passed */ + qmiLocInterSystemBiasStructT_v02 gpsGalInterSystemBias; + /**< GPS to GALILEO Inter-system Time Bias \n + Reported if both GPS and GALILEO system \n + information reporting is enabled \n + System-1: GPS \n + System-2: GALILEO \n + */ + + /* Optional */ + /* BDS to GLONASS Inter-system Time Bias. + Reported if both BDS and GLONASS system information reporting is enabled. + System-1: BDS, System-2: GLONASS */ + uint8_t bdsGloInterSystemBias_valid; /**< Must be set to true if bdsGloInterSystemBias is being passed */ + qmiLocInterSystemBiasStructT_v02 bdsGloInterSystemBias; + /**< BDS to GLONASS Inter-system Time Bias \n + Reported if both BDS and GLONASS system \n + information reporting is enabled \n + System-1: BDS \n + System-2: GLONASS \n + */ + + /* Optional */ + /* GAL to GLONASS Inter-system Time Bias. + Reported if both BDS and GLONASS system information reporting is enabled. + System-1: GAL, System-2: GLONASS */ + uint8_t galGloInterSystemBias_valid; /**< Must be set to true if galGloInterSystemBias is being passed */ + qmiLocInterSystemBiasStructT_v02 galGloInterSystemBias; + /**< GAL to GLONASS Inter-system Time Bias \n + Reported if both GAL and GLONASS system \n + information reporting is enabled \n + System-1: GAL \n + System-2: GLONASS \n + */ + + /* Optional */ + /* GAL to BDS Inter-system Time Bias. + Reported if both GAL and BDS system information reporting is enabled. + System-1: GAL, System-2: BDS */ + uint8_t galBdsInterSystemBias_valid; /**< Must be set to true if galBdsInterSystemBias is being passed */ + qmiLocInterSystemBiasStructT_v02 galBdsInterSystemBias; + /**< GAL to BDS Inter-system Time Bias \n + Reported if both GAL and BDS system \n + information reporting is enabled \n + System-1: GAL \n + System-2: BDS \n + */ + + /* Optional */ + /* Satellite system Time information for GPS, BDS, GAL constellation */ + uint8_t systemTime_valid; /**< Must be set to true if systemTime is being passed */ + qmiLocGnssTimeStructT_v02 systemTime; + /**< Satellite system Time information for GPS, BDS, GAL constellation */ + + /* Optional */ + /* GLONASS system Time information */ + uint8_t gloTime_valid; /**< Must be set to true if gloTime is being passed */ + qmiLocGloTimeStructT_v02 gloTime; + /**< GLONASS system Time information */ + + /* Optional */ + /* Extended time information */ + uint8_t systemTimeExt_valid; /**< Must be set to true if systemTimeExt is being passed */ + qmiLocGnssTimeExtStructT_v02 systemTimeExt; + /**< Extended time information */ + + /* Optional */ + /* Satellite System Measurement report for enabled constellation */ + uint8_t svMeasurement_valid; /**< Must be set to true if svMeasurement is being passed */ + uint32_t svMeasurement_len; /**< Must be set to # of elements in svMeasurement */ + qmiLocSVMeasurementStructT_v02 svMeasurement[QMI_LOC_SV_MEAS_LIST_MAX_SIZE_V02]; + /**< Satellite System Clock & SV Measurement report for enabled constellation \n + */ +}qmiLocEventGnssSvMeasInfoIndMsgT_v02; /* Message */ +/** + @} + */ + +typedef uint16_t qmiLocSvPolyStatusMaskT_v02; +#define QMI_LOC_SV_POLY_SRC_ALM_CORR_V02 ((qmiLocSvPolyStatusMaskT_v02)0x01) /**< Polynomials based on XTRA */ +#define QMI_LOC_SV_POLY_GLO_STR4_V02 ((qmiLocSvPolyStatusMaskT_v02)0x02) /**< GLONASS String 4 has been received */ +typedef uint16_t qmiLocSvPolyStatusMaskValidityT_v02; +#define QMI_LOC_SV_POLY_SRC_ALM_CORR_VALID_V02 ((qmiLocSvPolyStatusMaskValidityT_v02)0x01) /**< Validity status for QMI_LOC_SV_POLY_SRC_ALM_CORR */ +#define QMI_LOC_SV_POLY_GLO_STR4_VALID_V02 ((qmiLocSvPolyStatusMaskValidityT_v02)0x02) /**< Validity status for QMI_LOC_SV_POLY_GLO_STR4 */ +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Sends a satellite polynomial report to the control point. */ +typedef struct { + + /* Mandatory */ + /* GNSS SV Polynomial Report */ + uint16_t gnssSvId; + /**< GNSS SV ID + \begin{itemize1} + \item Range: \begin{itemize1} + \item For GPS: 1 to 32 + \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} */ + + /* Mandatory */ + double T0; + /**< Reference time for polynomial calculations \n + GPS: Secs in week \n + GLO: Full secs since Jan/01/96 \n + BDS: Full Secs since Jan/01/2006 \n + */ + + /* Mandatory */ + qmiLocSvPolyStatusMaskValidityT_v02 svPolyFlagValid; + /**< Validity mask for bits in svPolyFlags. A set bit in svPolyFlagValid indicates \n + corresponding bit in svPolyFlags having valid status information \n + + Valid bitmasks: \n + - QMI_LOC_SV_POLY_SRC_ALM_CORR_VALID (0x01) -- Validity status for QMI_LOC_SV_POLY_SRC_ALM_CORR + - QMI_LOC_SV_POLY_GLO_STR4_VALID (0x02) -- Validity status for QMI_LOC_SV_POLY_GLO_STR4 */ + + /* Mandatory */ + qmiLocSvPolyStatusMaskT_v02 svPolyFlags; + /**< Flags indicating status of polynomial report. + + Valid bitmasks: \n + - QMI_LOC_SV_POLY_SRC_ALM_CORR (0x01) -- Polynomials based on XTRA + - QMI_LOC_SV_POLY_GLO_STR4 (0x02) -- GLONASS String 4 has been received */ + + /* Optional */ + uint8_t polyCoeffXYZ0_valid; /**< Must be set to true if polyCoeffXYZ0 is being passed */ + double polyCoeffXYZ0[QMI_LOC_SV_POLY_XYZ_0_TH_ORDER_COEFF_SIZE_V02]; + /**< Polynomial Coefficients 0th term for X,Y,Z co-ordinates (C0X, C0Y, C0Z) \n + - Units: meter \n + */ + + /* Optional */ + uint8_t polyCoefXYZN_valid; /**< Must be set to true if polyCoefXYZN is being passed */ + double polyCoefXYZN[QMI_LOC_SV_POLY_XYZ_N_TH_ORDER_COEFF_SIZE_V02]; + /**< Polynomial coefficients 1st, 2nd and 3rd terms for X,Y,Z co-ordinates (C1X, C2X,... C2Z, C3Z) \n + - Units: 1st term: meter/s, 2rd Term: meter/s^2, 3rd term: meter/s^3 \n + */ + + /* Optional */ + uint8_t polyCoefClockBias_valid; /**< Must be set to true if polyCoefClockBias is being passed */ + float polyCoefClockBias[QMI_LOC_SV_POLY_SV_CLKBIAS_COEFF_SIZE_V02]; + /**< Polynomial coefficients for satellite clock bias correction (C0T, C1T, C2T, C3T) \n + - Units: 0th term: msec/sec, 1st term: msec/sec^2, 2rd Term: msec/sec^3, 3rd term: msec/sec^4 \n + */ + + /* Optional */ + /* GLONASS frequency number */ + uint8_t gloFrequency_valid; /**< Must be set to true if gloFrequency is being passed */ + uint8_t gloFrequency; + /**< GLONASS frequency number + 7 \n + Valid only for GLONASS System \n + Shall be ignored for all other systems \n + - Range: 1 to 14 \n + */ + + /* Optional */ + /* Ephemeris reference time */ + uint8_t IODE_valid; /**< Must be set to true if IODE is being passed */ + uint16_t IODE; + /**< Ephemeris reference time \n + GPS:Issue of Data Ephemeris used [unitless]\n + GLO: Tb 7-bit \n + */ + + /* Optional */ + /* Enhanced reference time */ + uint8_t enhancedIOD_valid; /**< Must be set to true if enhancedIOD is being passed */ + uint32_t enhancedIOD; + /**< For BDS eph, this is TOE + */ + + /* Optional */ + /* SV Position Uncertainty */ + uint8_t svPosUnc_valid; /**< Must be set to true if svPosUnc is being passed */ + float svPosUnc; + /**< SV position uncertainty \n + - Units: meter \n + */ + + /* Optional */ + /* Iono delay */ + uint8_t ionoDelay_valid; /**< Must be set to true if ionoDelay is being passed */ + float ionoDelay; + /**< Ionospheric delay at T0 \n + - Units: meter \n + */ + + /* Optional */ + /* Iono delay rate */ + uint8_t ionoDot_valid; /**< Must be set to true if ionoDot is being passed */ + float ionoDot; + /**< Iono delay rate\n + - Units: meter/sec \n + */ + + /* Optional */ + /* SBAS Iono delay */ + uint8_t sbasIonoDelay_valid; /**< Must be set to true if sbasIonoDelay is being passed */ + float sbasIonoDelay; + /**< SBAS Ionospheric delay at T0 \n + - Units: meter \n + */ + + /* Optional */ + /* SBAS Iono delay rate */ + uint8_t sbasIonoDot_valid; /**< Must be set to true if sbasIonoDot is being passed */ + float sbasIonoDot; + /**< SBAS Iono delay rate \n + - Units: meter/sec \n + */ + + /* Optional */ + /* Tropospheric delay */ + uint8_t tropoDelay_valid; /**< Must be set to true if tropoDelay is being passed */ + float tropoDelay; + /**< Tropospheric delay \n + - Units: meter \n + */ + + /* Optional */ + /* Satellite elevation */ + uint8_t elevation_valid; /**< Must be set to true if elevation is being passed */ + float elevation; + /**< Elevation at T0 \n + - Units: radians \n + */ + + /* Optional */ + /* Satellite elevation rate */ + uint8_t elevationDot_valid; /**< Must be set to true if elevationDot is being passed */ + float elevationDot; + /**< Elevation rate \n + - Units: radians/sec \n + */ + + /* Optional */ + /* Satellite elevation uncertainty */ + uint8_t elenationUnc_valid; /**< Must be set to true if elenationUnc is being passed */ + float elenationUnc; + /**< SV elevation [rad] uncertainty \n + - Units: radians \n + */ + + /* Optional */ + /* Polynomial coefficients for SV velocity */ + uint8_t velCoef_valid; /**< Must be set to true if velCoef is being passed */ + double velCoef[QMI_LOC_SV_POLY_VELOCITY_COEF_SIZE_V02]; + /**< Polynomial coefficients for SV velocity (C0X, C1X, C2X, C3X,... C2Z, C3Z)\n + - Units: 0th term: meter/s, 1st term: meter/s^2, 2rd Term: meter/s^3, 3rd term: meter/s^4 \n + */ +}qmiLocEventGnssSvPolyIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + uint8_t wifiApMacAddress[QMI_LOC_WIFI_MAC_ADDR_LENGTH_V02]; + /**< The MAC Address of the Wifi AP. */ +}qmiLocWifiApMacAddressStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_aggregates + @{ + */ +typedef struct { + + char uuid[QMI_LOC_MAX_IBEACON_UUID_STR_LENGTH_V02 + 1]; + /**< NULL termnated IBeacon identifier string. It is a 128 bit value */ + + uint32_t majorNumber; + /**< The IBeacon Major number.*/ + + uint32_t minorNumber; + /**< The IBeacon minor number.*/ +}qmiLocIBeaconIdStructT_v02; /* Type */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Message; Used by the control point to inject the geofence context. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Add geofence context indication. */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Geofence identifier allocated by the engine. + If Geofence ID is not provided, a geofence will be created with Area id list only (like Wifi only list Geofence). + If Geofence ID is provided, the added list will be used as assistance data to the existing Geofence. */ + + /* Optional */ + /* Wifi AP SSID string */ + uint8_t wifiApSsidInfo_valid; /**< Must be set to true if wifiApSsidInfo is being passed */ + uint32_t wifiApSsidInfo_len; /**< Must be set to # of elements in wifiApSsidInfo */ + qmiLocWifiApSsidStructT_v02 wifiApSsidInfo[QMI_LOC_WIFI_AREA_ID_LIST_LENGTH_V02]; + /**< The ordering of Wifi AP SSID list should match with the Wifi AP MAC address list, when both of them are provided. + i.e the the first element of Wifi AP SSID list must be the SSID of the AP whose MAC + address is in the first element in the Wifi AP MAC Address and so on. */ + + /* Optional */ + /* Wifi AP MAC address list for the geofence. */ + uint8_t wifiApMacAddressList_valid; /**< Must be set to true if wifiApMacAddressList is being passed */ + uint32_t wifiApMacAddressList_len; /**< Must be set to # of elements in wifiApMacAddressList */ + qmiLocWifiApMacAddressStructT_v02 wifiApMacAddressList[QMI_LOC_WIFI_AREA_ID_LIST_LENGTH_V02]; + /**< The ordering of Wifi AP SSID list should match with the Wifi AP MAC address list, when both of them are provided. + i.e the the first element of Wifi AP SSID list must be the SSID of the AP whose MAC + address is in the first element in the Wifi AP MAC Address and so on. */ + + /* Optional */ + /* TDSCDMA Cell ID list for the geofence. */ + uint8_t tdsCdmaCellIDList_valid; /**< Must be set to true if tdsCdmaCellIDList is being passed */ + qmiLocTDSCDMACellIdStructT_v02 tdsCdmaCellIDList[QMI_LOC_CELL_ID_LIST_LENGTH_V02]; + /**< \n Identifies the TDSCDMA cell on which the device is currently camped. */ + + /* Optional */ + /* WCDMA Cell ID list for the geofence. */ + uint8_t wcdmaCellIDList_valid; /**< Must be set to true if wcdmaCellIDList is being passed */ + uint32_t wcdmaCellIDList_len; /**< Must be set to # of elements in wcdmaCellIDList */ + qmiLocWCDMACellIdStructT_v02 wcdmaCellIDList[QMI_LOC_CELL_ID_LIST_LENGTH_V02]; + /**< \n Identifies the WCDMA cell on which the device is currently camped. */ + + /* Optional */ + /* GSM Cell ID list for the geofence. */ + uint8_t gsmCellIDList_valid; /**< Must be set to true if gsmCellIDList is being passed */ + uint32_t gsmCellIDList_len; /**< Must be set to # of elements in gsmCellIDList */ + qmiLocGSMCellIdStructT_v02 gsmCellIDList[QMI_LOC_CELL_ID_LIST_LENGTH_V02]; + /**< \n Identifies the GSM cell on which the device is currently camped. */ + + /* Optional */ + /* IBeacon list the geofence. */ + uint8_t iBeaconList_valid; /**< Must be set to true if iBeaconList is being passed */ + uint32_t iBeaconList_len; /**< Must be set to # of elements in iBeaconList */ + qmiLocIBeaconIdStructT_v02 iBeaconList[QMI_LOC_IBEACON_LIST_LENGTH_V02]; +}qmiLocAddGeofenceContextReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject the geofence context. */ +typedef struct { + + /* Mandatory */ + /* Status of the add geofence context request. */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Add geofence context request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - 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; + /**< Transaction ID that was specified in the add geofence context + request. This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Geofence identifier allocated by the engine. + If the client specifies the geofence ID during the add geofence context request , then the same ID is returned. + If the client does not specify the geofence ID during the add geofence context request , then a new geofence ID is created + by the geofence engine and returned. */ + + /* Optional */ + /* Context ID */ + uint8_t contextId_valid; /**< Must be set to true if contextId is being passed */ + uint32_t contextId; + /**< Geofence context ID allocated by the engine. + The context ID is generated by the geofence engine to identify the context for a particular geofence ID. + The same geofence ID may be associated with multiple contexts. */ +}qmiLocAddGeofenceContextIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Message; Used by the control point to inject the geofence engine context. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Set geofence engine context indication. */ + + /* Optional */ + /* UTC Timestamp of the day */ + uint8_t utcTimeOfDay_valid; /**< Must be set to true if utcTimeOfDay is being passed */ + uint64_t utcTimeOfDay; + /**< The UTC time of the day . */ + + /* Optional */ + /* Temperature of the day in Fahrenheit */ + uint8_t temperature_valid; /**< Must be set to true if temperature is being passed */ + int32_t temperature; + /**< The temperature of the day in fahren heat */ +}qmiLocSetGeofenceEngineContextReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to inject the geofence engine context. */ +typedef struct { + + /* Mandatory */ + /* Status of the add geofence context request. */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Set geofence engine context request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - 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; + /**< Transaction ID that was specified in the set geofence engine context + request. This parameter will always be present + if the status field is set to SUCCESS. */ +}qmiLocSetGeofenceEngineContextIndMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Message; Used by the control point to delete the geofence context. */ +typedef struct { + + /* Mandatory */ + /* Transaction ID */ + uint32_t transactionId; + /**< Identifies the transaction. The transaction ID + is returned in the Delete geofence context indication. */ + + /* Mandatory */ + /* Geofence ID */ + uint32_t geofenceId; + /**< Identifies the geofence whose context needs to be deleted . */ + + /* Optional */ + /* Context ID */ + uint8_t contextId_valid; /**< Must be set to true if contextId is being passed */ + uint32_t contextId; + /**< Identifies the context associated with the geofence which needs to be deleted . + If not specified then all the contexts associated with this geofence is deleted. */ +}qmiLocDeleteGeofenceContextReqMsgT_v02; /* Message */ +/** + @} + */ + +/** @addtogroup loc_qmi_messages + @{ + */ +/** Indication Message; Used by the control point to delete the geofence context. */ +typedef struct { + + /* Mandatory */ + /* Status of the delete geofence context request */ + qmiLocStatusEnumT_v02 status; + /**< Status of the Assistance Data to Geofence request. + + Valid values: \n + - eQMI_LOC_SUCCESS (0) -- Request was completed successfully + - eQMI_LOC_GENERAL_FAILURE (1) -- Request failed because of a general failure + - eQMI_LOC_UNSUPPORTED (2) -- Request failed because it is not supported + - eQMI_LOC_INVALID_PARAMETER (3) -- Request failed because it contained invalid parameters + - eQMI_LOC_ENGINE_BUSY (4) -- Request failed because the engine is busy + - eQMI_LOC_PHONE_OFFLINE (5) -- Request failed because the phone is offline + - eQMI_LOC_TIMEOUT (6) -- Request failed because it timed out + - eQMI_LOC_CONFIG_NOT_SUPPORTED (7) -- Request failed because an undefined configuration was requested + - eQMI_LOC_INSUFFICIENT_MEMORY (8) -- Request failed because the engine could not allocate sufficient memory for the request + - eQMI_LOC_MAX_GEOFENCE_PROGRAMMED (9) -- Request failed because the maximum number of Geofences are already programmed + - 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; + /**< Transaction ID that was specified in the delete geofence context request. + This parameter will always be present + if the status field is set to SUCCESS. */ + + /* Optional */ + /* Geofence ID */ + uint8_t geofenceId_valid; /**< Must be set to true if geofenceId is being passed */ + uint32_t geofenceId; + /**< Identifier for the Geofence whose context was deleted. */ + + /* Optional */ + /* Context ID */ + uint8_t contextId_valid; /**< Must be set to true if contextId is being passed */ + uint32_t contextId; + /**< Identifier for the context of the Geofence that was deleted. */ +}qmiLocDeleteGeofenceContextIndMsgT_v02; /* Message */ +/** + @} + */ + +/* Conditional compilation tags for message removal */ +//#define REMOVE_QMI_LOC_ADD_CIRCULAR_GEOFENCE_V02 +//#define REMOVE_QMI_LOC_ADD_GEOFENCE_CONTEXT_V02 +//#define REMOVE_QMI_LOC_DELETE_ASSIST_DATA_V02 +//#define REMOVE_QMI_LOC_DELETE_GEOFENCE_V02 +//#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_BATCH_FULL_NOTIFICATION_V02 +//#define REMOVE_QMI_LOC_EVENT_ENGINE_STATE_V02 +//#define REMOVE_QMI_LOC_EVENT_FIX_SESSION_STATE_V02 +//#define REMOVE_QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_V02 +//#define REMOVE_QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_V02 +//#define REMOVE_QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_V02 +//#define REMOVE_QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_V02 +//#define REMOVE_QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02 +//#define REMOVE_QMI_LOC_EVENT_GNSS_SV_INFO_V02 +//#define REMOVE_QMI_LOC_EVENT_INJECT_POSITION_REQ_V02 +//#define REMOVE_QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_V02 +//#define REMOVE_QMI_LOC_EVENT_INJECT_TIME_REQ_V02 +//#define REMOVE_QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_V02 +//#define REMOVE_QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_V02 +//#define REMOVE_QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_V02 +//#define REMOVE_QMI_LOC_EVENT_MOTION_DATA_CONTROL_V02 +//#define REMOVE_QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_V02 +//#define REMOVE_QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_V02 +//#define REMOVE_QMI_LOC_EVENT_NMEA_V02 +//#define REMOVE_QMI_LOC_EVENT_PEDOMETER_CONTROL_V02 +//#define REMOVE_QMI_LOC_EVENT_POSITION_REPORT_V02 +//#define REMOVE_QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_V02 +//#define REMOVE_QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_V02 +//#define REMOVE_QMI_LOC_EVENT_SV_POLYNOMIAL_REPORT_IND_V02 +//#define REMOVE_QMI_LOC_EVENT_TIME_SYNC_REQ_V02 +//#define REMOVE_QMI_LOC_EVENT_VEHICLE_DATA_READY_STATUS_V02 +//#define REMOVE_QMI_LOC_EVENT_WIFI_REQ_V02 +//#define REMOVE_QMI_LOC_GET_AVAILABLE_WWAN_POSITION_V02 +//#define REMOVE_QMI_LOC_GET_BATCH_SIZE_V02 +//#define REMOVE_QMI_LOC_GET_BEST_AVAILABLE_POSITION_V02 +//#define REMOVE_QMI_LOC_GET_CRADLE_MOUNT_CONFIG_V02 +//#define REMOVE_QMI_LOC_GET_ENGINE_LOCK_V02 +//#define REMOVE_QMI_LOC_GET_EXTERNAL_POWER_CONFIG_V02 +//#define REMOVE_QMI_LOC_GET_FIX_CRITERIA_V02 +//#define REMOVE_QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_V02 +//#define REMOVE_QMI_LOC_GET_LOW_POWER_MODE_V02 +//#define REMOVE_QMI_LOC_GET_NI_GEOFENCE_ID_LIST_V02 +//#define REMOVE_QMI_LOC_GET_NMEA_TYPES_V02 +//#define REMOVE_QMI_LOC_GET_OPERATION_MODE_V02 +//#define REMOVE_QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_V02 +//#define REMOVE_QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_V02 +//#define REMOVE_QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_V02 +//#define REMOVE_QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_V02 +//#define REMOVE_QMI_LOC_GET_REGISTERED_EVENTS_V02 +//#define REMOVE_QMI_LOC_GET_SBAS_CONFIG_V02 +//#define REMOVE_QMI_LOC_GET_SENSOR_CONTROL_CONFIG_V02 +//#define REMOVE_QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_V02 +//#define REMOVE_QMI_LOC_GET_SENSOR_PROPERTIES_V02 +//#define REMOVE_QMI_LOC_GET_SERVER_V02 +//#define REMOVE_QMI_LOC_GET_SERVICE_REVISION_V02 +//#define REMOVE_QMI_LOC_GET_SUPPORTED_FIELDS_V02 +//#define REMOVE_QMI_LOC_GET_SUPPORTED_MSGS_V02 +//#define REMOVE_QMI_LOC_GET_XTRA_T_SESSION_CONTROL_V02 +//#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_GSM_CELL_INFO_V02 +//#define REMOVE_QMI_LOC_INJECT_MOTION_DATA_V02 +//#define REMOVE_QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_V02 +//#define REMOVE_QMI_LOC_INJECT_POSITION_V02 +//#define REMOVE_QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_V02 +//#define REMOVE_QMI_LOC_INJECT_SENSOR_DATA_V02 +//#define REMOVE_QMI_LOC_INJECT_SUBSCRIBER_ID_V02 +//#define REMOVE_QMI_LOC_INJECT_SUPL_CERTIFICATE_V02 +//#define REMOVE_QMI_LOC_INJECT_TDSCDMA_CELL_INFO_V02 +//#define REMOVE_QMI_LOC_INJECT_TIME_SYNC_DATA_V02 +//#define REMOVE_QMI_LOC_INJECT_UTC_TIME_V02 +//#define REMOVE_QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_V02 +//#define REMOVE_QMI_LOC_INJECT_WCDMA_CELL_INFO_V02 +//#define REMOVE_QMI_LOC_INJECT_WIFI_AP_DATA_V02 +//#define REMOVE_QMI_LOC_INJECT_WIFI_POSITION_V02 +//#define REMOVE_QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_V02 +//#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_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_SET_CRADLE_MOUNT_CONFIG_V02 +//#define REMOVE_QMI_LOC_SET_ENGINE_LOCK_V02 +//#define REMOVE_QMI_LOC_SET_EXTERNAL_POWER_CONFIG_V02 +//#define REMOVE_QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_V02 +//#define REMOVE_QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_V02 +//#define REMOVE_QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_V02 +//#define REMOVE_QMI_LOC_SET_LOW_POWER_MODE_V02 +//#define REMOVE_QMI_LOC_SET_NMEA_TYPES_V02 +//#define REMOVE_QMI_LOC_SET_OPERATION_MODE_V02 +//#define REMOVE_QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_V02 +//#define REMOVE_QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_V02 +//#define REMOVE_QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_V02 +//#define REMOVE_QMI_LOC_SET_SBAS_CONFIG_V02 +//#define REMOVE_QMI_LOC_SET_SENSOR_CONTROL_CONFIG_V02 +//#define REMOVE_QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_V02 +//#define REMOVE_QMI_LOC_SET_SENSOR_PROPERTIES_V02 +//#define REMOVE_QMI_LOC_SET_SERVER_V02 +//#define REMOVE_QMI_LOC_SET_SPI_STATUS_V02 +//#define REMOVE_QMI_LOC_SET_XTRA_T_SESSION_CONTROL_V02 +//#define REMOVE_QMI_LOC_SET_XTRA_VERSION_CHECK_V02 +//#define REMOVE_QMI_LOC_START_V02 +//#define REMOVE_QMI_LOC_START_BATCHING_V02 +//#define REMOVE_QMI_LOC_STOP_V02 +//#define REMOVE_QMI_LOC_STOP_BATCHING_V02 +//#define REMOVE_QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_V02 + +/*Service Message Definition*/ +/** @addtogroup loc_qmi_msg_ids + @{ + */ +#define QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02 0x001E +#define QMI_LOC_GET_SUPPORTED_MSGS_RESP_V02 0x001E +#define QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02 0x001F +#define QMI_LOC_GET_SUPPORTED_FIELDS_RESP_V02 0x001F +#define QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02 0x0020 +#define QMI_LOC_INFORM_CLIENT_REVISION_RESP_V02 0x0020 +#define QMI_LOC_REG_EVENTS_REQ_V02 0x0021 +#define QMI_LOC_REG_EVENTS_RESP_V02 0x0021 +#define QMI_LOC_START_REQ_V02 0x0022 +#define QMI_LOC_START_RESP_V02 0x0022 +#define QMI_LOC_STOP_REQ_V02 0x0023 +#define QMI_LOC_STOP_RESP_V02 0x0023 +#define QMI_LOC_EVENT_POSITION_REPORT_IND_V02 0x0024 +#define QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02 0x0025 +#define QMI_LOC_EVENT_NMEA_IND_V02 0x0026 +#define QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02 0x0027 +#define QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02 0x0028 +#define QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02 0x0029 +#define QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02 0x002A +#define QMI_LOC_EVENT_ENGINE_STATE_IND_V02 0x002B +#define QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02 0x002C +#define QMI_LOC_EVENT_WIFI_REQ_IND_V02 0x002D +#define QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02 0x002E +#define QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02 0x002F +#define QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02 0x0030 +#define QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02 0x0031 +#define QMI_LOC_GET_SERVICE_REVISION_REQ_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_RESP_V02 0x0032 +#define QMI_LOC_GET_SERVICE_REVISION_IND_V02 0x0032 +#define QMI_LOC_GET_FIX_CRITERIA_REQ_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_RESP_V02 0x0033 +#define QMI_LOC_GET_FIX_CRITERIA_IND_V02 0x0033 +#define QMI_LOC_NI_USER_RESPONSE_REQ_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_RESP_V02 0x0034 +#define QMI_LOC_NI_USER_RESPONSE_IND_V02 0x0034 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_RESP_V02 0x0035 +#define QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_IND_V02 0x0035 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_RESP_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_IND_V02 0x0036 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_RESP_V02 0x0037 +#define QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_IND_V02 0x0037 +#define QMI_LOC_INJECT_UTC_TIME_REQ_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_RESP_V02 0x0038 +#define QMI_LOC_INJECT_UTC_TIME_IND_V02 0x0038 +#define QMI_LOC_INJECT_POSITION_REQ_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_RESP_V02 0x0039 +#define QMI_LOC_INJECT_POSITION_IND_V02 0x0039 +#define QMI_LOC_SET_ENGINE_LOCK_REQ_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_RESP_V02 0x003A +#define QMI_LOC_SET_ENGINE_LOCK_IND_V02 0x003A +#define QMI_LOC_GET_ENGINE_LOCK_REQ_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_RESP_V02 0x003B +#define QMI_LOC_GET_ENGINE_LOCK_IND_V02 0x003B +#define QMI_LOC_SET_SBAS_CONFIG_REQ_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_RESP_V02 0x003C +#define QMI_LOC_SET_SBAS_CONFIG_IND_V02 0x003C +#define QMI_LOC_GET_SBAS_CONFIG_REQ_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_RESP_V02 0x003D +#define QMI_LOC_GET_SBAS_CONFIG_IND_V02 0x003D +#define QMI_LOC_SET_NMEA_TYPES_REQ_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_RESP_V02 0x003E +#define QMI_LOC_SET_NMEA_TYPES_IND_V02 0x003E +#define QMI_LOC_GET_NMEA_TYPES_REQ_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_RESP_V02 0x003F +#define QMI_LOC_GET_NMEA_TYPES_IND_V02 0x003F +#define QMI_LOC_SET_LOW_POWER_MODE_REQ_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_RESP_V02 0x0040 +#define QMI_LOC_SET_LOW_POWER_MODE_IND_V02 0x0040 +#define QMI_LOC_GET_LOW_POWER_MODE_REQ_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_RESP_V02 0x0041 +#define QMI_LOC_GET_LOW_POWER_MODE_IND_V02 0x0041 +#define QMI_LOC_SET_SERVER_REQ_V02 0x0042 +#define QMI_LOC_SET_SERVER_RESP_V02 0x0042 +#define QMI_LOC_SET_SERVER_IND_V02 0x0042 +#define QMI_LOC_GET_SERVER_REQ_V02 0x0043 +#define QMI_LOC_GET_SERVER_RESP_V02 0x0043 +#define QMI_LOC_GET_SERVER_IND_V02 0x0043 +#define QMI_LOC_DELETE_ASSIST_DATA_REQ_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_RESP_V02 0x0044 +#define QMI_LOC_DELETE_ASSIST_DATA_IND_V02 0x0044 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0045 +#define QMI_LOC_SET_XTRA_T_SESSION_CONTROL_IND_V02 0x0045 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_RESP_V02 0x0046 +#define QMI_LOC_GET_XTRA_T_SESSION_CONTROL_IND_V02 0x0046 +#define QMI_LOC_INJECT_WIFI_POSITION_REQ_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_RESP_V02 0x0047 +#define QMI_LOC_INJECT_WIFI_POSITION_IND_V02 0x0047 +#define QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_RESP_V02 0x0048 +#define QMI_LOC_NOTIFY_WIFI_STATUS_IND_V02 0x0048 +#define QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_RESP_V02 0x0049 +#define QMI_LOC_GET_REGISTERED_EVENTS_IND_V02 0x0049 +#define QMI_LOC_SET_OPERATION_MODE_REQ_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_RESP_V02 0x004A +#define QMI_LOC_SET_OPERATION_MODE_IND_V02 0x004A +#define QMI_LOC_GET_OPERATION_MODE_REQ_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_RESP_V02 0x004B +#define QMI_LOC_GET_OPERATION_MODE_IND_V02 0x004B +#define QMI_LOC_SET_SPI_STATUS_REQ_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_RESP_V02 0x004C +#define QMI_LOC_SET_SPI_STATUS_IND_V02 0x004C +#define QMI_LOC_INJECT_SENSOR_DATA_REQ_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_RESP_V02 0x004D +#define QMI_LOC_INJECT_SENSOR_DATA_IND_V02 0x004D +#define QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_RESP_V02 0x004E +#define QMI_LOC_INJECT_TIME_SYNC_DATA_IND_V02 0x004E +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_RESP_V02 0x004F +#define QMI_LOC_SET_CRADLE_MOUNT_CONFIG_IND_V02 0x004F +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_RESP_V02 0x0050 +#define QMI_LOC_GET_CRADLE_MOUNT_CONFIG_IND_V02 0x0050 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0051 +#define QMI_LOC_SET_EXTERNAL_POWER_CONFIG_IND_V02 0x0051 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_RESP_V02 0x0052 +#define QMI_LOC_GET_EXTERNAL_POWER_CONFIG_IND_V02 0x0052 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_RESP_V02 0x0053 +#define QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_IND_V02 0x0053 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0054 +#define QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0054 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_RESP_V02 0x0055 +#define QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 0x0055 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0056 +#define QMI_LOC_SET_SENSOR_CONTROL_CONFIG_IND_V02 0x0056 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_RESP_V02 0x0057 +#define QMI_LOC_GET_SENSOR_CONTROL_CONFIG_IND_V02 0x0057 +#define QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_RESP_V02 0x0058 +#define QMI_LOC_SET_SENSOR_PROPERTIES_IND_V02 0x0058 +#define QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_RESP_V02 0x0059 +#define QMI_LOC_GET_SENSOR_PROPERTIES_IND_V02 0x0059 +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005A +#define QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005A +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_RESP_V02 0x005B +#define QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_IND_V02 0x005B +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_RESP_V02 0x005C +#define QMI_LOC_INJECT_SUPL_CERTIFICATE_IND_V02 0x005C +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_RESP_V02 0x005D +#define QMI_LOC_DELETE_SUPL_CERTIFICATE_IND_V02 0x005D +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005E +#define QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005E +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_RESP_V02 0x005F +#define QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_IND_V02 0x005F +#define QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02 0x0060 +#define QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02 0x0061 +#define QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02 0x0062 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_RESP_V02 0x0063 +#define QMI_LOC_ADD_CIRCULAR_GEOFENCE_IND_V02 0x0063 +#define QMI_LOC_DELETE_GEOFENCE_REQ_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_RESP_V02 0x0064 +#define QMI_LOC_DELETE_GEOFENCE_IND_V02 0x0064 +#define QMI_LOC_QUERY_GEOFENCE_REQ_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_RESP_V02 0x0065 +#define QMI_LOC_QUERY_GEOFENCE_IND_V02 0x0065 +#define QMI_LOC_EDIT_GEOFENCE_REQ_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_RESP_V02 0x0066 +#define QMI_LOC_EDIT_GEOFENCE_IND_V02 0x0066 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_RESP_V02 0x0067 +#define QMI_LOC_GET_BEST_AVAILABLE_POSITION_IND_V02 0x0067 +#define QMI_LOC_INJECT_MOTION_DATA_REQ_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_RESP_V02 0x0068 +#define QMI_LOC_INJECT_MOTION_DATA_IND_V02 0x0068 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_RESP_V02 0x0069 +#define QMI_LOC_GET_NI_GEOFENCE_ID_LIST_IND_V02 0x0069 +#define QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_RESP_V02 0x006A +#define QMI_LOC_INJECT_GSM_CELL_INFO_IND_V02 0x006A +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_RESP_V02 0x006B +#define QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_IND_V02 0x006B +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_RESP_V02 0x006C +#define QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_IND_V02 0x006C +#define QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02 0x006D +#define QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02 0x006E +#define QMI_LOC_PEDOMETER_REPORT_REQ_V02 0x006F +#define QMI_LOC_PEDOMETER_REPORT_RESP_V02 0x006F +#define QMI_LOC_PEDOMETER_REPORT_IND_V02 0x006F +#define QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02 0x0070 +#define QMI_LOC_INJECT_WCDMA_CELL_INFO_RESP_V02 0x0070 +#define QMI_LOC_INJECT_WCDMA_CELL_INFO_IND_V02 0x0070 +#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02 0x0071 +#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_RESP_V02 0x0071 +#define QMI_LOC_INJECT_TDSCDMA_CELL_INFO_IND_V02 0x0071 +#define QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02 0x0072 +#define QMI_LOC_INJECT_SUBSCRIBER_ID_RESP_V02 0x0072 +#define QMI_LOC_INJECT_SUBSCRIBER_ID_IND_V02 0x0072 +#define QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_REQ_V02 0x0073 +#define QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_RESP_V02 0x0073 +#define QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_IND_V02 0x0073 +#define QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_REQ_V02 0x0074 +#define QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_RESP_V02 0x0074 +#define QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_IND_V02 0x0074 +#define QMI_LOC_GET_BATCH_SIZE_REQ_V02 0x0075 +#define QMI_LOC_GET_BATCH_SIZE_RESP_V02 0x0075 +#define QMI_LOC_GET_BATCH_SIZE_IND_V02 0x0075 +#define QMI_LOC_START_BATCHING_REQ_V02 0x0076 +#define QMI_LOC_START_BATCHING_RESP_V02 0x0076 +#define QMI_LOC_START_BATCHING_IND_V02 0x0076 +#define QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02 0x0077 +#define QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02 0x0078 +#define QMI_LOC_READ_FROM_BATCH_REQ_V02 0x0079 +#define QMI_LOC_READ_FROM_BATCH_RESP_V02 0x0079 +#define QMI_LOC_READ_FROM_BATCH_IND_V02 0x0079 +#define QMI_LOC_STOP_BATCHING_REQ_V02 0x007A +#define QMI_LOC_STOP_BATCHING_RESP_V02 0x007A +#define QMI_LOC_STOP_BATCHING_IND_V02 0x007A +#define QMI_LOC_RELEASE_BATCH_REQ_V02 0x007B +#define QMI_LOC_RELEASE_BATCH_RESP_V02 0x007B +#define QMI_LOC_RELEASE_BATCH_IND_V02 0x007B +#define QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_IND_V02 0x007C +#define QMI_LOC_INJECT_WIFI_AP_DATA_REQ_V02 0x007D +#define QMI_LOC_INJECT_WIFI_AP_DATA_RESP_V02 0x007D +#define QMI_LOC_INJECT_WIFI_AP_DATA_IND_V02 0x007D +#define QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_REQ_V02 0x007E +#define QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_RESP_V02 0x007E +#define QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_IND_V02 0x007E +#define QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_REQ_V02 0x007F +#define QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_RESP_V02 0x007F +#define QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_IND_V02 0x007F +#define QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02 0x0080 +#define QMI_LOC_EVENT_VEHICLE_DATA_READY_STATUS_IND_V02 0x0081 +#define QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_REQ_V02 0x0082 +#define QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_RESP_V02 0x0082 +#define QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_IND_V02 0x0082 +#define QMI_LOC_GET_AVAILABLE_WWAN_POSITION_REQ_V02 0x0083 +#define QMI_LOC_GET_AVAILABLE_WWAN_POSITION_RESP_V02 0x0083 +#define QMI_LOC_GET_AVAILABLE_WWAN_POSITION_IND_V02 0x0083 +#define QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_REQ_V02 0x0084 +#define QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_RESP_V02 0x0084 +#define QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_IND_V02 0x0084 +#define QMI_LOC_SET_XTRA_VERSION_CHECK_REQ_V02 0x0085 +#define QMI_LOC_SET_XTRA_VERSION_CHECK_RESP_V02 0x0085 +#define QMI_LOC_SET_XTRA_VERSION_CHECK_IND_V02 0x0085 +#define QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02 0x0086 +#define QMI_LOC_EVENT_SV_POLYNOMIAL_REPORT_IND_V02 0x0087 +#define QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_V02 0x0088 +#define QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_RESP_V02 0x0088 +#define QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02 0x0088 +#define QMI_LOC_ADD_GEOFENCE_CONTEXT_REQ_V02 0x0089 +#define QMI_LOC_ADD_GEOFENCE_CONTEXT_RESP_V02 0x0089 +#define QMI_LOC_ADD_GEOFENCE_CONTEXT_IND_V02 0x0089 +#define QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_REQ_V02 0x008A +#define QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_RESP_V02 0x008A +#define QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_IND_V02 0x008A +#define QMI_LOC_DELETE_GEOFENCE_CONTEXT_REQ_V02 0x008B +#define QMI_LOC_DELETE_GEOFENCE_CONTEXT_RESP_V02 0x008B +#define QMI_LOC_DELETE_GEOFENCE_CONTEXT_IND_V02 0x008B +#define QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02 0x008C +/** + @} + */ + +/* Service Object Accessor */ +/** @addtogroup wms_qmi_accessor + @{ + */ +/** This function is used internally by the autogenerated code. Clients should use the + macro loc_get_service_object_v02( ) that takes in no arguments. */ +qmi_idl_service_object_type loc_get_service_object_internal_v02 + ( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ); + +/** This macro should be used to get the service object */ +#define loc_get_service_object_v02( ) \ + loc_get_service_object_internal_v02( \ + LOC_V02_IDL_MAJOR_VERS, LOC_V02_IDL_MINOR_VERS, \ + LOC_V02_IDL_TOOL_VERS ) +/** + @} + */ + + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp new file mode 100644 index 0000000..e8cb93a --- /dev/null +++ b/gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp @@ -0,0 +1,46 @@ +/* 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 +#include +#include "platform_lib_time.h" + +int64_t systemTime(int clock) +{ + struct timeval t; + t.tv_sec = t.tv_usec = 0; + gettimeofday(&t, NULL); + return t.tv_sec*1000000LL + t.tv_usec; +} + + +int64_t elapsedMillisSinceBoot() +{ + int64_t t_us = systemTime(0); + return (int64_t) t_us / 1000LL; +} diff --git a/gps/platform_lib_abstractions/platform_lib_includes.h b/gps/platform_lib_abstractions/platform_lib_includes.h new file mode 100644 index 0000000..5858674 --- /dev/null +++ b/gps/platform_lib_abstractions/platform_lib_includes.h @@ -0,0 +1,35 @@ +/* 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. + */ + +#ifndef _PLATFORM_LIB_INCLUDES_H_ +#define _PLATFORM_LIB_INCLUDES_H_ + +#include "platform_lib_time.h" +#include "platform_lib_macros.h" + +#endif diff --git a/gps/platform_lib_abstractions/platform_lib_macros.h b/gps/platform_lib_abstractions/platform_lib_macros.h new file mode 100644 index 0000000..bc48dd9 --- /dev/null +++ b/gps/platform_lib_abstractions/platform_lib_macros.h @@ -0,0 +1,81 @@ +/* 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. + */ + +#ifndef __PLATFORM_LIB_MACROS_H__ +#define __PLATFORM_LIB_MACROS_H__ + +#include + +#define TS_PRINTF(format, x...) \ +{ \ + struct timeval tv; \ + struct timezone tz; \ + int hh, mm, ss; \ + gettimeofday(&tv, &tz); \ + hh = tv.tv_sec/3600%24; \ + mm = (tv.tv_sec%3600)/60; \ + ss = tv.tv_sec%60; \ + fprintf(stdout,"%02d:%02d:%02d.%06ld]" format "\n", hh, mm, ss, tv.tv_usec,##x); \ +} + + +#ifdef USE_GLIB + +#define strlcat g_strlcat +#define strlcpy g_strlcpy + +#define ALOGE(format, x...) TS_PRINTF("E/%s (%d): " format , LOG_TAG, getpid(), ##x) +#define ALOGW(format, x...) TS_PRINTF("W/%s (%d): " format , LOG_TAG, getpid(), ##x) +#define ALOGI(format, x...) TS_PRINTF("I/%s (%d): " format , LOG_TAG, getpid(), ##x) +#define ALOGD(format, x...) TS_PRINTF("D/%s (%d): " format , LOG_TAG, getpid(), ##x) +#define ALOGV(format, x...) TS_PRINTF("V/%s (%d): " format , LOG_TAG, getpid(), ##x) + +#define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid)) + +#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread +#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot()) + + +#else + +#ifdef __cplusplus +extern "C" { +#endif +pid_t gettid(void); + +#ifdef __cplusplus +} +#endif + +#define GETTID_PLATFORM_LIB_ABSTRACTION (gettid()) +#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread +#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime()) + +#endif + +#endif diff --git a/gps/platform_lib_abstractions/platform_lib_time.h b/gps/platform_lib_abstractions/platform_lib_time.h new file mode 100644 index 0000000..ce013af --- /dev/null +++ b/gps/platform_lib_abstractions/platform_lib_time.h @@ -0,0 +1,35 @@ +/* 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. + */ + +#ifndef _PLATFORM_LIB_TIME_H_ +#define _PLATFORM_LIB_TIME_H_ + +int64_t systemTime(int clock); +int64_t elapsedMillisSinceBoot(); + +#endif diff --git a/prebuilt/etc/quipc.conf b/gps/quipc.conf similarity index 100% rename from prebuilt/etc/quipc.conf rename to gps/quipc.conf diff --git a/prebuilt/etc/sap.conf b/gps/sap.conf similarity index 93% rename from prebuilt/etc/sap.conf rename to gps/sap.conf index d66ff5d..22b62ff 100644 --- a/prebuilt/etc/sap.conf +++ b/gps/sap.conf @@ -29,9 +29,7 @@ SENSOR_CONTROL_MODE=0 # Enable or Disable Sensors for GPS use (0=Enable, 1=Disable) # used in loc_eng_reinit -#LGE_UPDATE_CHANGE jdoc.kim@lge.com, to disable sap feature -#SENSOR_USAGE=0 -SENSOR_USAGE=1 +SENSOR_USAGE=0 # Choose GSIFF sensor provider (1=Snapdragon Sensors Core, 2=Android NDK) SENSOR_PROVIDER=1 diff --git a/gps/utils/Android.mk b/gps/utils/Android.mk new file mode 100644 index 0000000..0f99907 --- /dev/null +++ b/gps/utils/Android.mk @@ -0,0 +1,59 @@ +ifneq ($(BUILD_TINY_ANDROID),true) +#Compile this library only for builds with the latest modem image + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +## Libs +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libcutils \ + liblog + +LOCAL_SRC_FILES += \ + loc_log.cpp \ + loc_cfg.cpp \ + msg_q.c \ + linked_list.c \ + loc_target.cpp \ + loc_timer.c \ + ../platform_lib_abstractions/elapsed_millis_since_boot.cpp \ + loc_misc_utils.cpp + +LOCAL_CFLAGS += \ + -fno-short-enums \ + -D_ANDROID_ + +ifeq ($(TARGET_BUILD_VARIANT),user) + LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER +endif + +LOCAL_LDFLAGS += -Wl,--export-dynamic + +## Includes +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/../platform_lib_abstractions + +LOCAL_COPY_HEADERS_TO:= gps.utils/ +LOCAL_COPY_HEADERS:= \ + loc_log.h \ + loc_cfg.h \ + log_util.h \ + linked_list.h \ + msg_q.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 \ + loc_misc_utils.h + +LOCAL_MODULE := libgps.utils + +LOCAL_MODULE_TAGS := optional + +LOCAL_PRELINK_MODULE := false + +include $(BUILD_SHARED_LIBRARY) +endif # not BUILD_TINY_ANDROID diff --git a/gps/utils/Makefile.am b/gps/utils/Makefile.am new file mode 100644 index 0000000..e5935f0 --- /dev/null +++ b/gps/utils/Makefile.am @@ -0,0 +1,44 @@ +AM_CFLAGS = -Wundef \ + -MD \ + -Wno-trigraphs \ + -g -O0 \ + -fno-inline \ + -fno-short-enums \ + -fpic \ + -I../platform_lib_abstractions + +libgps_utils_so_la_h_sources = log_util.h \ + msg_q.h \ + linked_list.h \ + loc_cfg.h \ + loc_log.h \ + ../platform_lib_abstractions/platform_lib_includes.h \ + ../platform_lib_abstractions/platform_lib_time.h \ + ../platform_lib_abstractions/platform_lib_macros.h + +libgps_utils_so_la_c_sources = linked_list.c \ + msg_q.c \ + loc_cfg.cpp \ + loc_log.cpp \ + ../platform_lib_abstractions/elapsed_millis_since_boot.cpp + +library_includedir = $(pkgincludedir)/utils + +library_include_HEADERS = $(libgps_utils_so_la_h_sources) + +libgps_utils_so_la_SOURCES = $(libgps_utils_so_la_c_sources) + +if USE_GLIB +libgps_utils_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libgps_utils_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libgps_utils_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libgps_utils_so_la_CFLAGS = $(AM_CFLAGS) +libgps_utils_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 +libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +libgps_utils_so_la_LIBADD = -lstdc++ -lcutils + +#Create and Install libraries +lib_LTLIBRARIES = libgps_utils_so.la diff --git a/gps/utils/linked_list.c b/gps/utils/linked_list.c new file mode 100644 index 0000000..92617fe --- /dev/null +++ b/gps/utils/linked_list.c @@ -0,0 +1,328 @@ +/* Copyright (c) 2011, 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 "linked_list.h" +#include +#include + +#define LOG_TAG "LocSvc_utils_ll" +#include "log_util.h" +#include "platform_lib_includes.h" +#include +#include + +typedef struct list_element { + struct list_element* next; + struct list_element* prev; + void* data_ptr; + void (*dealloc_func)(void*); +}list_element; + +typedef struct list_state { + list_element* p_head; + list_element* p_tail; +} list_state; + +/* ----------------------- END INTERNAL FUNCTIONS ---------------------------------------- */ + +/*=========================================================================== + + FUNCTION: linked_list_init + + ===========================================================================*/ +linked_list_err_type linked_list_init(void** list_data) +{ + if( list_data == NULL ) + { + LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); + return eLINKED_LIST_INVALID_PARAMETER; + } + + list_state* tmp_list; + tmp_list = (list_state*)calloc(1, sizeof(list_state)); + if( tmp_list == NULL ) + { + LOC_LOGE("%s: Unable to allocate space for list!\n", __FUNCTION__); + return eLINKED_LIST_FAILURE_GENERAL; + } + + tmp_list->p_head = NULL; + tmp_list->p_tail = NULL; + + *list_data = tmp_list; + + return eLINKED_LIST_SUCCESS; +} + +/*=========================================================================== + + FUNCTION: linked_list_destroy + + ===========================================================================*/ +linked_list_err_type linked_list_destroy(void** list_data) +{ + if( list_data == NULL ) + { + LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); + return eLINKED_LIST_INVALID_HANDLE; + } + + list_state* p_list = (list_state*)*list_data; + + linked_list_flush(p_list); + + free(*list_data); + *list_data = NULL; + + return eLINKED_LIST_SUCCESS; +} + +/*=========================================================================== + + FUNCTION: linked_list_add + + ===========================================================================*/ +linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dealloc)(void*)) +{ + LOC_LOGD("%s: Adding to list data_obj = 0x%08X\n", __FUNCTION__, data_obj); + if( list_data == NULL ) + { + LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); + return eLINKED_LIST_INVALID_HANDLE; + } + + if( data_obj == NULL ) + { + LOC_LOGE("%s: Invalid input parameter!\n", __FUNCTION__); + return eLINKED_LIST_INVALID_PARAMETER; + } + + list_state* p_list = (list_state*)list_data; + list_element* elem = (list_element*)malloc(sizeof(list_element)); + if( elem == NULL ) + { + LOC_LOGE("%s: Memory allocation failed\n", __FUNCTION__); + return eLINKED_LIST_FAILURE_GENERAL; + } + + /* Copy data to newly created element */ + elem->data_ptr = data_obj; + elem->next = NULL; + elem->prev = NULL; + elem->dealloc_func = dealloc; + + /* Replace head element */ + list_element* tmp = p_list->p_head; + p_list->p_head = elem; + /* Point next to the previous head element */ + p_list->p_head->next = tmp; + + if( tmp != NULL ) + { + tmp->prev = p_list->p_head; + } + else + { + p_list->p_tail = p_list->p_head; + } + + return eLINKED_LIST_SUCCESS; +} + +/*=========================================================================== + + FUNCTION: linked_list_remove + + ===========================================================================*/ +linked_list_err_type linked_list_remove(void* list_data, void **data_obj) +{ + LOC_LOGD("%s: Removing from list\n", __FUNCTION__); + if( list_data == NULL ) + { + LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); + return eLINKED_LIST_INVALID_HANDLE; + } + + if( data_obj == NULL ) + { + LOC_LOGE("%s: Invalid input parameter!\n", __FUNCTION__); + return eLINKED_LIST_INVALID_PARAMETER; + } + + list_state* p_list = (list_state*)list_data; + if( p_list->p_tail == NULL ) + { + return eLINKED_LIST_UNAVAILABLE_RESOURCE; + } + + list_element* tmp = p_list->p_tail; + + /* Replace tail element */ + p_list->p_tail = tmp->prev; + + if( p_list->p_tail != NULL ) + { + p_list->p_tail->next = NULL; + } + else + { + p_list->p_head = p_list->p_tail; + } + + /* Copy data to output param */ + *data_obj = tmp->data_ptr; + + /* Free allocated list element */ + free(tmp); + + return eLINKED_LIST_SUCCESS; +} + +/*=========================================================================== + + FUNCTION: linked_list_empty + + ===========================================================================*/ +int linked_list_empty(void* list_data) +{ + if( list_data == NULL ) + { + LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); + return (int)eLINKED_LIST_INVALID_HANDLE; + } + else + { + list_state* p_list = (list_state*)list_data; + return p_list->p_head == NULL ? 1 : 0; + } +} + +/*=========================================================================== + + FUNCTION: linked_list_flush + + ===========================================================================*/ +linked_list_err_type linked_list_flush(void* list_data) +{ + if( list_data == NULL ) + { + LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); + return eLINKED_LIST_INVALID_HANDLE; + } + + list_state* p_list = (list_state*)list_data; + + /* Remove all dynamically allocated elements */ + while( p_list->p_head != NULL ) + { + list_element* tmp = p_list->p_head->next; + + /* Free data pointer if told to do so. */ + if( p_list->p_head->dealloc_func != NULL ) + { + p_list->p_head->dealloc_func(p_list->p_head->data_ptr); + } + + /* Free list element */ + free(p_list->p_head); + + p_list->p_head = tmp; + } + + p_list->p_tail = NULL; + + return eLINKED_LIST_SUCCESS; +} + +/*=========================================================================== + + FUNCTION: linked_list_search + + ===========================================================================*/ +linked_list_err_type linked_list_search(void* list_data, void **data_p, + bool (*equal)(void* data_0, void* data), + void* data_0, bool rm_if_found) +{ + LOC_LOGD("%s: Search the list\n", __FUNCTION__); + if( list_data == NULL || NULL == equal ) + { + LOC_LOGE("%s: Invalid list parameter! list_data %p equal %p\n", + __FUNCTION__, list_data, equal); + return eLINKED_LIST_INVALID_HANDLE; + } + + list_state* p_list = (list_state*)list_data; + if( p_list->p_tail == NULL ) + { + return eLINKED_LIST_UNAVAILABLE_RESOURCE; + } + + list_element* tmp = p_list->p_head; + + if (NULL != data_p) { + *data_p = NULL; + } + + while (NULL != tmp) { + if ((*equal)(data_0, tmp->data_ptr)) { + if (NULL != data_p) { + *data_p = tmp->data_ptr; + } + + if (rm_if_found) { + if (NULL == tmp->prev) { + p_list->p_head = tmp->next; + } else { + tmp->prev->next = tmp->next; + } + + if (NULL == tmp->next) { + p_list->p_tail = tmp->prev; + } else { + tmp->next->prev = tmp->prev; + } + + tmp->prev = tmp->next = NULL; + + // dealloc data if it is not copied out && caller + // has given us a dealloc function pointer. + if (NULL == data_p && NULL != tmp->dealloc_func) { + tmp->dealloc_func(tmp->data_ptr); + } + free(tmp); + } + + tmp = NULL; + } else { + tmp = tmp->next; + } + } + + return eLINKED_LIST_SUCCESS; +} + diff --git a/gps/utils/linked_list.h b/gps/utils/linked_list.h new file mode 100644 index 0000000..a85f09a --- /dev/null +++ b/gps/utils/linked_list.h @@ -0,0 +1,217 @@ +/* Copyright (c) 2011, 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 __LINKED_LIST_H__ +#define __LINKED_LIST_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include + +/** Linked List Return Codes */ +typedef enum +{ + eLINKED_LIST_SUCCESS = 0, + /**< Request was successful. */ + eLINKED_LIST_FAILURE_GENERAL = -1, + /**< Failed because of a general failure. */ + eLINKED_LIST_INVALID_PARAMETER = -2, + /**< Failed because the request contained invalid parameters. */ + eLINKED_LIST_INVALID_HANDLE = -3, + /**< Failed because an invalid handle was specified. */ + eLINKED_LIST_UNAVAILABLE_RESOURCE = -4, + /**< Failed because an there were not enough resources. */ + eLINKED_LIST_INSUFFICIENT_BUFFER = -5, + /**< Failed because an the supplied buffer was too small. */ +}linked_list_err_type; + +/*=========================================================================== +FUNCTION linked_list_init + +DESCRIPTION + Initializes internal structures for linked list. + + list_data: State of list to be initialized. + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +linked_list_err_type linked_list_init(void** list_data); + +/*=========================================================================== +FUNCTION linked_list_destroy + +DESCRIPTION + Destroys internal structures for linked list. + + p_list_data: State of list to be destroyed. + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +linked_list_err_type linked_list_destroy(void** list_data); + +/*=========================================================================== +FUNCTION linked_list_add + +DESCRIPTION + Adds an element to the head of the linked list. The passed in data pointer + is not modified or freed. Passed in data_obj is expected to live throughout + the use of the linked_list (i.e. data is not allocated internally) + + p_list_data: List to add data to the head of. + data_obj: Pointer to data to add into list + dealloc: Function used to deallocate memory for this element. Pass NULL + if you do not want data deallocated during a flush operation + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dealloc)(void*)); + +/*=========================================================================== +FUNCTION linked_list_remove + +DESCRIPTION + Retrieves data from the list tail. data_obj is the tail element from the list + passed in by linked_list_add. + + p_list_data: List to remove the tail from. + data_obj: Pointer to data removed from list + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +linked_list_err_type linked_list_remove(void* list_data, void **data_obj); + +/*=========================================================================== +FUNCTION linked_list_empty + +DESCRIPTION + Tells whether the list currently contains any elements + + p_list_data: List to check if empty. + +DEPENDENCIES + N/A + +RETURN VALUE + 0/FALSE : List contains elements + 1/TRUE : List is Empty + Otherwise look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +int linked_list_empty(void* list_data); + +/*=========================================================================== +FUNCTION linked_list_flush + +DESCRIPTION + Removes all elements from the list and deallocates them using the provided + dealloc function while adding elements. + + p_list_data: List to remove all elements from. + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +linked_list_err_type linked_list_flush(void* list_data); + +/*=========================================================================== +FUNCTION linked_list_search + +DESCRIPTION + Searches for an element in the linked list. + + p_list_data: List handle. + data_p: to be stored with the data found; NUll if no match. + if data_p passed in as NULL, then no write to it. + equal: Function ptr takes in a list element, and returns + indication if this the one looking for. + data_0: The data being compared against. + rm_if_found: Should data be removed if found? + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +linked_list_err_type linked_list_search(void* list_data, void **data_p, + bool (*equal)(void* data_0, void* data), + void* data_0, bool rm_if_found); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LINKED_LIST_H__ */ diff --git a/gps/utils/loc_cfg.cpp b/gps/utils/loc_cfg.cpp new file mode 100644 index 0000000..404f3ed --- /dev/null +++ b/gps/utils/loc_cfg.cpp @@ -0,0 +1,394 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_utils_cfg" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef USE_GLIB +#include +#endif +#include "platform_lib_includes.h" + +/*============================================================================= + * + * GLOBAL DATA DECLARATION + * + *============================================================================*/ + +/* Parameter data */ +static uint8_t DEBUG_LEVEL = 0xff; +static uint8_t TIMESTAMP = 0; + +/* Parameter spec table */ +static loc_param_s_type loc_param_table[] = +{ + {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, + {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, +}; +int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); + +typedef struct loc_param_v_type +{ + char* param_name; + char* param_str_value; + int param_int_value; + double param_double_value; +}loc_param_v_type; + +/*=========================================================================== +FUNCTION loc_set_config_entry + +DESCRIPTION + Potentially sets a given configuration table entry based on the passed in + configuration value. This is done by using a string comparison of the + parameter names and those found in the configuration file. + +PARAMETERS: + config_entry: configuration entry in the table to possibly set + config_value: value to store in the entry if the parameter names match + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ +int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value) +{ + int ret=-1; + if(NULL == config_entry || NULL == config_value) + { + LOC_LOGE("%s: INVALID config entry or parameter", __FUNCTION__); + return ret; + } + + if (strcmp(config_entry->param_name, config_value->param_name) == 0 && + config_entry->param_ptr) + { + switch (config_entry->param_type) + { + case 's': + if (strcmp(config_value->param_str_value, "NULL") == 0) + { + *((char*)config_entry->param_ptr) = '\0'; + } + else { + strlcpy((char*) config_entry->param_ptr, + config_value->param_str_value, + LOC_MAX_PARAM_STRING + 1); + } + /* Log INI values */ + LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, + config_entry->param_name, (char*)config_entry->param_ptr); + + if(NULL != config_entry->param_set) + { + *(config_entry->param_set) = 1; + } + ret = 0; + break; + case 'n': + *((int *)config_entry->param_ptr) = config_value->param_int_value; + /* Log INI values */ + LOC_LOGD("%s: PARAM %s = %d", __FUNCTION__, + config_entry->param_name, config_value->param_int_value); + + if(NULL != config_entry->param_set) + { + *(config_entry->param_set) = 1; + } + ret = 0; + break; + case 'f': + *((double *)config_entry->param_ptr) = config_value->param_double_value; + /* Log INI values */ + LOC_LOGD("%s: PARAM %s = %f", __FUNCTION__, + config_entry->param_name, config_value->param_double_value); + + if(NULL != config_entry->param_set) + { + *(config_entry->param_set) = 1; + } + ret = 0; + break; + default: + LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", + __FUNCTION__, config_entry->param_name); + } + } + return ret; +} + +/*=========================================================================== +FUNCTION loc_fill_conf_item + +DESCRIPTION + Takes a line of configuration item and sets defined values based on + the passed in configuration table. This table maps strings to values to + set along with the type of each of these values. + +PARAMETERS: + input_buf : buffer contanis config item + config_table: table definition of strings to places to store information + table_length: length of the configuration table + +DEPENDENCIES + N/A + +RETURN VALUE + 0: Number of records in the config_table filled with input_buf + +SIDE EFFECTS + N/A +===========================================================================*/ +int loc_fill_conf_item(char* input_buf, + loc_param_s_type* config_table, uint32_t table_length) +{ + int ret = 0; + + if (input_buf && config_table) { + char *lasts; + loc_param_v_type config_value; + memset(&config_value, 0, sizeof(config_value)); + + /* Separate variable and value */ + config_value.param_name = strtok_r(input_buf, "=", &lasts); + /* skip lines that do not contain "=" */ + if (config_value.param_name) { + config_value.param_str_value = strtok_r(NULL, "=", &lasts); + + /* skip lines that do not contain two operands */ + if (config_value.param_str_value) { + /* Trim leading and trailing spaces */ + loc_util_trim_space(config_value.param_name); + loc_util_trim_space(config_value.param_str_value); + + /* Parse numerical value */ + if ((strlen(config_value.param_str_value) >=3) && + (config_value.param_str_value[0] == '0') && + (tolower(config_value.param_str_value[1]) == 'x')) + { + /* hex */ + config_value.param_int_value = (int) strtol(&config_value.param_str_value[2], + (char**) NULL, 16); + } + else { + config_value.param_double_value = (double) atof(config_value.param_str_value); /* float */ + config_value.param_int_value = atoi(config_value.param_str_value); /* dec */ + } + + for(uint32_t i = 0; NULL != config_table && i < table_length; i++) + { + if(!loc_set_config_entry(&config_table[i], &config_value)) { + ret += 1; + } + } + } + } + } + + return ret; +} + +/*=========================================================================== +FUNCTION loc_read_conf_r (repetitive) + +DESCRIPTION + Reads the specified configuration file and sets defined values based on + the passed in configuration table. This table maps strings to values to + set along with the type of each of these values. + The difference between this and loc_read_conf is that this function returns + the file pointer position at the end of filling a config table. Also, it + reads a fixed number of parameters at a time which is equal to the length + of the configuration table. This functionality enables the caller to + repeatedly call the function to read data from the same file. + +PARAMETERS: + conf_fp : file pointer + config_table: table definition of strings to places to store information + table_length: length of the configuration table + +DEPENDENCIES + N/A + +RETURN VALUE + 0: Table filled successfully + 1: No more parameters to read + -1: Error filling table + +SIDE EFFECTS + N/A +===========================================================================*/ +int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t table_length) +{ + int ret=0; + + unsigned int num_params=table_length; + if(conf_fp == NULL) { + LOC_LOGE("%s:%d]: ERROR: File pointer is NULL\n", __func__, __LINE__); + ret = -1; + goto err; + } + + /* Clear all validity bits */ + for(uint32_t i = 0; NULL != config_table && i < table_length; i++) + { + if(NULL != config_table[i].param_set) + { + *(config_table[i].param_set) = 0; + } + } + + char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */ + + LOC_LOGD("%s:%d]: num_params: %d\n", __func__, __LINE__, num_params); + while(num_params) + { + if(!fgets(input_buf, LOC_MAX_PARAM_LINE, conf_fp)) { + LOC_LOGD("%s:%d]: fgets returned NULL\n", __func__, __LINE__); + break; + } + + num_params -= loc_fill_conf_item(input_buf, config_table, table_length); + } + +err: + return ret; +} + +/*=========================================================================== +FUNCTION loc_udpate_conf + +DESCRIPTION + Parses the passed in buffer for configuration items, and update the table + that is also passed in. + +Reads the specified configuration file and sets defined values based on + the passed in configuration table. This table maps strings to values to + set along with the type of each of these values. + +PARAMETERS: + conf_data: configuration items in bufferas a string + length: strlen(conf_data) + config_table: table definition of strings to places to store information + table_length: length of the configuration table + +DEPENDENCIES + N/A + +RETURN VALUE + number of the records in the table that is updated at time of return. + +SIDE EFFECTS + N/A +===========================================================================*/ +int loc_update_conf(const char* conf_data, int32_t length, + loc_param_s_type* config_table, uint32_t table_length) +{ + int ret = -1; + + if (conf_data && length && config_table && table_length) { + // make a copy, so we do not tokenize the original data + char* conf_copy = (char*)malloc(length+1); + 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; + + 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); + } + } + + return ret; +} + +/*=========================================================================== +FUNCTION loc_read_conf + +DESCRIPTION + Reads the specified configuration file and sets defined values based on + the passed in configuration table. This table maps strings to values to + set along with the type of each of these values. + +PARAMETERS: + conf_file_name: configuration file to read + config_table: table definition of strings to places to store information + table_length: length of the configuration table + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ +void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, + uint32_t table_length) +{ + FILE *conf_fp = NULL; + char *lasts; + loc_param_v_type config_value; + uint32_t i; + + if((conf_fp = fopen(conf_file_name, "r")) != NULL) + { + LOC_LOGD("%s: using %s", __FUNCTION__, conf_file_name); + if(table_length && config_table) { + loc_read_conf_r(conf_fp, config_table, table_length); + rewind(conf_fp); + } + loc_read_conf_r(conf_fp, loc_param_table, loc_param_num); + fclose(conf_fp); + } + /* Initialize logging mechanism with parsed data */ + loc_logger_init(DEBUG_LEVEL, TIMESTAMP); +} diff --git a/gps/utils/loc_cfg.h b/gps/utils/loc_cfg.h new file mode 100644 index 0000000..ea4865b --- /dev/null +++ b/gps/utils/loc_cfg.h @@ -0,0 +1,91 @@ +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef LOC_CFG_H +#define LOC_CFG_H + +#include +#include + +#define LOC_MAX_PARAM_NAME 80 +#define LOC_MAX_PARAM_STRING 80 +#define LOC_MAX_PARAM_LINE (LOC_MAX_PARAM_NAME + LOC_MAX_PARAM_STRING) + +#define UTIL_UPDATE_CONF(conf_data, len, config_table) \ + loc_update_conf((conf_data), (len), (config_table), \ + sizeof(config_table) / sizeof(config_table[0])) + +#define UTIL_READ_CONF_DEFAULT(filename) \ + loc_read_conf((filename), NULL, 0); + +#define UTIL_READ_CONF(filename, config_table) \ + loc_read_conf((filename), (config_table), sizeof(config_table) / sizeof(config_table[0])) + +/*============================================================================= + * + * MODULE TYPE DECLARATION + * + *============================================================================*/ +typedef struct +{ + char param_name[LOC_MAX_PARAM_NAME]; + void *param_ptr; + uint8_t *param_set; /* was this value set by config file? */ + char param_type; /* 'n' for number, + 's' for string, + 'f' for float */ +} loc_param_s_type; + +/*============================================================================= + * + * MODULE EXTERNAL DATA + * + *============================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/*============================================================================= + * + * MODULE EXPORTED FUNCTIONS + * + *============================================================================*/ +void loc_read_conf(const char* conf_file_name, + loc_param_s_type* config_table, + uint32_t table_length); +int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, + uint32_t table_length); +int loc_update_conf(const char* conf_data, int32_t length, + loc_param_s_type* config_table, uint32_t table_length); +#ifdef __cplusplus +} +#endif + +#endif /* LOC_CFG_H */ diff --git a/gps/utils/loc_log.cpp b/gps/utils/loc_log.cpp new file mode 100644 index 0000000..392966e --- /dev/null +++ b/gps/utils/loc_log.cpp @@ -0,0 +1,240 @@ +/* Copyright (c) 2011-2012, 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 + +#include +#include +#include +#include "loc_log.h" +#include "msg_q.h" +#ifdef USE_GLIB +#include +#endif /* USE_GLIB */ +#include "log_util.h" +#include "platform_lib_includes.h" + +#define BUFFER_SIZE 120 + +// Logging Improvements +const char *loc_logger_boolStr[]={"False","True"}; +const char VOID_RET[] = "None"; +const char FROM_AFW[] = "===>"; +const char TO_MODEM[] = "--->"; +const char FROM_MODEM[] = "<---"; +const char TO_AFW[] = "<==="; +const char EXIT_TAG[] = "Exiting"; +const char ENTRY_TAG[] = "Entering"; + +/* Logging Mechanism */ +loc_logger_s_type loc_logger; + +/* Get names from value */ +const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask) +{ + int i; + for (i = 0; i < table_size; i++) + { + if (table[i].val & (long) mask) + { + return table[i].name; + } + } + return UNKNOWN_STR; +} + +/* Get names from value */ +const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value) +{ + int i; + for (i = 0; i < table_size; i++) + { + if (table[i].val == (long) value) + { + return table[i].name; + } + } + return UNKNOWN_STR; +} + +static loc_name_val_s_type loc_msg_q_status[] = +{ + NAME_VAL( eMSG_Q_SUCCESS ), + NAME_VAL( eMSG_Q_FAILURE_GENERAL ), + NAME_VAL( eMSG_Q_INVALID_PARAMETER ), + NAME_VAL( eMSG_Q_INVALID_HANDLE ), + NAME_VAL( eMSG_Q_UNAVAILABLE_RESOURCE ), + NAME_VAL( eMSG_Q_INSUFFICIENT_BUFFER ) +}; +static int loc_msg_q_status_num = sizeof(loc_msg_q_status) / sizeof(loc_name_val_s_type); + +/* Find msg_q status name */ +const char* loc_get_msg_q_status(int status) +{ + return loc_get_name_from_val(loc_msg_q_status, loc_msg_q_status_num, (long) status); +} + +const char* log_succ_fail_string(int is_succ) +{ + return is_succ? "successful" : "failed"; +} + +//Target names +loc_name_val_s_type target_name[] = +{ + NAME_VAL(GNSS_NONE), + NAME_VAL(GNSS_MSM), + NAME_VAL(GNSS_GSS), + NAME_VAL(GNSS_MDM), + NAME_VAL(GNSS_QCA1530), + NAME_VAL(GNSS_UNKNOWN) +}; + +static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); + +/*=========================================================================== + +FUNCTION loc_get_target_name + +DESCRIPTION + Returns pointer to a string that contains name of the target + + XX:XX:XX.000\0 + +RETURN VALUE + The target name string + +===========================================================================*/ +const char *loc_get_target_name(unsigned int target) +{ + int index = 0; + static char ret[BUFFER_SIZE]; + + index = getTargetGnssType(target); + if( index >= target_name_num || index < 0) + index = target_name_num - 1; + + if( (target & HAS_SSC) == HAS_SSC ) { + snprintf(ret, sizeof(ret), " %s with SSC", + loc_get_name_from_val(target_name, target_name_num, (long)index) ); + } + else { + snprintf(ret, sizeof(ret), " %s without SSC", + loc_get_name_from_val(target_name, target_name_num, (long)index) ); + } + return ret; +} + + +/*=========================================================================== + +FUNCTION loc_get_time + +DESCRIPTION + Logs a callback event header. + The pointer time_string should point to a buffer of at least 13 bytes: + + XX:XX:XX.000\0 + +RETURN VALUE + The time string + +===========================================================================*/ +char *loc_get_time(char *time_string, unsigned long buf_size) +{ + struct timeval now; /* sec and usec */ + struct tm now_tm; /* broken-down time */ + char hms_string[80]; /* HH:MM:SS */ + + gettimeofday(&now, NULL); + localtime_r(&now.tv_sec, &now_tm); + + strftime(hms_string, sizeof hms_string, "%H:%M:%S", &now_tm); + snprintf(time_string, buf_size, "%s.%03d", hms_string, (int) (now.tv_usec / 1000)); + + return time_string; +} + + +/*=========================================================================== +FUNCTION loc_logger_init + +DESCRIPTION + Initializes the state of DEBUG_LEVEL and TIMESTAMP + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ +void loc_logger_init(unsigned long debug, unsigned long timestamp) +{ + loc_logger.DEBUG_LEVEL = debug; +#ifdef TARGET_BUILD_VARIANT_USER + // force user builds to 2 or less + if (loc_logger.DEBUG_LEVEL > 2) { + loc_logger.DEBUG_LEVEL = 2; + } +#endif + loc_logger.TIMESTAMP = timestamp; +} + + +/*=========================================================================== +FUNCTION get_timestamp + +DESCRIPTION + Generates a timestamp using the current system time + +DEPENDENCIES + N/A + +RETURN VALUE + Char pointer to the parameter str + +SIDE EFFECTS + N/A +===========================================================================*/ +char * get_timestamp(char *str, unsigned long buf_size) +{ + struct timeval tv; + struct timezone tz; + int hh, mm, ss; + gettimeofday(&tv, &tz); + hh = tv.tv_sec/3600%24; + mm = (tv.tv_sec%3600)/60; + ss = tv.tv_sec%60; + snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_usec); + return str; +} + diff --git a/gps/utils/loc_log.h b/gps/utils/loc_log.h new file mode 100644 index 0000000..82dc636 --- /dev/null +++ b/gps/utils/loc_log.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2011-2012, 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_LOG_H +#define LOC_LOG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include "loc_target.h" + +typedef struct +{ + char name[128]; + long val; +} loc_name_val_s_type; + +#define NAME_VAL(x) {"" #x "", x } + +#define UNKNOWN_STR "UNKNOWN" + +#define CHECK_MASK(type, value, mask_var, mask) \ + ((mask_var & mask) ? (type) value : (type) (-1)) + +/* Get names from value */ +const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); +const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value); +const char* loc_get_msg_q_status(int status); +const char* loc_get_target_name(unsigned int target); + +extern const char* log_succ_fail_string(int is_succ); + +extern char *loc_get_time(char *time_string, unsigned long buf_size); + +#ifdef __cplusplus +} +#endif + +#endif /* LOC_LOG_H */ diff --git a/gps/utils/loc_misc_utils.cpp b/gps/utils/loc_misc_utils.cpp new file mode 100644 index 0000000..7e96313 --- /dev/null +++ b/gps/utils/loc_misc_utils.cpp @@ -0,0 +1,114 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include +#include +#include +#include +#include + +#define LOG_NDDEBUG 0 +#define LOG_TAG "LocSvc_misc_utils" + +int loc_util_split_string(char *raw_string, char **split_strings_ptr, + int max_num_substrings, char delimiter) +{ + int raw_string_index=0; + int num_split_strings=0; + unsigned char end_string=0; + int raw_string_length=0; + + if(!raw_string || !split_strings_ptr) { + LOC_LOGE("%s:%d]: NULL parameters", __func__, __LINE__); + num_split_strings = -1; + goto err; + } + LOC_LOGD("%s:%d]: raw string: %s\n", __func__, __LINE__, raw_string); + raw_string_length = strlen(raw_string) + 1; + split_strings_ptr[num_split_strings] = &raw_string[raw_string_index]; + for(raw_string_index=0; raw_string_index < raw_string_length; raw_string_index++) { + if(raw_string[raw_string_index] == '\0') + end_string=1; + if((raw_string[raw_string_index] == delimiter) || end_string) { + raw_string[raw_string_index] = '\0'; + LOC_LOGD("%s:%d]: split string: %s\n", + __func__, __LINE__, split_strings_ptr[num_split_strings]); + num_split_strings++; + if(((raw_string_index + 1) < raw_string_length) && + (num_split_strings < max_num_substrings)) { + split_strings_ptr[num_split_strings] = &raw_string[raw_string_index+1]; + } + else { + break; + } + } + if(end_string) + break; + } +err: + LOC_LOGD("%s:%d]: num_split_strings: %d\n", __func__, __LINE__, num_split_strings); + return num_split_strings; +} + +void loc_util_trim_space(char *org_string) +{ + char *scan_ptr, *write_ptr; + char *first_nonspace = NULL, *last_nonspace = NULL; + + if(org_string == NULL) { + LOC_LOGE("%s:%d]: NULL parameter", __func__, __LINE__); + goto err; + } + + scan_ptr = write_ptr = org_string; + + while (*scan_ptr) { + //Find the first non-space character + if ( !isspace(*scan_ptr) && first_nonspace == NULL) { + first_nonspace = scan_ptr; + } + //Once the first non-space character is found in the + //above check, keep shifting the characters to the left + //to replace the spaces + if (first_nonspace != NULL) { + *(write_ptr++) = *scan_ptr; + //Keep track of which was the last non-space character + //encountered + //last_nonspace will not be updated in the case where + //the string ends with spaces + if ( !isspace(*scan_ptr)) { + last_nonspace = write_ptr; + } + } + scan_ptr++; + } + //Add NULL terminator after the last non-space character + if (last_nonspace) { *last_nonspace = '\0'; } +err: + return; +} diff --git a/gps/utils/loc_misc_utils.h b/gps/utils/loc_misc_utils.h new file mode 100644 index 0000000..7d66d84 --- /dev/null +++ b/gps/utils/loc_misc_utils.h @@ -0,0 +1,99 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation, nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef _LOC_MISC_UTILS_H_ +#define _LOC_MISC_UTILS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/*=========================================================================== +FUNCTION loc_split_string + +DESCRIPTION: + This function is used to split a delimiter separated string into + sub-strings. This function does not allocate new memory to store the split + strings. Instead, it places '\0' in places of delimiters and assings the + starting address of the substring within the raw string as the string address + The input raw_string no longer remains to be a collection of sub-strings + after this function is executed. + Please make a copy of the input string before calling this function if + necessary + +PARAMETERS: + char *raw_string: is the original string with delimiter separated substrings + char **split_strings_ptr: is the arraw of pointers which will hold the addresses + of individual substrings + int max_num_substrings: is the maximum number of substrings that are expected + by the caller. The array of pointers in the above parameter + is usually this long + char delimiter: is the delimiter that separates the substrings. Examples: ' ', ';' + +DEPENDENCIES + N/A + +RETURN VALUE + int Number of split strings + +SIDE EFFECTS + The input raw_string no longer remains a delimiter separated single string. + +EXAMPLE + delimiter = ' ' //space + raw_string = "hello new user" //delimiter is space ' ' + addresses = 0123456789abcd + split_strings_ptr[0] = &raw_string[0]; //split_strings_ptr[0] contains "hello" + split_strings_ptr[1] = &raw_string[6]; //split_strings_ptr[1] contains "new" + split_strings_ptr[2] = &raw_string[a]; //split_strings_ptr[2] contains "user" + +===========================================================================*/ +int loc_util_split_string(char *raw_string, char **split_strings_ptr, int max_num_substrings, + char delimiter); + +/*=========================================================================== +FUNCTION trim_space + +DESCRIPTION + Removes leading and trailing spaces of the string + +DEPENDENCIES + N/A + +RETURN VALUE + None + +SIDE EFFECTS + N/A +===========================================================================*/ +void loc_util_trim_space(char *org_string); +#ifdef __cplusplus +} +#endif + +#endif //_LOC_MISC_UTILS_H_ diff --git a/gps/utils/loc_target.cpp b/gps/utils/loc_target.cpp new file mode 100644 index 0000000..8dbe885 --- /dev/null +++ b/gps/utils/loc_target.cpp @@ -0,0 +1,245 @@ +/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * 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 +#include +#include +#include +#include +#include +#include +#include +#include "loc_target.h" +#include "loc_log.h" +#include "log_util.h" + +#define APQ8064_ID_1 "109" +#define APQ8064_ID_2 "153" +#define MPQ8064_ID_1 "130" +#define MSM8930_ID_1 "142" +#define MSM8930_ID_2 "116" +#define APQ8030_ID_1 "157" +#define APQ8074_ID_1 "184" +#define PDS_ID_1 "178" + +#define LINE_LEN 100 +#define STR_LIQUID "Liquid" +#define STR_SURF "Surf" +#define STR_MTP "MTP" +#define STR_APQ "apq" +#define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') +#define LENGTH(s) (sizeof(s) - 1) +#define GPS_CHECK_NO_ERROR 0 +#define GPS_CHECK_NO_GPS_HW 1 +/* When system server is started, it uses 20 seconds as ActivityManager + * timeout. After that it sends SIGSTOP signal to process. + */ +#define QCA1530_DETECT_TIMEOUT 15 +#define QCA1530_DETECT_PRESENT "yes" +#define QCA1530_DETECT_PROGRESS "detect" + +static unsigned int gTarget = (unsigned int)-1; + +static int read_a_line(const char * file_path, char * line, int line_size) +{ + FILE *fp; + int result = 0; + + * line = '\0'; + fp = fopen(file_path, "r" ); + if( fp == NULL ) { + LOC_LOGE("open failed: %s: %s\n", file_path, strerror(errno)); + result = -1; + } else { + int len; + fgets(line, line_size, fp); + len = strlen(line); + len = len < line_size - 1? len : line_size - 1; + line[len] = '\0'; + LOC_LOGD("cat %s: %s", file_path, line); + fclose(fp); + } + return result; +} + +/*! + * \brief Checks if QCA1530 is avalable. + * + * Function verifies if qca1530 SoC is configured on the device. The test is + * based on property value. For 1530 scenario, the value shall be one of the + * following: "yes", "no", "detect". All other values are treated equally to + * "no". When the value is "detect" the system waits for SoC detection to + * finish before returning result. + * + * \retval true - QCA1530 is available. + * \retval false - QCA1530 is not available. + */ +static bool is_qca1530(void) +{ + static const char qca1530_property_name[] = "sys.qca1530"; + bool res = false; + int ret, i; + char buf[PROPERTY_VALUE_MAX]; + + memset(buf, 0, sizeof(buf)); + + for (i = 0; i < QCA1530_DETECT_TIMEOUT; ++i) + { + ret = property_get(qca1530_property_name, buf, NULL); + if (ret < 0) + { + LOC_LOGV( "qca1530: property %s is not accessible, ret=%d", + qca1530_property_name, + ret); + + break; + } + + LOC_LOGV( "qca1530: property %s is set to %s", + qca1530_property_name, + buf); + + if (!memcmp(buf, QCA1530_DETECT_PRESENT, + sizeof(QCA1530_DETECT_PRESENT))) + { + res = true; + break; + } + if (!memcmp(buf, QCA1530_DETECT_PROGRESS, + sizeof(QCA1530_DETECT_PROGRESS))) + { + LOC_LOGV("qca1530: SoC detection is in progress."); + sleep(1); + continue; + } + break; + } + + LOC_LOGD("qca1530: detected=%s", res ? "true" : "false"); + return res; +} + +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +void loc_get_target_baseband(char *baseband, int array_length) +{ + if(baseband && (array_length >= PROPERTY_VALUE_MAX)) { + property_get("ro.baseband", baseband, ""); + LOC_LOGD("%s:%d]: Baseband: %s\n", __func__, __LINE__, baseband); + } + else { + LOC_LOGE("%s:%d]: NULL parameter or array length less than PROPERTY_VALUE_MAX\n", + __func__, __LINE__); + } +} + +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +void loc_get_platform_name(char *platform_name, int array_length) +{ + if(platform_name && (array_length >= PROPERTY_VALUE_MAX)) { + property_get("ro.board.platform", platform_name, ""); + LOC_LOGD("%s:%d]: Target name: %s\n", __func__, __LINE__, platform_name); + } + else { + LOC_LOGE("%s:%d]: Null parameter or array length less than PROPERTY_VALUE_MAX\n", + __func__, __LINE__); + } +} + +unsigned int loc_get_target(void) +{ + if (gTarget != (unsigned int)-1) + return gTarget; + + static const char hw_platform[] = "/sys/devices/soc0/hw_platform"; + static const char id[] = "/sys/devices/soc0/soc_id"; + static const char hw_platform_dep[] = + "/sys/devices/system/soc/soc0/hw_platform"; + static const char id_dep[] = "/sys/devices/system/soc/soc0/id"; + static const char mdm[] = "/dev/mdm"; // No such file or directory + + char rd_hw_platform[LINE_LEN]; + char rd_id[LINE_LEN]; + char rd_mdm[LINE_LEN]; + char baseband[LINE_LEN]; + + if (is_qca1530()) { + gTarget = TARGET_QCA1530; + goto detected; + } + + loc_get_target_baseband(baseband, sizeof(baseband)); + + if (!access(hw_platform, F_OK)) { + read_a_line(hw_platform, rd_hw_platform, LINE_LEN); + } else { + read_a_line(hw_platform_dep, rd_hw_platform, LINE_LEN); + } + if (!access(id, F_OK)) { + read_a_line(id, rd_id, LINE_LEN); + } else { + read_a_line(id_dep, rd_id, LINE_LEN); + } + if( !memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) ){ + if( !memcmp(rd_id, PDS_ID_1, LENGTH(PDS_ID_1)) + && IS_STR_END(rd_id[LENGTH(PDS_ID_1)]) ) + gTarget = TARGET_PDS; + } + else if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ + if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) + && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) + gTarget = TARGET_MPQ; + else + gTarget = TARGET_APQ_SA; + } + else { + if( (!memcmp(rd_hw_platform, STR_LIQUID, LENGTH(STR_LIQUID)) + && IS_STR_END(rd_hw_platform[LENGTH(STR_LIQUID)])) || + (!memcmp(rd_hw_platform, STR_SURF, LENGTH(STR_SURF)) + && IS_STR_END(rd_hw_platform[LENGTH(STR_SURF)])) || + (!memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) + && IS_STR_END(rd_hw_platform[LENGTH(STR_MTP)]))) { + + if (!read_a_line( mdm, rd_mdm, LINE_LEN)) + gTarget = TARGET_MDM; + } + else if( (!memcmp(rd_id, MSM8930_ID_1, LENGTH(MSM8930_ID_1)) + && IS_STR_END(rd_id[LENGTH(MSM8930_ID_1)])) || + (!memcmp(rd_id, MSM8930_ID_2, LENGTH(MSM8930_ID_2)) + && IS_STR_END(rd_id[LENGTH(MSM8930_ID_2)])) ) + gTarget = TARGET_MSM_NO_SSC; + else + gTarget = TARGET_UNKNOWN; + } + +detected: + LOC_LOGD("HAL: %s returned %d", __FUNCTION__, gTarget); + return gTarget; +} diff --git a/gps/utils/loc_target.h b/gps/utils/loc_target.h new file mode 100644 index 0000000..208a34c --- /dev/null +++ b/gps/utils/loc_target.h @@ -0,0 +1,77 @@ +/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * 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_TARGET_H +#define LOC_TARGET_H +#define TARGET_SET(gnss,ssc) ( (gnss<<1)|ssc ) +#define TARGET_DEFAULT TARGET_SET(GNSS_MSM, HAS_SSC) +#define TARGET_MDM TARGET_SET(GNSS_MDM, HAS_SSC) +#define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC) +#define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC) +#define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) +#define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC) +#define TARGET_PDS TARGET_SET(GNSS_PDS, NO_SSC) +#define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) +#define getTargetGnssType(target) (target>>1) + +#ifdef __cplusplus +extern "C" +{ +#endif + +unsigned int loc_get_target(void); + +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +void loc_get_target_baseband(char *baseband, int array_length); +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +void loc_get_platform_name(char *platform_name, int array_length); + +/* Please remember to update 'target_name' in loc_log.cpp, + if do any changes to this enum. */ +typedef enum { + GNSS_NONE = 0, + GNSS_MSM, + GNSS_GSS, + GNSS_MDM, + GNSS_QCA1530, + GNSS_PDS, + GNSS_UNKNOWN +}GNSS_TARGET; + +typedef enum { + NO_SSC = 0, + HAS_SSC +}SSC_TYPE; + +#ifdef __cplusplus +} +#endif + +#endif /*LOC_TARGET_H*/ diff --git a/gps/utils/loc_timer.c b/gps/utils/loc_timer.c new file mode 100644 index 0000000..2beca5f --- /dev/null +++ b/gps/utils/loc_timer.c @@ -0,0 +1,202 @@ +/* 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 +#include +#include +#include "loc_timer.h" +#include +#include + +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 new file mode 100644 index 0000000..0034d27 --- /dev/null +++ b/gps/utils/loc_timer.h @@ -0,0 +1,63 @@ +/* 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. + * + */ + +#ifndef __LOC_DELAY_H__ +#define __LOC_DELAY_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +#include +#include "log_util.h" + +/* + Return values: + Success = 0 + Failure = Non zero +*/ +typedef void(*loc_timer_callback)(void *user_data, int result); + + +/* + Returns the handle, which can be used to stop the timer +*/ +void* loc_timer_start(unsigned int delay_msec, + loc_timer_callback, + void* user_data); + +/* + handle becomes invalid upon the return of the callback +*/ +void loc_timer_stop(void* handle); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //__LOC_DELAY_H__ diff --git a/gps/utils/log_util.h b/gps/utils/log_util.h new file mode 100644 index 0000000..8ff6b5a --- /dev/null +++ b/gps/utils/log_util.h @@ -0,0 +1,181 @@ +/* Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __LOG_UTIL_H__ +#define __LOG_UTIL_H__ + +#ifndef USE_GLIB +#include +#endif /* USE_GLIB */ + +#ifdef USE_GLIB + +#include +#include +#include + +#ifndef LOG_TAG +#define LOG_TAG "GPS_UTILS" + +#endif // LOG_TAG + +#endif /* USE_GLIB */ + +#ifdef __cplusplus +extern "C" +{ +#endif +/*============================================================================= + * + * LOC LOGGER TYPE DECLARATION + * + *============================================================================*/ +/* LOC LOGGER */ +typedef struct loc_logger_s +{ + unsigned long DEBUG_LEVEL; + unsigned long TIMESTAMP; +} loc_logger_s_type; + +/*============================================================================= + * + * EXTERNAL DATA + * + *============================================================================*/ +extern loc_logger_s_type loc_logger; + +// Logging Improvements +extern const char *loc_logger_boolStr[]; + +extern const char *boolStr[]; +extern const char VOID_RET[]; +extern const char FROM_AFW[]; +extern const char TO_MODEM[]; +extern const char FROM_MODEM[]; +extern const char TO_AFW[]; +extern const char EXIT_TAG[]; +extern const char ENTRY_TAG[]; +/*============================================================================= + * + * MODULE EXPORTED FUNCTIONS + * + *============================================================================*/ +extern void loc_logger_init(unsigned long debug, unsigned long timestamp); +extern char* get_timestamp(char* str, unsigned long buf_size); + +#ifndef DEBUG_DMN_LOC_API + +/* LOGGING MACROS */ +/*loc_logger.DEBUG_LEVEL is initialized to 0xff in loc_cfg.cpp + if that value remains unchanged, it means gps.conf did not + provide a value and we default to the initial value to use + Android's logging levels*/ +#define IF_LOC_LOGE if((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5)) + +#define IF_LOC_LOGW if((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5)) + +#define IF_LOC_LOGI if((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5)) + +#define IF_LOC_LOGD if((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5)) + +#define IF_LOC_LOGV if((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5)) + +#define LOC_LOGE(...) \ +IF_LOC_LOGE { ALOGE("E/" __VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("E/" __VA_ARGS__); } + +#define LOC_LOGW(...) \ +IF_LOC_LOGW { ALOGE("W/" __VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/" __VA_ARGS__); } + +#define LOC_LOGI(...) \ +IF_LOC_LOGI { ALOGE("I/" __VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/" __VA_ARGS__); } + +#define LOC_LOGD(...) \ +IF_LOC_LOGD { ALOGE("D/" __VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/" __VA_ARGS__); } + +#define LOC_LOGV(...) \ +IF_LOC_LOGV { ALOGE("V/" __VA_ARGS__); } \ +else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } + +#else /* DEBUG_DMN_LOC_API */ + +#define LOC_LOGE(...) ALOGE("E/" __VA_ARGS__) + +#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__) + +#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__) + +#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__) + +#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__) + +#endif /* DEBUG_DMN_LOC_API */ + +/*============================================================================= + * + * LOGGING IMPROVEMENT MACROS + * + *============================================================================*/ +#define LOG_(LOC_LOG, ID, WHAT, SPEC, VAL) \ + do { \ + if (loc_logger.TIMESTAMP) { \ + char ts[32]; \ + LOC_LOG("[%s] %s %s line %d " #SPEC, \ + get_timestamp(ts, sizeof(ts)), ID, WHAT, __LINE__, VAL); \ + } else { \ + LOC_LOG("%s %s line %d " #SPEC, \ + ID, WHAT, __LINE__, VAL); \ + } \ + } while(0) + + +#define 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 ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "") +#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL) + + +// Used for logging callflow from Android Framework +#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "") +// Used for logging callflow to Modem +#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __func__, SPEC, VAL) +// Used for logging callflow from Modem(TO_MODEM, __func__, %s, "") +#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __func__, SPEC, VAL) +// Used for logging callflow to Android Framework +#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL) + +#ifdef __cplusplus +} +#endif + +#endif // __LOG_UTIL_H__ diff --git a/gps/utils/msg_q.c b/gps/utils/msg_q.c new file mode 100644 index 0000000..f82d4c0 --- /dev/null +++ b/gps/utils/msg_q.c @@ -0,0 +1,336 @@ +/* Copyright (c) 2011-2012, 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 "msg_q.h" + +#define LOG_TAG "LocSvc_utils_q" +#include "log_util.h" +#include "platform_lib_includes.h" +#include "linked_list.h" +#include +#include +#include + +typedef struct msg_q { + void* msg_list; /* Linked list to store information */ + pthread_cond_t list_cond; /* Condition variable for waiting on msg queue */ + pthread_mutex_t list_mutex; /* Mutex for exclusive access to message queue */ + int unblocked; /* Has this message queue been unblocked? */ +} msg_q; + +/*=========================================================================== +FUNCTION convert_linked_list_err_type + +DESCRIPTION + Converts from one set of enum values to another. + + linked_list_val: Value to convert to msg_q_enum_type + +DEPENDENCIES + N/A + +RETURN VALUE + Corresponding linked_list_enum_type in msg_q_enum_type + +SIDE EFFECTS + N/A + +===========================================================================*/ +static msq_q_err_type convert_linked_list_err_type(linked_list_err_type linked_list_val) +{ + switch( linked_list_val ) + { + case eLINKED_LIST_SUCCESS: + return eMSG_Q_SUCCESS; + case eLINKED_LIST_INVALID_PARAMETER: + return eMSG_Q_INVALID_PARAMETER; + case eLINKED_LIST_INVALID_HANDLE: + return eMSG_Q_INVALID_HANDLE; + case eLINKED_LIST_UNAVAILABLE_RESOURCE: + return eMSG_Q_UNAVAILABLE_RESOURCE; + case eLINKED_LIST_INSUFFICIENT_BUFFER: + return eMSG_Q_INSUFFICIENT_BUFFER; + + case eLINKED_LIST_FAILURE_GENERAL: + default: + return eMSG_Q_FAILURE_GENERAL; + } +} + +/* ----------------------- END INTERNAL FUNCTIONS ---------------------------------------- */ + +/*=========================================================================== + + FUNCTION: msg_q_init + + ===========================================================================*/ +msq_q_err_type msg_q_init(void** msg_q_data) +{ + if( msg_q_data == NULL ) + { + LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); + return eMSG_Q_INVALID_PARAMETER; + } + + msg_q* tmp_msg_q; + tmp_msg_q = (msg_q*)calloc(1, sizeof(msg_q)); + if( tmp_msg_q == NULL ) + { + LOC_LOGE("%s: Unable to allocate space for message queue!\n", __FUNCTION__); + return eMSG_Q_FAILURE_GENERAL; + } + + if( linked_list_init(&tmp_msg_q->msg_list) != 0 ) + { + LOC_LOGE("%s: Unable to initialize storage list!\n", __FUNCTION__); + free(tmp_msg_q); + return eMSG_Q_FAILURE_GENERAL; + } + + if( pthread_mutex_init(&tmp_msg_q->list_mutex, NULL) != 0 ) + { + LOC_LOGE("%s: Unable to initialize list mutex!\n", __FUNCTION__); + linked_list_destroy(&tmp_msg_q->msg_list); + free(tmp_msg_q); + return eMSG_Q_FAILURE_GENERAL; + } + + if( pthread_cond_init(&tmp_msg_q->list_cond, NULL) != 0 ) + { + LOC_LOGE("%s: Unable to initialize msg q cond var!\n", __FUNCTION__); + linked_list_destroy(&tmp_msg_q->msg_list); + pthread_mutex_destroy(&tmp_msg_q->list_mutex); + free(tmp_msg_q); + return eMSG_Q_FAILURE_GENERAL; + } + + tmp_msg_q->unblocked = 0; + + *msg_q_data = tmp_msg_q; + + return eMSG_Q_SUCCESS; +} + +/*=========================================================================== + + FUNCTION: msg_q_init2 + + ===========================================================================*/ +const void* msg_q_init2() +{ + void* q = NULL; + if (eMSG_Q_SUCCESS != msg_q_init(&q)) { + q = NULL; + } + return q; +} + +/*=========================================================================== + + FUNCTION: msg_q_destroy + + ===========================================================================*/ +msq_q_err_type msg_q_destroy(void** msg_q_data) +{ + if( msg_q_data == NULL ) + { + LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); + return eMSG_Q_INVALID_HANDLE; + } + + msg_q* p_msg_q = (msg_q*)*msg_q_data; + + linked_list_destroy(&p_msg_q->msg_list); + pthread_mutex_destroy(&p_msg_q->list_mutex); + pthread_cond_destroy(&p_msg_q->list_cond); + + p_msg_q->unblocked = 0; + + free(*msg_q_data); + *msg_q_data = NULL; + + return eMSG_Q_SUCCESS; +} + +/*=========================================================================== + + FUNCTION: msg_q_snd + + ===========================================================================*/ +msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*)) +{ + msq_q_err_type rv; + if( msg_q_data == NULL ) + { + LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); + return eMSG_Q_INVALID_HANDLE; + } + if( msg_obj == NULL ) + { + LOC_LOGE("%s: Invalid msg_obj parameter!\n", __FUNCTION__); + return eMSG_Q_INVALID_PARAMETER; + } + + msg_q* p_msg_q = (msg_q*)msg_q_data; + + pthread_mutex_lock(&p_msg_q->list_mutex); + LOC_LOGD("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + + if( p_msg_q->unblocked ) + { + LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__); + pthread_mutex_unlock(&p_msg_q->list_mutex); + return eMSG_Q_UNAVAILABLE_RESOURCE; + } + + rv = convert_linked_list_err_type(linked_list_add(p_msg_q->msg_list, msg_obj, dealloc)); + + /* Show data is in the message queue. */ + pthread_cond_signal(&p_msg_q->list_cond); + + pthread_mutex_unlock(&p_msg_q->list_mutex); + + LOC_LOGD("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + + return rv; +} + +/*=========================================================================== + + FUNCTION: msg_q_rcv + + ===========================================================================*/ +msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) +{ + msq_q_err_type rv; + if( msg_q_data == NULL ) + { + LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); + return eMSG_Q_INVALID_HANDLE; + } + + if( msg_obj == NULL ) + { + LOC_LOGE("%s: Invalid msg_obj parameter!\n", __FUNCTION__); + return eMSG_Q_INVALID_PARAMETER; + } + + msg_q* p_msg_q = (msg_q*)msg_q_data; + + LOC_LOGD("%s: Waiting on message\n", __FUNCTION__); + + pthread_mutex_lock(&p_msg_q->list_mutex); + + if( p_msg_q->unblocked ) + { + LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__); + pthread_mutex_unlock(&p_msg_q->list_mutex); + return eMSG_Q_UNAVAILABLE_RESOURCE; + } + + /* Wait for data in the message queue */ + while( linked_list_empty(p_msg_q->msg_list) && !p_msg_q->unblocked ) + { + pthread_cond_wait(&p_msg_q->list_cond, &p_msg_q->list_mutex); + } + + rv = convert_linked_list_err_type(linked_list_remove(p_msg_q->msg_list, msg_obj)); + + pthread_mutex_unlock(&p_msg_q->list_mutex); + + LOC_LOGD("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); + + return rv; +} + +/*=========================================================================== + + FUNCTION: msg_q_flush + + ===========================================================================*/ +msq_q_err_type msg_q_flush(void* msg_q_data) +{ + msq_q_err_type rv; + if ( msg_q_data == NULL ) + { + LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); + return eMSG_Q_INVALID_HANDLE; + } + + msg_q* p_msg_q = (msg_q*)msg_q_data; + + LOC_LOGD("%s: Flushing Message Queue\n", __FUNCTION__); + + pthread_mutex_lock(&p_msg_q->list_mutex); + + /* Remove all elements from the list */ + rv = convert_linked_list_err_type(linked_list_flush(p_msg_q->msg_list)); + + pthread_mutex_unlock(&p_msg_q->list_mutex); + + LOC_LOGD("%s: Message Queue flushed\n", __FUNCTION__); + + return rv; +} + +/*=========================================================================== + + FUNCTION: msg_q_unblock + + ===========================================================================*/ +msq_q_err_type msg_q_unblock(void* msg_q_data) +{ + if ( msg_q_data == NULL ) + { + LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__); + return eMSG_Q_INVALID_HANDLE; + } + + msg_q* p_msg_q = (msg_q*)msg_q_data; + pthread_mutex_lock(&p_msg_q->list_mutex); + + if( p_msg_q->unblocked ) + { + LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__); + pthread_mutex_unlock(&p_msg_q->list_mutex); + return eMSG_Q_UNAVAILABLE_RESOURCE; + } + + LOC_LOGD("%s: Unblocking Message Queue\n", __FUNCTION__); + /* Unblocking message queue */ + p_msg_q->unblocked = 1; + + /* Allow all the waiters to wake up */ + pthread_cond_broadcast(&p_msg_q->list_cond); + + pthread_mutex_unlock(&p_msg_q->list_mutex); + + LOC_LOGD("%s: Message Queue unblocked\n", __FUNCTION__); + + return eMSG_Q_SUCCESS; +} diff --git a/gps/utils/msg_q.h b/gps/utils/msg_q.h new file mode 100644 index 0000000..453b8ce --- /dev/null +++ b/gps/utils/msg_q.h @@ -0,0 +1,207 @@ +/* Copyright (c) 2011, 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 __MSG_Q_H__ +#define __MSG_Q_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +/** Linked List Return Codes */ +typedef enum +{ + eMSG_Q_SUCCESS = 0, + /**< Request was successful. */ + eMSG_Q_FAILURE_GENERAL = -1, + /**< Failed because of a general failure. */ + eMSG_Q_INVALID_PARAMETER = -2, + /**< Failed because the request contained invalid parameters. */ + eMSG_Q_INVALID_HANDLE = -3, + /**< Failed because an invalid handle was specified. */ + eMSG_Q_UNAVAILABLE_RESOURCE = -4, + /**< Failed because an there were not enough resources. */ + eMSG_Q_INSUFFICIENT_BUFFER = -5, + /**< Failed because an the supplied buffer was too small. */ +}msq_q_err_type; + +/*=========================================================================== +FUNCTION msg_q_init + +DESCRIPTION + Initializes internal structures for message queue. + + msg_q_data: pointer to an opaque Q handle to be returned; NULL if fails + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +msq_q_err_type msg_q_init(void** msg_q_data); + +/*=========================================================================== +FUNCTION msg_q_init2 + +DESCRIPTION + Initializes internal structures for message queue. + +DEPENDENCIES + N/A + +RETURN VALUE + opaque handle to the Q created; NULL if create fails + +SIDE EFFECTS + N/A + +===========================================================================*/ +const void* msg_q_init2(); + +/*=========================================================================== +FUNCTION msg_q_destroy + +DESCRIPTION + Releases internal structures for message queue. + + msg_q_data: State of message queue to be released. + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +msq_q_err_type msg_q_destroy(void** msg_q_data); + +/*=========================================================================== +FUNCTION msg_q_snd + +DESCRIPTION + Sends data to the message queue. The passed in data pointer + is not modified or freed. Passed in msg_obj is expected to live throughout + the use of the msg_q (i.e. data is not allocated internally) + + msg_q_data: Message Queue to add the element to. + msgp: Pointer to data to add into message queue. + dealloc: Function used to deallocate memory for this element. Pass NULL + if you do not want data deallocated during a flush operation + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*)); + +/*=========================================================================== +FUNCTION msg_q_rcv + +DESCRIPTION + Retrieves data from the message queue. msg_obj is the oldest message received + and pointer is simply removed from message queue. + + msg_q_data: Message Queue to copy data from into msgp. + msg_obj: Pointer to space to copy msg_q contents to. + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj); + +/*=========================================================================== +FUNCTION msg_q_flush + +DESCRIPTION + Function removes all elements from the message queue. + + msg_q_data: Message Queue to remove elements from. + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +msq_q_err_type msg_q_flush(void* msg_q_data); + +/*=========================================================================== +FUNCTION msg_q_unblock + +DESCRIPTION + This function will stop use of the message queue. All waiters will wake up + and likely receive nothing from the queue resulting in a negative return + value. The message queue can no longer be used until it is destroyed + and initialized again after calling this function. + + msg_q_data: Message queue to unblock. + +DEPENDENCIES + N/A + +RETURN VALUE + Look at error codes above. + +SIDE EFFECTS + N/A + +===========================================================================*/ +msq_q_err_type msg_q_unblock(void* msg_q_data); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __MSG_Q_H__ */ diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 1940a52..8950047 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -59,17 +59,10 @@ true - @null - com.android.location.fused - com.qualcomm.location - true - true - true - true - - com.google.android.gms - com.android.location.fused - + false + com.qualcomm.location + false + com.qualcomm.location false diff --git a/prebuilt/etc/gps.conf b/prebuilt/etc/gps.conf deleted file mode 100644 index 55acdab..0000000 --- a/prebuilt/etc/gps.conf +++ /dev/null @@ -1,156 +0,0 @@ -#Test -#NTP_SERVER=time.gpsonextra.net -#Asia -# NTP_SERVER=asia.pool.ntp.org -#Europe -NTP_SERVER=europe.pool.ntp.org -NTP_SERVER_SCA=south-america.pool.ntp.org -NTP_SERVER_AME=asia.pool.ntp.org -NTP_SERVER_AU=oceania.pool.ntp.org -NTP_SERVER_CN=cn.pool.ntp.org -#North America -# NTP_SERVER=north-america.pool.ntp.org -#Korea -#NTP_SERVER=0.kr.pool.ntp.org -#JP -# NTP_SERVER=3.jp.pool.ntp.org - -XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra2.bin -XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra2.bin -XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra2.bin - -# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info -# 4 - Debug, 5 - Verbose -#DEBUG_LEVEL = 3 -DEBUG_LEVEL = 5 - -# Intermediate position report, 1=enable, 0=disable -INTERMEDIATE_POS=0 - -# supl version 1.0 -SUPL_VER=0x10000 -# supl version 2.0 -#SUPL_VER=0x20000 - -#VDF supl version -SUPL_VER_262_2=0x20000 -SUPL_VER_214_1=0x20000 -SUPL_VER_222_10=0x20000 - -# Error Estimate -# _SET = 1 -# _CLEAR = 0 -ERR_ESTIMATE=0 - -# GPS Capabilities bit mask -# SCHEDULING = 1 -# MSB = 2 -# MSA = 4 -# ON_DEMAND_TIME=0x10 -# ULP = 0x20 -# default = MSA | MSB | SCHEDULING | ULP | ON_DEMAND_TIME -# CAPABILITIES=0x37 -CAPABILITIES=0x37 - -# Accuracy threshold for intermediate positions -# less accurate positions are ignored, 0 for passing all positions -# ACCURACY_THRES=5000 - -################################ -##### AGPS server settings ##### -################################ - -# FOR SUPL SUPPORT, set the following -# SUPL_HOST=supl.host.com or IP -# SUPL_PORT=1234 -SUPL_HOST=supl.google.com -SUPL_PORT=7276 - -#VDF supl server and port -SUPL_HOST_262_2=supl.vodafone.com -SUPL_PORT_262_2=7275 -SUPL_HOST_214_1=supl.vodafone.com -SUPL_PORT_214_1=7275 -SUPL_HOST_222_10=supl.vodafone.com -SUPL_PORT_222_10=7275 -SUPL_HOST_204_4=supl.vodafone.com -SUPL_PORT_204_4=7275 -SUPL_HOST_268_1=supl.vodafone.com -SUPL_PORT_268_1=7275 -SUPL_HOST_226_1=supl.vodafone.com -SUPL_PORT_226_1=7275 -SUPL_HOST_202_5=supl.vodafone.com -SUPL_PORT_202_5=7275 -SUPL_HOST_530_1=supl.vodafone.com -SUPL_PORT_530_1=7275 - -#UNF host,port -SUPL_HOST_UNF=supl.iusacell.com -SUPL_PORT_UNF=7275 - -#SFR supl server and port -SUPL_PORT_208_10=7275 - -# FOR C2K PDE SUPPORT, set the following -# C2K_HOST=c2k.pde.com or IP -# C2K_PORT=1234 - -################################ -# Indoor Positioning Settings -################################ -# 0: QUIPC disabled, 1: QUIPC enabled, 2: forced QUIPC only -QUIPC_ENABLED = 0 - -################################ -# EXTRA SETTINGS -################################ -# Enable or Disable Wiper (1=Enable, 0=Disable) -#ENABLE_WIPER=1 -ENABLE_WIPER=0 -# NMEA provider (1=Modem Processor, 0=Application Processor) -#NMEA_PROVIDER=0 -NMEA_PROVIDER=1 - -#################################### -# LTE Positioning Profile Settings -#################################### -# 0: Enable RRLP on LTE(Default) -# 1: Enable LPP_User_Plane on LTE -# 2: Enable LPP_Control_Plane -# 3: Enable both LPP_User_Plane and LPP_Control_Plane -LPP_PROFILE = 0 - -################################################## -# Select Positioning Protocol on A-GLONASS system -################################################## -# 0x1: RRC CPlane -# 0x2: RRLP UPlane -# 0x4: LLP Uplane -A_GLONASS_POS_PROTOCOL_SELECT = 0 - -################################ -# LGE EXTRA SETTINGS -################################ -VENDOR=GLOBAL -LGE_TLS_MODE=0 - -#VDF tls mode -LGE_TLS_MODE_262_2=1 -LGE_TLS_MODE_214_1=1 -LGE_TLS_MODE_222_10=1 -LGE_TLS_MODE_204_4=1 -LGE_TLS_MODE_268_1=1 -LGE_TLS_MODE_226_1=1 -LGE_TLS_MODE_202_5=1 -LGE_TLS_MODE_530_1=1 - -#UNF tls mode -LGE_TLS_MODE_UNF=1 - -#SFR tls mode -LGE_TLS_MODE_208_10=1 - -LGE_GPS_POSITION_MODE=1 - -#UNF position mode -LGE_GPS_POSITION_MODE_UNF=0 diff --git a/prebuilt/etc/izat.conf b/prebuilt/etc/izat.conf deleted file mode 100644 index 48ce3dc..0000000 --- a/prebuilt/etc/izat.conf +++ /dev/null @@ -1,47 +0,0 @@ -######################################## -# NLP/WIFI positioning options bit mask -######################################## -# Enable NLP fixes for WIPER/ODCPI feature => WIPER = 0x1 -# Enable free wifi scan injections for GEOFENCE => FREE_WIFI = 0x2 -# Enable SUPL2 MLD wifi => SUPL_WIFI = 0x4 -# default = WIPER | FREE_WIFI | SUPL_WIFI -#LGE_UPDATE_CHANGE jdoc.kim@lge.com, to disable wiper feature -#NLP_WIFI_LISTENER_MODE = 7 -NLP_WIFI_LISTENER_MODE = 0 - -################################################## -# Select WIFI Wait Timeout value in seconds for SUPL -################################################## -WIFI_WAIT_TIMEOUT_SELECT = 0 - -################################ -# Indoor Positioning Settings -################################ -# 0: QUIPC disabled, 1: QUIPC enabled, 2: forced QUIPC only -#LGE_UPDATE_CHANGE lgetaewon.kim, to disable quipc feature -#QUIPC_ENABLED = 1 -QUIPC_ENABLED = 0 - -################################ -# NLP Settings -################################ -# NLP_MODE 1: GNP Only, 2: QNP Only, 3: Combo -# NLP_TOLERANCE_TIME_FIRST: Time in ms used in Combo mode -# to determine how much Tolerance for first position -# NLP_TOLERANCE_TIME_AFTER: Time in ms used in Combo mode -# to determine how much Tolerance for positions after first -# NLP_THRESHOLD: Sets how many failures needed before -# switching preferred NLP in Combo mode -# NLP_ACCURACY_MULTIPLE: Determines how far off the accuracy -# must be, in multiples, between two NLP location reports to -# be considered much worse accuracy. Used in switching logic -#LGE_UPDATE_CHANGE jdoc.kim@lge.com, to disable QLP/GLP feature -NLP_MODE = 0 -NLP_TOLERANCE_TIME_FIRST = 5000 -NLP_TOLERANCE_TIME_AFTER = 20000 -NLP_THRESHOLD = 3 -NLP_ACCURACY_MULTIPLE = 2 - -# Threshold period for ZPP triggers -#LGE_UPDATAE_CHAGE wonkyum.kim, To change the interval. 10 sec -> 24 hour -ZPP_TRIGGER_THRESHOLD=86400000 diff --git a/prebuilt/etc/init.d/090fixup b/prebuilt/fixup.sh old mode 100644 new mode 100755 similarity index 95% rename from prebuilt/etc/init.d/090fixup rename to prebuilt/fixup.sh index ed54ee1..4f00027 --- a/prebuilt/etc/init.d/090fixup +++ b/prebuilt/fixup.sh @@ -1,7 +1,7 @@ #!/system/bin/sh model=`getprop ro.product.model` - +su -c "setenforce 0" mount -o remount,rw /system rm /system/usr/keylayout/Generic.kl @@ -25,3 +25,4 @@ if [ "$model" = "LG-D415" ]; then fi mount -o remount,ro /system +su -c "setenforce 1" diff --git a/proprietary-blobs.txt b/proprietary-blobs.txt index c69f090..4ef3fca 100644 --- a/proprietary-blobs.txt +++ b/proprietary-blobs.txt @@ -1,8 +1,5 @@ # Time services -app/TimeService.apk bin/time_daemon -vendor/lib/libtime_genoff.so -vendor/lib/libTimeService.so # Keystore vendor/firmware/keymaster/keymaster.b00 @@ -228,19 +225,21 @@ bin/thermal-engine vendor/lib/libthermalioctl.so vendor/lib/libthermalclient.so -# Gps -lib/hw/gps.default.so -lib/libloc_core.so -lib/libloc_eng.so +# GPS +etc/permissions/com.qualcomm.location.xml lib/libloc_api_v02.so lib/libloc_ds_api.so -lib/libgps.utils.so -vendor/lib/libquipc_os_api.so -vendor/lib/liblocationservice.so -vendor/lib/libulp2.so vendor/lib/libgeofence.so vendor/lib/libizat_core.so vendor/lib/liblbs_core.so +vendor/lib/liblocationservice.so +vendor/lib/liblowi_client.so +vendor/lib/libquipc_os_api.so +vendor/lib/libquipc_os_api.so +vendor/lib/libquipc_ulp_adapter.so +vendor/lib/libulp2.so +vendor/lib/libalarmservice_jni.so + # Sensors vendor/lib/hw/sensors.msm8226.so diff --git a/rootdir/init.w7.rc b/rootdir/init.w7.rc index 900d41f..a8a8230 100755 --- a/rootdir/init.w7.rc +++ b/rootdir/init.w7.rc @@ -188,6 +188,8 @@ on fs mkdir /firmware 0771 system system mount vfat /dev/block/platform/msm_sdcc.1/by-name/modem /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 + start fixup + on charger class_start charger @@ -302,6 +304,12 @@ service rmt_storage /system/bin/rmt_storage class core user root +service fixup /system/bin/fixup.sh + class core + user root + disabled + oneshot + service bt-dun /system/bin/dun-server /dev/smd7 /dev/rfcomm0 class late_start user bluetooth diff --git a/sepolicy/init.te b/sepolicy/init.te index 21c5989..d6390ce 100644 --- a/sepolicy/init.te +++ b/sepolicy/init.te @@ -3,4 +3,6 @@ allow init fuse:dir search; allow init self:capability sys_module; allow init fuse:dir mounton; allow init self:process execmem; +allow init labeledfs:filesystem remount; +allow init su_exec:file execute_no_trans; diff --git a/sepolicy/sysinit.te b/sepolicy/sysinit.te index 4d14d88..b690cdb 100644 --- a/sepolicy/sysinit.te +++ b/sepolicy/sysinit.te @@ -8,4 +8,6 @@ allow sysinit self:capability sys_admin; allow sysinit kernel:process setsched; allow sysinit system_file:dir {remove_name add_name }; allow sysinit unlabeled:lnk_file unlink; - +allow sysinit selinuxfs:file write; +allow sysinit selinuxfs:file read; +allow sysinit selinuxfs:file getattr; diff --git a/sepolicy/thermal-engine.te b/sepolicy/thermal-engine.te index a830a49..06568b6 100644 --- a/sepolicy/thermal-engine.te +++ b/sepolicy/thermal-engine.te @@ -12,3 +12,4 @@ allow thermal-engine sysfs_battery_supply:file read; allow thermal-engine sysfs_battery_supply:file write; allow thermal-engine sysfs_battery_supply:file open; + diff --git a/setup-makefiles.sh b/setup-makefiles.sh index bc63c7c..8c6c881 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -62,9 +62,24 @@ DEVICE_PACKAGE_OVERLAYS := vendor/$VENDOR/$DEVICE/overlay # Apps PRODUCT_PACKAGES += \\ - TimeService \\ + com.qualcomm.location \\ + QuickBoot \\ qcrilmsgtunnel \\ - com.qualcomm.location + shutdownlistener + +PRODUCT_PACKAGES += \\ + libtime_genoff \\ + libTimeService \\ + TimeService + +PRODUCT_PACKAGES += \\ + libscale \\ + +PRODUCT_PACKAGES += \\ + libwvdrmengine \\ + libwvdrm_L3 \\ + libwvm \\ + libWVStreamControlAPI_L3 #com.qualcomm.services.location @@ -115,27 +130,18 @@ LOCAL_PATH := \$(call my-dir) include \$(CLEAR_VARS) LOCAL_MODULE := com.qualcomm.location LOCAL_MODULE_OWNER := $VENDOR -LOCAL_SRC_FILES := proprietary/app/com.qualcomm.location.apk +LOCAL_SRC_FILES := proprietary/priv-app/com.qualcomm.location/com.qualcomm.location.apk LOCAL_MODULE_TAGS := optional LOCAL_MODULE_SUFFIX := \$(COMMON_ANDROID_PACKAGE_SUFFIX) LOCAL_MODULE_CLASS := APPS LOCAL_CERTIFICATE := platform +LOCAL_PRIVILEGED_MODULE := true include \$(BUILD_PREBUILT) -#include \$(CLEAR_VARS) -#LOCAL_MODULE := com.qualcomm.services.location -#LOCAL_MODULE_OWNER := $VENDOR -#LOCAL_SRC_FILES := proprietary/app/com.qualcomm.services.location.apk -#LOCAL_MODULE_TAGS := optional -#LOCAL_MODULE_SUFFIX := \$(COMMON_ANDROID_PACKAGE_SUFFIX) -#LOCAL_MODULE_CLASS := APPS -#LOCAL_CERTIFICATE := platform -#include \$(BUILD_PREBUILT) - include \$(CLEAR_VARS) -LOCAL_MODULE := TimeService +LOCAL_MODULE := shutdownlistener LOCAL_MODULE_OWNER := $VENDOR -LOCAL_SRC_FILES := proprietary/app/TimeService.apk +LOCAL_SRC_FILES := proprietary/app/shutdownlistener/shutdownlistener.apk LOCAL_MODULE_TAGS := optional LOCAL_MODULE_SUFFIX := \$(COMMON_ANDROID_PACKAGE_SUFFIX) LOCAL_MODULE_CLASS := APPS @@ -145,13 +151,53 @@ include \$(BUILD_PREBUILT) include \$(CLEAR_VARS) LOCAL_MODULE := qcrilmsgtunnel LOCAL_MODULE_OWNER := $VENDOR -LOCAL_SRC_FILES := proprietary/app/qcrilmsgtunnel.apk +LOCAL_SRC_FILES := proprietary/app/qcrilmsgtunnel/qcrilmsgtunnel.apk +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_SUFFIX := \$(COMMON_ANDROID_PACKAGE_SUFFIX) +LOCAL_MODULE_CLASS := APPS +LOCAL_CERTIFICATE := platform +include \$(BUILD_PREBUILT) + +include \$(CLEAR_VARS) +LOCAL_MODULE := QuickBoot +LOCAL_MODULE_OWNER := $VENDOR +LOCAL_SRC_FILES := proprietary/app/QuickBoot/QuickBoot.apk LOCAL_MODULE_TAGS := optional LOCAL_MODULE_SUFFIX := \$(COMMON_ANDROID_PACKAGE_SUFFIX) LOCAL_MODULE_CLASS := APPS LOCAL_CERTIFICATE := platform include \$(BUILD_PREBUILT) +include \$(CLEAR_VARS) +LOCAL_MODULE := libtime_genoff +LOCAL_MODULE_OWNER := $VENDOR +LOCAL_SRC_FILES := proprietary/vendor/lib/libtime_genoff.so +LOCAL_MODULE_PATH := \$(TARGET_OUT_VENDOR_SHARED_LIBRARIES) +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_SUFFIX := .so +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +include \$(BUILD_PREBUILT) + +include \$(CLEAR_VARS) +LOCAL_MODULE := TimeService +LOCAL_MODULE_OWNER := $VENDOR +LOCAL_SRC_FILES := proprietary/app/TimeService/TimeService.apk +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_SUFFIX := \$(COMMON_ANDROID_PACKAGE_SUFFIX) +LOCAL_MODULE_CLASS := APPS +LOCAL_CERTIFICATE := platform +include \$(BUILD_PREBUILT) + +include \$(CLEAR_VARS) +LOCAL_MODULE := libTimeService +LOCAL_MODULE_OWNER := $VENDOR +LOCAL_SRC_FILES := proprietary/vendor/lib/libTimeService.so +LOCAL_MODULE_PATH := \$(TARGET_OUT_VENDOR_SHARED_LIBRARIES) +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_SUFFIX := .so +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +include \$(BUILD_PREBUILT) + endif EOF diff --git a/system.prop b/system.prop index f3dd291..5bb37c2 100644 --- a/system.prop +++ b/system.prop @@ -2,6 +2,8 @@ # system.prop for w7 # ############################################################ CLEANUP ME PLEASE QUARX ########################################################### +# We need it for unified build +persist.sys.root_access=3 # Use reference RIL for initial bringup ro.vendor.extension_library=/vendor/lib/libqti-perfd-client.so @@ -17,22 +19,15 @@ persist.rild.nitz_short_ons_0= persist.rild.nitz_short_ons_1= persist.rild.nitz_short_ons_2= persist.rild.nitz_short_ons_3= +persist.qcril.disable_retry=true ril.subscription.types=NV,RUIM DEVICE_PROVISIONED=1 persist.radio.msgtunnel.start=false -# Start in cdma mode -# -# System props for telephony -# System prop to turn on CdmaLTEPhone always -# LGE_CHANGE_S by.mun@lge.com 2013-08-14 turn off CdmaLTEPhone for W7 telephony.lteOnCdmaDevice=0 ro.telephony.default_network=0 - ro.ril.enable.amr.wideband=1 ro.lge.proximity.delay=25 ro.telephony.call_ring.delay=0 - -persist.radio.adb_log_on=1 persist.radio.qcril_am_enabled=1 drm.service.enabled=true persist.lg.data.autoprof.msim=true @@ -63,18 +58,11 @@ debug.qualcomm.sns.daemon=e debug.qualcomm.sns.libsensor1=e persist.sys.ssr.restart_level=3 persist.sys.strictmode.disable=true -persist.sys.logkit.ctrlcode=0 ro.lge.irrc.type=sw persist.debug.wfd.enable=1 -persist.sys.wfd.virtual=0 tunnel.audio.encode = true persist.gsm.sms.forcegsm7=1 ro.sf.lcd_density=240 -ro.qc.sdk.izat.premium_enabled=1 -ro.qc.sdk.izat.service_mask=0x0 -persist.gps.qc_nlp_in_use=0 -ro.gps.agps_provider=1 -persist.qcril.disable_retry=true persist.service.crash.enable=0 ro.config.vc_call_vol_steps=6 persist.data.sbp.update=0