summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorVamana Murthi <vthuniki@codeaurora.org>2016-05-10 18:16:40 +0530
committerKevin Tang <zhikait@codeaurora.org>2016-05-12 18:11:31 -0700
commit35877af173aeb6363b77f3a1a3d024cb85ce590f (patch)
tree8c1042d39dc7ce6ae4e06ff03e92fc10f5ecd4a7 /core
parent7bf29855bf49c21458b4dd434400602997d89aac (diff)
parentbc1348c51543518d0d32aa922392d421bad20e9d (diff)
downloadgps-35877af173aeb6363b77f3a1a3d024cb85ce590f.tar.gz
Merge remote-tracking branch 'origin/location.lnx.1.0-rel.1.0' into HEAD
git merge upto CRT tag location.lnx.1.0-00036 to private_n_location.lnx Change-Id: I922daaa9a8c2745095ec9d425192d3649657e76c CRs-Fixed: 1015000
Diffstat (limited to 'core')
-rw-r--r--core/Android.mk6
-rw-r--r--core/ContextBase.cpp6
-rw-r--r--core/LocAdapterBase.cpp2
-rw-r--r--core/LocApiBase.cpp8
-rw-r--r--core/LocApiBase.h6
-rw-r--r--core/LocDualContext.cpp6
-rw-r--r--core/Makefile.am46
-rw-r--r--core/UlpProxyBase.h1
-rw-r--r--core/gps_extended.h17
-rw-r--r--core/gps_extended_c.h62
-rw-r--r--core/loc_core_log.cpp2
11 files changed, 141 insertions, 21 deletions
diff --git a/core/Android.mk b/core/Android.mk
index c6d3128..3650fbb 100644
--- a/core/Android.mk
+++ b/core/Android.mk
@@ -20,7 +20,8 @@ LOCAL_SHARED_LIBRARIES := \
libutils \
libcutils \
libgps.utils \
- libdl
+ libdl \
+ libloc_pla
LOCAL_SRC_FILES += \
LocApiBase.cpp \
@@ -35,7 +36,8 @@ LOCAL_CFLAGS += \
LOCAL_C_INCLUDES:= \
$(TARGET_OUT_HEADERS)/gps.utils \
- $(TARGET_OUT_HEADERS)/libflp
+ $(TARGET_OUT_HEADERS)/libflp \
+ $(TARGET_OUT_HEADERS)/libloc_pla
LOCAL_COPY_HEADERS_TO:= libloc_core/
LOCAL_COPY_HEADERS:= \
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp
index 9f6c4aa..58dc8a7 100644
--- a/core/ContextBase.cpp
+++ b/core/ContextBase.cpp
@@ -35,7 +35,7 @@
#include <ContextBase.h>
#include <msg_q.h>
#include <loc_target.h>
-#include <log_util.h>
+#include <platform_lib_includes.h>
#include <loc_log.h>
namespace loc_core {
@@ -52,6 +52,10 @@ LBSProxyBase* ContextBase::getLBSProxy(const char* libName)
proxy = (*getter)();
}
}
+ else
+ {
+ LOC_LOGW("%s:%d]: FAILED TO LOAD libname: %s\n", __func__, __LINE__, libName);
+ }
if (NULL == proxy) {
proxy = new LBSProxyBase();
}
diff --git a/core/LocAdapterBase.cpp b/core/LocAdapterBase.cpp
index d4727d8..d3082e2 100644
--- a/core/LocAdapterBase.cpp
+++ b/core/LocAdapterBase.cpp
@@ -32,7 +32,7 @@
#include <dlfcn.h>
#include <LocAdapterBase.h>
#include <loc_target.h>
-#include <log_util.h>
+#include <platform_lib_log_util.h>
#include <LocAdapterProxyBase.h>
namespace loc_core {
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp
index 3a274ed..7c11470 100644
--- a/core/LocApiBase.cpp
+++ b/core/LocApiBase.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -32,7 +32,7 @@
#include <dlfcn.h>
#include <LocApiBase.h>
#include <LocAdapterBase.h>
-#include <log_util.h>
+#include <platform_lib_log_util.h>
#include <LocDualContext.h>
namespace loc_core {
@@ -444,6 +444,10 @@ enum loc_api_adapter_err LocApiBase::
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
+ setNMEATypes (uint32_t typesMask)
+DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+
+enum loc_api_adapter_err LocApiBase::
setLPPConfig(uint32_t profile)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
diff --git a/core/LocApiBase.h b/core/LocApiBase.h
index 744c688..e92cdaa 100644
--- a/core/LocApiBase.h
+++ b/core/LocApiBase.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -33,7 +33,7 @@
#include <ctype.h>
#include <gps_extended.h>
#include <MsgTask.h>
-#include <log_util.h>
+#include <platform_lib_log_util.h>
namespace loc_core {
class ContextBase;
@@ -172,6 +172,8 @@ public:
virtual enum loc_api_adapter_err
setSUPLVersion(uint32_t version);
virtual enum loc_api_adapter_err
+ setNMEATypes (uint32_t typesMask);
+ virtual enum loc_api_adapter_err
setLPPConfig(uint32_t profile);
virtual enum loc_api_adapter_err
setSensorControlConfig(int sensorUsage, int sensorProvider);
diff --git a/core/LocDualContext.cpp b/core/LocDualContext.cpp
index 578421c..74b2903 100644
--- a/core/LocDualContext.cpp
+++ b/core/LocDualContext.cpp
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <LocDualContext.h>
#include <msg_q.h>
-#include <log_util.h>
+#include <platform_lib_log_util.h>
#include <loc_log.h>
namespace loc_core {
@@ -59,7 +59,11 @@ ContextBase* LocDualContext::mBgContext = NULL;
ContextBase* LocDualContext::mInjectContext = NULL;
// the name must be shorter than 15 chars
const char* LocDualContext::mLocationHalName = "Loc_hal_worker";
+#ifndef USE_GLIB
const char* LocDualContext::mLBSLibName = "liblbs_core.so";
+#else
+const char* LocDualContext::mLBSLibName = "liblbs_core.so.1";
+#endif
pthread_mutex_t LocDualContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER;
diff --git a/core/Makefile.am b/core/Makefile.am
new file mode 100644
index 0000000..341153a
--- /dev/null
+++ b/core/Makefile.am
@@ -0,0 +1,46 @@
+AM_CFLAGS = -I./ \
+ -I../utils \
+ $(LOCPLA_CFLAGS) \
+ -I$(WORKSPACE)/gps-noship/flp \
+ -D__func__=__PRETTY_FUNCTION__ \
+ -fno-short-enums
+
+libloc_core_la_h_sources = \
+ LocApiBase.h \
+ LocAdapterBase.h \
+ ContextBase.h \
+ LocDualContext.h \
+ LBSProxyBase.h \
+ UlpProxyBase.h \
+ gps_extended_c.h \
+ gps_extended.h \
+ loc_core_log.h \
+ LocAdapterProxyBase.h
+
+libloc_core_la_c_sources = \
+ LocApiBase.cpp \
+ LocAdapterBase.cpp \
+ ContextBase.cpp \
+ LocDualContext.cpp \
+ loc_core_log.cpp
+
+library_includedir = $(pkgincludedir)/core
+
+library_include_HEADERS = $(libloc_core_la_h_sources)
+
+libloc_core_la_SOURCES = $(libloc_core_la_c_sources)
+
+if USE_GLIB
+libloc_core_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
+libloc_core_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
+libloc_core_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
+else
+libloc_core_la_CFLAGS = $(AM_CFLAGS)
+libloc_core_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
+libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
+endif
+
+libloc_core_la_LIBADD = -lstdc++ -ldl $(LOCPLA_LIBS) ../utils/libgps_utils_so.la
+
+#Create and Install libraries
+lib_LTLIBRARIES = libloc_core.la
diff --git a/core/UlpProxyBase.h b/core/UlpProxyBase.h
index ed99e5b..c5cf972 100644
--- a/core/UlpProxyBase.h
+++ b/core/UlpProxyBase.h
@@ -31,7 +31,6 @@
#include <gps_extended.h>
#include "fused_location_extended.h"
-
namespace loc_core {
class LocAdapterBase;
diff --git a/core/gps_extended.h b/core/gps_extended.h
index 88b0415..b6d7a41 100644
--- a/core/gps_extended.h
+++ b/core/gps_extended.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -29,11 +29,19 @@
#ifndef GPS_EXTENDED_H
#define GPS_EXTENDED_H
+#include <gps_extended_c.h>
+/**
+ * @file
+ * @brief C++ declarations for GPS types
+ */
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-#include <gps_extended_c.h>
+#if defined(USE_GLIB) || defined(OFF_TARGET)
+#include <string.h>
+#endif
struct LocPosMode
{
@@ -48,7 +56,8 @@ struct LocPosMode
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),
+ min_interval(gap < GPS_MIN_POSSIBLE_FIX_INTERVAL_MS ?
+ GPS_MIN_POSSIBLE_FIX_INTERVAL_MS : gap),
preferred_accuracy(accu), preferred_time(time) {
memset(credentials, 0, sizeof(credentials));
memset(provider, 0, sizeof(provider));
@@ -63,7 +72,7 @@ struct LocPosMode
inline LocPosMode() :
mode(LOC_POSITION_MODE_MS_BASED),
recurrence(GPS_POSITION_RECURRENCE_PERIODIC),
- min_interval(MIN_POSSIBLE_FIX_INTERVAL),
+ min_interval(GPS_DEFAULT_FIX_INTERVAL_MS),
preferred_accuracy(50), preferred_time(120000) {
memset(credentials, 0, sizeof(credentials));
memset(provider, 0, sizeof(provider));
diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h
index 415e763..9b677b8 100644
--- a/core/gps_extended_c.h
+++ b/core/gps_extended_c.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -29,16 +29,21 @@
#ifndef GPS_EXTENDED_C_H
#define GPS_EXTENDED_C_H
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
#include <ctype.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <hardware/gps.h>
+/**
+ * @file
+ * @brief C++ declarations for GPS types
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/** Location has valid source information. */
#define LOCATION_HAS_SOURCE_INFO 0x0020
/** GpsLocation has valid "is indoor?" flag */
@@ -195,7 +200,24 @@ typedef enum loc_position_mode_type {
} LocPositionMode;
-#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */
+/**
+ * @brief Minimum allowed value for fix interval.
+ *
+ * This value is a sanity limit in GPS framework. The hardware has own internal
+ * limits that may not match this value
+ *
+ * @sa GPS_DEFAULT_FIX_INTERVAL_MS
+ */
+
+#define GPS_MIN_POSSIBLE_FIX_INTERVAL_MS 100
+/**
+ * @brief Default value for fix interval.
+ *
+ * This value is used by default whenever appropriate.
+ *
+ * @sa GPS_MIN_POSSIBLE_FIX_INTERVAL_MS
+ */
+#define GPS_DEFAULT_FIX_INTERVAL_MS 1000
/** Flags to indicate which values are valid in a GpsLocationExtended. */
typedef uint16_t GpsLocationExtendedFlags;
@@ -283,6 +305,34 @@ typedef uint32_t LocPosTechMask;
#define LOC_POS_TECH_MASK_AFLT ((LocPosTechMask)0x00000040)
#define LOC_POS_TECH_MASK_HYBRID ((LocPosTechMask)0x00000080)
+// Nmea sentence types mask
+typedef uint32_t NmeaSentenceTypesMask;
+#define LOC_NMEA_MASK_GGA_V02 ((NmeaSentenceTypesMask)0x00000001) /**< Enable GGA type */
+#define LOC_NMEA_MASK_RMC_V02 ((NmeaSentenceTypesMask)0x00000002) /**< Enable RMC type */
+#define LOC_NMEA_MASK_GSV_V02 ((NmeaSentenceTypesMask)0x00000004) /**< Enable GSV type */
+#define LOC_NMEA_MASK_GSA_V02 ((NmeaSentenceTypesMask)0x00000008) /**< Enable GSA type */
+#define LOC_NMEA_MASK_VTG_V02 ((NmeaSentenceTypesMask)0x00000010) /**< Enable VTG type */
+#define LOC_NMEA_MASK_PQXFI_V02 ((NmeaSentenceTypesMask)0x00000020) /**< Enable PQXFI type */
+#define LOC_NMEA_MASK_PSTIS_V02 ((NmeaSentenceTypesMask)0x00000040) /**< Enable PSTIS type */
+#define LOC_NMEA_MASK_GLGSV_V02 ((NmeaSentenceTypesMask)0x00000080) /**< Enable GLGSV type */
+#define LOC_NMEA_MASK_GNGSA_V02 ((NmeaSentenceTypesMask)0x00000100) /**< Enable GNGSA type */
+#define LOC_NMEA_MASK_GNGNS_V02 ((NmeaSentenceTypesMask)0x00000200) /**< Enable GNGNS type */
+#define LOC_NMEA_MASK_GARMC_V02 ((NmeaSentenceTypesMask)0x00000400) /**< Enable GARMC type */
+#define LOC_NMEA_MASK_GAGSV_V02 ((NmeaSentenceTypesMask)0x00000800) /**< Enable GAGSV type */
+#define LOC_NMEA_MASK_GAGSA_V02 ((NmeaSentenceTypesMask)0x00001000) /**< Enable GAGSA type */
+#define LOC_NMEA_MASK_GAVTG_V02 ((NmeaSentenceTypesMask)0x00002000) /**< Enable GAVTG type */
+#define LOC_NMEA_MASK_GAGGA_V02 ((NmeaSentenceTypesMask)0x00004000) /**< Enable GAGGA type */
+#define LOC_NMEA_MASK_PQGSA_V02 ((NmeaSentenceTypesMask)0x00008000) /**< Enable PQGSA type */
+#define LOC_NMEA_MASK_PQGSV_V02 ((NmeaSentenceTypesMask)0x00010000) /**< Enable PQGSV type */
+#define LOC_NMEA_ALL_SUPPORTED_MASK (LOC_NMEA_MASK_GGA_V02 | LOC_NMEA_MASK_RMC_V02 | \
+ LOC_NMEA_MASK_GSV_V02 | LOC_NMEA_MASK_GSA_V02 | LOC_NMEA_MASK_VTG_V02 | \
+ LOC_NMEA_MASK_PQXFI_V02 | LOC_NMEA_MASK_PSTIS_V02 | LOC_NMEA_MASK_GLGSV_V02 | \
+ LOC_NMEA_MASK_GNGSA_V02 | LOC_NMEA_MASK_GNGNS_V02 | LOC_NMEA_MASK_GARMC_V02 | \
+ LOC_NMEA_MASK_GAGSV_V02 | LOC_NMEA_MASK_GAGSA_V02 | LOC_NMEA_MASK_GAVTG_V02 | \
+ LOC_NMEA_MASK_GAGGA_V02 | LOC_NMEA_MASK_PQGSA_V02 | LOC_NMEA_MASK_PQGSV_V02 )
+
+
+
typedef enum {
LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0,
LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM,
diff --git a/core/loc_core_log.cpp b/core/loc_core_log.cpp
index 3ca6c0a..4556fae 100644
--- a/core/loc_core_log.cpp
+++ b/core/loc_core_log.cpp
@@ -31,8 +31,8 @@
#define LOG_TAG "LocSvc_core_log"
#include <loc_log.h>
-#include <log_util.h>
#include <loc_core_log.h>
+#include <platform_lib_includes.h>
void LocPosMode::logv() const
{