sm8250-common: import location from LA.UM.9.12.r1-13500.01-SMxx50.QSSI12.0
Change-Id: If93ba9b50dc3bb07a4ba81694187e99f58dd172c
This commit is contained in:
parent
72410cf795
commit
64ab05b033
103 changed files with 92521 additions and 0 deletions
7
location/synergy_loc_api/Android.bp
Normal file
7
location/synergy_loc_api/Android.bp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
cc_library_headers {
|
||||
|
||||
name: "libsynergyloc_api_headers",
|
||||
export_include_dirs: ["."],
|
||||
vendor: true,
|
||||
}
|
||||
40
location/synergy_loc_api/Android.mk
Normal file
40
location/synergy_loc_api/Android.mk
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libsynergy_loc_api
|
||||
# activate the following line for debug purposes only, comment out for production
|
||||
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
|
||||
|
||||
LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
|
||||
LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libutils \
|
||||
libcutils \
|
||||
libqmi_cci \
|
||||
libqmi_common_so \
|
||||
libloc_core \
|
||||
libgps.utils \
|
||||
libdl \
|
||||
liblog
|
||||
|
||||
LOCAL_SRC_FILES = \
|
||||
SynergyLocApi.cpp
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-fno-short-enums \
|
||||
-D_ANDROID_
|
||||
|
||||
## Includes
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libloc_core_headers \
|
||||
libgps.utils_headers \
|
||||
libloc_pla_headers \
|
||||
loc_sll_if_headers \
|
||||
liblocation_api_headers
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
2764
location/synergy_loc_api/SynergyLocApi.cpp
Normal file
2764
location/synergy_loc_api/SynergyLocApi.cpp
Normal file
File diff suppressed because it is too large
Load diff
189
location/synergy_loc_api/SynergyLocApi.h
Normal file
189
location/synergy_loc_api/SynergyLocApi.h
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
/* Copyright (c) 2019-2020, 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 SYNERGY_LOC_API_H
|
||||
#define SYNERGY_LOC_API_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <LocApiBase.h>
|
||||
#include <loc_sll_interface.h>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
|
||||
#define LOC_CLIENT_INVALID_HANDLE_VALUE (NULL)
|
||||
|
||||
using Resender = std::function<void()>;
|
||||
|
||||
using namespace std;
|
||||
using namespace loc_core;
|
||||
|
||||
|
||||
/* This class derives from the LocApiBase class.
|
||||
The members of this class are responsible for converting
|
||||
the Synergy Location API data structures into Loc Adapter data structures.
|
||||
This class also implements some of the virtual functions that
|
||||
handle the requests from loc engine. */
|
||||
class SynergyLocApi : public LocApiBase {
|
||||
protected:
|
||||
|
||||
|
||||
private:
|
||||
bool mInSession;
|
||||
GnssPowerMode mPowerMode;
|
||||
bool mEngineOn;
|
||||
bool mMeasurementsStarted;
|
||||
std::vector<Resender> mResenders;
|
||||
bool mIsMasterRegistered;
|
||||
bool mMasterRegisterNotSupported;
|
||||
GnssSvMeasurementSet* mSvMeasurementSet;
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mSlMask;
|
||||
|
||||
const SllInterfaceReq *sllReqIf;
|
||||
|
||||
void registerEventMask(LOC_API_ADAPTER_EVENT_MASK_T adapterMask);
|
||||
|
||||
|
||||
protected:
|
||||
virtual enum loc_api_adapter_err
|
||||
open(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
||||
virtual enum loc_api_adapter_err
|
||||
close();
|
||||
|
||||
SynergyLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase *context = NULL);
|
||||
virtual ~SynergyLocApi();
|
||||
|
||||
public:
|
||||
static LocApiBase* createSynergyLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase* context);
|
||||
|
||||
|
||||
virtual void startFix(const LocPosMode& posMode,
|
||||
LocApiResponse *adapterResponse);
|
||||
|
||||
virtual void stopFix(LocApiResponse *adapterResponse);
|
||||
|
||||
virtual void setPositionMode(const LocPosMode& mode);
|
||||
|
||||
virtual void
|
||||
setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
|
||||
virtual int getNumSvUsed (uint64_t svUsedIdsMask, int totalSvCntInOneConstellation);
|
||||
|
||||
virtual void
|
||||
injectPosition(const Location& location, bool onDemandCpi);
|
||||
|
||||
virtual void
|
||||
injectPosition(const GnssLocationInfoNotification &locationInfo, bool onDemandCpi);
|
||||
|
||||
virtual void
|
||||
deleteAidingData(const GnssAidingData& data, LocApiResponse *adapterResponse);
|
||||
|
||||
virtual void
|
||||
informNiResponse(GnssNiResponse userResponse, const void* passThroughData);
|
||||
|
||||
virtual LocationError
|
||||
setServerSync(const char* url, int len, LocServerType type);
|
||||
|
||||
virtual LocationError
|
||||
setServerSync(unsigned int ip, int port, LocServerType type);
|
||||
|
||||
virtual void
|
||||
atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen, AGpsBearerType bear,
|
||||
LocAGpsType agpsType, LocApnTypeMask mask);
|
||||
virtual void atlCloseStatus(int handle, int is_succ);
|
||||
virtual LocationError setSUPLVersionSync(GnssConfigSuplVersion version);
|
||||
|
||||
virtual enum loc_api_adapter_err setNMEATypesSync(uint32_t typesMask);
|
||||
|
||||
virtual LocationError setLPPConfigSync(GnssConfigLppProfileMask profileMask);
|
||||
|
||||
|
||||
virtual enum loc_api_adapter_err
|
||||
setSensorPropertiesSync(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
|
||||
setSensorPerfControlConfigSync(int controlMode, int accelSamplesPerBatch,
|
||||
int accelBatchesPerSec, int gyroSamplesPerBatch, int gyroBatchesPerSec,
|
||||
int accelSamplesPerBatchHigh, int accelBatchesPerSecHigh,
|
||||
int gyroSamplesPerBatchHigh, int gyroBatchesPerSecHigh, int algorithmConfig);
|
||||
virtual LocationError
|
||||
setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol);
|
||||
virtual LocationError setLPPeProtocolCpSync(GnssConfigLppeControlPlaneMask lppeCP);
|
||||
virtual LocationError setLPPeProtocolUpSync(GnssConfigLppeUserPlaneMask lppeUP);
|
||||
virtual void getWwanZppFix();
|
||||
virtual void getBestAvailableZppFix();
|
||||
virtual LocationError setGpsLockSync(GnssConfigGpsLock lock);
|
||||
virtual void setConstrainedTuncMode(bool enabled,
|
||||
float tuncConstraint,
|
||||
uint32_t energyBudget,
|
||||
LocApiResponse* adapterResponse=nullptr);
|
||||
virtual void setPositionAssistedClockEstimatorMode(bool enabled,
|
||||
LocApiResponse* adapterResponse=nullptr);
|
||||
virtual void getGnssEnergyConsumed();
|
||||
virtual void requestForAidingData(GnssAidingDataSvMask svDataMask);
|
||||
|
||||
virtual LocationError setXtraVersionCheckSync(uint32_t check);
|
||||
|
||||
virtual void startTimeBasedTracking(const TrackingOptions& options,
|
||||
LocApiResponse* adapterResponse);
|
||||
virtual void stopTimeBasedTracking(LocApiResponse* adapterResponse);
|
||||
virtual void startDistanceBasedTracking(uint32_t sessionId, const LocationOptions& options,
|
||||
LocApiResponse* adapterResponse);
|
||||
virtual void stopDistanceBasedTracking(uint32_t sessionId,
|
||||
LocApiResponse* adapterResponse = nullptr);
|
||||
|
||||
virtual GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion);
|
||||
virtual GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask);
|
||||
virtual GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask);
|
||||
|
||||
/* Requests for SV/Constellation Control */
|
||||
virtual LocationError setBlacklistSvSync(const GnssSvIdConfig& config);
|
||||
virtual void setBlacklistSv(const GnssSvIdConfig& config,
|
||||
LocApiResponse* adapterResponse=nullptr);
|
||||
virtual void getBlacklistSv();
|
||||
virtual void setConstellationControl(const GnssSvTypeConfig& config,
|
||||
LocApiResponse *adapterResponse=nullptr);
|
||||
virtual void getConstellationControl();
|
||||
virtual void resetConstellationControl(LocApiResponse *adapterResponse=nullptr);
|
||||
};
|
||||
|
||||
extern "C" LocApiBase* getLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase *context);
|
||||
|
||||
#endif //SYNERGY_LOC_API_H
|
||||
84
location/synergy_loc_api/synergy_loc_util_log.h
Normal file
84
location/synergy_loc_api/synergy_loc_util_log.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
/* Copyright (c) 2011-2012, 2014, 2019, 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 SYNERGY_LOCATION_UTIL_LOG_H
|
||||
#define SYNERGY_LOCATION_UTIL_LOG_H
|
||||
|
||||
#include <log_util.h>
|
||||
|
||||
#if defined(_ANDROID_)
|
||||
//#include "loc_api_v02_log.h"
|
||||
|
||||
#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__);
|
||||
#elif !defined(USE_GLIB)
|
||||
|
||||
// common for QNX and Griffon
|
||||
#if !defined (_ANDROID_) && !defined(USE_GLIB)
|
||||
//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 //!defined (_ANDROID_) && !defined(USE_GLIB)
|
||||
#endif //__LOC_API_V02_LOG_SILENT__
|
||||
|
||||
#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 <stdio.h>
|
||||
# include <asm/errno.h>
|
||||
# include <sys/time.h>
|
||||
|
||||
// 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 //SYNERGY_LOCATION_UTIL_LOG_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue