Update to 07.00.00.253.024

am: 0d4db83776

Change-Id: I139946b174aeacaa5bb9717f75c07d2a65054802
This commit is contained in:
Thierry Strudel
2016-10-07 22:09:22 +00:00
committed by android-build-merger
25 changed files with 1829 additions and 616 deletions

View File

@@ -0,0 +1,32 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libgnsspps
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := \
libutils \
libcutils \
libgps.utils \
liblog
LOCAL_SRC_FILES += \
gnsspps.c
LOCAL_CFLAGS += \
-fno-short-enums \
-D_ANDROID_
LOCAL_COPY_HEADERS_TO:= libgnsspps/
LOCAL_COPY_HEADERS:= \
gnsspps.h
## Includes
LOCAL_C_INCLUDES := \
$(TARGET_OUT_HEADERS)/gps.utils \
$(TARGET_OUT_HEADERS)/libloc_pla
include $(BUILD_SHARED_LIBRARY)

View File

@@ -0,0 +1,35 @@
AM_CFLAGS = \
$(LOCPLA_CFLAGS) \
-I./
ACLOCAL_AMFLAGS = -I m4
libgnsspps_la_SOURCES = \
gnsspps.c
if USE_GLIB
libgnsspps_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
libgnsspps_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
libgnsspps_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
else
libgnsspps_la_CFLAGS = $(AM_CFLAGS)
libgnsspps_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
libgnsspps_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
endif
libgnsspps_la_LIBADD = -lstdc++
library_include_HEADERS = \
gnsspps.h
#Create and Install libraries
lib_LTLIBRARIES = libgnsspps.la
library_includedir = $(pkgincludedir)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gnsspps.pc
EXTRA_DIST = $(pkgconfig_DATA)

View File

@@ -0,0 +1,60 @@
# configure.ac -- Autoconf script for gps lbs-core
#
# Process this file with autoconf to produce a configure script
# Requires autoconf tool later than 2.61
AC_PREREQ(2.61)
# Initialize the gps lbs-core package version 1.0.0
AC_INIT([gnsspps],1.0.0)
# Does not strictly follow GNU Coding standards
AM_INIT_AUTOMAKE([foreign])
# Disables auto rebuilding of configure, Makefile.ins
AM_MAINTAINER_MODE
# Verifies the --srcdir is correct by checking for the path
AC_CONFIG_SRCDIR([Makefile.am])
# defines some macros variable to be included by source
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_LIBTOOL
AC_PROG_CXX
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
# Checks for libraries.
PKG_CHECK_MODULES([LOCPLA], [loc-pla])
AC_SUBST([LOCPLA_CFLAGS])
AC_SUBST([LOCPLA_LIBS])
AC_ARG_WITH([glib],
AC_HELP_STRING([--with-glib],
[enable glib, building HLOS systems which use glib]))
if (test "x${with_glib}" = "xyes"); then
AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
AC_MSG_ERROR(GThread >= 2.16 is required))
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
AC_MSG_ERROR(GLib >= 2.16 is required))
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
fi
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
AC_CONFIG_FILES([ \
Makefile \
gnsspps.pc
])
AC_OUTPUT

194
location/gnsspps/gnsspps.c Normal file
View File

@@ -0,0 +1,194 @@
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* 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.
*/
#include <platform_lib_log_util.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <pthread.h>
#include <timepps.h>
#include <linux/types.h>
//DRsync kernel timestamp
static struct timespec drsyncKernelTs = {0,0};
//DRsync userspace timestamp
static struct timespec drsyncUserTs = {0,0};
//flag to stop fetching timestamp
static int isActive = 0;
static pps_handle handle;
static pthread_mutex_t ts_lock;
/* checks the PPS source and opens it */
int check_device(char *path, pps_handle *handle)
{
int ret;
/* Try to find the source by using the supplied "path" name */
ret = open(path, O_RDWR);
if (ret < 0)
{
LOC_LOGV("%s:%d unable to open device %s", __func__, __LINE__, path);
return ret;
}
/* Open the PPS source */
ret = pps_create(ret, handle);
if (ret < 0)
{
LOC_LOGV( "%s:%d cannot create a PPS source from device %s", __func__, __LINE__, path);
return -1;
}
return 0;
}
/* fetches the timestamp from the PPS source */
int read_pps(pps_handle *handle)
{
struct timespec timeout;
pps_info infobuf;
int ret;
// 3sec timeout
timeout.tv_sec = 3;
timeout.tv_nsec = 0;
ret = pps_fetch(*handle, PPS_TSFMT_TSPEC, &infobuf,&timeout);
if (ret < 0 && ret !=-EINTR)
{
LOC_LOGV("%s:%d pps_fetch() error %d", __func__, __LINE__, ret);
return -1;
}
pthread_mutex_lock(&ts_lock);
drsyncKernelTs.tv_sec = infobuf.tv_sec;
drsyncKernelTs.tv_nsec = infobuf.tv_nsec;
ret = clock_gettime(CLOCK_BOOTTIME,&drsyncUserTs);
pthread_mutex_unlock(&ts_lock);
if(ret != 0)
{
LOC_LOGV("%s:%d clock_gettime() error",__func__,__LINE__);
}
return 0;
}
#ifdef __cplusplus
extern "C" {
#endif
/* infinitely calls read_pps() */
void *thread_handle(void *input)
{
int ret;
if(input != NULL)
{
LOC_LOGV("%s:%d Thread Input is present", __func__, __LINE__);
}
while(isActive)
{
ret = read_pps(&handle);
if (ret == -1 && errno != ETIMEDOUT )
{
LOC_LOGV("%s:%d Could not fetch PPS source", __func__, __LINE__);
}
}
return NULL;
}
/* opens the device and fetches from PPS source */
int initPPS(char *devname)
{
int ret,pid;
pthread_t thread;
isActive = 1;
ret = check_device(devname, &handle);
if (ret < 0)
{
LOC_LOGV("%s:%d Could not find PPS source", __func__, __LINE__);
return 0;
}
pthread_mutex_init(&ts_lock,NULL);
pid = pthread_create(&thread,NULL,&thread_handle,NULL);
if(pid != 0)
{
LOC_LOGV("%s:%d Could not create thread in InitPPS", __func__, __LINE__);
return 0;
}
return 1;
}
/* stops fetching and closes the device */
void deInitPPS()
{
pthread_mutex_lock(&ts_lock);
isActive = 0;
pthread_mutex_unlock(&ts_lock);
pthread_mutex_destroy(&ts_lock);
pps_destroy(handle);
}
/* retrieves DRsync kernel timestamp,DRsync userspace timestamp
and updates current timestamp */
/* Returns:
* 1. @Param out DRsync kernel timestamp
* 2. @Param out DRsync userspace timestamp
* 3. @Param out current timestamp
*/
int getPPS(struct timespec *fineKernelTs ,struct timespec *currentTs,
struct timespec *fineUserTs)
{
int ret;
pthread_mutex_lock(&ts_lock);
fineKernelTs->tv_sec = drsyncKernelTs.tv_sec;
fineKernelTs->tv_nsec = drsyncKernelTs.tv_nsec;
fineUserTs->tv_sec = drsyncUserTs.tv_sec;
fineUserTs->tv_nsec = drsyncUserTs.tv_nsec;
ret = clock_gettime(CLOCK_BOOTTIME,currentTs);
pthread_mutex_unlock(&ts_lock);
if(ret != 0)
{
LOC_LOGV("%s:%d clock_gettime() error",__func__,__LINE__);
return 0;
}
return 1;
}
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,45 @@
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* 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.
*/
#ifndef _GNSSPPS_H
#define _GNSSPPS_H
#ifdef __cplusplus
extern "C" {
#endif
/* opens the device and fetches from PPS source */
int initPPS(char *devname);
/* updates the fine time stamp */
int getPPS(struct timespec *current_ts, struct timespec *current_boottime, struct timespec *last_boottime);
/* stops fetching and closes the device */
void deInitPPS();
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: gnsspps
Description: QTI GPS drplugin-client
Version: @VERSION
Libs: -L${libdir} -lgnsspps
Cflags: -I${includedir}/gnsspps

106
location/gnsspps/timepps.h Normal file
View File

@@ -0,0 +1,106 @@
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* 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.
*/
#include <errno.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/pps.h>
#ifndef _TIMEPPS_H
#define _TIMEPPS_H
#ifdef __cplusplus
extern "C" {
#endif
/* time of assert event */
typedef struct timespec pps_info;
/* represents pps source */
typedef int pps_handle;
/* Open the PPS source */
static __inline int pps_create(int source, pps_handle *handle)
{
int ret;
struct pps_kparams dummy;
if (!handle)
{
errno = EINVAL;
return -1;
}
/* check if current device is valid pps */
ret = ioctl(source, PPS_GETPARAMS, &dummy);
if (ret)
{
errno = EOPNOTSUPP;
return -1;
}
*handle = source;
return 0;
}
/* close the pps source */
static __inline int pps_destroy(pps_handle handle)
{
return close(handle);
}
/*reads timestamp from pps device*/
static __inline int pps_fetch(pps_handle handle, const int tsformat,
pps_info *ppsinfobuf,
const struct timespec *timeout)
{
struct pps_fdata fdata;
int ret;
if (tsformat != PPS_TSFMT_TSPEC)
{
errno = EINVAL;
return -1;
}
if (timeout)
{
fdata.timeout.sec = timeout->tv_sec;
fdata.timeout.nsec = timeout->tv_nsec;
fdata.timeout.flags = ~PPS_TIME_INVALID;
}
else
{
fdata.timeout.flags = PPS_TIME_INVALID;
}
ret = ioctl(handle, PPS_FETCH, &fdata);
ppsinfobuf->tv_sec = fdata.info.assert_tu.sec;
ppsinfobuf->tv_nsec = fdata.info.assert_tu.nsec;
return ret;
}
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -34,17 +34,18 @@
namespace qc_loc_fw {
class InPostcard;
class OutPostcard;
}
namespace izat_remote_api {
class IzatNotifierProxy;
struct OutCard;
class IzatNotifier {
protected:
IzatNotifierProxy* const mNotifierProxy;
IzatNotifier(const char* const tag, qc_loc_fw::OutPostcard* const subCard);
IzatNotifier(const char* const tag, const OutCard* subCard);
virtual ~IzatNotifier();
public:
virtual void handleMsg(qc_loc_fw::InPostcard * const in_card) = 0;
@@ -52,20 +53,38 @@ public:
class LocationUpdater : public IzatNotifier {
static const char* const sInfoTag;
static const char* const sLatTag;
static const char* const sLonTag;
static const char* const sAccuracyTag;
static qc_loc_fw::OutPostcard* const sSubscriptionCard;
static const OutCard* sSubscriptionCard;
protected:
inline LocationUpdater() : IzatNotifier(sName, sSubscriptionCard) {}
virtual inline ~LocationUpdater() {}
public:
static const char* const sName;
static const char sName[];
virtual void handleMsg(qc_loc_fw::InPostcard * const in_card) final;
virtual void locationUpdate(UlpLocation& location, GpsLocationExtended& locExtended) = 0;
};
class SstpUpdater : public IzatNotifier {
static const char* const sLatTag;
static const char* const sLonTag;
static const char* const sUncTag;
static const char* const sUncConfTag;
protected:
inline SstpUpdater() : IzatNotifier(sName, nullptr) {}
virtual inline ~SstpUpdater() {}
public:
static const char sName[];
virtual void handleMsg(qc_loc_fw::InPostcard * const in_card) final;
void stop();
virtual void errReport(const char* errStr) = 0;
virtual void siteUpdate(const char* name, double lat, double lon,
float unc, int32_t uncConfidence) = 0;
virtual void mccUpdate(uint32_t mcc, const char* confidence) = 0;
};
} // izat_remote_api
#endif //__IZATREMOTEAPIS_H__

View File

@@ -42,12 +42,14 @@ typedef void (*locationUpdateCb)(UlpLocation *location,
/* registers a client callback for listening to location updates
locationCb - location callback function pointer implemented by client
Can not be NULL.
clientData - an opaque data pointer from client. This pointer will be
provided back when the locationCb() callbacak is called.
This can be used by client to store application context
or statemachine etc. This parameter can be NULL.
or statemachine etc.
Can be NULL.
return: an opaque pointer that serves as a request handle. This handle
os tp be fed to theunregisterLocationUpdater() call.
is to be fed to theunregisterLocationUpdater() call.
*/
void* registerLocationUpdater(locationUpdateCb locationCb, void* clientData);
@@ -57,6 +59,45 @@ void* registerLocationUpdater(locationUpdateCb locationCb, void* clientData);
*/
void unregisterLocationUpdater(void* locationUpdaterHandle);
typedef void (*errReportCb)(const char* errStr, void* clientData);
typedef void (*sstpSiteUpdateCb)(const char* name, double lat, double lon,
float unc, int32_t uncConfidence,
void* clientData);
typedef void (*sstpMccUpdateCb)(uint32_t mcc, const char* confidence,
void* clientData);
/* registers a client callback for listening to SSTP updates
siteCb - site info callback function pointer implemented by client
Can not be NULL.
mccCb - MCC info callback function pointer implemented by client
Can not be NULL.
errCb - callback to receive error report in string format, in case
of any error that might happen, and no siteCb or mccCb can
be called.
Can be NULL.
clientData - an opaque data pointer from client. This pointer will be
provided back when the locationCb() callbacak is called.
This can be used by client to store application context
or statemachine etc.
Can be NULL.
return: an opaque pointer that serves as a request handle. This handle
is to be fed to theunregisterLocationUpdater() call.
*/
void* registerSstpUpdater(sstpSiteUpdateCb siteCb, sstpMccUpdateCb mccCb,
errReportCb errCb, void* clientData);
/* unregisters the client callback
sstpUpdaterHandle - the opaque pointer from the return of
registerLocationUpdater()
*/
void unregisterSstpUpdater(void* sstpUpdaterHandle);
/* stop the current burst of SSTP updates (until next triggering event)
sstpUpdaterHandle - the opaque pointer from the return of
registerLocationUpdater()
*/
void stopSstpUpdate(void* sstpUpdaterHandle);
#ifdef __cplusplus
} // extern "C"
#endif

View File

@@ -17,9 +17,31 @@ QMI_BOARD_PLATFORM_LIST += msm8996
QMI_BOARD_PLATFORM_LIST += msm8953
QMI_BOARD_PLATFORM_LIST += msm8937
QMI_BOARD_PLATFORM_LIST += msmcobalt
QMI_BOARD_PLATFORM_LIST += msmfalcon
ifneq (,$(filter $(QMI_BOARD_PLATFORM_LIST),$(TARGET_BOARD_PLATFORM)))
include $(call all-subdir-makefiles)
endif #is-board-platform-in-list
# link gss.bxx files into /etc/firmware folder
ifeq ($(call is-board-platform-in-list, msm8960),true)
$(shell ln -sf /firmware/image/gss.b00 $(TARGET_OUT_ETC)/firmware/gss.b00)
$(shell ln -sf /firmware/image/gss.b01 $(TARGET_OUT_ETC)/firmware/gss.b01)
$(shell ln -sf /firmware/image/gss.b02 $(TARGET_OUT_ETC)/firmware/gss.b02)
$(shell ln -sf /firmware/image/gss.b03 $(TARGET_OUT_ETC)/firmware/gss.b03)
$(shell ln -sf /firmware/image/gss.b04 $(TARGET_OUT_ETC)/firmware/gss.b04)
$(shell ln -sf /firmware/image/gss.b05 $(TARGET_OUT_ETC)/firmware/gss.b05)
$(shell ln -sf /firmware/image/gss.b06 $(TARGET_OUT_ETC)/firmware/gss.b06)
$(shell ln -sf /firmware/image/gss.b07 $(TARGET_OUT_ETC)/firmware/gss.b07)
$(shell ln -sf /firmware/image/gss.b08 $(TARGET_OUT_ETC)/firmware/gss.b08)
$(shell ln -sf /firmware/image/gss.b09 $(TARGET_OUT_ETC)/firmware/gss.b09)
$(shell ln -sf /firmware/image/gss.b10 $(TARGET_OUT_ETC)/firmware/gss.b10)
$(shell ln -sf /firmware/image/gss.b11 $(TARGET_OUT_ETC)/firmware/gss.b11)
$(shell ln -sf /firmware/image/gss.b12 $(TARGET_OUT_ETC)/firmware/gss.b12)
$(shell ln -sf /firmware/image/gss.b13 $(TARGET_OUT_ETC)/firmware/gss.b13)
$(shell ln -sf /firmware/image/gss.b14 $(TARGET_OUT_ETC)/firmware/gss.b14)
$(shell ln -sf /firmware/image/gss.b15 $(TARGET_OUT_ETC)/firmware/gss.b15)
$(shell ln -sf /firmware/image/gss.mdt $(TARGET_OUT_ETC)/firmware/gss.mdt)
endif
endif#BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE

629
location/loc_api/loc_api_v02/LocApiV02.cpp Normal file → Executable file
View File

@@ -44,6 +44,7 @@
#include <loc_util_log.h>
#include <gps_extended.h>
#include "platform_lib_includes.h"
#include <loc_cfg.h>
using namespace loc_core;
@@ -92,6 +93,15 @@ const struct conf_scaler_to_68_pair confScalers[CONF_SCALER_ARRAY_MAX] = {
{63, 1.072}, // 51 - 63. Index 2
};
#define GPS_CONF_FILE "/etc/gps.conf"
/*fixed timestamp uncertainty 10 milli second */
static int ap_timestamp_uncertainty = 0;
static loc_param_s_type gps_conf_param_table[] =
{
{"AP_TIMESTAMP_UNCERTAINTY",&ap_timestamp_uncertainty,NULL,'n'}
};
/* static event callbacks that call the LocApiV02 callbacks*/
/* global event callback, call the eventCb function in loc api adapter v02
@@ -176,6 +186,19 @@ locClientCallbacksType globalCallbacks =
globalErrorCb
};
static void getInterSystemTimeBias(const char* interSystem,
Gnss_InterSystemBiasStructType &interSystemBias,
const qmiLocInterSystemBiasStructT_v02* pInterSysBias)
{
LOC_LOGV("%s] Mask:%d, TimeBias:%f, TimeBiasUnc:%f,\n",
interSystem, pInterSysBias->validMask, pInterSysBias->timeBias,
pInterSysBias->timeBiasUnc);
interSystemBias.validMask = pInterSysBias->validMask;
interSystemBias.timeBias = pInterSysBias->timeBias;
interSystemBias.timeBiasUnc = pInterSysBias->timeBiasUnc;
}
/* Constructor for LocApiV02 */
LocApiV02 :: LocApiV02(const MsgTask* msgTask,
LOC_API_ADAPTER_EVENT_MASK_T exMask,
@@ -191,6 +214,8 @@ LocApiV02 :: LocApiV02(const MsgTask* msgTask,
{
// initialize loc_sync_req interface
loc_sync_req_init();
UTIL_READ_CONF(GPS_CONF_FILE,gps_conf_param_table);
}
/* Destructor for LocApiV02 */
@@ -394,7 +419,13 @@ LocApiV02 :: open(LOC_API_ADAPTER_EVENT_MASK_T mask)
mQmiMask = qmiMask;
}
}
LOC_LOGD("%s:%d]: Exit mMask: %x; mask: %x mQmiMask: %llx qmiMask: %llx",
/*Set the SV Measurement Constellation when Measurement Report or Polynomial report is set*/
if( (qmiMask & QMI_LOC_EVENT_MASK_GNSS_MEASUREMENT_REPORT_V02) ||
(qmiMask & QMI_LOC_EVENT_MASK_GNSS_SV_POLYNOMIAL_REPORT_V02) )
{
setSvMeasurementConstellation(eQMI_SYSTEM_GPS_V02|eQMI_SYSTEM_GLO_V02);
}
LOC_LOGD("%s:%d]: Exit mMask: %x; mask: %x mQmiMask: %lld qmiMask: %lld",
__func__, __LINE__, mMask, mask, mQmiMask, qmiMask);
if (LOC_API_ADAPTER_ERR_SUCCESS == rtv) {
@@ -551,6 +582,10 @@ enum loc_api_adapter_err LocApiV02 :: startFix(const LocPosMode& fixCriteria)
// TBD: store session ID, check for session id in pos reports.
start_msg.sessionId = LOC_API_V02_DEF_SESSION_ID;
//Set whether position report can be shared with other LOC clients
start_msg.sharePosition_valid = 1;
start_msg.sharePosition = fixCriteria.share_position;
if (fixCriteria.credentials[0] != 0) {
int size1 = sizeof(start_msg.applicationId.applicationName);
int size2 = sizeof(fixCriteria.credentials);
@@ -713,7 +748,17 @@ enum loc_api_adapter_err LocApiV02 ::
inject_pos_msg.rawHorConfidence = 68; //1 std dev assumed as specified by API
/* Log */
struct timespec time_info_current;
if(clock_gettime(CLOCK_REALTIME,&time_info_current) == 0) //success
{
inject_pos_msg.timestampUtc_valid = 1;
inject_pos_msg.timestampUtc = (time_info_current.tv_sec)*1e3 +
(time_info_current.tv_nsec)/1e6;
LOC_LOGV("%s:%d] inject timestamp from system: %llu",
__func__, __LINE__, inject_pos_msg.timestampUtc);
}
/* 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);
@@ -1783,63 +1828,6 @@ enum loc_api_adapter_err LocApiV02 :: setSensorPerfControlConfig(int controlMode
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)
{
@@ -2022,6 +2010,12 @@ locClientEventMaskType LocApiV02 :: convertMask(
if(mask & LOC_API_ADAPTER_BIT_BATCHED_POSITION_REPORT)
eventMask |= QMI_LOC_EVENT_MASK_LIVE_BATCHED_POSITION_REPORT_V02;
if(mask & LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT_REPORT)
eventMask |= QMI_LOC_EVENT_MASK_GNSS_MEASUREMENT_REPORT_V02;
if(mask & LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT)
eventMask |= QMI_LOC_EVENT_MASK_GNSS_SV_POLYNOMIAL_REPORT_V02;
// for GDT
if(mask & LOC_API_ADAPTER_BIT_GDT_UPLOAD_BEGIN_REQ)
eventMask |= QMI_LOC_EVENT_MASK_GDT_UPLOAD_BEGIN_REQ_V02;
@@ -2111,6 +2105,19 @@ void LocApiV02 :: reportPosition (
GpsLocationExtended locationExtended;
memset(&locationExtended, 0, sizeof (GpsLocationExtended));
locationExtended.size = sizeof(locationExtended);
if( clock_gettime( CLOCK_BOOTTIME, &locationExtended.timeStamp.apTimeStamp)== 0 )
{
locationExtended.timeStamp.apTimeStampUncertaintyMs = (float)ap_timestamp_uncertainty;
}
else
{
locationExtended.timeStamp.apTimeStampUncertaintyMs = FLT_MAX;
LOC_LOGE("%s:%d Error in clock_gettime() ",__func__, __LINE__);
}
LOC_LOGD("%s:%d QMI_PosPacketTime %ld (sec) %ld (nsec)", __func__, __LINE__,
locationExtended.timeStamp.apTimeStamp.tv_sec,
locationExtended.timeStamp.apTimeStamp.tv_nsec);
// Process the position from final and intermediate reports
if( (location_report_ptr->sessionStatus == eQMI_LOC_SESS_STATUS_SUCCESS_V02) ||
@@ -2465,6 +2472,449 @@ void LocApiV02 :: reportSv (
}
}
/* convert satellite measurementreport to loc eng format and send the converted
report to loc eng */
void LocApiV02 :: reportSvMeasurement (
const qmiLocEventGnssSvMeasInfoIndMsgT_v02 *gnss_raw_measurement_ptr)
{
GnssSvMeasurementSet svMeasurementSet;
memset(&svMeasurementSet, 0, sizeof(GnssSvMeasurementSet));
svMeasurementSet.size = sizeof(svMeasurementSet);
if( clock_gettime( CLOCK_BOOTTIME, &svMeasurementSet.timeStamp.apTimeStamp)== 0 )
{
svMeasurementSet.timeStamp.apTimeStampUncertaintyMs = (float)ap_timestamp_uncertainty;
}
else
{
svMeasurementSet.timeStamp.apTimeStampUncertaintyMs = FLT_MAX;
LOC_LOGE("%s:%d Error in clock_gettime() ",__func__, __LINE__);
}
LOC_LOGD("%s:%d QMI_MeasPacketTime %ld (sec) %ld (nsec)",__func__,__LINE__,
svMeasurementSet.timeStamp.apTimeStamp.tv_sec,
svMeasurementSet.timeStamp.apTimeStamp.tv_nsec);
LOC_LOGI("[SvMeas] SeqNum: %d, MaxMsgNum: %d, MeasValid: %d, #of SV: %d\n",
gnss_raw_measurement_ptr->seqNum,
gnss_raw_measurement_ptr->maxMessageNum,
gnss_raw_measurement_ptr->svMeasurement_valid,
(gnss_raw_measurement_ptr->svMeasurement_valid)?
gnss_raw_measurement_ptr->svMeasurement_len : 0);
svMeasurementSet.seqNum = gnss_raw_measurement_ptr->seqNum;
svMeasurementSet.maxMessageNum = gnss_raw_measurement_ptr->maxMessageNum;
if(1 == gnss_raw_measurement_ptr->rcvrClockFrequencyInfo_valid)
{
qmiLocRcvrClockFrequencyInfoStructT_v02* rcvClockFreqInfo =
(qmiLocRcvrClockFrequencyInfoStructT_v02*) &gnss_raw_measurement_ptr->rcvrClockFrequencyInfo;
svMeasurementSet.clockFreq.size = sizeof(Gnss_LocRcvrClockFrequencyInfoStructType);
svMeasurementSet.clockFreqValid = gnss_raw_measurement_ptr->rcvrClockFrequencyInfo_valid;
svMeasurementSet.clockFreq.clockDrift =
gnss_raw_measurement_ptr->rcvrClockFrequencyInfo.clockDrift;
svMeasurementSet.clockFreq.clockDriftUnc =
gnss_raw_measurement_ptr->rcvrClockFrequencyInfo.clockDriftUnc;
svMeasurementSet.clockFreq.sourceOfFreq = (Gnss_LocSourceofFreqEnumType)
gnss_raw_measurement_ptr->rcvrClockFrequencyInfo.sourceOfFreq;
LOC_LOGV("FreqInfo:: Drift: %f, DriftUnc: %f",
svMeasurementSet.clockFreq.clockDrift,
svMeasurementSet.clockFreq.clockDriftUnc);
}
if((1 == gnss_raw_measurement_ptr->leapSecondInfo_valid) &&
(0 == gnss_raw_measurement_ptr->leapSecondInfo.leapSecUnc) )
{
qmiLocLeapSecondInfoStructT_v02* leapSecond =
(qmiLocLeapSecondInfoStructT_v02*)&gnss_raw_measurement_ptr->leapSecondInfo;
svMeasurementSet.leapSec.size = sizeof(Gnss_LeapSecondInfoStructType);
svMeasurementSet.leapSecValid = (bool)gnss_raw_measurement_ptr->leapSecondInfo_valid;
svMeasurementSet.leapSec.leapSec = gnss_raw_measurement_ptr->leapSecondInfo.leapSec;
svMeasurementSet.leapSec.leapSecUnc = gnss_raw_measurement_ptr->leapSecondInfo.leapSecUnc;
LOC_LOGV("leapSecondInfo:: leapSec: %d, leapSecUnc: %d",
svMeasurementSet.leapSec.leapSec, svMeasurementSet.leapSec.leapSecUnc);
}
if(1 == gnss_raw_measurement_ptr->gpsGloInterSystemBias_valid)
{
qmiLocInterSystemBiasStructT_v02* interSystemBias =
(qmiLocInterSystemBiasStructT_v02*)&gnss_raw_measurement_ptr->gpsGloInterSystemBias;
getInterSystemTimeBias("gpsGloInterSystemBias",
svMeasurementSet.gpsGloInterSystemBias, interSystemBias);
}
if(1 == gnss_raw_measurement_ptr->gpsBdsInterSystemBias_valid)
{
qmiLocInterSystemBiasStructT_v02* interSystemBias =
(qmiLocInterSystemBiasStructT_v02*)&gnss_raw_measurement_ptr->gpsBdsInterSystemBias;
getInterSystemTimeBias("gpsBdsInterSystemBias",
svMeasurementSet.gpsBdsInterSystemBias, interSystemBias);
}
if(1 == gnss_raw_measurement_ptr->gpsGalInterSystemBias_valid)
{
qmiLocInterSystemBiasStructT_v02* interSystemBias =
(qmiLocInterSystemBiasStructT_v02*)&gnss_raw_measurement_ptr->gpsGalInterSystemBias;
getInterSystemTimeBias("gpsGalInterSystemBias",
svMeasurementSet.gpsGalInterSystemBias, interSystemBias);
}
if(1 == gnss_raw_measurement_ptr->bdsGloInterSystemBias_valid)
{
qmiLocInterSystemBiasStructT_v02* interSystemBias =
(qmiLocInterSystemBiasStructT_v02*)&gnss_raw_measurement_ptr->bdsGloInterSystemBias;
getInterSystemTimeBias("bdsGloInterSystemBias",
svMeasurementSet.bdsGloInterSystemBias, interSystemBias);
}
if(1 == gnss_raw_measurement_ptr->galGloInterSystemBias_valid)
{
qmiLocInterSystemBiasStructT_v02* interSystemBias =
(qmiLocInterSystemBiasStructT_v02*)&gnss_raw_measurement_ptr->galGloInterSystemBias;
getInterSystemTimeBias("galGloInterSystemBias",
svMeasurementSet.galGloInterSystemBias, interSystemBias);
}
if(1 == gnss_raw_measurement_ptr->galBdsInterSystemBias_valid)
{
qmiLocInterSystemBiasStructT_v02* interSystemBias =
(qmiLocInterSystemBiasStructT_v02*)&gnss_raw_measurement_ptr->galBdsInterSystemBias;
getInterSystemTimeBias("galBdsInterSystemBias",
svMeasurementSet.galBdsInterSystemBias,interSystemBias);
}
svMeasurementSet.gnssMeas.size = sizeof(Gnss_SVMeasurementStructType);
svMeasurementSet.gnssMeas.system = (Gnss_LocSvSystemEnumType)gnss_raw_measurement_ptr->system;
if(1 == gnss_raw_measurement_ptr->systemTime_valid)
{
svMeasurementSet.gnssMeas.isSystemTimeValid = gnss_raw_measurement_ptr->systemTime_valid;
svMeasurementSet.gnssMeas.systemTime.size = sizeof(Gnss_LocSystemTimeStructType);
svMeasurementSet.gnssMeas.systemTime.systemWeek =
gnss_raw_measurement_ptr->systemTime.systemWeek;
svMeasurementSet.gnssMeas.systemTime.systemMsec =
gnss_raw_measurement_ptr->systemTime.systemMsec;
svMeasurementSet.gnssMeas.systemTime.systemClkTimeBias =
gnss_raw_measurement_ptr->systemTime.systemClkTimeBias;
svMeasurementSet.gnssMeas.systemTime.systemClkTimeUncMs =
gnss_raw_measurement_ptr->systemTime.systemClkTimeUncMs;
}
if(1 == gnss_raw_measurement_ptr->gloTime_valid)
{
svMeasurementSet.gnssMeas.isGloTime_valid = gnss_raw_measurement_ptr->gloTime_valid;
svMeasurementSet.gnssMeas.gloTime.size = sizeof(Gnss_LocGloTimeStructType);
svMeasurementSet.gnssMeas.gloTime.gloDays = gnss_raw_measurement_ptr->gloTime.gloDays;
svMeasurementSet.gnssMeas.gloTime.gloFourYear = gnss_raw_measurement_ptr->gloTime.gloFourYear;
svMeasurementSet.gnssMeas.gloTime.gloMsec = gnss_raw_measurement_ptr->gloTime.gloMsec;
svMeasurementSet.gnssMeas.gloTime.gloClkTimeBias = gnss_raw_measurement_ptr->gloTime.gloClkTimeBias;
svMeasurementSet.gnssMeas.gloTime.gloClkTimeUncMs = gnss_raw_measurement_ptr->gloTime.gloClkTimeUncMs;
}
if(1 == gnss_raw_measurement_ptr->systemTimeExt_valid)
{
svMeasurementSet.gnssMeas.isSystemTimeExt_valid = gnss_raw_measurement_ptr->systemTimeExt_valid;
svMeasurementSet.gnssMeas.systemTimeExt.size = sizeof(Gnss_LocGnssTimeExtStructType);
svMeasurementSet.gnssMeas.systemTimeExt.refFCount = gnss_raw_measurement_ptr->systemTimeExt.refFCount;
svMeasurementSet.gnssMeas.systemTimeExt.systemRtc_valid =
gnss_raw_measurement_ptr->systemTimeExt.systemRtc_valid;
svMeasurementSet.gnssMeas.systemTimeExt.systemRtcMs =
gnss_raw_measurement_ptr->systemTimeExt.systemRtcMs;
svMeasurementSet.gnssMeas.systemTimeExt.sourceOfTime =
gnss_raw_measurement_ptr->systemTimeExt.sourceOfTime;
}
if(1 == gnss_raw_measurement_ptr->svMeasurement_valid)
{
svMeasurementSet.gnssMeas.numSvs = gnss_raw_measurement_ptr->svMeasurement_len;
svMeasurementSet.gnssMeasValid = gnss_raw_measurement_ptr->svMeasurement_valid;
if(gnss_raw_measurement_ptr->svMeasurement_len > GNSS_LOC_SV_MEAS_LIST_MAX_SIZE)
{
//This should not happen normally, anycase limit to Max List Size
svMeasurementSet.gnssMeas.numSvs = GNSS_LOC_SV_MEAS_LIST_MAX_SIZE;
}
svMeasurementSet.gnssMeas.numSvs = gnss_raw_measurement_ptr->svMeasurement_len;
svMeasurementSet.gnssMeasValid = gnss_raw_measurement_ptr->svMeasurement_valid;
uint32_t i = 0, cnt=0;
for(i=0;i<gnss_raw_measurement_ptr->svMeasurement_len;i++)
{
svMeasurementSet.gnssMeas.svMeasurement[i].size = sizeof(Gnss_SVMeasurementStructType);
if((0 != gnss_raw_measurement_ptr->svMeasurement[i].gnssSvId) &&
(0 != gnss_raw_measurement_ptr->svMeasurement[i].measurementStatus))
{
svMeasurementSet.gnssMeas.svMeasurement[i].gnssSvId =
gnss_raw_measurement_ptr->svMeasurement[i].gnssSvId;
svMeasurementSet.gnssMeas.svMeasurement[i].gloFrequency =
gnss_raw_measurement_ptr->svMeasurement[i].gloFrequency;
if(gnss_raw_measurement_ptr->svMeasurement[i].validMask & QMI_LOC_SV_LOSSOFLOCK_VALID_V02)
{
svMeasurementSet.gnssMeas.svMeasurement[i].lossOfLock = (bool)
gnss_raw_measurement_ptr->svMeasurement[i].lossOfLock;
}
svMeasurementSet.gnssMeas.svMeasurement[i].svStatus = (Gnss_LocSvSearchStatusEnumT)
gnss_raw_measurement_ptr->svMeasurement[i].svStatus;
if(gnss_raw_measurement_ptr->svMeasurement[i].validMask & QMI_LOC_SV_HEALTH_VALID_V02)
{
svMeasurementSet.gnssMeas.svMeasurement[i].healthStatus_valid = 1;
svMeasurementSet.gnssMeas.svMeasurement[i].healthStatus = (uint8_t)gnss_raw_measurement_ptr->svMeasurement[i].healthStatus;
}
svMeasurementSet.gnssMeas.svMeasurement[i].svInfoMask = (Gnss_LocSvInfoMaskT)
gnss_raw_measurement_ptr->svMeasurement[i].svInfoMask;
svMeasurementSet.gnssMeas.svMeasurement[i].CNo =
gnss_raw_measurement_ptr->svMeasurement[i].CNo;
svMeasurementSet.gnssMeas.svMeasurement[i].gloRfLoss =
gnss_raw_measurement_ptr->svMeasurement[i].gloRfLoss;
svMeasurementSet.gnssMeas.svMeasurement[i].measLatency =
gnss_raw_measurement_ptr->svMeasurement[i].measLatency;
/*SVTimeSpeed*/
svMeasurementSet.gnssMeas.svMeasurement[i].svTimeSpeed.size = sizeof(Gnss_LocSVTimeSpeedStructType);
svMeasurementSet.gnssMeas.svMeasurement[i].svTimeSpeed.svMs =
gnss_raw_measurement_ptr->svMeasurement[i].svTimeSpeed.svTimeMs;
svMeasurementSet.gnssMeas.svMeasurement[i].svTimeSpeed.svSubMs =
gnss_raw_measurement_ptr->svMeasurement[i].svTimeSpeed.svTimeSubMs;
svMeasurementSet.gnssMeas.svMeasurement[i].svTimeSpeed.svTimeUncMs =
gnss_raw_measurement_ptr->svMeasurement[i].svTimeSpeed.svTimeUncMs;
svMeasurementSet.gnssMeas.svMeasurement[i].svTimeSpeed.dopplerShift =
gnss_raw_measurement_ptr->svMeasurement[i].svTimeSpeed.dopplerShift;
svMeasurementSet.gnssMeas.svMeasurement[i].svTimeSpeed.dopplerShiftUnc=
gnss_raw_measurement_ptr->svMeasurement[i].svTimeSpeed.dopplerShiftUnc;
svMeasurementSet.gnssMeas.svMeasurement[i].measurementStatus =
(uint32_t)gnss_raw_measurement_ptr->svMeasurement[i].measurementStatus;
if(gnss_raw_measurement_ptr->svMeasurement[i].validMask & QMI_LOC_SV_MULTIPATH_EST_VALID_V02)
{
svMeasurementSet.gnssMeas.svMeasurement[i].multipathEstValid = 1;
svMeasurementSet.gnssMeas.svMeasurement[i].multipathEstimate =
gnss_raw_measurement_ptr->svMeasurement[i].multipathEstimate;
}
if(gnss_raw_measurement_ptr->svMeasurement[i].validMask & QMI_LOC_SV_FINE_SPEED_VALID_V02)
{
svMeasurementSet.gnssMeas.svMeasurement[i].fineSpeedValid = 1;
svMeasurementSet.gnssMeas.svMeasurement[i].fineSpeed =
gnss_raw_measurement_ptr->svMeasurement[i].fineSpeed;
}
if(gnss_raw_measurement_ptr->svMeasurement[i].validMask & QMI_LOC_SV_FINE_SPEED_UNC_VALID_V02)
{
svMeasurementSet.gnssMeas.svMeasurement[i].fineSpeedUncValid = 1;
svMeasurementSet.gnssMeas.svMeasurement[i].fineSpeedUnc =
gnss_raw_measurement_ptr->svMeasurement[i].fineSpeedUnc;
}
if(gnss_raw_measurement_ptr->svMeasurement[i].validMask & QMI_LOC_SV_CARRIER_PHASE_VALID_V02)
{
svMeasurementSet.gnssMeas.svMeasurement[i].carrierPhaseValid = 1;
svMeasurementSet.gnssMeas.svMeasurement[i].carrierPhase =
gnss_raw_measurement_ptr->svMeasurement[i].carrierPhase;
}
if(gnss_raw_measurement_ptr->svMeasurement[i].validMask & QMI_LOC_SV_SV_DIRECTION_VALID_V02)
{
svMeasurementSet.gnssMeas.svMeasurement[i].svDirectionValid = 1;
svMeasurementSet.gnssMeas.svMeasurement[i].svElevation =
gnss_raw_measurement_ptr->svMeasurement[i].svElevation;
svMeasurementSet.gnssMeas.svMeasurement[i].svAzimuth =
gnss_raw_measurement_ptr->svMeasurement[i].svAzimuth;
}
if(gnss_raw_measurement_ptr->svMeasurement[i].validMask & QMI_LOC_SV_CYCLESLIP_COUNT_VALID_V02)
{
svMeasurementSet.gnssMeas.svMeasurement[i].cycleSlipCountValid = 1;
svMeasurementSet.gnssMeas.svMeasurement[i].cycleSlipCount =
gnss_raw_measurement_ptr->svMeasurement[i].cycleSlipCount;
}
cnt++;
}
svMeasurementSet.gnssMeas.numSvs = cnt; /*set the measurement length to the actual SVId's filled in the array*/
}
if(gnss_raw_measurement_ptr->svMeasurement_len != cnt)
{
LOC_LOGW("[SV_MEAS_QMI] #of SV in QMI: %d, Valid SV-id Count: %d",
gnss_raw_measurement_ptr->svMeasurement_len,cnt );
}
} //if svClockMeasurement_valid
else
{
LOC_LOGV("%s] [SV_MEAS] SV Measurement Not Valid", __func__);
}
//Report SV measurement irrespective of #of SVs for APDR
LocApiBase::reportSvMeasurement(svMeasurementSet);
}
/* convert satellite polynomial to loc eng format and send the converted
report to loc eng */
void LocApiV02 :: reportSvPolynomial (
const qmiLocEventGnssSvPolyIndMsgT_v02 *gnss_sv_poly_ptr)
{
GnssSvPolynomial svPolynomial;
memset(&svPolynomial, 0, sizeof(GnssSvPolynomial));
svPolynomial.size = sizeof(GnssSvPolynomial);
svPolynomial.is_valid = 0;
if(0 != gnss_sv_poly_ptr->gnssSvId)
{
svPolynomial.gnssSvId = gnss_sv_poly_ptr->gnssSvId;
svPolynomial.T0 = gnss_sv_poly_ptr->T0;
svPolynomial.svPolyFlags = gnss_sv_poly_ptr->svPolyFlags;
if(1 == gnss_sv_poly_ptr->gloFrequency_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_GLO_FREQ;
svPolynomial.freqNum = gnss_sv_poly_ptr->gloFrequency;
}
if(1 == gnss_sv_poly_ptr->IODE_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_IODE;
svPolynomial.iode = gnss_sv_poly_ptr->IODE;
}
if(1 == gnss_sv_poly_ptr->svPosUnc_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_SV_POSUNC;
svPolynomial.svPosUnc = gnss_sv_poly_ptr->svPosUnc;
}
if(1 == gnss_sv_poly_ptr->svPolyFlagValid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_FLAG;
svPolynomial.svPolyFlags = gnss_sv_poly_ptr->svPolyFlags;
}
if(1 == gnss_sv_poly_ptr->polyCoeffXYZ0_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_POLYCOEFF_XYZ0;
for(int i=0;i<GNSS_SV_POLY_XYZ_0_TH_ORDER_COEFF_MAX_SIZE;i++)
{
svPolynomial.polyCoeffXYZ0[i] = gnss_sv_poly_ptr->polyCoeffXYZ0[i];
}
}
if(1 == gnss_sv_poly_ptr->polyCoefXYZN_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_POLYCOEFF_XYZN;
for(int i=0;i<GNSS_SV_POLY_XYZ_N_TH_ORDER_COEFF_MAX_SIZE;i++)
{
svPolynomial.polyCoefXYZN[i] = gnss_sv_poly_ptr->polyCoefXYZN[i];
}
}
if(1 == gnss_sv_poly_ptr->polyCoefClockBias_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_POLYCOEFF_OTHER;
for(int i=0;i<GNSS_SV_POLY_SV_CLKBIAS_COEFF_MAX_SIZE;i++)
{
svPolynomial.polyCoefOther[i] = gnss_sv_poly_ptr->polyCoefClockBias[i];
}
}
if(1 == gnss_sv_poly_ptr->ionoDot_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_IONODOT;
svPolynomial.ionoDot = gnss_sv_poly_ptr->ionoDot;
}
if(1 == gnss_sv_poly_ptr->ionoDelay_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_IONODELAY;
svPolynomial.ionoDelay = gnss_sv_poly_ptr->ionoDelay;
}
if(1 == gnss_sv_poly_ptr->sbasIonoDot_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_SBAS_IONODOT;
svPolynomial.sbasIonoDot = gnss_sv_poly_ptr->sbasIonoDot;
}
if(1 == gnss_sv_poly_ptr->sbasIonoDelay_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_SBAS_IONODELAY;
svPolynomial.sbasIonoDelay = gnss_sv_poly_ptr->sbasIonoDelay;
}
if(1 == gnss_sv_poly_ptr->tropoDelay_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_TROPODELAY;
svPolynomial.tropoDelay = gnss_sv_poly_ptr->tropoDelay;
}
if(1 == gnss_sv_poly_ptr->elevation_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_ELEVATION;
svPolynomial.elevation = gnss_sv_poly_ptr->elevation;
}
if(1 == gnss_sv_poly_ptr->elevationDot_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_ELEVATIONDOT;
svPolynomial.elevationDot = gnss_sv_poly_ptr->elevationDot;
}
if(1 == gnss_sv_poly_ptr->elenationUnc_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_ELEVATIONUNC;
svPolynomial.elevationUnc = gnss_sv_poly_ptr->elenationUnc;
}
if(1 == gnss_sv_poly_ptr->velCoef_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_VELO_COEFF;
for(int i=0;i<GNSS_SV_POLY_VELOCITY_COEF_MAX_SIZE;i++)
{
svPolynomial.velCoef[i] = gnss_sv_poly_ptr->velCoef[i];
}
}
if(1 == gnss_sv_poly_ptr->enhancedIOD_valid)
{
svPolynomial.is_valid |= ULP_GNSS_SV_POLY_BIT_ENHANCED_IOD;
svPolynomial.enhancedIOD = gnss_sv_poly_ptr->enhancedIOD;
}
LocApiBase::reportSvPolynomial(svPolynomial);
LOC_LOGV("[SV_POLY_QMI] SV-Id:%d\n", svPolynomial.gnssSvId);
}
else
{
LOC_LOGV("[SV_POLY] INVALID SV-Id:%d", svPolynomial.gnssSvId);
}
} //reportSvPolynomial
/* convert engine state report to loc eng format and send the converted
report to loc eng */
void LocApiV02 :: reportEngineState (
@@ -2543,7 +2993,6 @@ void LocApiV02 :: reportFixSessionState (
void LocApiV02 :: reportNmea (
const qmiLocEventNmeaIndMsgT_v02 *nmea_report_ptr)
{
LocApiBase::reportNmea(nmea_report_ptr->nmea,
strlen(nmea_report_ptr->nmea));
@@ -3237,9 +3686,17 @@ void LocApiV02 :: eventCb(locClientHandleType clientHandle,
reportAtlRequest(eventPayload.pLocationServerConnReqEvent);
break;
// GNSS Measurement Report
case QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02:
reportGnssMeasurementData(*eventPayload.pGnssSvRawInfoEvent);
LOC_LOGD("%s:%d]: GNSS Measurement Report\n", __func__,
__LINE__);
reportSvMeasurement(eventPayload.pGnssSvRawInfoEvent);
reportGnssMeasurementData(*eventPayload.pGnssSvRawInfoEvent); /*TBD merge into one function*/
break;
case QMI_LOC_EVENT_SV_POLYNOMIAL_REPORT_IND_V02:
LOC_LOGD("%s:%d]: GNSS SV Polynomial Ind\n", __func__,
__LINE__);
reportSvPolynomial(eventPayload.pGnssSvPolyInfoEvent);
break;
}
}
@@ -3259,6 +3716,8 @@ void LocApiV02 :: errorCb(locClientHandleType handle,
the loc engine re-initializes the adapter and the
loc-api_v02 interface */
mGnssMeasurementSupported = sup_unknown;
handleEngineUpEvent();
}
}
@@ -3897,17 +4356,45 @@ void LocApiV02 :: installAGpsCert(const DerEncodedCertificate* pData,
}
}
/*
Returns
0: update the gps reporting event successfully
-1: on failure
*/
int LocApiV02 :: updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event,
loc_registration_mask_status isEnabled)
int LocApiV02::setSvMeasurementConstellation(const qmiLocGNSSConstellEnumT_v02 svConstellation)
{
LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__);
enum loc_api_adapter_err ret_val = LOC_API_ADAPTER_ERR_SUCCESS;
qmiLocSetGNSSConstRepConfigReqMsgT_v02 setGNSSConstRepConfigReq;
qmiLocSetGNSSConstRepConfigIndMsgT_v02 setGNSSConstRepConfigInd;
locClientStatusEnumType status;
locClientReqUnionType req_union;
LOC_LOGD("%s] set GNSS measurement to report constellation: %lld\n",
__func__, svConstellation);
return open((isEnabled == LOC_REGISTRATION_MASK_ENABLED)?(mMask|event):(mMask&~event));
memset(&setGNSSConstRepConfigReq, 0, sizeof(setGNSSConstRepConfigReq));
setGNSSConstRepConfigReq.measReportConfig_valid = true;
setGNSSConstRepConfigReq.measReportConfig = svConstellation;
setGNSSConstRepConfigReq.svPolyReportConfig_valid = true;
setGNSSConstRepConfigReq.svPolyReportConfig = svConstellation;
req_union.pSetGNSSConstRepConfigReq = &setGNSSConstRepConfigReq;
memset(&setGNSSConstRepConfigInd, 0, sizeof(setGNSSConstRepConfigInd));
status = loc_sync_send_req(clientHandle,
QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_V02,
req_union,
LOC_ENGINE_SYNC_REQUEST_TIMEOUT,
QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_IND_V02,
&setGNSSConstRepConfigInd);
if(status != eLOC_CLIENT_SUCCESS || setGNSSConstRepConfigInd.status != eQMI_LOC_SUCCESS_V02)
{
LOC_LOGE("%s:%d]: Set GNSS constellation failed. status: %s, ind status:%s\n",
__func__, __LINE__,
loc_get_v02_client_status_name(status),
loc_get_v02_qmi_status_name(setGNSSConstRepConfigInd.status));
ret_val = LOC_API_ADAPTER_ERR_GENERAL_FAILURE;
} else {
LOC_LOGD("%s:%d]: Set GNSS constellation succeeded.\n",
__func__, __LINE__);
}
return ret_val;
}
bool LocApiV02 :: gnssConstellationConfig()

View File

@@ -104,6 +104,12 @@ private:
report to loc eng */
void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr);
void reportSvMeasurement (
const qmiLocEventGnssSvMeasInfoIndMsgT_v02 *gnss_raw_measurement_ptr);
void reportSvPolynomial (
const qmiLocEventGnssSvPolyIndMsgT_v02 *gnss_sv_poly_ptr);
/* convert engine state report to loc eng format and send the converted
report to loc eng */
void reportEngineState (
@@ -219,7 +225,6 @@ public:
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 setLPPeProtocol(unsigned long lppeCP, unsigned long lppeUP);
virtual enum loc_api_adapter_err
@@ -240,15 +245,11 @@ public:
-1 on failure
*/
virtual int getGpsLock(void);
virtual int setSvMeasurementConstellation(const qmiLocGNSSConstellEnumT_v02 svConstellation);
virtual enum loc_api_adapter_err setXtraVersionCheck(enum xtra_version_check check);
virtual void installAGpsCert(const DerEncodedCertificate* pData,
size_t length,
uint32_t slotBitMask);
/*
Update Registration Mask
*/
virtual int updateRegistrationMask(LOC_API_ADAPTER_EVENT_MASK_T event,
loc_registration_mask_status isEnabled);
/*
Set Gnss Constellation Config
*/

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2011,2013,2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011,2013,2016, The Linux Foundation. All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are

View File

@@ -222,6 +222,16 @@ static const locClientEventIndTableStructT locClientEventIndTable[]= {
sizeof(qmiLocEventGeofenceProximityIndMsgT_v02),
QMI_LOC_EVENT_MASK_GEOFENCE_PROXIMITY_NOTIFICATION_V02},
//GNSS Measurement Indication
{ QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02,
sizeof(qmiLocEventGnssSvMeasInfoIndMsgT_v02),
QMI_LOC_EVENT_MASK_GNSS_MEASUREMENT_REPORT_V02 },
//GNSS Measurement Indication
{ QMI_LOC_EVENT_SV_POLYNOMIAL_REPORT_IND_V02,
sizeof(qmiLocEventGnssSvPolyIndMsgT_v02),
QMI_LOC_EVENT_MASK_GNSS_SV_POLYNOMIAL_REPORT_V02 },
// for GDT
{ QMI_LOC_EVENT_GDT_UPLOAD_BEGIN_STATUS_REQ_IND_V02,
sizeof(qmiLocEventGdtUploadBeginStatusReqIndMsgT_v02),

View File

@@ -921,6 +921,18 @@ typedef union
The eventIndId field in the event indication callback is set to
QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02. @newpagetable */
const qmiLocEventGnssSvMeasInfoIndMsgT_v02* pGnssSvRawInfoEvent;
/**< Sent by the engine when GNSS measurements are available
The eventIndId field in the event indication callback is set to
QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02. @newpagetable */
const qmiLocEventGnssSvPolyIndMsgT_v02* pGnssSvPolyInfoEvent;
/**< Sent by the engine when GNSS measurements are available
The eventIndId field in the event indication callback is set to
QMI_LOC_EVENT_SV_POLYNOMIAL_REPORT_IND_V02. @newpagetable */
const qmiLocEventGdtUploadBeginStatusReqIndMsgT_v02* pGdtUploadBeginEvent;
/**< Sent by the engine to notify the client about a GDT upload
begine event.
@@ -935,11 +947,6 @@ typedef union
The eventIndId field in the event indication callback is set to
QMI_LOC_EVENT_GDT_UPLOAD_END_REQ_IND_V02. @newpagetable */
const qmiLocEventGnssSvMeasInfoIndMsgT_v02* pGnssSvRawInfoEvent;
/**< Sent by the engine to report GNSS measurement.
The eventIndId field in the event indication callback is set to
QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02. @newpagetable */
const qmiLocEventDbtPositionReportIndMsgT_v02 *pDbtPositionReportEvent;
/**< Sent by the engine to notify the client of a distance based
tracking position report.

File diff suppressed because it is too large Load Diff

View File

@@ -63,7 +63,7 @@
*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
/* This file was generated with Tool version 6.14.7
It was generated on: Wed Jun 15 2016 (Spin 0)
It was generated on: Tue Jun 28 2016 (Spin 0)
From IDL File: location_service_v02.idl */
/** @defgroup loc_qmi_consts Constant values defined in the IDL */
@@ -89,7 +89,7 @@ extern "C" {
/** Major Version Number of the IDL used to generate this file */
#define LOC_V02_IDL_MAJOR_VERS 0x02
/** Revision Number of the IDL used to generate this file */
#define LOC_V02_IDL_MINOR_VERS 0x38
#define LOC_V02_IDL_MINOR_VERS 0x39
/** Major Version Number of the qmi_idl_compiler used to generate this file */
#define LOC_V02_IDL_TOOL_VERS 0x06
/** Maximum Defined Message ID */
@@ -438,9 +438,9 @@ typedef uint64_t qmiLocEventRegMaskT_v02;
using the context ID in this indication. The context of a Geofence may contain Wi-Fi area ID lists, IBeacon lists,
Cell-ID list, and so forth. */
#define QMI_LOC_EVENT_MASK_GDT_UPLOAD_BEGIN_REQ_V02 ((qmiLocEventRegMaskT_v02)0x08000000ull) /**< The control point must enable this mask to receive Generic Data Transport (GDT)
session begin request event indications. */
upload session begin request event indications. */
#define QMI_LOC_EVENT_MASK_GDT_UPLOAD_END_REQ_V02 ((qmiLocEventRegMaskT_v02)0x10000000ull) /**< The control point must enable this mask to receive GDT
session end request event indications. */
upload session end request event indications. */
#define QMI_LOC_EVENT_MASK_GEOFENCE_BATCH_DWELL_NOTIFICATION_V02 ((qmiLocEventRegMaskT_v02)0x20000000ull) /**< The control point must enable this mask to receive notifications when
a Geofence is dwelled. These events are generated when a UE enters
or leaves the perimeter of a Geofence and dwells inside or outside for a specified time.
@@ -540,9 +540,9 @@ typedef struct {
using the context ID in this indication. The context of a Geofence may contain Wi-Fi area ID lists, IBeacon lists,
Cell-ID list, and so forth.
- QMI_LOC_EVENT_MASK_GDT_UPLOAD_BEGIN_REQ (0x08000000) -- The control point must enable this mask to receive Generic Data Transport (GDT)
session begin request event indications.
upload session begin request event indications.
- QMI_LOC_EVENT_MASK_GDT_UPLOAD_END_REQ (0x10000000) -- The control point must enable this mask to receive GDT
session end request event indications.
upload session end request event indications.
- QMI_LOC_EVENT_MASK_GEOFENCE_BATCH_DWELL_NOTIFICATION (0x20000000) -- The control point must enable this mask to receive notifications when
a Geofence is dwelled. These events are generated when a UE enters
or leaves the perimeter of a Geofence and dwells inside or outside for a specified time.
@@ -3599,6 +3599,8 @@ typedef struct {
@}
*/
typedef uint32_t qmiLocGdtDownloadReqMaskT_v02;
#define QMI_LOC_GDT_DOWNLOAD_REQ_MASK_DBH_V02 ((qmiLocGdtDownloadReqMaskT_v02)0x00000001) /**< Bitmask to specify whether DBH is on or off for the request */
/** @addtogroup loc_qmi_messages
@{
*/
@@ -3642,10 +3644,10 @@ typedef struct {
*/
/* Mandatory */
/* Data Filepath */
/* Data Filepath (Null terminated) */
uint32_t filePath_len; /**< Must be set to # of elements in filePath */
char filePath[QMI_LOC_MAX_GDT_PATH_LEN_V02];
/**< File path to the position data expected by the MP. \n
/**< File path to the GTP response data that is applicable to MP. \n
- Type: Array of bytes \n
- Maximum length of the array: 255
*/
@@ -3661,6 +3663,12 @@ typedef struct {
uint8_t powerBudgetAllowance_valid; /**< Must be set to true if powerBudgetAllowance is being passed */
uint32_t powerBudgetAllowance;
/**< Power budget allowance. */
/* Optional */
/* Download Request Mask */
uint8_t downloadRequestMask_valid; /**< Must be set to true if downloadRequestMask is being passed */
qmiLocGdtDownloadReqMaskT_v02 downloadRequestMask;
/**< Download Request Mask */
}qmiLocEventGdtDownloadBeginReqIndMsgT_v02; /* Message */
/**
@}
@@ -6236,9 +6244,9 @@ typedef struct {
using the context ID in this indication. The context of a Geofence may contain Wi-Fi area ID lists, IBeacon lists,
Cell-ID list, and so forth.
- QMI_LOC_EVENT_MASK_GDT_UPLOAD_BEGIN_REQ (0x08000000) -- The control point must enable this mask to receive Generic Data Transport (GDT)
session begin request event indications.
upload session begin request event indications.
- QMI_LOC_EVENT_MASK_GDT_UPLOAD_END_REQ (0x10000000) -- The control point must enable this mask to receive GDT
session end request event indications.
upload session end request event indications.
- QMI_LOC_EVENT_MASK_GEOFENCE_BATCH_DWELL_NOTIFICATION (0x20000000) -- The control point must enable this mask to receive notifications when
a Geofence is dwelled. These events are generated when a UE enters
or leaves the perimeter of a Geofence and dwells inside or outside for a specified time.
@@ -13881,7 +13889,7 @@ typedef struct {
/* Data */
uint32_t ClientDownloadedData_len; /**< Must be set to # of elements in ClientDownloadedData */
char ClientDownloadedData[QMI_LOC_MAX_GTP_WWAN_CLIENT_DOWNLOADED_DATA_LEN_V02];
/**< All GTP response client downloaded data, including WWAN, WLAN, common, etc. \n
/**< WWAN client downloaded data. \n
- Type: Array of bytes \n
- Maximum length of the array: 512
*/
@@ -14179,13 +14187,16 @@ typedef struct {
*/
typedef enum {
QMILOCGTPPROCESSSTATUSENUMT_MIN_ENUM_VAL_V02 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/
eQMI_LOC_GTP_PROCESS_SUCCESS_FROM_LOCAL_V02 = 1, /**< DL processing is allowed using a local AP cache */
eQMI_LOC_GTP_PROCESS_SUCCESS_FROM_SERVER_V02 = 2, /**< DL processing is allowed using server access */
eQMI_LOC_GTP_PROCESS_SUCCESS_FROM_LOCAL_V02 = 1, /**< DL processing is processed successfully locally */
eQMI_LOC_GTP_PROCESS_SUCCESS_FROM_SERVER_V02 = 2, /**< DL processing is processed successfully via server access */
eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_AP_NOT_READY_V02 = 3, /**< DL processing is not allowed because the AP is not ready */
eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_AP_TIMEOUT_V02 = 4, /**< DL processing is not allowed because the AP cannot process within the given interval */
eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_NO_CONNECTIVITY_V02 = 5, /**< DL processing is not allowed because the AP has no connectivity */
eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_THROTTLED_V02 = 6, /**< DL processing is not allowed due to throttling */
eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_OTHER_V02 = 7, /**< DL processing is not allowed for any other reason */
eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_NO_CONNECTIVITY_V02 = 5, /**< DL processing via server is not allowed since AP has no connectivity but
will be processed locally */
eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_THROTTLED_V02 = 6, /**< DL processing via server is not allowed due to throttling but will be
processed locally */
eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_OTHER_V02 = 7, /**< DL processing via server is not allowed for any other reason but will be
processed locally */
eQMI_LOC_GTP_PROCESS_FAILED_UNSPECIFIED_V02 = 8, /**< DL processing failed for any other reason */
QMILOCGTPPROCESSSTATUSENUMT_MAX_ENUM_VAL_V02 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/
}qmiLocGtpProcessStatusEnumT_v02;
@@ -14196,7 +14207,7 @@ typedef enum {
/** @addtogroup loc_qmi_messages
@{
*/
/** Request Message; Sends a GTP message to the MP notifying it of AP DB readiness. */
/** Request Message; Sends a GTP message to MP notifying MP of AP download response. */
typedef struct {
/* Mandatory */
@@ -14218,13 +14229,16 @@ typedef struct {
/**< AP processing status information for this service ID.
Valid values: \n
- eQMI_LOC_GTP_PROCESS_SUCCESS_FROM_LOCAL (1) -- DL processing is allowed using a local AP cache
- eQMI_LOC_GTP_PROCESS_SUCCESS_FROM_SERVER (2) -- DL processing is allowed using server access
- eQMI_LOC_GTP_PROCESS_SUCCESS_FROM_LOCAL (1) -- DL processing is processed successfully locally
- eQMI_LOC_GTP_PROCESS_SUCCESS_FROM_SERVER (2) -- DL processing is processed successfully via server access
- eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_AP_NOT_READY (3) -- DL processing is not allowed because the AP is not ready
- eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_AP_TIMEOUT (4) -- DL processing is not allowed because the AP cannot process within the given interval
- eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_NO_CONNECTIVITY (5) -- DL processing is not allowed because the AP has no connectivity
- eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_THROTTLED (6) -- DL processing is not allowed due to throttling
- eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_OTHER (7) -- DL processing is not allowed for any other reason
- eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_NO_CONNECTIVITY (5) -- DL processing via server is not allowed since AP has no connectivity but
will be processed locally
- eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_THROTTLED (6) -- DL processing via server is not allowed due to throttling but will be
processed locally
- eQMI_LOC_GTP_PROCESS_NOT_ALLOWED_OTHER (7) -- DL processing via server is not allowed for any other reason but will be
processed locally
- eQMI_LOC_GTP_PROCESS_FAILED_UNSPECIFIED (8) -- DL processing failed for any other reason
*/
@@ -14243,6 +14257,12 @@ typedef struct {
- Type: Array of bytes \n
- Maximum length of the array: 256
*/
/* Optional */
/* AP Remaining Throttle Time */
uint8_t apRemainingThrottleTime_valid; /**< Must be set to true if apRemainingThrottleTime is being passed */
uint32_t apRemainingThrottleTime;
/**< Remaining time in seconds during which AP will remain throttled for server access. */
}qmiLocGdtDownloadBeginStatusReqMsgT_v02; /* Message */
/**
@}
@@ -14251,7 +14271,7 @@ typedef struct {
/** @addtogroup loc_qmi_messages
@{
*/
/** Indication Message; Sends a GTP message to the MP notifying it of AP DB readiness. */
/** Indication Message; Sends a GTP message to MP notifying MP of AP download response. */
typedef struct {
/* Mandatory */
@@ -14314,7 +14334,7 @@ typedef struct {
*/
/* Mandatory */
/* Data File Path (non-NULL Terminated) */
/* Data File Path (NULL Terminated) */
uint32_t filePath_len; /**< Must be set to # of elements in filePath */
char filePath[QMI_LOC_MAX_GDT_PATH_LEN_V02];
/**< File path to the data. \n

View File

@@ -204,5 +204,17 @@ public class QtiCallConstants {
/* Invalid phone Id */
public static final int INVALID_PHONE_ID = -1;
/**
* Extra indicating the Wifi Quality
* <p>
* Type: int (one of the VOWIFI_QUALITY_* values)
*/
public static final String VOWIFI_CALL_QUALITY_EXTRA_KEY = "VoWiFiCallQuality";
public static final int VOWIFI_QUALITY_NONE = 0;
public static final int VOWIFI_QUALITY_EXCELLENT = 1;
public static final int VOWIFI_QUALITY_FAIR = 2;
public static final int VOWIFI_QUALITY_POOR = 4;
}

View File

@@ -44,4 +44,16 @@ public class QtiCarrierConfigs {
/* Flag specifying whether video calls are supported if device is in low battery or not */
public static final String ALLOW_VIDEO_CALL_IN_LOW_BATTERY = "allow_video_call_in_low_battery";
/**
* Flag indicating whether preview video needs to be hidden during
* video conference call.
*/
public static final String HIDE_PREVIEW_IN_VT_CONFERENCE =
"config_hide_preview_in_vt_confcall";
/* Flag specifying whether IMS to CS retry should be available for carrier
false - hard disabled.
true - then depends on user preference */
public static final String CONFIG_CS_RETRY = "config_carrier_cs_retry_available";
}

View File

@@ -71,6 +71,11 @@ public abstract class QtiImsExtBase {
onSendCallDeflectRequest(phoneId, deflectNumber, listener);
}
@Override
public void resumePendingCall(int videoState) {
onResumePendingCall(videoState);
}
@Override
public void sendCallTransferRequest(int phoneId, int type, String number,
IQtiImsExtListener listener) {
@@ -96,6 +101,12 @@ public abstract class QtiImsExtBase {
public void registerForViceRefreshInfo(IQtiImsExtListener listener) {
onRegisterForViceRefreshInfo(listener);
}
@Override
public void registerForParticipantStatusInfo(IQtiImsExtListener listener) {
onRegisterForParticipantStatusInfo(listener);
}
};
private QtiImsExtBinder mQtiImsExtBinder;
@@ -126,6 +137,9 @@ public abstract class QtiImsExtBase {
IQtiImsExtListener listener) {
// no-op
}
protected void onResumePendingCall(int videoState) {
// no-op
}
protected void onSendCallTransferRequest(int phoneId, int type, String number,
IQtiImsExtListener listener) {
// no-op
@@ -142,4 +156,7 @@ public abstract class QtiImsExtBase {
protected void onRegisterForViceRefreshInfo(IQtiImsExtListener listener) {
// no-op
}
protected void onRegisterForParticipantStatusInfo(IQtiImsExtListener listener) {
// no-op
}
}

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -76,5 +76,10 @@ public class QtiImsExtListenerBaseImpl extends IQtiImsExtListener.Stub {
@Override
public void notifyRefreshViceInfo(QtiViceInfo viceInfo) {
}
@Override
public void notifyParticipantStatusInfo(int operation, int sipStatus,
String participantUri, boolean isEct) {
}
}

View File

@@ -123,6 +123,15 @@ public class QtiImsExtManager {
}
}
public void resumePendingCall(int videoState) throws QtiImsException {
obtainBinder();
try {
mQtiImsExt.resumePendingCall(videoState);
} catch(RemoteException e) {
throw new QtiImsException("Remote ImsService resumePendingCall : " + e);
}
}
public void sendCallTransferRequest(int phoneId, int type, String number,
IQtiImsExtListener listener) throws QtiImsException {
obtainBinder();
@@ -171,6 +180,16 @@ public class QtiImsExtManager {
}
}
public void registerForParticipantStatusInfo(IQtiImsExtListener listener)
throws QtiImsException {
obtainBinder();
try {
mQtiImsExt.registerForParticipantStatusInfo(listener);
} catch(RemoteException e) {
throw new QtiImsException("Remote ImsService registerForParticipantStatusInfo : " + e);
}
}
/**
* Check if binder is available, else try to retrieve it from ServiceManager
* if binder still doesn't exists throw {@link QtiImsException}

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -144,13 +144,32 @@ interface IQtiImsExt {
*/
int getImsPhoneId();
/**
* resumePendingCall
* This API shall continue to place DIAL request with videoState as either
* Video or Voice based on user confirmation on low battery MO Video call
*
* @param videoState indicates either Video or Voice type
* @return void
*/
oneway void resumePendingCall(int videoState);
/**
* Register for VICE dialog
*
* @param listener, provided if caller needs to be notified for get result.
* @param listener, to get notified for VICE refresh information.
* @return void
*
*/
oneway void registerForViceRefreshInfo(IQtiImsExtListener listener);
/**
* Register for Pariticipant status information
*
* @param listener, to get notified for participant status information.
* @return void
*
*/
oneway void registerForParticipantStatusInfo(IQtiImsExtListener listener);
}

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -137,4 +137,20 @@ oneway interface IQtiImsExtListener {
* @return void.
*/
void notifyRefreshViceInfo(in QtiViceInfo viceInfo);
/**
* Notifies client when Participant status information is received
*
* @param operation - operation add or remove participant
* @param sipStatus - sip code indicating status of operation
* 180 - Ringing, 603 - remote user rejected the call
* 200 - Remote user accepted the call, if operation is add
* Participant removed successfully if operation is remove
* @param participantUri - Participant URI
* @param isEct - Explicit call transfer true or false
*
* @return void.
*/
void notifyParticipantStatusInfo(int operation, int sipStatus,
String participantUri, boolean isEct);
}

View File

@@ -139,6 +139,15 @@ public class QtiImsExtUtils {
return SystemProperties.getBoolean("persist.radio.ims_call_transfer", false);
}
/**
* This API checks to see whether IMS to CS retry is enabled or not.
* @param context context for getting the CS retry configuration value
* Returns true if enabled, or false otherwise.
*/
public static boolean isCsRetryConfigEnabled(Context context) {
return isCarrierConfigEnabled(context, QtiCarrierConfigs.CONFIG_CS_RETRY);
}
/**
* Returns true if config flag is enabled.
*/
@@ -158,6 +167,11 @@ public class QtiImsExtUtils {
return isCarrierConfigEnabled(context, QtiCarrierConfigs.ALLOW_VIDEO_CALL_IN_LOW_BATTERY);
}
public static boolean shallHidePreviewInVtConference(Context context) {
return isCarrierConfigEnabled(context,
QtiCarrierConfigs.HIDE_PREVIEW_IN_VT_CONFERENCE);
}
private static PersistableBundle getConfigForDefaultImsPhoneId(Context context) {
return getConfigForPhoneId(context, getImsPhoneId());
}