replace common qcom sources with samsung ones
This commit is contained in:
2
qcom/opensource/location/loc_api/Android.mk
Normal file
2
qcom/opensource/location/loc_api/Android.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(call all-subdir-makefiles)
|
||||
7
qcom/opensource/location/loc_api/loc_api_v02/Android.bp
Normal file
7
qcom/opensource/location/loc_api/loc_api_v02/Android.bp
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
cc_library_headers {
|
||||
|
||||
name: "libloc_api_v02_headers",
|
||||
export_include_dirs: ["."],
|
||||
vendor: true,
|
||||
}
|
||||
48
qcom/opensource/location/loc_api/loc_api_v02/Android.mk
Normal file
48
qcom/opensource/location/loc_api/loc_api_v02/Android.mk
Normal file
@@ -0,0 +1,48 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libloc_api_v02
|
||||
LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
|
||||
LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libutils \
|
||||
libcutils \
|
||||
libqmi_cci \
|
||||
libqmi_common_so \
|
||||
libloc_core \
|
||||
libgps.utils \
|
||||
libdl \
|
||||
liblog \
|
||||
libsemnativecarrierfeature
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
LocApiV02.cpp \
|
||||
loc_api_v02_log.cpp \
|
||||
loc_api_v02_client.cpp \
|
||||
loc_api_sync_req.cpp \
|
||||
location_service_v02.c \
|
||||
qmi_secgps_clnt.c \
|
||||
qmi_secgps_api_v01.c
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-fno-short-enums \
|
||||
-D_ANDROID_
|
||||
|
||||
## Includes
|
||||
LOCAL_C_INCLUDES := bionic external/stlport/stlport
|
||||
LOCAL_C_INCLUDES += vendor/samsung/configs/feature/CarrierFeature/libsemnativecarrierfeature
|
||||
LOCAL_C_INCLUDES += external/zlib
|
||||
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libloc_core_headers \
|
||||
libgps.utils_headers \
|
||||
libloc_pla_headers \
|
||||
liblocation_api_headers \
|
||||
libqmi_common_headers \
|
||||
libqmi_cci_headers
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
13571
qcom/opensource/location/loc_api/loc_api_v02/LocApiV02.cpp
Normal file
13571
qcom/opensource/location/loc_api/loc_api_v02/LocApiV02.cpp
Normal file
File diff suppressed because it is too large
Load Diff
721
qcom/opensource/location/loc_api/loc_api_v02/LocApiV02.h
Normal file
721
qcom/opensource/location/loc_api/loc_api_v02/LocApiV02.h
Normal file
@@ -0,0 +1,721 @@
|
||||
/* Copyright (c) 2011-2021, 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted (subject to the limitations in the
|
||||
disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef LOC_API_V_0_2_H
|
||||
#define LOC_API_V_0_2_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <loc_pla.h>
|
||||
#include <LocApiBase.h>
|
||||
#include <loc_api_v02_client.h>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
#include <SecGpsInterface.h> //SEC
|
||||
|
||||
#define LOC_SEND_SYNC_REQ(NAME, ID, REQ) \
|
||||
int rv = true; \
|
||||
locClientStatusEnumType st; \
|
||||
locClientReqUnionType reqUnion; \
|
||||
qmiLoc##NAME##IndMsgT_v02 ind; \
|
||||
\
|
||||
memset(&ind, 0, sizeof(ind)); \
|
||||
reqUnion.p##NAME##Req = &REQ; \
|
||||
\
|
||||
st = locSyncSendReq(QMI_LOC_##ID##_REQ_V02, \
|
||||
reqUnion, \
|
||||
LOC_ENGINE_SYNC_REQUEST_TIMEOUT, \
|
||||
QMI_LOC_##ID##_IND_V02, \
|
||||
&ind); \
|
||||
\
|
||||
if (st != eLOC_CLIENT_SUCCESS || \
|
||||
eQMI_LOC_SUCCESS_V02 != ind.status) { \
|
||||
rv = false; \
|
||||
}
|
||||
|
||||
using Resender = std::function<void()>;
|
||||
using namespace loc_core;
|
||||
|
||||
typedef uint64_t GpsSvMeasHeaderFlags;
|
||||
#define BIAS_GPSL1_VALID 0x00000001
|
||||
#define BIAS_GPSL1_UNC_VALID 0x00000002
|
||||
#define BIAS_GPSL1_GPSL5_VALID 0x00000004
|
||||
#define BIAS_GPSL1_GPSL5_UNC_VALID 0x00000008
|
||||
#define BIAS_GPSL1_GLOG1_VALID 0x00000010
|
||||
#define BIAS_GPSL1_GLOG1_UNC_VALID 0x00000020
|
||||
#define BIAS_GPSL1_GALE1_VALID 0x00000040
|
||||
#define BIAS_GPSL1_GALE1_UNC_VALID 0x00000080
|
||||
#define BIAS_GPSL1_BDSB1_VALID 0x00000100
|
||||
#define BIAS_GPSL1_BDSB1_UNC_VALID 0x00000200
|
||||
#define BIAS_GPSL1_NAVIC_VALID 0x00000400
|
||||
#define BIAS_GPSL1_NAVIC_UNC_VALID 0x00000800
|
||||
|
||||
#define BIAS_GALE1_VALID 0x00001000
|
||||
#define BIAS_GALE1_UNC_VALID 0x00002000
|
||||
#define BIAS_GALE1_GALE5A_VALID 0x00004000
|
||||
#define BIAS_GALE1_GALE5A_UNC_VALID 0x00008000
|
||||
#define BIAS_BDSB1_VALID 0x00010000
|
||||
#define BIAS_BDSB1_UNC_VALID 0x00020000
|
||||
#define BIAS_BDSB1_BDSB1C_VALID 0x00040000
|
||||
#define BIAS_BDSB1_BDSB1C_UNC_VALID 0x00080000
|
||||
#define BIAS_BDSB1_BDSB2A_VALID 0x00100000
|
||||
#define BIAS_BDSB1_BDSB2A_UNC_VALID 0x00200000
|
||||
|
||||
#define BIAS_GPSL1_GPSL2C_VALID 0x00400000
|
||||
#define BIAS_GPSL1_GPSL2C_UNC_VALID 0x00800000
|
||||
#define BIAS_GALE1_GALE5B_VALID 0x01000000
|
||||
#define BIAS_GALE1_GALE5B_UNC_VALID 0x02000000
|
||||
#define BIAS_BDSB1_BDSB2BI_VALID 0x04000000
|
||||
#define BIAS_BDSB1_BDSB2BI_UNC_VALID 0x08000000
|
||||
|
||||
#define BIAS_GLOG1_VALID 0x10000000
|
||||
#define BIAS_GLOG1_UNC_VALID 0x20000000
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint64_t flags;
|
||||
|
||||
/* used directly */
|
||||
float gpsL1;
|
||||
float gpsL1Unc;
|
||||
float gpsL1_gpsL5;
|
||||
float gpsL1_gpsL5Unc;
|
||||
float gpsL1_gpsL2c;
|
||||
float gpsL1_gpsL2cUnc;
|
||||
float gpsL1_gloG1;
|
||||
float gpsL1_gloG1Unc;
|
||||
float gpsL1_galE1;
|
||||
float gpsL1_galE1Unc;
|
||||
float gpsL1_bdsB1;
|
||||
float gpsL1_bdsB1Unc;
|
||||
float gpsL1_navic;
|
||||
float gpsL1_navicUnc;
|
||||
|
||||
/* used for intermediate computations */
|
||||
float galE1;
|
||||
float galE1Unc;
|
||||
float galE1_galE5a;
|
||||
float galE1_galE5aUnc;
|
||||
float galE1_galE5b;
|
||||
float galE1_galE5bUnc;
|
||||
float bdsB1;
|
||||
float bdsB1Unc;
|
||||
float bdsB1_bdsB1c;
|
||||
float bdsB1_bdsB1cUnc;
|
||||
float bdsB1_bdsB2a;
|
||||
float bdsB1_bdsB2aUnc;
|
||||
float bdsB1_bdsB2bi;
|
||||
float bdsB1_bdsB2biUnc;
|
||||
float gloG1;
|
||||
float gloG1Unc;
|
||||
} timeBiases;
|
||||
|
||||
typedef struct {
|
||||
GnssSvType svType;
|
||||
double carrierFrequencyHz;
|
||||
GnssMeasurementsCodeType codeType;
|
||||
} referenceSignalTypeForIsb;
|
||||
|
||||
typedef struct {
|
||||
/* bitwise OR of GnssMeasurementsClockFlagsBits */
|
||||
GnssMeasurementsClockFlagsMask flags;
|
||||
int64_t timeNs;
|
||||
int64_t fullBiasNs;
|
||||
} GnssBasicClockInfo;
|
||||
|
||||
typedef struct {
|
||||
int16_t svId;
|
||||
GnssSignalTypeMask gnssSignalType;
|
||||
} GnssBasicMeasurementsData;
|
||||
|
||||
typedef struct {
|
||||
/* clock info */
|
||||
GnssBasicClockInfo clock;
|
||||
std::vector<GnssBasicMeasurementsData> measurements;
|
||||
} GnssBasicMeasurementsInfo;
|
||||
|
||||
struct MeasCacheInfo {
|
||||
uint8_t cycleSlipCount;
|
||||
uint32_t refFCount;
|
||||
};
|
||||
|
||||
/** Indicate Gnss Constellation RF Band type <br/> */
|
||||
enum GnssRfBand {
|
||||
/**< Gnss RF Band Unknown <br/> */
|
||||
GNSS_RF_BAND_UNKNOWN = 0,
|
||||
/**< Gnss L1 RF Band <br/> */
|
||||
GNSS_RF_BAND_L1 = 1,
|
||||
/**< Gnss L2 RF Band <br/> */
|
||||
GNSS_RF_BAND_L2 = 2,
|
||||
/**< Gnss L5 RF Band <br/> */
|
||||
GNSS_RF_BAND_L5 = 3,
|
||||
};
|
||||
|
||||
typedef std::unordered_map<string, MeasCacheInfo> CycleSlipCountMap;
|
||||
typedef CycleSlipCountMap::iterator CycleSlipCountMapItr;
|
||||
|
||||
/* This class derives from the LocApiBase class.
|
||||
The members of this class are responsible for converting
|
||||
the Loc API V02 data structures into Loc Adapter data structures.
|
||||
This class also implements some of the virtual functions that
|
||||
handle the requests from loc engine. */
|
||||
class LocApiV02 : public LocApiBase {
|
||||
protected:
|
||||
/* loc api v02 handle*/
|
||||
locClientHandleType clientHandle;
|
||||
|
||||
private:
|
||||
locClientEventMaskType mQmiMask;
|
||||
bool mInSession;
|
||||
GnssPowerMode mPowerMode;
|
||||
bool mEngineOn;
|
||||
bool mFirstMeasurementOfSessionReceived;
|
||||
std::vector<Resender> mResenders;
|
||||
bool mMasterRegisterNotSupported;
|
||||
uint32_t mCounter;
|
||||
uint32_t mMinInterval;
|
||||
|
||||
CycleSlipCountMap mPrev1HzSlipCountMap;
|
||||
CycleSlipCountMap mPrevNhzSlipCountMap;
|
||||
CycleSlipCountMap mCurrentCycleSlipCountMap1Hz;
|
||||
CycleSlipCountMap mCurrentCycleSlipCountMapNHz;
|
||||
|
||||
GnssMeasurements* mGnssMeasurements;
|
||||
bool mPreferredSignalTypeReceived;
|
||||
timeBiases mTimeBiases;
|
||||
std::unordered_map<uint16_t, GnssSvPolynomial> mSvPolynomialMap;
|
||||
qmiLocPlatformPowerStateEnumT_v02 mPlatformPowerState;
|
||||
|
||||
size_t mBatchSize, mDesiredBatchSize;
|
||||
size_t mTripBatchSize, mDesiredTripBatchSize;
|
||||
bool mIsFirstFinalFixReported;
|
||||
bool mIsFirstStartFixReq;
|
||||
uint64_t mHlosQtimer1, mHlosQtimer2;
|
||||
uint32_t mRefFCount;
|
||||
std::string mPackageName[eQMI_LOC_NTN_V02+1];
|
||||
bool mIsFullTracking;
|
||||
qmiLocGnssSignalTypeMaskT_v02 mPreferredSignalType;
|
||||
referenceSignalTypeForIsb mReferenceSignalTypeForIsb;
|
||||
ModemGnssQesdkFeatureMask mQesdkFeatureMask;
|
||||
// GPTP inititialization
|
||||
bool mIsGptpInitialized;
|
||||
|
||||
// < SEC_GPS
|
||||
bool mSecDefaultInitDone;
|
||||
bool mIsSsrHappened;
|
||||
bool mIsWifiOnly;
|
||||
bool mPendingSetParam;
|
||||
bool mSentCI;
|
||||
// SEC_GPS >
|
||||
|
||||
// Below two member variables are for elapsedRealTime calculation
|
||||
RealtimeEstimator mMeasElapsedRealTimeCal;
|
||||
GnssMeasurementsNotification m1HzMeasurementsNotify;
|
||||
GnssBasicMeasurementsInfo m1HzMeasurementsInfo;
|
||||
|
||||
/* Convert event mask from loc eng to loc_api_v02 format */
|
||||
static locClientEventMaskType convertLocClientEventMask(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
||||
|
||||
/* Convert GPS LOCK from LocationAPI format to QMI format */
|
||||
static qmiLocLockEnumT_v02 convertGpsLockFromAPItoQMI(GnssConfigGpsLock lock);
|
||||
|
||||
// QC CR3933472
|
||||
/* Convert GPS LOCK to QMI Client Config Mask */
|
||||
static qmiLocClientsMaskT_v02 convertGpsLock(GnssConfigGpsLock lock);
|
||||
|
||||
/* Convert Engine Lock State from QMI format to LocationAPI format */
|
||||
static EngineLockState convertEngineLockState(qmiLocEngineLockStateEnumT_v02 LockState);
|
||||
|
||||
/* Convert error from loc_api_v02 to loc eng format*/
|
||||
static enum loc_api_adapter_err convertErr(locClientStatusEnumType status);
|
||||
|
||||
/* convert Ni Encoding type from QMI_LOC to loc eng format */
|
||||
static GnssNiEncodingType convertNiEncoding(
|
||||
qmiLocNiDataCodingSchemeEnumT_v02 loc_encoding);
|
||||
|
||||
/*convert NI notify verify type from QMI LOC to loc eng format*/
|
||||
static bool convertNiNotifyVerifyType (GnssNiNotification *notif,
|
||||
qmiLocNiNotifyVerifyEnumT_v02 notif_priv);
|
||||
|
||||
/*convert signal type to carrier frequency*/
|
||||
static double convertSignalTypeToCarrierFrequency(
|
||||
qmiLocGnssSignalTypeMaskT_v02 signalType,
|
||||
uint8_t gloFrequency);
|
||||
|
||||
/*convert GnssMeasurement type from QMI LOC to loc eng format*/
|
||||
void convertGnssMeasurements (
|
||||
const qmiLocEventGnssSvMeasInfoIndMsgT_v02& gnss_measurement_report_ptr,
|
||||
int index, bool isExt, bool validDgnssSvMeas, bool validMlInference);
|
||||
|
||||
/* Convert APN Type mask */
|
||||
static qmiLocApnTypeMaskT_v02 convertLocApnTypeMask(LocApnTypeMask mask);
|
||||
static LocApnTypeMask convertQmiLocApnTypeMask(qmiLocApnTypeMaskT_v02 mask);
|
||||
|
||||
/* Convert Get Constellation QMI Ind info to GnssSvTypeConfig */
|
||||
static void convertToGnssSvTypeConfig(
|
||||
const qmiLocGetConstellationConfigIndMsgT_v02& ind,
|
||||
GnssSvTypeConfig& config);
|
||||
|
||||
/* Convert GnssPowerMode to QMI Loc Power Mode Enum */
|
||||
static qmiLocPowerModeEnumT_v02 convertPowerMode(GnssPowerMode powerMode);
|
||||
|
||||
void convertGnssMeasurementsHeader(const Gnss_LocSvSystemEnumType locSvSystemType,
|
||||
const qmiLocEventGnssSvMeasInfoIndMsgT_v02& gnss_measurement_info);
|
||||
|
||||
/*convert LocGnssClock type from QMI LOC to loc eng format*/
|
||||
void convertGnssClock (GnssMeasurementsClock& clock,
|
||||
const qmiLocEventGnssSvMeasInfoIndMsgT_v02& gnss_measurement_info);
|
||||
|
||||
/* convert dgnss constellation mask from QMI loc to loc eng format */
|
||||
static void convertGnssConestellationMask (
|
||||
qmiLocGNSSConstellEnumT_v02 qmiConstellationEnum,
|
||||
GnssConstellationTypeMask& constellationMask);
|
||||
|
||||
static GnssSignalTypeMask convertQmiGnssSignalType(
|
||||
qmiLocGnssSignalTypeMaskT_v02 qmiGnssSignalType);
|
||||
|
||||
void convertOsnmaTreeNode(qmiLocOsnmaTreeNodeT_v02& out, mgpOsnmaTreeNodeT& in);
|
||||
void convertPublicKeyAndMerkleTreeStruct(qmiLocOsnmaPublicKeyMerkleTreeReqMsgT_v02& qmiOut,
|
||||
mgpOsnmaPublicKeyAndMerkleTreeStruct& in);
|
||||
/* convert Agc status from QMI loc to loc eng format */
|
||||
static AgcStatus convertQmiAgcStatusType(qmiLocAgcStatusEnumT_v02 qmiAgcStatus);
|
||||
|
||||
/* If Confidence value is less than 68%, then scale the accuracy value to 68%
|
||||
confidence.*/
|
||||
void scaleAccuracyTo68PercentConfidence(const uint8_t confidenceValue,
|
||||
LocGpsLocation &gpsLocation,
|
||||
const bool isCircularUnc);
|
||||
|
||||
/* convert position report to loc eng format and send the converted
|
||||
position to loc eng */
|
||||
void reportPosition
|
||||
(const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr,
|
||||
bool unpropagatedPosition = false);
|
||||
|
||||
/* convert satellite report to loc eng format and send the converted
|
||||
report to loc eng */
|
||||
void reportSv (const qmiLocEventGnssSvInfoIndMsgT_v02 *gnss_report_ptr);
|
||||
|
||||
void reportSvPolynomial (
|
||||
const qmiLocEventGnssSvPolyIndMsgT_v02 *gnss_sv_poly_ptr);
|
||||
|
||||
void reportSvEphemeris (
|
||||
uint32_t eventId, const locClientEventIndUnionType &eventPayload);
|
||||
|
||||
void populateGpsEphemeris(const qmiLocGpsEphemerisReportIndMsgT_v02 *,
|
||||
GnssSvEphemerisReport &);
|
||||
void populateGlonassEphemeris(const qmiLocGloEphemerisReportIndMsgT_v02 *,
|
||||
GnssSvEphemerisReport &);
|
||||
void populateBdsEphemeris(const qmiLocBdsEphemerisReportIndMsgT_v02 *,
|
||||
GnssSvEphemerisReport &);
|
||||
void populateGalEphemeris(const qmiLocGalEphemerisReportIndMsgT_v02 *,
|
||||
GnssSvEphemerisReport &);
|
||||
void populateQzssEphemeris(const qmiLocQzssEphemerisReportIndMsgT_v02 *,
|
||||
GnssSvEphemerisReport &);
|
||||
void populateCommonEphemeris(const qmiLocEphGnssDataStructT_v02 &, GnssEphCommon &);
|
||||
void populateGpsTimeOfReport(const qmiLocGnssTimeStructT_v02 &, GnssSystemTimeStructType &);
|
||||
|
||||
void populateFeatureStatusReport(const qmiLocFeaturesStatusMaskT_v02 &featureStatusReport,
|
||||
std::unordered_map<LocationQwesFeatureType, bool> &featureMap);
|
||||
void reportLocEvent(const qmiLocEventReportIndMsgT_v02 *event_report_ptr);
|
||||
/* convert system info to location api format and dispatch to
|
||||
the registered adapter */
|
||||
void reportSystemInfo(const qmiLocSystemInfoIndMsgT_v02* system_info_ptr);
|
||||
void reportLocationRequestNotification(
|
||||
const qmiLocLocationRequestNotificationIndMsgT_v02* loc_req_notif);
|
||||
|
||||
/* convert engine state report to loc eng format and send the converted
|
||||
report to loc eng */
|
||||
void reportEngineState (
|
||||
const qmiLocEventEngineStateIndMsgT_v02 *engine_state_ptr);
|
||||
|
||||
/* convert fix session report to loc eng format and send the converted
|
||||
report to loc eng */
|
||||
void reportFixSessionState (
|
||||
const qmiLocEventFixSessionStateIndMsgT_v02 *fix_session_state_ptr);
|
||||
|
||||
/* convert and report an ATL request to loc engine */
|
||||
void reportAtlRequest(
|
||||
const qmiLocEventLocationServerConnectionReqIndMsgT_v02
|
||||
*server_request_ptr);
|
||||
|
||||
/* convert and report NI request to loc eng */
|
||||
void reportNiRequest(
|
||||
const qmiLocEventNiNotifyVerifyReqIndMsgT_v02 *ni_req_ptr);
|
||||
|
||||
/* report the xtra server info */
|
||||
void reportXtraServerUrl(
|
||||
const qmiLocEventInjectPredictedOrbitsReqIndMsgT_v02* server_request_ptr);
|
||||
|
||||
/* convert and report GNSS measurement data to loc eng */
|
||||
void reportGnssMeasurementData(
|
||||
const qmiLocEventGnssSvMeasInfoIndMsgT_v02& gnss_measurement_report_ptr);
|
||||
|
||||
void reportSvMeasurementInternal();
|
||||
|
||||
inline void resetSvMeasurementReport(){
|
||||
if (mGnssMeasurements) {
|
||||
memset(mGnssMeasurements, 0, sizeof(GnssMeasurements));
|
||||
mGnssMeasurements->size = sizeof(GnssMeasurements);
|
||||
mGnssMeasurements->gnssSvMeasurementSet.size = sizeof(GnssSvMeasurementSet);
|
||||
mGnssMeasurements->gnssSvMeasurementSet.isNhz = false;
|
||||
mGnssMeasurements->gnssSvMeasurementSet.svMeasSetHeader.size =
|
||||
sizeof(GnssSvMeasurementHeader);
|
||||
}
|
||||
memset(&mTimeBiases, 0, sizeof(mTimeBiases));
|
||||
mPreferredSignalTypeReceived = false;
|
||||
}
|
||||
|
||||
void convertJammerIndicator(
|
||||
const qmiLocEventGnssSvMeasInfoIndMsgT_v02& gnss_measurement_report_ptr,
|
||||
double& agcLevelDb,
|
||||
GnssMeasurementsDataFlagsMask& flags,
|
||||
bool updateFlags = false);
|
||||
|
||||
void convertSvType(
|
||||
const qmiLocEventGnssSvMeasInfoIndMsgT_v02& gnss_measurement_report_ptr,
|
||||
GnssSvType& svType);
|
||||
|
||||
void setGnssBiasesForL1CA();
|
||||
void setGnssBiasesForB1I();
|
||||
void setGnssBiases();
|
||||
|
||||
/* convert and report ODCPI request */
|
||||
void requestOdcpi(
|
||||
const qmiLocEventWifiReqIndMsgT_v02& odcpiReq);
|
||||
|
||||
void registerEventMask();
|
||||
bool sendRequestForAidingData(locClientEventMaskType qmiMask);
|
||||
locClientEventMaskType adjustLocClientEventMask(locClientEventMaskType qmiMask);
|
||||
bool cacheGnssMeasurementSupport();
|
||||
void registerMasterClient();
|
||||
void getEngineLockStateSync();
|
||||
void getRobustLocationConfig(uint32_t sessionId, LocApiResponse* adapterResponse);
|
||||
void getMinGpsWeek(uint32_t sessionId, LocApiResponse* adapterResponse);
|
||||
|
||||
/* Convert get blacklist sv info to GnssSvIdConfig */
|
||||
void reportGnssSvIdConfig
|
||||
(const qmiLocGetBlacklistSvIndMsgT_v02& getBlacklistSvIndMsg);
|
||||
|
||||
/* Convert get constellation info to GnssSvTypeConfig */
|
||||
void reportGnssSvTypeConfig
|
||||
(const qmiLocGetConstellationConfigIndMsgT_v02& getConstellationConfigIndMsg);
|
||||
|
||||
/* Inform ODCPI availability to Modem */
|
||||
void wifiStatusInformSync();
|
||||
|
||||
void sendNfwNotification(GnssNfwNotification& notification);
|
||||
LocationError queryBatchBuffer(size_t desiredSize,
|
||||
size_t &allocatedSize, BatchingMode batchMode);
|
||||
LocationError releaseBatchBuffer(BatchingMode batchMode);
|
||||
void readModemLocations(Location* pLocationPiece, size_t count,
|
||||
BatchingMode batchingMode, size_t& numbOfEntries);
|
||||
void setOperationMode(GnssSuplMode mode);
|
||||
bool needsNewTripBatchRestart(uint32_t newTripDistance, uint32_t newTripTBFInterval,
|
||||
uint32_t &accumulatedDistance, uint32_t &numOfBatchedPositions);
|
||||
void batchFullEvent(const qmiLocEventBatchFullIndMsgT_v02* batchFullInfo);
|
||||
void batchStatusEvent(const qmiLocEventBatchingStatusIndMsgT_v02* batchStatusInfo);
|
||||
void onDbtPosReportEvent(const qmiLocEventDbtPositionReportIndMsgT_v02* pDbtPosReport);
|
||||
void geofenceBreachEvent(const qmiLocEventGeofenceBreachIndMsgT_v02* breachInfo);
|
||||
void geofenceBreachEvent(const qmiLocEventGeofenceBatchedBreachIndMsgT_v02* batchedBreachInfo);
|
||||
void geofenceStatusEvent(const qmiLocEventGeofenceGenAlertIndMsgT_v02* alertInfo);
|
||||
void geofenceDwellEvent(const qmiLocEventGeofenceBatchedDwellIndMsgT_v02 *dwellEvent);
|
||||
void reportLatencyInfo(const qmiLocLatencyInformationIndMsgT_v02* pLocLatencyInfo);
|
||||
void reportEngineLockStatus(const qmiLocEngineLockStateEnumT_v02 engineLockState);
|
||||
void reportEngDebugDataInfo(const qmiLocEngineDebugDataIndMsgT_v02* pLocEngDbgDataInfoIndMsg);
|
||||
|
||||
void reportPowerStateChangeInfo(
|
||||
const qmiLocPlatformPowerStateChangedIndMsgT_v02 *pPowerStateChangedInfo);
|
||||
|
||||
/* report disaster and crisis message */
|
||||
void reportDcMessage(const qmiLocEventDcReportIndMsgT_v02* pDcReportIndMsg);
|
||||
|
||||
bool isMeasurementRefreshForSv(uint16_t gnssSvId,
|
||||
GnssSignalTypeMask gnssSignalTypeMask);
|
||||
|
||||
bool isTOAValid(const qmiLocEventPositionReportIndMsgT_v02 *location_report_ptr,
|
||||
const GnssBasicMeasurementsInfo *pOneHzMeasurements);
|
||||
|
||||
void processGnssBandsSupportedInd(
|
||||
const qmiLocGnssBandsSupportedIndMsgT_v02* pGnssBandsSupportedIndMsg);
|
||||
|
||||
GnssMeasurementsCodeType getCodeType(qmiLocGnssSignalTypeMaskT_v02 gnssSignalType);
|
||||
void updateGnssCapabNotification(GnssCapabNotification& gnssCapabNotification,
|
||||
qmiLocGnssSignalTypeMaskT_v02 gnssSignalType);
|
||||
|
||||
protected:
|
||||
virtual enum loc_api_adapter_err
|
||||
open(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
||||
virtual enum loc_api_adapter_err
|
||||
close();
|
||||
|
||||
LocApiV02(LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase *context = NULL);
|
||||
virtual ~LocApiV02();
|
||||
|
||||
public:
|
||||
static LocApiBase* createLocApiV02(LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase* context);
|
||||
/* event callback registered with the loc_api v02 interface */
|
||||
virtual void eventCb(locClientHandleType client_handle,
|
||||
uint32_t loc_event_id,
|
||||
locClientEventIndUnionType loc_event_payload);
|
||||
|
||||
/* error callback, this function handles the service unavailable
|
||||
error */
|
||||
void errorCb(locClientHandleType handle,
|
||||
locClientErrorEnumType errorId);
|
||||
|
||||
// Tracking
|
||||
void startTimeBasedTracking(const TrackingOptions& options, LocApiResponse* adapterResponse);
|
||||
void stopTimeBasedTracking(LocApiResponse* adapterResponse);
|
||||
void startDistanceBasedTracking(uint32_t sessionId, const LocationOptions& options,
|
||||
LocApiResponse* adapterResponse);
|
||||
void stopDistanceBasedTracking(uint32_t sessionId, LocApiResponse* adapterResponse);
|
||||
|
||||
// Batching
|
||||
void startBatching(uint32_t sessionId, const LocationOptions& options, uint32_t accuracy,
|
||||
uint32_t timeout, LocApiResponse* adapterResponse);
|
||||
void stopBatching(uint32_t sessionId, LocApiResponse* adapterResponse);
|
||||
LocationError startOutdoorTripBatchingSync(uint32_t tripDistance, uint32_t tripTbf,
|
||||
uint32_t timeout);
|
||||
void startOutdoorTripBatching(uint32_t tripDistance, uint32_t tripTbf, uint32_t timeout,
|
||||
LocApiResponse* adapterResponse);
|
||||
void reStartOutdoorTripBatching(uint32_t ongoingTripDistance, uint32_t ongoingTripInterval,
|
||||
uint32_t batchingTimeout, LocApiResponse* adapterResponse);
|
||||
LocationError stopOutdoorTripBatchingSync(bool deallocBatchBuffer = true);
|
||||
void stopOutdoorTripBatching(bool deallocBatchBuffer = true,
|
||||
LocApiResponse* adapterResponse = nullptr);
|
||||
LocationError getBatchedLocationsSync(size_t count);
|
||||
void getBatchedLocations(size_t count, LocApiResponse* adapterResponse);
|
||||
LocationError getBatchedTripLocationsSync(size_t count, uint32_t accumulatedDistance);
|
||||
void getBatchedTripLocations(size_t count, uint32_t accumulatedDistance,
|
||||
LocApiResponse* adapterResponse);
|
||||
virtual void setBatchSize(size_t size);
|
||||
virtual void setTripBatchSize(size_t size);
|
||||
LocationError queryAccumulatedTripDistanceSync(uint32_t &accumulatedTripDistance,
|
||||
uint32_t &numOfBatchedPositions);
|
||||
void queryAccumulatedTripDistance(
|
||||
LocApiResponseData<LocApiBatchData>* adapterResponseData);
|
||||
|
||||
// Geofence
|
||||
virtual void addGeofence(uint32_t clientId, const GeofenceOption& options,
|
||||
const GeofenceInfo& info, LocApiResponseData<LocApiGeofenceData>* adapterResponseData);
|
||||
virtual void removeGeofence(uint32_t hwId, uint32_t clientId, LocApiResponse* adapterResponse);
|
||||
virtual void pauseGeofence(uint32_t hwId, uint32_t clientId, LocApiResponse* adapterResponse);
|
||||
virtual void resumeGeofence(uint32_t hwId, uint32_t clientId, LocApiResponse* adapterResponse);
|
||||
virtual void modifyGeofence(uint32_t hwId, uint32_t clientId,
|
||||
const GeofenceOption& options, LocApiResponse* adapterResponse);
|
||||
virtual void addToCallQueue(LocApiResponse* adapterResponse);
|
||||
|
||||
|
||||
virtual void
|
||||
setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
|
||||
virtual void
|
||||
injectPosition(double latitude, double longitude, float accuracy, bool onDemandCpi);
|
||||
|
||||
virtual void
|
||||
injectPosition(const Location& location, bool onDemandCpi);
|
||||
|
||||
virtual void
|
||||
injectPosition(const GnssLocationInfoNotification &locationInfo, bool onDemandCpi);
|
||||
|
||||
virtual void injectPositionAndCivicAddress(const Location& location,
|
||||
const GnssCivicAddress& addr);
|
||||
|
||||
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 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
|
||||
handleWwanZppFixIndication(const qmiLocGetAvailWwanPositionIndMsgT_v02 &zpp_ind);
|
||||
virtual void
|
||||
handleZppBestAvailableFixIndication(const qmiLocGetBestAvailablePositionIndMsgT_v02 &zpp_ind);
|
||||
virtual void getBestAvailableZppFix();
|
||||
virtual bool getBestAvailableZppFixSync(LocGpsLocation &zppLoc,
|
||||
LocPosTechMask &tech_mask);
|
||||
virtual LocationError setGpsLockSync(GnssConfigGpsLock lock);
|
||||
virtual void setConstrainedTuncMode(bool enabled, float tuncConstraint, uint32_t powerBudget,
|
||||
LocApiResponse *adapterResponse=nullptr);
|
||||
virtual void setPositionAssistedClockEstimatorMode(bool enabled,
|
||||
LocApiResponse *adapterResponse=nullptr);
|
||||
virtual void getGnssEnergyConsumed();
|
||||
virtual void updateSystemPowerState(PowerStateType powerState);
|
||||
virtual void updatePowerConnectState(bool connected);
|
||||
|
||||
virtual void requestForAidingData(GnssAidingDataSvMask svDataMask);
|
||||
virtual void configRobustLocation(bool enable, bool enableForE911,
|
||||
LocApiResponse *adapterResponse=nullptr,
|
||||
bool enableForE911Valid = false);
|
||||
virtual void configMinGpsWeek(uint16_t minGpsWeek,
|
||||
LocApiResponse *adapterResponse=nullptr);
|
||||
virtual LocationError setParameterSync(const GnssConfig & gnssConfig);
|
||||
|
||||
virtual void getParameter(uint32_t sessionId, GnssConfigFlagsMask flags,
|
||||
LocApiResponse* adapterResponse=nullptr);
|
||||
virtual void setTribandState(bool enabled);
|
||||
|
||||
/*
|
||||
Returns
|
||||
Current value of GPS Lock on success
|
||||
-1 on failure
|
||||
*/
|
||||
virtual int setSvMeasurementConstellation(const locClientEventMaskType mask);
|
||||
virtual LocationError setXtraVersionCheckSync(uint32_t check);
|
||||
|
||||
virtual LocPosTechMask convertPosTechMask(qmiLocPosTechMaskT_v02 mask);
|
||||
virtual LocNavSolutionMask convertNavSolutionMask(qmiLocNavSolutionMaskT_v02 mask);
|
||||
virtual GnssConfigSuplVersion convertSuplVersion(const uint32_t suplVersion);
|
||||
virtual GnssConfigLppeControlPlaneMask convertLppeCp(const uint32_t lppeControlPlaneMask);
|
||||
virtual GnssConfigLppeUserPlaneMask convertLppeUp(const uint32_t lppeUserPlaneMask);
|
||||
virtual LocationError setEmergencyExtensionWindowSync(const uint32_t emergencyExtensionSeconds);
|
||||
virtual void setMeasurementCorrections(
|
||||
const GnssMeasurementCorrections& gnssMeasurementCorrections);
|
||||
|
||||
void convertQmiBlacklistedSvConfigToGnssConfig(
|
||||
const qmiLocGetBlacklistSvIndMsgT_v02& qmiBlacklistConfig,
|
||||
GnssSvIdConfig& gnssBlacklistConfig);
|
||||
|
||||
virtual void convertQmiSecondaryConfigToGnssConfig(
|
||||
qmiLocGNSSConstellEnumT_v02 qmiSecondaryBandConfig,
|
||||
GnssSvTypeConfig& secondaryBandConfig);
|
||||
|
||||
virtual void configPrecisePositioning(uint32_t featureId, bool enable,
|
||||
const std::string& appHash, LocApiResponse* adapterResponse=nullptr);
|
||||
/* 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);
|
||||
|
||||
virtual void configConstellationMultiBand(const GnssSvTypeConfig& secondaryBandConfig,
|
||||
LocApiResponse* adapterResponse=nullptr);
|
||||
virtual void configMerkleTree(mgpOsnmaPublicKeyAndMerkleTreeStruct* merkleTree,
|
||||
LocApiResponse* adapterResponse=nullptr);
|
||||
|
||||
virtual void configOsnmaEnablement(bool enable, LocApiResponse* adapterResponse=nullptr);
|
||||
|
||||
virtual void getNtnConfigSignalMask(LocApiResponse* adapterResponse = nullptr);
|
||||
|
||||
virtual void setNtnConfigSignalMask(GnssSignalTypeMask gpsSignalTypeConfigMask,
|
||||
LocApiResponse* adapterResponse = nullptr);
|
||||
|
||||
virtual void getConstellationMultiBandConfig(uint32_t sessionId,
|
||||
LocApiResponse* adapterResponse=nullptr);
|
||||
|
||||
locClientStatusEnumType locSyncSendReq(uint32_t req_id, locClientReqUnionType req_payload,
|
||||
uint32_t timeout_msec, uint32_t ind_id, void* ind_payload_ptr);
|
||||
|
||||
inline locClientStatusEnumType locClientSendReq(uint32_t req_id,
|
||||
locClientReqUnionType req_payload) {
|
||||
return ::locClientSendReq(clientHandle, req_id, req_payload);
|
||||
}
|
||||
// < SEC_GPS
|
||||
virtual int setSecGnssParams();
|
||||
virtual enum loc_api_adapter_err setSuplSecurity(int enable);
|
||||
virtual void setSecGnssConfiguration (const char* sec_ext_config, int32_t length);
|
||||
virtual void sendSAPconfigtoCP();
|
||||
virtual void requestSetSecGnssParams();
|
||||
// SEC_GPS >
|
||||
};
|
||||
|
||||
extern "C" LocApiBase* getLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase *context);
|
||||
#endif //LOC_API_V_0_2_H
|
||||
56
qcom/opensource/location/loc_api/loc_api_v02/Makefile.am
Normal file
56
qcom/opensource/location/loc_api/loc_api_v02/Makefile.am
Normal file
@@ -0,0 +1,56 @@
|
||||
AM_CFLAGS = \
|
||||
-I. \
|
||||
$(LOCPLA_CFLAGS) \
|
||||
$(GPSUTILS_CFLAGS) \
|
||||
$(LOCCORE_CFLAGS) \
|
||||
$(QMIFW_CFLAGS) \
|
||||
-fno-short-enums \
|
||||
-D__func__=__PRETTY_FUNCTION__ \
|
||||
-DTARGET_USES_QCOM_BSP
|
||||
|
||||
if PTP_SUPPORTED
|
||||
AM_CFLAGS += -I$(WORKSPACE)/external/open-avb/lib/libgptp \
|
||||
-DPTP_SUPPORTED
|
||||
endif
|
||||
|
||||
libloc_api_v02_la_SOURCES = \
|
||||
LocApiV02.cpp \
|
||||
loc_api_v02_log.cpp \
|
||||
loc_api_v02_client.cpp \
|
||||
loc_api_sync_req.cpp \
|
||||
location_service_v02.c
|
||||
|
||||
if USE_GLIB
|
||||
libloc_api_v02_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_api_v02_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread -lcutils @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_api_v02_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_api_v02_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_api_v02_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread -lcutils -shared -version-info 1:0:0
|
||||
libloc_api_v02_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_api_v02_la_CXXFLAGS = -std=c++0x
|
||||
libloc_api_v02_la_LIBADD = -lstdc++ -ldl -lutils $(QMIFW_LIBS) $(GPSUTILS_LIBS) $(LOCCORE_LIBS)
|
||||
|
||||
if PTP_SUPPORTED
|
||||
libloc_api_v02_la_LIBADD += -lgptp
|
||||
endif
|
||||
|
||||
library_include_HEADERS = \
|
||||
location_service_v02.h \
|
||||
loc_api_v02_log.h \
|
||||
loc_api_v02_client.h \
|
||||
loc_api_sync_req.h \
|
||||
LocApiV02.h \
|
||||
loc_util_log.h
|
||||
|
||||
library_includedir = $(pkgincludedir)/loc_api_v02
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_api_v02.la
|
||||
|
||||
library_includedir = $(pkgincludedir)
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = loc-api-v02.pc
|
||||
EXTRA_DIST = $(pkgconfig_DATA)
|
||||
27
qcom/opensource/location/loc_api/loc_api_v02/NOTICE
Normal file
27
qcom/opensource/location/loc_api/loc_api_v02/NOTICE
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
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
|
||||
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.
|
||||
99
qcom/opensource/location/loc_api/loc_api_v02/configure.ac
Normal file
99
qcom/opensource/location/loc_api/loc_api_v02/configure.ac
Normal file
@@ -0,0 +1,99 @@
|
||||
# configure.ac -- Autoconf script for gps loc-api-v02
|
||||
#
|
||||
# Process this file with autoconf to produce a configure script
|
||||
|
||||
# Requires autoconf tool later than 2.61
|
||||
AC_PREREQ(2.61)
|
||||
# Initialize the gps loc-api-v02 package version 1.0.0
|
||||
AC_INIT([loc-api-v02],1.0.0)
|
||||
# Does not strictly follow GNU Coding standards
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
# 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([GPSUTILS], [qcom-gps-utils])
|
||||
AC_SUBST([GPSUTILS_CFLAGS])
|
||||
AC_SUBST([GPSUTILS_LIBS])
|
||||
|
||||
PKG_CHECK_MODULES([LOCCORE], [loc-core])
|
||||
AC_SUBST([LOCCORE_CFLAGS])
|
||||
AC_SUBST([LOCCORE_LIBS])
|
||||
|
||||
PKG_CHECK_MODULES([QMIFW], [qmi-framework])
|
||||
AC_SUBST([QMIFW_CFLAGS])
|
||||
AC_SUBST([QMIFW_LIBS])
|
||||
|
||||
AC_ARG_WITH([core_includes],
|
||||
AC_HELP_STRING([--with-core-includes=@<:@dir@:>@],
|
||||
[Specify the location of the core headers]),
|
||||
[core_incdir=$withval],
|
||||
with_core_includes=no)
|
||||
|
||||
if test "x${with_core_includes}" != "xno"; then
|
||||
CPPFLAGS="${CPPFLAGS} -I${core_incdir}"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([locpla_includes],
|
||||
AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@],
|
||||
[Specify the path to locpla-includes in loc-pla_git.bb]),
|
||||
[locpla_incdir=$withval],
|
||||
with_locpla_includes=no)
|
||||
|
||||
if test "x${with_locpla_includes}" != "xno"; then
|
||||
AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}")
|
||||
fi
|
||||
|
||||
AC_SUBST([CPPFLAGS])
|
||||
|
||||
AC_ARG_WITH([glib],
|
||||
AC_HELP_STRING([--with-glib],
|
||||
[enable glib, building HLOS systems which use glib]))
|
||||
|
||||
if (test "x${with_glib}" = "xyes"); then
|
||||
AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
|
||||
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
|
||||
AC_MSG_ERROR(GThread >= 2.16 is required))
|
||||
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
|
||||
AC_MSG_ERROR(GLib >= 2.16 is required))
|
||||
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
|
||||
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
|
||||
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([ptp],
|
||||
[ --enable-ptp enable ptp],
|
||||
[case "${enableval}" in
|
||||
yes) ptp=true ;;
|
||||
no) ptp=false ;;
|
||||
*) AC_MSG_ERROR([bad value ${enableval} for --enable-ptp]) ;;
|
||||
esac],[ptp=false])
|
||||
AM_CONDITIONAL(PTP_SUPPORTED, [test x$ptp = xtrue])
|
||||
|
||||
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
|
||||
|
||||
AC_CONFIG_FILES([ \
|
||||
Makefile \
|
||||
loc-api-v02.pc
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
@@ -0,0 +1,10 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: loc-api-v02
|
||||
Description: Loc Api V02
|
||||
Version: @VERSION
|
||||
Libs: -L${libdir} -lloc_api_v02
|
||||
Cflags: -I${includedir} -I${includedir}/loc-api-v02
|
||||
@@ -0,0 +1,532 @@
|
||||
/* Copyright (c) 2011-2012, 2015-2016, 2021 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <loc_cfg.h>
|
||||
#include "loc_api_v02_client.h"
|
||||
#include "loc_api_sync_req.h"
|
||||
#include "loc_api_v02_log.h"
|
||||
#include <loc_pla.h>
|
||||
|
||||
/* Logging */
|
||||
// Uncomment to log verbose logs
|
||||
#define LOG_NDEBUG 1
|
||||
|
||||
// log debug logs
|
||||
#define LOG_NDDEBUG 1
|
||||
#define LOG_TAG "LocSvc_api_v02"
|
||||
#include "loc_util_log.h"
|
||||
|
||||
#define LOC_SYNC_REQ_BUFFER_SIZE 8
|
||||
pthread_mutex_t loc_sync_call_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
static bool loc_sync_call_initialized = false;
|
||||
|
||||
typedef struct {
|
||||
pthread_mutex_t sync_req_lock;
|
||||
|
||||
/* Client ID */
|
||||
locClientHandleType client_handle;
|
||||
|
||||
/* waiting conditional variable */
|
||||
pthread_cond_t ind_arrived_cond;
|
||||
|
||||
/* Callback waiting data block, protected by loc_cb_data_mutex */
|
||||
bool ind_is_selected; /* is cb selected? */
|
||||
bool ind_is_waiting; /* is waiting? */
|
||||
bool ind_has_arrived; /* callback has arrived */
|
||||
uint32_t req_id; /* sync request */
|
||||
void *recv_ind_payload_ptr; /* received payload */
|
||||
uint32_t recv_ind_id; /* received ind */
|
||||
|
||||
} loc_sync_req_data_s_type;
|
||||
|
||||
typedef struct {
|
||||
bool in_use; /* at least one sync call is active */
|
||||
bool slot_in_use[LOC_SYNC_REQ_BUFFER_SIZE];
|
||||
loc_sync_req_data_s_type slots[LOC_SYNC_REQ_BUFFER_SIZE];
|
||||
} loc_sync_req_array_s_type;
|
||||
|
||||
/***************************************************************************
|
||||
* DATA FOR ASYNCHRONOUS RPC PROCESSING
|
||||
**************************************************************************/
|
||||
loc_sync_req_array_s_type loc_sync_array;
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_req_init
|
||||
|
||||
DESCRIPTION
|
||||
Initialize this module
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
none
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
void loc_sync_req_init()
|
||||
{
|
||||
UTIL_READ_CONF_DEFAULT(LOC_PATH_GPS_CONF);
|
||||
pthread_mutex_lock(&loc_sync_call_mutex);
|
||||
if(true == loc_sync_call_initialized)
|
||||
{
|
||||
LOC_LOGv("already initialized");
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
loc_sync_array.in_use = false;
|
||||
|
||||
memset(loc_sync_array.slot_in_use, 0, sizeof(loc_sync_array.slot_in_use));
|
||||
|
||||
int i;
|
||||
for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++)
|
||||
{
|
||||
loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i];
|
||||
|
||||
pthread_mutex_init(&slot->sync_req_lock, NULL);
|
||||
pthread_condattr_t condAttr;
|
||||
pthread_condattr_init(&condAttr);
|
||||
pthread_condattr_setclock(&condAttr, CLOCK_REALTIME);
|
||||
pthread_cond_init(&slot->ind_arrived_cond, &condAttr);
|
||||
pthread_condattr_destroy(&condAttr);
|
||||
|
||||
slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE;
|
||||
slot->ind_is_selected = false; /* is ind selected? */
|
||||
slot->ind_is_waiting = false; /* is waiting? */
|
||||
slot->ind_has_arrived = false; /* callback has arrived */
|
||||
slot->recv_ind_id = 0; /* ind to wait for */
|
||||
slot->recv_ind_payload_ptr = NULL;
|
||||
slot->req_id = 0; /* req id */
|
||||
}
|
||||
|
||||
loc_sync_call_initialized = true;
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_process_ind
|
||||
|
||||
DESCRIPTION
|
||||
Wakes up blocked API calls to check if the needed callback has arrived
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
none
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
void loc_sync_process_ind(
|
||||
locClientHandleType client_handle, /* handle of the client */
|
||||
uint32_t ind_id , /* ind id */
|
||||
void *ind_payload_ptr, /* payload */
|
||||
uint32_t ind_payload_size /* payload size */
|
||||
)
|
||||
{
|
||||
LOC_LOGv("received indication, handle = %p ind_id = %u",
|
||||
client_handle, ind_id);
|
||||
|
||||
pthread_mutex_lock(&loc_sync_call_mutex);
|
||||
|
||||
if (!loc_sync_array.in_use)
|
||||
{
|
||||
LOC_LOGd("loc_sync_array not in use");
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
bool in_use = false, consumed = false;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE && !consumed; i++)
|
||||
{
|
||||
loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i];
|
||||
|
||||
in_use |= loc_sync_array.slot_in_use[i];
|
||||
|
||||
pthread_mutex_lock(&slot->sync_req_lock);
|
||||
|
||||
if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle)
|
||||
&& (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived))
|
||||
{
|
||||
LOC_LOGv("found slot %d selected for ind %u", i, ind_id);
|
||||
|
||||
if( NULL != slot->recv_ind_payload_ptr &&
|
||||
NULL != ind_payload_ptr && ind_payload_size > 0 )
|
||||
{
|
||||
LOC_LOGv("copying ind payload size = %u", ind_payload_size);
|
||||
|
||||
memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, ind_payload_size);
|
||||
|
||||
consumed = true;
|
||||
}
|
||||
/* Received a callback while waiting, wake up thread to check it */
|
||||
if (slot->ind_is_waiting)
|
||||
{
|
||||
slot->recv_ind_id = ind_id;
|
||||
|
||||
pthread_cond_signal(&slot->ind_arrived_cond);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If callback arrives before wait, remember it */
|
||||
LOC_LOGv("ind %u arrived before wait was called", ind_id);
|
||||
|
||||
slot->ind_has_arrived = true;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&slot->sync_req_lock);
|
||||
}
|
||||
|
||||
if (!in_use) {
|
||||
loc_sync_array.in_use = false;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_alloc_slot
|
||||
|
||||
DESCRIPTION
|
||||
Allocates a buffer slot for the synchronous API call
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
Select ID (>=0) : successful
|
||||
-1 : buffer full
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_alloc_slot()
|
||||
{
|
||||
int i, select_id = -1; /* no free buffer */
|
||||
|
||||
pthread_mutex_lock(&loc_sync_call_mutex);
|
||||
|
||||
for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++)
|
||||
{
|
||||
if (!loc_sync_array.slot_in_use[i])
|
||||
{
|
||||
select_id = i;
|
||||
loc_sync_array.slot_in_use[i] = 1;
|
||||
loc_sync_array.in_use = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
LOC_LOGv("returning slot %d", select_id);
|
||||
return select_id;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_free_slot
|
||||
|
||||
DESCRIPTION
|
||||
Frees a buffer slot after the synchronous API call
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
None
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static void loc_free_slot(int select_id)
|
||||
{
|
||||
int i;
|
||||
loc_sync_req_data_s_type *slot;
|
||||
|
||||
pthread_mutex_lock(&loc_sync_call_mutex);
|
||||
|
||||
loc_sync_array.slot_in_use[select_id] = 0;
|
||||
|
||||
slot = &loc_sync_array.slots[select_id];
|
||||
|
||||
slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE;
|
||||
slot->ind_is_selected = false; /* is ind selected? */
|
||||
slot->ind_is_waiting = false; /* is waiting? */
|
||||
slot->ind_has_arrived = false; /* callback has arrived */
|
||||
slot->recv_ind_id = 0; /* ind to wait for */
|
||||
slot->recv_ind_payload_ptr = NULL;
|
||||
slot->req_id = 0;
|
||||
|
||||
// check if all slots are now free
|
||||
for (i = 0; i < LOC_SYNC_REQ_BUFFER_SIZE; i++)
|
||||
{
|
||||
if (loc_sync_array.slot_in_use[i]) break;
|
||||
}
|
||||
|
||||
if (i >= LOC_SYNC_REQ_BUFFER_SIZE)
|
||||
{
|
||||
loc_sync_array.in_use = false;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&loc_sync_call_mutex);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_select_ind
|
||||
|
||||
DESCRIPTION
|
||||
Selects which indication to wait for.
|
||||
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
Select ID (>=0) : successful
|
||||
-ENOMEM : out of buffer
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_sync_select_ind(
|
||||
locClientHandleType client_handle, /* Client handle */
|
||||
uint32_t ind_id, /* ind Id wait for */
|
||||
uint32_t req_id, /* req id */
|
||||
void * ind_payload_ptr /* ptr where payload should be copied to*/
|
||||
)
|
||||
{
|
||||
int select_id = loc_alloc_slot();
|
||||
|
||||
LOC_LOGv("client handle %p, ind_id %u, req_id %u",
|
||||
client_handle, ind_id, req_id);
|
||||
|
||||
if (select_id < 0)
|
||||
{
|
||||
LOC_LOGe("buffer full for this synchronous req %s",
|
||||
loc_get_v02_event_name(req_id));
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id];
|
||||
|
||||
pthread_mutex_lock(&slot->sync_req_lock);
|
||||
|
||||
slot->client_handle = client_handle;
|
||||
slot->ind_is_selected = true;
|
||||
slot->ind_is_waiting = false;
|
||||
slot->ind_has_arrived = false;
|
||||
|
||||
slot->recv_ind_id = ind_id;
|
||||
slot->req_id = req_id;
|
||||
slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr
|
||||
|
||||
pthread_mutex_unlock(&slot->sync_req_lock);
|
||||
|
||||
return select_id;
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_wait_for_ind
|
||||
|
||||
DESCRIPTION
|
||||
Waits for a selected indication. The wait expires in timeout_seconds seconds.
|
||||
If the function is called before an existing wait has finished, it will
|
||||
immediately return error.
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
0 on SUCCESS, -ve value on failure
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_sync_wait_for_ind(
|
||||
int select_id, /* ID from loc_sync_select_ind() */
|
||||
int timeout_seconds, /* Timeout in this number of seconds */
|
||||
uint32_t ind_id
|
||||
)
|
||||
{
|
||||
if (select_id < 0 || select_id >= LOC_SYNC_REQ_BUFFER_SIZE || !loc_sync_array.slot_in_use[select_id])
|
||||
{
|
||||
LOC_LOGe("invalid select_id: %d ", select_id);
|
||||
return (-EINVAL);
|
||||
}
|
||||
|
||||
loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id];
|
||||
|
||||
int ret_val = 0; /* the return value of this function: 0 = no error */
|
||||
int rc; /* return code from pthread calls */
|
||||
|
||||
struct timespec expire_time = {};
|
||||
|
||||
pthread_mutex_lock(&slot->sync_req_lock);
|
||||
|
||||
do
|
||||
{
|
||||
if (slot->ind_has_arrived)
|
||||
{
|
||||
ret_val = 0; /* success */
|
||||
break;
|
||||
}
|
||||
|
||||
if (slot->ind_is_waiting)
|
||||
{
|
||||
LOC_LOGw("already waiting in this slot %d", select_id);
|
||||
ret_val = -EBUSY; // busy
|
||||
break;
|
||||
}
|
||||
|
||||
/* Calculate absolute expire time */
|
||||
clock_gettime(CLOCK_REALTIME, &expire_time);
|
||||
expire_time.tv_sec += timeout_seconds;
|
||||
|
||||
/* Take new wait request */
|
||||
slot->ind_is_waiting = true;
|
||||
|
||||
/* Waiting */
|
||||
rc = pthread_cond_timedwait(&slot->ind_arrived_cond,
|
||||
&slot->sync_req_lock, &expire_time);
|
||||
|
||||
slot->ind_is_waiting = false;
|
||||
|
||||
if(rc == ETIMEDOUT)
|
||||
{
|
||||
LOC_LOGe("slot %d, timed out for ind_id %s",
|
||||
select_id, loc_get_v02_event_name(ind_id));
|
||||
ret_val = -ETIMEDOUT; //time out
|
||||
}
|
||||
|
||||
} while (0);
|
||||
|
||||
pthread_mutex_unlock(&slot->sync_req_lock);
|
||||
loc_free_slot(select_id);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
||||
FUNCTION loc_sync_send_req
|
||||
|
||||
DESCRIPTION
|
||||
Synchronous req call (thread safe)
|
||||
|
||||
DEPENDENCIES
|
||||
N/A
|
||||
|
||||
RETURN VALUE
|
||||
Loc API 2.0 status
|
||||
|
||||
SIDE EFFECTS
|
||||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
locClientStatusEnumType loc_sync_send_req
|
||||
(
|
||||
locClientHandleType client_handle,
|
||||
uint32_t req_id, /* req id */
|
||||
locClientReqUnionType req_payload,
|
||||
uint32_t timeout_msec,
|
||||
uint32_t ind_id, //ind ID to block for, usually the same as req_id */
|
||||
void *ind_payload_ptr /* can be NULL*/
|
||||
)
|
||||
{
|
||||
locClientStatusEnumType status = eLOC_CLIENT_SUCCESS ;
|
||||
int select_id;
|
||||
int rc = 0;
|
||||
|
||||
// Select the callback we are waiting for
|
||||
select_id = loc_sync_select_ind(client_handle, ind_id, req_id,
|
||||
ind_payload_ptr);
|
||||
|
||||
if (select_id >= 0)
|
||||
{
|
||||
status = locClientSendReq (client_handle, req_id, req_payload);
|
||||
LOC_LOGv("select_id = %d,locClientSendReq returned %d",
|
||||
select_id, status);
|
||||
|
||||
if (status != eLOC_CLIENT_SUCCESS )
|
||||
{
|
||||
loc_free_slot(select_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Wait for the indication callback
|
||||
if (( rc = loc_sync_wait_for_ind( select_id,
|
||||
timeout_msec / 1000,
|
||||
ind_id) ) < 0)
|
||||
{
|
||||
if ( rc == -ETIMEDOUT)
|
||||
status = eLOC_CLIENT_FAILURE_TIMEOUT;
|
||||
else
|
||||
status = eLOC_CLIENT_FAILURE_INTERNAL;
|
||||
|
||||
// Callback waiting failed
|
||||
LOC_LOGe("loc_api_wait_for_ind failed, err %d, select id %d, status %s",
|
||||
rc, select_id, loc_get_v02_client_status_name(status));
|
||||
}
|
||||
else
|
||||
{
|
||||
status = eLOC_CLIENT_SUCCESS;
|
||||
LOC_LOGv("success (select id %d)", select_id);
|
||||
}
|
||||
}
|
||||
} /* select id */
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/* 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
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef LOC_SYNC_REQ_H
|
||||
#define LOC_SYNC_REQ_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "loc_api_v02_client.h"
|
||||
|
||||
#define LOC_ENGINE_SYNC_REQUEST_TIMEOUT (1000) // 1 second
|
||||
#define LOC_ENGINE_SYNC_REQUEST_LONG_TIMEOUT (5000) // 5 seconds
|
||||
|
||||
/* Init function */
|
||||
extern void loc_sync_req_init();
|
||||
|
||||
|
||||
/* Process Loc API indications to wake up blocked user threads */
|
||||
extern void loc_sync_process_ind(
|
||||
locClientHandleType client_handle, /* handle of the client */
|
||||
uint32_t ind_id , /* respInd id */
|
||||
void *ind_payload_ptr, /* payload */
|
||||
uint32_t ind_payload_size /* payload size */
|
||||
);
|
||||
|
||||
/* Thread safe synchronous request, using Loc API status return code */
|
||||
extern locClientStatusEnumType loc_sync_send_req
|
||||
(
|
||||
locClientHandleType client_handle,
|
||||
uint32_t req_id, /* req id */
|
||||
locClientReqUnionType req_payload,
|
||||
uint32_t timeout_msec,
|
||||
uint32_t ind_id, //ind ID to block for, usually the same as req_id */
|
||||
void *ind_payload_ptr /* can be NULL*/
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LOC_SYNC_REQ_H */
|
||||
2643
qcom/opensource/location/loc_api/loc_api_v02/loc_api_v02_client.cpp
Normal file
2643
qcom/opensource/location/loc_api/loc_api_v02/loc_api_v02_client.cpp
Normal file
File diff suppressed because it is too large
Load Diff
2035
qcom/opensource/location/loc_api/loc_api_v02/loc_api_v02_client.h
Normal file
2035
qcom/opensource/location/loc_api/loc_api_v02/loc_api_v02_client.h
Normal file
File diff suppressed because it is too large
Load Diff
365
qcom/opensource/location/loc_api/loc_api_v02/loc_api_v02_log.cpp
Normal file
365
qcom/opensource/location/loc_api/loc_api_v02/loc_api_v02_log.cpp
Normal file
@@ -0,0 +1,365 @@
|
||||
/* Copyright (c) 2011-2015, 2018-2021 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted (subject to the limitations in the
|
||||
disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
|
||||
HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 <loc_api_v02_log.h>
|
||||
#include <location_service_v02.h>
|
||||
|
||||
DECLARE_TBL(loc_v02_event_name) =
|
||||
{
|
||||
NAME_VAL(QMI_LOC_GET_SUPPORTED_MSGS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SUPPORTED_FIELDS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INFORM_CLIENT_REVISION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_REG_EVENTS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_START_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_STOP_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_POSITION_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GNSS_SV_INFO_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_NI_NOTIFY_VERIFY_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_INJECT_TIME_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_INJECT_PREDICTED_ORBITS_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_INJECT_POSITION_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_ENGINE_STATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_FIX_SESSION_STATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_WIFI_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_SENSOR_STREAMING_READY_STATUS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_TIME_SYNC_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_SET_SPI_STREAMING_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_LOCATION_SERVER_CONNECTION_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SERVICE_REVISION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_FIX_CRITERIA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_NI_USER_RESPONSE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_PREDICTED_ORBITS_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_SOURCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PREDICTED_ORBITS_DATA_VALIDITY_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_UTC_TIME_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_POSITION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_ENGINE_LOCK_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_ENGINE_LOCK_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SBAS_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SBAS_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_LOW_POWER_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_LOW_POWER_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_REGISTER_MASTER_CLIENT_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SERVER_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SERVER_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_ASSIST_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_XTRA_T_SESSION_CONTROL_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_XTRA_T_SESSION_CONTROL_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_WIFI_POSITION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_NOTIFY_WIFI_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_REGISTERED_EVENTS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_OPERATION_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_OPERATION_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SPI_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SENSOR_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TIME_SYNC_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_CRADLE_MOUNT_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_CRADLE_MOUNT_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_EXTERNAL_POWER_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_EXTERNAL_POWER_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INFORM_LOCATION_SERVER_CONN_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_CONTROL_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_CONTROL_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_PROPERTIES_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_PROPERTIES_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SENSOR_PERFORMANCE_CONTROL_CONFIGURATION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SUPL_CERTIFICATE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_SUPL_CERTIFICATE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_POSITION_ENGINE_CONFIG_PARAMETERS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_NI_GEOFENCE_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GEOFENCE_GEN_ALERT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BREACH_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_ADD_CIRCULAR_GEOFENCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_GEOFENCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_QUERY_GEOFENCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EDIT_GEOFENCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_BEST_AVAILABLE_POSITION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_MOTION_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NI_GEOFENCE_ID_LIST_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_GSM_CELL_INFO_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_NETWORK_INITIATED_MESSAGE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_WWAN_OUT_OF_SERVICE_NOTIFICATION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_PEDOMETER_CONTROL_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_MOTION_DATA_CONTROL_IND_V02),
|
||||
NAME_VAL(QMI_LOC_PEDOMETER_REPORT_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_WCDMA_CELL_INFO_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TDSCDMA_CELL_INFO_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SUBSCRIBER_ID_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_GEOFENCE_ENGINE_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_GEOFENCE_ENGINE_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_BATCH_SIZE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_START_BATCHING_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_BATCH_FULL_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_LIVE_BATCHED_POSITION_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_READ_FROM_BATCH_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_STOP_BATCHING_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_RELEASE_BATCH_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_INJECT_WIFI_AP_DATA_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_WIFI_AP_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_NOTIFY_WIFI_ATTACHMENT_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_NOTIFY_WIFI_ENABLED_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BATCHED_BREACH_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_VEHICLE_DATA_READY_STATUS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_VEHICLE_SENSOR_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_AVAILABLE_WWAN_POSITION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_PREMIUM_SERVICES_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_XTRA_VERSION_CHECK_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GNSS_MEASUREMENT_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_SV_POLYNOMIAL_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_GNSS_CONSTELL_REPORT_CONFIG_V02),
|
||||
NAME_VAL(QMI_LOC_ADD_GEOFENCE_CONTEXT_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_GEOFENCE_ENGINE_CONTEXT_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_GEOFENCE_CONTEXT_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GEOFENCE_PROXIMITY_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_GTP_CLIENT_DOWNLOADED_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GDT_UPLOAD_BEGIN_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GDT_UPLOAD_END_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GDT_UPLOAD_BEGIN_STATUS_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GDT_UPLOAD_END_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_START_DBT_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_DBT_POSITION_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_DBT_SESSION_STATUS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_STOP_DBT_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SECURE_GET_AVAILABLE_POSITION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GEOFENCE_BATCHED_DWELL_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GET_TIME_ZONE_INFO_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TIME_ZONE_INFO_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_APCACHE_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_APDONOTCACHE_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_BATCHING_STATUS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_QUERY_AON_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GTP_AP_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GDT_DOWNLOAD_BEGIN_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GDT_DOWNLOAD_READY_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GDT_RECEIVE_DONE_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GDT_DOWNLOAD_END_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GDT_DOWNLOAD_BEGIN_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GDT_RECEIVE_DONE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GDT_DOWNLOAD_END_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_DELETE_GNSS_SERVICE_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_XTRA_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_XTRA_PCID_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_SUPPORTED_FEATURE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_INTERNAL_STATUS_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_INTERNAL_STATUS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_INJECT_SRN_AP_DATA_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_SRN_AP_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_CROWDSOURCE_MANAGER_CONTROL_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_CROWDSOURCE_MANAGER_READ_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_QUERY_XTRA_INFO_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_START_OUTDOOR_TRIP_BATCHING_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_QUERY_OTB_ACCUMULATED_DISTANCE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_FDCL_BS_LIST_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_FDCL_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_FDCL_SERVICE_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_BLACKLIST_SV_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_BLACKLIST_SV_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_CONSTELLATION_CONTROL_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_UNPROPAGATED_POSITION_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_BS_OBS_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_CONSTELLATION_CONTROL_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_BS_OBS_DATA_SERVICE_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_CONSTRAINED_TUNC_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_ENABLE_POSITION_ASSISTED_CLOCK_EST_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_QUERY_GNSS_ENERGY_CONSUMED_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GPS_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GLONASS_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_BDS_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GALILEO_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_QZSS_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SYSTEM_INFO_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_CONSTELLATION_CONTROL_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_UNPROPAGATED_POSITION_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_ENABLE_POSITION_INJECTION_TEST_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_TEST_POSITION_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_BS_OBS_DATA_SERVICE_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_BS_OBS_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GPS_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GLONASS_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_BDS_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_GALILEO_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_QZSS_EPHEMERIS_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_CONSTRAINED_TUNC_MODE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_ENABLE_POSITION_ASSISTED_CLOCK_EST_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_QUERY_GNSS_ENERGY_CONSUMED_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_BAND_MEASUREMENT_METRICS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_LOCATION_REQUEST_NOTIFICATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_PLATFORM_POWER_STATE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_PLATFORM_POWER_STATE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_PLATFORM_POWER_STATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_ROBUST_LOCATION_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_ROBUST_LOCATION_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_MIN_GPS_WEEK_NUMBER_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_MIN_GPS_WEEK_NUMBER_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_QUERY_XTRA_INFO_REQ_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_PARAMETER_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_PARAMETER_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_MULTIBAND_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_MULTIBAND_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_LATENCY_INFORMATION_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_LOCATION_CIVIC_ADDRESS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_LOCATION_CIVIC_ADDRESS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_LOCATION_CIVIC_ADDRESS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_PLATFORM_POWER_STATE_CHANGED_IND_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_RAW_DATA_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_RAW_DATA_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_INJECT_RAW_DATA_IND_V02),
|
||||
NAME_VAL(QMI_LOC_ENGINE_DEBUG_DATA_IND_V02),
|
||||
NAME_VAL(QMI_LOC_DC_REPORT_IND_V02),
|
||||
NAME_VAL(QMI_LOC_EVENT_ENGINE_LOCK_STATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_TRIBAND_STATE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_TRIBAND_STATE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_TRIBAND_STATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_TRIBAND_STATE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_TRIBAND_STATE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_TRIBAND_STATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SDK_FEATURE_CONFIG_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SDK_FEATURE_CONFIG_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_SDK_FEATURE_CONFIG_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GNSS_BANDS_SUPPORTED_IND_V02),
|
||||
NAME_VAL(QMI_LOC_OSNMA_PUBLIC_KEY_MERKLE_TREE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_OSNMA_PUBLIC_KEY_MERKLE_TREE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_OSNMA_PUBLIC_KEY_MERKLE_TREE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_OSNMA_STATE_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_OSNMA_STATE_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_OSNMA_STATE_IND_V02),
|
||||
NAME_VAL(QMI_LOC_SET_NTN_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_SET_NTN_STATUS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_SET_NTN_STATUS_IND_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NTN_STATUS_REQ_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NTN_STATUS_RESP_V02),
|
||||
NAME_VAL(QMI_LOC_GET_NTN_STATUS_IND_V02),
|
||||
};
|
||||
|
||||
const char* loc_get_v02_event_name(uint32_t event)
|
||||
{
|
||||
return loc_get_name_from_val(loc_v02_event_name_tbl, (int64_t) event);
|
||||
}
|
||||
|
||||
DECLARE_TBL(loc_v02_client_status_name) =
|
||||
{
|
||||
NAME_VAL(eLOC_CLIENT_SUCCESS),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_GENERAL),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_UNSUPPORTED),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_PARAMETER),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_ENGINE_BUSY),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_PHONE_OFFLINE),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_TIMEOUT),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_NOT_PRESENT),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_SERVICE_VERSION_UNSUPPORTED),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_CLIENT_VERSION_UNSUPPORTED),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_HANDLE),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_INTERNAL),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_NOT_INITIALIZED),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_NOT_ENOUGH_MEMORY),
|
||||
NAME_VAL(eLOC_CLIENT_FAILURE_INVALID_MESSAGE_ID),
|
||||
};
|
||||
|
||||
const char* loc_get_v02_client_status_name(locClientStatusEnumType status)
|
||||
{
|
||||
return loc_get_name_from_val(loc_v02_client_status_name_tbl, (int64_t) status);
|
||||
}
|
||||
|
||||
|
||||
DECLARE_TBL(loc_v02_qmi_status_name) =
|
||||
{
|
||||
NAME_VAL(eQMI_LOC_SUCCESS_V02),
|
||||
NAME_VAL(eQMI_LOC_GENERAL_FAILURE_V02),
|
||||
NAME_VAL(eQMI_LOC_UNSUPPORTED_V02),
|
||||
NAME_VAL(eQMI_LOC_INVALID_PARAMETER_V02),
|
||||
NAME_VAL(eQMI_LOC_ENGINE_BUSY_V02),
|
||||
NAME_VAL(eQMI_LOC_PHONE_OFFLINE_V02),
|
||||
NAME_VAL(eQMI_LOC_TIMEOUT_V02),
|
||||
NAME_VAL(eQMI_LOC_CONFIG_NOT_SUPPORTED_V02),
|
||||
NAME_VAL(eQMI_LOC_INSUFFICIENT_MEMORY_V02),
|
||||
NAME_VAL(eQMI_LOC_MAX_GEOFENCE_PROGRAMMED_V02),
|
||||
NAME_VAL(eQMI_LOC_XTRA_VERSION_CHECK_FAILURE_V02),
|
||||
NAME_VAL(eQMI_LOC_GNSS_DISABLED_V02),
|
||||
};
|
||||
|
||||
const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status)
|
||||
{
|
||||
return loc_get_name_from_val(loc_v02_qmi_status_name_tbl, (int64_t) status);
|
||||
}
|
||||
|
||||
|
||||
DECLARE_TBL(loc_v02_qmi_reg_mk_status_name) =
|
||||
{
|
||||
NAME_VAL(eQMI_LOC_REGISTER_MASTER_CLIENT_SUCCESS_V02),
|
||||
NAME_VAL(eQMI_LOC_REGISTER_MASTER_CLIENT_INVALID_KEY_V02),
|
||||
NAME_VAL(eQMI_LOC_REGISTER_MASTER_CLIENT_ALREADY_HAVE_MASTER_CLIENT_V02),
|
||||
NAME_VAL(eQMI_LOC_REGISTER_MASTER_CLIENT_INTERNAL_FAILURE_V02),
|
||||
};
|
||||
|
||||
const char* loc_get_v02_qmi_reg_mk_status_name(qmiLocRegisterMasterClientStatusEnumT_v02 status)
|
||||
{
|
||||
return loc_get_name_from_val(loc_v02_qmi_reg_mk_status_name_tbl, (int64_t)status);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/* Copyright (c) 2011, 2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOC_API_V02_LOG_H
|
||||
#define LOC_API_V02_LOG_H
|
||||
|
||||
#include <loc_log.h>
|
||||
#include <loc_api_v02_client.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
const char* loc_get_v02_event_name(uint32_t event);
|
||||
const char* loc_get_v02_client_status_name(locClientStatusEnumType status);
|
||||
const char* loc_get_v02_qmi_status_name(qmiLocStatusEnumT_v02 status);
|
||||
const char* loc_get_v02_qmi_reg_mk_status_name(qmiLocRegisterMasterClientStatusEnumT_v02 status);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LOC_API_V02_LOG_H */
|
||||
78
qcom/opensource/location/loc_api/loc_api_v02/loc_util_log.h
Normal file
78
qcom/opensource/location/loc_api/loc_api_v02/loc_util_log.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* Copyright (c) 2011-2012, 2014, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef LOC_UTIL_LOG_H
|
||||
#define LOC_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
|
||||
|
||||
//error logs
|
||||
#define LOC_LOGE(...) printf(__VA_ARGS__)
|
||||
//warning logs
|
||||
#define LOC_LOGW(...) printf(__VA_ARGS__)
|
||||
// debug logs
|
||||
#define LOC_LOGD(...) printf(__VA_ARGS__)
|
||||
//info logs
|
||||
#define LOC_LOGI(...) printf(__VA_ARGS__)
|
||||
//verbose logs
|
||||
#define LOC_LOGV(...) printf(__VA_ARGS__)
|
||||
#endif //__LOC_API_V02_LOG_SILENT__
|
||||
|
||||
//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 //LOC_UTIL_LOG_H
|
||||
10935
qcom/opensource/location/loc_api/loc_api_v02/location_service_v02.c
Normal file
10935
qcom/opensource/location/loc_api/loc_api_v02/location_service_v02.c
Normal file
File diff suppressed because it is too large
Load Diff
26944
qcom/opensource/location/loc_api/loc_api_v02/location_service_v02.h
Normal file
26944
qcom/opensource/location/loc_api/loc_api_v02/location_service_v02.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,502 @@
|
||||
/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
|
||||
|
||||
Q M I _ S E C G P S _ A P I _ V 0 1 . C
|
||||
|
||||
GENERAL DESCRIPTION
|
||||
This is the file which defines the secgps service Data structures.
|
||||
|
||||
|
||||
|
||||
|
||||
*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
|
||||
/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
|
||||
*THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY
|
||||
*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
|
||||
|
||||
/* This file was generated with Tool version 2.6
|
||||
It was generated on: Mon Aug 6 2018
|
||||
From IDL File: qmi_secgps_api_v01.idl */
|
||||
|
||||
#include "stdint.h"
|
||||
#include "qmi_idl_lib_internal.h"
|
||||
#include "qmi_secgps_api_v01.h"
|
||||
|
||||
|
||||
/*Type Definitions*/
|
||||
static const uint8_t secgps_name_type_data_v01[] = {
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_name_type_v01, name),
|
||||
SECGPS_MAX_NAME_SIZE_V01,
|
||||
QMI_IDL_OFFSET8(secgps_name_type_v01, name) - QMI_IDL_OFFSET8(secgps_name_type_v01, name_len),
|
||||
|
||||
QMI_IDL_FLAG_END_VALUE
|
||||
};
|
||||
|
||||
/*Message Definitions*/
|
||||
static const uint8_t secgps_req_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_req_msg_v01, ping),
|
||||
4,
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_req_msg_v01, client_name) - QMI_IDL_OFFSET8(secgps_req_msg_v01, client_name_valid)),
|
||||
0x10,
|
||||
QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET8(secgps_req_msg_v01, client_name),
|
||||
QMI_IDL_TYPE88(0, 0)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_resp_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_resp_msg_v01, pong),
|
||||
4,
|
||||
|
||||
0x02,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_resp_msg_v01, resp),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_resp_msg_v01, service_name) - QMI_IDL_OFFSET8(secgps_resp_msg_v01, service_name_valid)),
|
||||
0x10,
|
||||
QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET8(secgps_resp_msg_v01, service_name),
|
||||
QMI_IDL_TYPE88(0, 0)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_ind_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ind_msg_v01, indication),
|
||||
5,
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_ind_msg_v01, service_name) - QMI_IDL_OFFSET8(secgps_ind_msg_v01, service_name_valid)),
|
||||
0x10,
|
||||
QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET8(secgps_ind_msg_v01, service_name),
|
||||
QMI_IDL_TYPE88(0, 0)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_data_req_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_data_req_msg_v01, data),
|
||||
((SECGPS_MAX_DATA_SIZE_V01) & 0xFF), ((SECGPS_MAX_DATA_SIZE_V01) >> 8),
|
||||
QMI_IDL_OFFSET8(secgps_data_req_msg_v01, data) - QMI_IDL_OFFSET8(secgps_data_req_msg_v01, data_len),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(secgps_data_req_msg_v01, client_name) - QMI_IDL_OFFSET16RELATIVE(secgps_data_req_msg_v01, client_name_valid)),
|
||||
0x10,
|
||||
QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET16ARRAY(secgps_data_req_msg_v01, client_name),
|
||||
QMI_IDL_TYPE88(0, 0)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_data_resp_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_data_resp_msg_v01, data),
|
||||
((SECGPS_MAX_DATA_SIZE_V01) & 0xFF), ((SECGPS_MAX_DATA_SIZE_V01) >> 8),
|
||||
QMI_IDL_OFFSET8(secgps_data_resp_msg_v01, data) - QMI_IDL_OFFSET8(secgps_data_resp_msg_v01, data_len),
|
||||
|
||||
0x02,
|
||||
QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET16ARRAY(secgps_data_resp_msg_v01, resp),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(secgps_data_resp_msg_v01, service_name) - QMI_IDL_OFFSET16RELATIVE(secgps_data_resp_msg_v01, service_name_valid)),
|
||||
0x10,
|
||||
QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET16ARRAY(secgps_data_resp_msg_v01, service_name),
|
||||
QMI_IDL_TYPE88(0, 0)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_data_ind_reg_req_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, num_inds) - QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, num_inds_valid)),
|
||||
0x10,
|
||||
QMI_IDL_GENERIC_2_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, num_inds),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, ind_size) - QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, ind_size_valid)),
|
||||
0x11,
|
||||
QMI_IDL_GENERIC_2_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, ind_size),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, ind_delay) - QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, ind_delay_valid)),
|
||||
0x12,
|
||||
QMI_IDL_GENERIC_2_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, ind_delay),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, num_reqs) - QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, num_reqs_valid)),
|
||||
0x13,
|
||||
QMI_IDL_GENERIC_2_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, num_reqs),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, client_name) - QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, client_name_valid)),
|
||||
0x14,
|
||||
QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET8(secgps_data_ind_reg_req_msg_v01, client_name),
|
||||
QMI_IDL_TYPE88(0, 0)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_data_ind_reg_resp_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_data_ind_reg_resp_msg_v01, resp),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_data_ind_reg_resp_msg_v01, service_name) - QMI_IDL_OFFSET8(secgps_data_ind_reg_resp_msg_v01, service_name_valid)),
|
||||
0x10,
|
||||
QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET8(secgps_data_ind_reg_resp_msg_v01, service_name),
|
||||
QMI_IDL_TYPE88(0, 0)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_data_ind_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_data_ind_msg_v01, data),
|
||||
((SECGPS_MAX_DATA_SIZE_V01) & 0xFF), ((SECGPS_MAX_DATA_SIZE_V01) >> 8),
|
||||
QMI_IDL_OFFSET8(secgps_data_ind_msg_v01, data) - QMI_IDL_OFFSET8(secgps_data_ind_msg_v01, data_len),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET16RELATIVE(secgps_data_ind_msg_v01, service_name) - QMI_IDL_OFFSET16RELATIVE(secgps_data_ind_msg_v01, service_name_valid)),
|
||||
0x10,
|
||||
QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET16ARRAY(secgps_data_ind_msg_v01, service_name),
|
||||
QMI_IDL_TYPE88(0, 0)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_get_service_name_req_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | QMI_IDL_TLV_FLAGS_OPTIONAL | (QMI_IDL_OFFSET8(secgps_get_service_name_req_msg_v01, client_name) - QMI_IDL_OFFSET8(secgps_get_service_name_req_msg_v01, client_name_valid)),
|
||||
0x10,
|
||||
QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET8(secgps_get_service_name_req_msg_v01, client_name),
|
||||
QMI_IDL_TYPE88(0, 0)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_get_service_name_resp_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET8(secgps_get_service_name_resp_msg_v01, service_name),
|
||||
QMI_IDL_TYPE88(0, 0),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02,
|
||||
QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET16ARRAY(secgps_get_service_name_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
/*
|
||||
* secgps_null_req_msg is empty
|
||||
* static const uint8_t secgps_null_req_msg_data_v01[] = {
|
||||
* };
|
||||
*/
|
||||
|
||||
static const uint8_t secgps_null_resp_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_AGGREGATE,
|
||||
QMI_IDL_OFFSET8(secgps_null_resp_msg_v01, service_name),
|
||||
QMI_IDL_TYPE88(0, 0),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02,
|
||||
QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET16ARRAY(secgps_null_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
/*
|
||||
* secgps_null_ind_msg is empty
|
||||
* static const uint8_t secgps_null_ind_msg_data_v01[] = {
|
||||
* };
|
||||
*/
|
||||
|
||||
static const uint8_t secgps_set_supported_agps_mode_req_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_4_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_supported_agps_mode_req_msg_v01, agps_mode)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_set_supported_agps_mode_resp_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_supported_agps_mode_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_set_xtra_enable_req_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_xtra_enable_req_msg_v01, enable)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_set_xtra_enable_resp_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_xtra_enable_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_set_glonass_enable_req_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_glonass_enable_req_msg_v01, enable)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_set_glonass_enable_resp_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_glonass_enable_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_set_cert_type_req_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_cert_type_req_msg_v01, cert_type)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_set_cert_type_resp_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_cert_type_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_ftm_req_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ftm_req_msg_v01, action),
|
||||
|
||||
0x02,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ftm_req_msg_v01, system_type),
|
||||
|
||||
0x03,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ftm_req_msg_v01, channel_mode),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ftm_req_msg_v01, freq)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_ftm_resp_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ftm_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_ftm_ind_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ftm_ind_msg_v01, system_type),
|
||||
|
||||
0x02,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ftm_ind_msg_v01, freq),
|
||||
|
||||
0x03,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ftm_ind_msg_v01, cno),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_ftm_ind_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_change_engine_only_mode_req_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_change_engine_only_mode_req_msg_v01, change_engine_only_mode)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_change_engine_only_mode_resp_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_change_engine_only_mode_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_set_spirent_type_req_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_spirent_type_req_msg_v01, spirent_type)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_set_spirent_type_resp_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_set_spirent_type_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_inject_ni_message_req_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_inject_ni_message_req_msg_v01, injectedNIMessageType),
|
||||
|
||||
0x02,
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_inject_ni_message_req_msg_v01, injectedNIMessage),
|
||||
((SECGPS_MAX_SUPL_NI_MSG_SIZE_V01) & 0xFF), ((SECGPS_MAX_SUPL_NI_MSG_SIZE_V01) >> 8),
|
||||
QMI_IDL_OFFSET8(secgps_inject_ni_message_req_msg_v01, injectedNIMessage) - QMI_IDL_OFFSET8(secgps_inject_ni_message_req_msg_v01, injectedNIMessage_len),
|
||||
|
||||
0x03,
|
||||
QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET16ARRAY(secgps_inject_ni_message_req_msg_v01, subid_valid),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x04,
|
||||
QMI_IDL_FLAGS_OFFSET_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET16ARRAY(secgps_inject_ni_message_req_msg_v01, sub_id)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_inject_ni_message_resp_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_inject_ni_message_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_agnss_config_message_req_msg_data_v01[] = {
|
||||
0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_agnss_config_message_req_msg_v01, agnssConfigMessageType),
|
||||
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x02,
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_agnss_config_message_req_msg_v01, agnssConfigMessage),
|
||||
((SECGPS_MAX_AGNSS_CONFIG_MSG_SIZE_V01) & 0xFF), ((SECGPS_MAX_AGNSS_CONFIG_MSG_SIZE_V01) >> 8),
|
||||
QMI_IDL_OFFSET8(secgps_agnss_config_message_req_msg_v01, agnssConfigMessage) - QMI_IDL_OFFSET8(secgps_agnss_config_message_req_msg_v01, agnssConfigMessage_len)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_agnss_config_message_resp_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_agnss_config_message_resp_msg_v01, resp)
|
||||
};
|
||||
|
||||
static const uint8_t secgps_agnss_config_message_ind_msg_data_v01[] = {
|
||||
QMI_IDL_TLV_FLAGS_LAST_TLV | 0x01,
|
||||
QMI_IDL_FLAGS_IS_ARRAY | QMI_IDL_FLAGS_IS_VARIABLE_LEN | QMI_IDL_FLAGS_SZ_IS_16 | QMI_IDL_GENERIC_1_BYTE,
|
||||
QMI_IDL_OFFSET8(secgps_agnss_config_message_ind_msg_v01, agnssConfigMessage),
|
||||
((SECGPS_MAX_AGNSS_CONFIG_MSG_SIZE_V01) & 0xFF), ((SECGPS_MAX_AGNSS_CONFIG_MSG_SIZE_V01) >> 8),
|
||||
QMI_IDL_OFFSET8(secgps_agnss_config_message_ind_msg_v01, agnssConfigMessage) - QMI_IDL_OFFSET8(secgps_agnss_config_message_ind_msg_v01, agnssConfigMessage_len)
|
||||
};
|
||||
|
||||
/* Type Table */
|
||||
static const qmi_idl_type_table_entry secgps_type_table_v01[] = {
|
||||
{sizeof(secgps_name_type_v01), secgps_name_type_data_v01}
|
||||
};
|
||||
|
||||
/* Message Table */
|
||||
static const qmi_idl_message_table_entry secgps_message_table_v01[] = {
|
||||
{sizeof(secgps_req_msg_v01), secgps_req_msg_data_v01},
|
||||
{sizeof(secgps_resp_msg_v01), secgps_resp_msg_data_v01},
|
||||
{sizeof(secgps_ind_msg_v01), secgps_ind_msg_data_v01},
|
||||
{sizeof(secgps_data_req_msg_v01), secgps_data_req_msg_data_v01},
|
||||
{sizeof(secgps_data_resp_msg_v01), secgps_data_resp_msg_data_v01},
|
||||
{sizeof(secgps_data_ind_reg_req_msg_v01), secgps_data_ind_reg_req_msg_data_v01},
|
||||
{sizeof(secgps_data_ind_reg_resp_msg_v01), secgps_data_ind_reg_resp_msg_data_v01},
|
||||
{sizeof(secgps_data_ind_msg_v01), secgps_data_ind_msg_data_v01},
|
||||
{sizeof(secgps_get_service_name_req_msg_v01), secgps_get_service_name_req_msg_data_v01},
|
||||
{sizeof(secgps_get_service_name_resp_msg_v01), secgps_get_service_name_resp_msg_data_v01},
|
||||
{sizeof(secgps_null_req_msg_v01), 0},
|
||||
{sizeof(secgps_null_resp_msg_v01), secgps_null_resp_msg_data_v01},
|
||||
{sizeof(secgps_null_ind_msg_v01), 0},
|
||||
{sizeof(secgps_set_supported_agps_mode_req_msg_v01), secgps_set_supported_agps_mode_req_msg_data_v01},
|
||||
{sizeof(secgps_set_supported_agps_mode_resp_msg_v01), secgps_set_supported_agps_mode_resp_msg_data_v01},
|
||||
{sizeof(secgps_set_xtra_enable_req_msg_v01), secgps_set_xtra_enable_req_msg_data_v01},
|
||||
{sizeof(secgps_set_xtra_enable_resp_msg_v01), secgps_set_xtra_enable_resp_msg_data_v01},
|
||||
{sizeof(secgps_set_glonass_enable_req_msg_v01), secgps_set_glonass_enable_req_msg_data_v01},
|
||||
{sizeof(secgps_set_glonass_enable_resp_msg_v01), secgps_set_glonass_enable_resp_msg_data_v01},
|
||||
{sizeof(secgps_set_cert_type_req_msg_v01), secgps_set_cert_type_req_msg_data_v01},
|
||||
{sizeof(secgps_set_cert_type_resp_msg_v01), secgps_set_cert_type_resp_msg_data_v01},
|
||||
{sizeof(secgps_ftm_req_msg_v01), secgps_ftm_req_msg_data_v01},
|
||||
{sizeof(secgps_ftm_resp_msg_v01), secgps_ftm_resp_msg_data_v01},
|
||||
{sizeof(secgps_ftm_ind_msg_v01), secgps_ftm_ind_msg_data_v01},
|
||||
{sizeof(secgps_change_engine_only_mode_req_msg_v01), secgps_change_engine_only_mode_req_msg_data_v01},
|
||||
{sizeof(secgps_change_engine_only_mode_resp_msg_v01), secgps_change_engine_only_mode_resp_msg_data_v01},
|
||||
{sizeof(secgps_set_spirent_type_req_msg_v01), secgps_set_spirent_type_req_msg_data_v01},
|
||||
{sizeof(secgps_set_spirent_type_resp_msg_v01), secgps_set_spirent_type_resp_msg_data_v01},
|
||||
{sizeof(secgps_inject_ni_message_req_msg_v01), secgps_inject_ni_message_req_msg_data_v01},
|
||||
{sizeof(secgps_inject_ni_message_resp_msg_v01), secgps_inject_ni_message_resp_msg_data_v01},
|
||||
{sizeof(secgps_agnss_config_message_req_msg_v01), secgps_agnss_config_message_req_msg_data_v01},
|
||||
{sizeof(secgps_agnss_config_message_resp_msg_v01), secgps_agnss_config_message_resp_msg_data_v01},
|
||||
{sizeof(secgps_agnss_config_message_ind_msg_v01), secgps_agnss_config_message_ind_msg_data_v01}
|
||||
};
|
||||
|
||||
/* Range Table */
|
||||
/* Predefine the Type Table Object */
|
||||
static const qmi_idl_type_table_object secgps_qmi_idl_type_table_object_v01;
|
||||
|
||||
/*Referenced Tables Array*/
|
||||
static const qmi_idl_type_table_object *secgps_qmi_idl_type_table_object_referenced_tables_v01[] =
|
||||
{&secgps_qmi_idl_type_table_object_v01};
|
||||
|
||||
/*Type Table Object*/
|
||||
static const qmi_idl_type_table_object secgps_qmi_idl_type_table_object_v01 = {
|
||||
sizeof(secgps_type_table_v01)/sizeof(qmi_idl_type_table_entry ),
|
||||
sizeof(secgps_message_table_v01)/sizeof(qmi_idl_message_table_entry),
|
||||
1,
|
||||
secgps_type_table_v01,
|
||||
secgps_message_table_v01,
|
||||
secgps_qmi_idl_type_table_object_referenced_tables_v01,
|
||||
NULL
|
||||
};
|
||||
|
||||
/*Arrays of service_message_table_entries for commands, responses and indications*/
|
||||
static const qmi_idl_service_message_table_entry secgps_service_command_messages_v01[] = {
|
||||
{QMI_SECGPS_REQ_V01, QMI_IDL_TYPE16(0, 0), 266},
|
||||
{QMI_SECGPS_DATA_REQ_V01, QMI_IDL_TYPE16(0, 3), 8456},
|
||||
{QMI_SECGPS_DATA_IND_REG_REQ_V01, QMI_IDL_TYPE16(0, 5), 279},
|
||||
{QMI_SECGPS_GET_SERVICE_NAME_REQ_V01, QMI_IDL_TYPE16(0, 8), 259},
|
||||
{QMI_SECGPS_NULL_REQ_V01, QMI_IDL_TYPE16(0, 10), 0},
|
||||
{QMI_SECGPS_SET_SUPPORTED_AGPS_MODE_REQ_V01, QMI_IDL_TYPE16(0, 13), 7},
|
||||
{QMI_SECGPS_SET_XTRA_ENABLE_REQ_V01, QMI_IDL_TYPE16(0, 15), 4},
|
||||
{QMI_SECGPS_SET_GLONASS_ENABLE_REQ_V01, QMI_IDL_TYPE16(0, 17), 4},
|
||||
{QMI_SECGPS_SET_CERT_TYPE_REQ_V01, QMI_IDL_TYPE16(0, 19), 4},
|
||||
{QMI_SECGPS_FTM_REQ_V01, QMI_IDL_TYPE16(0, 21), 16},
|
||||
{QMI_SECGPS_SET_SPIRENT_TYPE_REQ_V01, QMI_IDL_TYPE16(0, 26), 4},
|
||||
{QMI_SECGPS_INJECT_NI_MESSAGE_REQ_V01, QMI_IDL_TYPE16(0, 28), 1041},
|
||||
{QMI_SECGPS_CHANGE_ENGINE_ONLY_MODE_REQ_V01, QMI_IDL_TYPE16(0, 24), 4},
|
||||
{QMI_SECGPS_AGNSS_CONFIG_MESSAGE_REQ_V01, QMI_IDL_TYPE16(0, 30), 2057}
|
||||
};
|
||||
|
||||
static const qmi_idl_service_message_table_entry secgps_service_response_messages_v01[] = {
|
||||
{QMI_SECGPS_RESP_V01, QMI_IDL_TYPE16(0, 1), 270},
|
||||
{QMI_SECGPS_DATA_RESP_V01, QMI_IDL_TYPE16(0, 4), 8460},
|
||||
{QMI_SECGPS_DATA_IND_REG_RESP_V01, QMI_IDL_TYPE16(0, 6), 263},
|
||||
{QMI_SECGPS_GET_SERVICE_NAME_RESP_V01, QMI_IDL_TYPE16(0, 9), 263},
|
||||
{QMI_SECGPS_NULL_RESP_V01, QMI_IDL_TYPE16(0, 11), 263},
|
||||
{QMI_SECGPS_SET_SUPPORTED_AGPS_MODE_RESP_V01, QMI_IDL_TYPE16(0, 14), 4},
|
||||
{QMI_SECGPS_SET_XTRA_ENABLE_RESP_V01, QMI_IDL_TYPE16(0, 16), 4},
|
||||
{QMI_SECGPS_SET_GLONASS_ENABLE_RESP_V01, QMI_IDL_TYPE16(0, 18), 4},
|
||||
{QMI_SECGPS_SET_CERT_TYPE_RESP_V01, QMI_IDL_TYPE16(0, 20), 4},
|
||||
{QMI_SECGPS_FTM_RESP_V01, QMI_IDL_TYPE16(0, 22), 4},
|
||||
{QMI_SECGPS_SET_SPIRENT_TYPE_RESP_V01, QMI_IDL_TYPE16(0, 27), 4},
|
||||
{QMI_SECGPS_INJECT_NI_MESSAGE_RESP_V01, QMI_IDL_TYPE16(0, 29), 4},
|
||||
{QMI_SECGPS_CHANGE_ENGINE_ONLY_MODE_RESP_V01, QMI_IDL_TYPE16(0, 25), 4},
|
||||
{QMI_SECGPS_AGNSS_CONFIG_MESSAGE_RESP_V01, QMI_IDL_TYPE16(0, 31), 4}
|
||||
};
|
||||
|
||||
static const qmi_idl_service_message_table_entry secgps_service_indication_messages_v01[] = {
|
||||
{QMI_SECGPS_IND_V01, QMI_IDL_TYPE16(0, 2), 267},
|
||||
{QMI_SECGPS_DATA_IND_V01, QMI_IDL_TYPE16(0, 7), 8456},
|
||||
{QMI_SECGPS_NULL_IND_V01, QMI_IDL_TYPE16(0, 12), 0},
|
||||
{QMI_SECGPS_FTM_IND_V01, QMI_IDL_TYPE16(0, 23), 16},
|
||||
{QMI_SECGPS_AGNSS_CONFIG_MESSAGE_IND_V01, QMI_IDL_TYPE16(0, 32), 2053}
|
||||
};
|
||||
|
||||
/*Service Object*/
|
||||
struct qmi_idl_service_object secgps_qmi_idl_service_object_v01 = {
|
||||
0x06,
|
||||
0x01,
|
||||
0xE8,
|
||||
8460,
|
||||
{ sizeof(secgps_service_command_messages_v01)/sizeof(qmi_idl_service_message_table_entry),
|
||||
sizeof(secgps_service_response_messages_v01)/sizeof(qmi_idl_service_message_table_entry),
|
||||
sizeof(secgps_service_indication_messages_v01)/sizeof(qmi_idl_service_message_table_entry) },
|
||||
{ secgps_service_command_messages_v01, secgps_service_response_messages_v01, secgps_service_indication_messages_v01},
|
||||
&secgps_qmi_idl_type_table_object_v01,
|
||||
0x01,
|
||||
NULL
|
||||
};
|
||||
|
||||
/* Service Object Accessor */
|
||||
qmi_idl_service_object_type secgps_get_service_object_internal_v01
|
||||
( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version ){
|
||||
if ( SECGPS_V01_IDL_MAJOR_VERS != idl_maj_version || SECGPS_V01_IDL_MINOR_VERS != idl_min_version
|
||||
|| SECGPS_V01_IDL_TOOL_VERS != library_version)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return (qmi_idl_service_object_type)&secgps_qmi_idl_service_object_v01;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,702 @@
|
||||
#ifndef SECGPS_SERVICE_01_H
|
||||
#define SECGPS_SERVICE_01_H
|
||||
/**
|
||||
@file qmi_secgps_api_v01.h
|
||||
|
||||
@brief This is the public header file which defines the secgps service Data structures.
|
||||
|
||||
This header file defines the types and structures that were defined in
|
||||
secgps. It contains the constant values defined, enums, structures,
|
||||
messages, and service message IDs (in that order) Structures that were
|
||||
defined in the IDL as messages contain mandatory elements, optional
|
||||
elements, a combination of mandatory and optional elements (mandatory
|
||||
always come before optionals in the structure), or nothing (null message)
|
||||
|
||||
An optional element in a message is preceded by a uint8_t value that must be
|
||||
set to true if the element is going to be included. When decoding a received
|
||||
message, the uint8_t values will be set to true or false by the decode
|
||||
routine, and should be checked before accessing the values that they
|
||||
correspond to.
|
||||
|
||||
Variable sized arrays are defined as static sized arrays with an unsigned
|
||||
integer (32 bit) preceding it that must be set to the number of elements
|
||||
in the array that are valid. For Example:
|
||||
|
||||
uint32_t test_opaque_len;
|
||||
uint8_t test_opaque[16];
|
||||
|
||||
If only 4 elements are added to test_opaque[] then test_opaque_len must be
|
||||
set to 4 before sending the message. When decoding, the _len value is set
|
||||
by the decode routine and should be checked so that the correct number of
|
||||
elements in the array will be accessed.
|
||||
|
||||
*/
|
||||
/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
|
||||
|
||||
|
||||
|
||||
*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
|
||||
/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
|
||||
*THIS IS AN AUTO GENERATED FILE. DO NOT ALTER IN ANY WAY
|
||||
*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
|
||||
|
||||
/* This file was generated with Tool version 6.13
|
||||
It was generated on: Thu Oct 27 2022 (Spin 0)
|
||||
From IDL File: qmi_secgps_api_v01.idl */
|
||||
|
||||
/** @defgroup secgps_qmi_consts Constant values defined in the IDL */
|
||||
/** @defgroup secgps_qmi_msg_ids Constant values for QMI message IDs */
|
||||
/** @defgroup secgps_qmi_enums Enumerated types used in QMI messages */
|
||||
/** @defgroup secgps_qmi_messages Structures sent as QMI messages */
|
||||
/** @defgroup secgps_qmi_aggregates Aggregate types used in QMI messages */
|
||||
/** @defgroup secgps_qmi_accessor Accessor for QMI service object */
|
||||
/** @defgroup secgps_qmi_version Constant values for versioning information */
|
||||
|
||||
#include <stdint.h>
|
||||
#include "qmi_idl_lib.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @addtogroup secgps_qmi_version
|
||||
@{
|
||||
*/
|
||||
/** Major Version Number of the IDL used to generate this file */
|
||||
#define SECGPS_V01_IDL_MAJOR_VERS 0x01
|
||||
/** Revision Number of the IDL used to generate this file */
|
||||
#define SECGPS_V01_IDL_MINOR_VERS 0x01
|
||||
/** Major Version Number of the qmi_idl_compiler used to generate this file */
|
||||
#define SECGPS_V01_IDL_TOOL_VERS 0x06
|
||||
/** Maximum Defined Message ID */
|
||||
#define SECGPS_V01_MAX_MESSAGE_ID 0x000F
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
|
||||
/** @addtogroup secgps_qmi_consts
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
Maximum size for a data TLV */
|
||||
#define SECGPS_MAX_DATA_SIZE_V01 8192
|
||||
|
||||
/** Maximum length of a client or service name */
|
||||
#define SECGPS_MAX_NAME_SIZE_V01 255
|
||||
#define SECGPS_MAX_SUPL_NI_MSG_SIZE_V01 1024
|
||||
#define SECGPS_MAX_AGNSS_CONFIG_MSG_SIZE_V01 2048
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_aggregates
|
||||
@{
|
||||
*/
|
||||
typedef struct {
|
||||
|
||||
uint32_t name_len; /**< Must be set to # of elements in name */
|
||||
char name[SECGPS_MAX_NAME_SIZE_V01];
|
||||
}secgps_name_type_v01; /* Type */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
char ping[4];
|
||||
/**< Simple 'secgps' request */
|
||||
|
||||
/* Optional */
|
||||
uint8_t client_name_valid; /**< Must be set to true if client_name is being passed */
|
||||
secgps_name_type_v01 client_name;
|
||||
/**< Optional name to identify clients */
|
||||
}secgps_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
char pong[4];
|
||||
/**< Simple 'pong' response */
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
|
||||
/* Optional */
|
||||
uint8_t service_name_valid; /**< Must be set to true if service_name is being passed */
|
||||
secgps_name_type_v01 service_name;
|
||||
/**< Optional name to identify service */
|
||||
}secgps_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
char indication[5];
|
||||
/**< Simple 'hello' indication */
|
||||
|
||||
/* Optional */
|
||||
uint8_t service_name_valid; /**< Must be set to true if service_name is being passed */
|
||||
secgps_name_type_v01 service_name;
|
||||
/**< Optional name to identify service */
|
||||
}secgps_ind_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint32_t data_len; /**< Must be set to # of elements in data */
|
||||
uint8_t data[SECGPS_MAX_DATA_SIZE_V01];
|
||||
/**< Variable sized data request */
|
||||
|
||||
/* Optional */
|
||||
uint8_t client_name_valid; /**< Must be set to true if client_name is being passed */
|
||||
secgps_name_type_v01 client_name;
|
||||
/**< Optional name to identify clients */
|
||||
}secgps_data_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint32_t data_len; /**< Must be set to # of elements in data */
|
||||
uint8_t data[SECGPS_MAX_DATA_SIZE_V01];
|
||||
/**< Variable sized data response */
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
|
||||
/* Optional */
|
||||
uint8_t service_name_valid; /**< Must be set to true if service_name is being passed */
|
||||
secgps_name_type_v01 service_name;
|
||||
/**< Optional name to identify service */
|
||||
}secgps_data_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Optional */
|
||||
uint8_t num_inds_valid; /**< Must be set to true if num_inds is being passed */
|
||||
uint16_t num_inds;
|
||||
/**< Number of indications to send */
|
||||
|
||||
/* Optional */
|
||||
uint8_t ind_size_valid; /**< Must be set to true if ind_size is being passed */
|
||||
uint16_t ind_size;
|
||||
/**< Max value 65000 */
|
||||
|
||||
/* Optional */
|
||||
uint8_t ind_delay_valid; /**< Must be set to true if ind_delay is being passed */
|
||||
uint16_t ind_delay;
|
||||
|
||||
/* Optional */
|
||||
uint8_t num_reqs_valid; /**< Must be set to true if num_reqs is being passed */
|
||||
uint16_t num_reqs;
|
||||
|
||||
/* Optional */
|
||||
uint8_t client_name_valid; /**< Must be set to true if client_name is being passed */
|
||||
secgps_name_type_v01 client_name;
|
||||
/**< Optional name to identify clients */
|
||||
}secgps_data_ind_reg_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
/**< Standard response type. */
|
||||
|
||||
/* Optional */
|
||||
uint8_t service_name_valid; /**< Must be set to true if service_name is being passed */
|
||||
secgps_name_type_v01 service_name;
|
||||
/**< Optional name to identify service */
|
||||
}secgps_data_ind_reg_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint32_t data_len; /**< Must be set to # of elements in data */
|
||||
uint8_t data[SECGPS_MAX_DATA_SIZE_V01];
|
||||
/**< Variable sized data indication */
|
||||
|
||||
/* Optional */
|
||||
uint8_t service_name_valid; /**< Must be set to true if service_name is being passed */
|
||||
secgps_name_type_v01 service_name;
|
||||
/**< Optional name to identify service */
|
||||
}secgps_data_ind_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Optional */
|
||||
uint8_t client_name_valid; /**< Must be set to true if client_name is being passed */
|
||||
secgps_name_type_v01 client_name;
|
||||
/**< Optional name to identify clients */
|
||||
}secgps_get_service_name_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
secgps_name_type_v01 service_name;
|
||||
/**< Name to identify service */
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
}secgps_get_service_name_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/* This element is a placeholder to prevent the declaration of
|
||||
an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */
|
||||
char __placeholder;
|
||||
}secgps_null_req_msg_v01;
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
secgps_name_type_v01 service_name;
|
||||
/**< Name to identify service */
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
}secgps_null_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/* This element is a placeholder to prevent the declaration of
|
||||
an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE */
|
||||
char __placeholder;
|
||||
}secgps_null_ind_msg_v01;
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint32_t agps_mode;
|
||||
}secgps_set_supported_agps_mode_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
}secgps_set_supported_agps_mode_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t enable;
|
||||
}secgps_set_xtra_enable_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
}secgps_set_xtra_enable_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t enable;
|
||||
}secgps_set_glonass_enable_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
}secgps_set_glonass_enable_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t cert_type;
|
||||
}secgps_set_cert_type_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
}secgps_set_cert_type_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t action;
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t system_type;
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t channel_mode;
|
||||
|
||||
/* Mandatory */
|
||||
int8_t freq;
|
||||
}secgps_ftm_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t resp;
|
||||
}secgps_ftm_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t system_type;
|
||||
|
||||
/* Mandatory */
|
||||
int8_t freq;
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t cno;
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t resp;
|
||||
}secgps_ftm_ind_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t change_engine_only_mode;
|
||||
}secgps_change_engine_only_mode_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t resp;
|
||||
}secgps_change_engine_only_mode_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t spirent_type;
|
||||
}secgps_set_spirent_type_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
}secgps_set_spirent_type_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t injectedNIMessageType;
|
||||
|
||||
/* Mandatory */
|
||||
uint32_t injectedNIMessage_len; /**< Must be set to # of elements in injectedNIMessage */
|
||||
uint8_t injectedNIMessage[SECGPS_MAX_SUPL_NI_MSG_SIZE_V01];
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t subid_valid;
|
||||
|
||||
/* Mandatory */
|
||||
int8_t sub_id;
|
||||
}secgps_inject_ni_message_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
}secgps_inject_ni_message_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint8_t agnssConfigMessageType;
|
||||
|
||||
/* Mandatory */
|
||||
uint32_t agnssConfigMessage_len; /**< Must be set to # of elements in agnssConfigMessage */
|
||||
uint8_t agnssConfigMessage[SECGPS_MAX_AGNSS_CONFIG_MSG_SIZE_V01];
|
||||
}secgps_agnss_config_message_req_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
int8_t resp;
|
||||
}secgps_agnss_config_message_resp_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/** @addtogroup secgps_qmi_messages
|
||||
@{
|
||||
*/
|
||||
/** Message; */
|
||||
typedef struct {
|
||||
|
||||
/* Mandatory */
|
||||
uint32_t agnssConfigMessage_len; /**< Must be set to # of elements in agnssConfigMessage */
|
||||
uint8_t agnssConfigMessage[SECGPS_MAX_AGNSS_CONFIG_MSG_SIZE_V01];
|
||||
}secgps_agnss_config_message_ind_msg_v01; /* Message */
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/* Conditional compilation tags for message removal */
|
||||
|
||||
/*Service Message Definition*/
|
||||
/** @addtogroup secgps_qmi_msg_ids
|
||||
@{
|
||||
*/
|
||||
#define QMI_SECGPS_REQ_V01 0x0001
|
||||
#define QMI_SECGPS_RESP_V01 0x0001
|
||||
#define QMI_SECGPS_IND_V01 0x0001
|
||||
#define QMI_SECGPS_DATA_REQ_V01 0x0002
|
||||
#define QMI_SECGPS_DATA_RESP_V01 0x0002
|
||||
#define QMI_SECGPS_DATA_IND_REG_REQ_V01 0x0003
|
||||
#define QMI_SECGPS_DATA_IND_REG_RESP_V01 0x0003
|
||||
#define QMI_SECGPS_DATA_IND_V01 0x0004
|
||||
#define QMI_SECGPS_GET_SERVICE_NAME_REQ_V01 0x0005
|
||||
#define QMI_SECGPS_GET_SERVICE_NAME_RESP_V01 0x0005
|
||||
#define QMI_SECGPS_NULL_REQ_V01 0x0006
|
||||
#define QMI_SECGPS_NULL_RESP_V01 0x0006
|
||||
#define QMI_SECGPS_NULL_IND_V01 0x0006
|
||||
#define QMI_SECGPS_SET_SUPPORTED_AGPS_MODE_REQ_V01 0x0007
|
||||
#define QMI_SECGPS_SET_SUPPORTED_AGPS_MODE_RESP_V01 0x0007
|
||||
#define QMI_SECGPS_SET_XTRA_ENABLE_REQ_V01 0x0008
|
||||
#define QMI_SECGPS_SET_XTRA_ENABLE_RESP_V01 0x0008
|
||||
#define QMI_SECGPS_SET_GLONASS_ENABLE_REQ_V01 0x0009
|
||||
#define QMI_SECGPS_SET_GLONASS_ENABLE_RESP_V01 0x0009
|
||||
#define QMI_SECGPS_SET_CERT_TYPE_REQ_V01 0x000A
|
||||
#define QMI_SECGPS_SET_CERT_TYPE_RESP_V01 0x000A
|
||||
#define QMI_SECGPS_FTM_REQ_V01 0x000B
|
||||
#define QMI_SECGPS_FTM_RESP_V01 0x000B
|
||||
#define QMI_SECGPS_FTM_IND_V01 0x000B
|
||||
#define QMI_SECGPS_SET_SPIRENT_TYPE_REQ_V01 0x000C
|
||||
#define QMI_SECGPS_SET_SPIRENT_TYPE_RESP_V01 0x000C
|
||||
#define QMI_SECGPS_INJECT_NI_MESSAGE_REQ_V01 0x000D
|
||||
#define QMI_SECGPS_INJECT_NI_MESSAGE_RESP_V01 0x000D
|
||||
#define QMI_SECGPS_CHANGE_ENGINE_ONLY_MODE_REQ_V01 0x000E
|
||||
#define QMI_SECGPS_CHANGE_ENGINE_ONLY_MODE_RESP_V01 0x000E
|
||||
#define QMI_SECGPS_AGNSS_CONFIG_MESSAGE_REQ_V01 0x000F
|
||||
#define QMI_SECGPS_AGNSS_CONFIG_MESSAGE_RESP_V01 0x000F
|
||||
#define QMI_SECGPS_AGNSS_CONFIG_MESSAGE_IND_V01 0x000F
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
/* Service Object Accessor */
|
||||
/** @addtogroup wms_qmi_accessor
|
||||
@{
|
||||
*/
|
||||
/** This function is used internally by the autogenerated code. Clients should use the
|
||||
macro secgps_get_service_object_v01( ) that takes in no arguments. */
|
||||
qmi_idl_service_object_type secgps_get_service_object_internal_v01
|
||||
( int32_t idl_maj_version, int32_t idl_min_version, int32_t library_version );
|
||||
|
||||
/** This macro should be used to get the service object */
|
||||
#define secgps_get_service_object_v01( ) \
|
||||
secgps_get_service_object_internal_v01( \
|
||||
SECGPS_V01_IDL_MAJOR_VERS, SECGPS_V01_IDL_MINOR_VERS, \
|
||||
SECGPS_V01_IDL_TOOL_VERS )
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
462
qcom/opensource/location/loc_api/loc_api_v02/qmi_secgps_clnt.c
Normal file
462
qcom/opensource/location/loc_api/loc_api_v02/qmi_secgps_clnt.c
Normal file
@@ -0,0 +1,462 @@
|
||||
/******************************************************************************
|
||||
---------------------------------------------------------------------------
|
||||
Copyright (c) 2011 QUALCOMM Incorporated. All Rights Reserved.
|
||||
QUALCOMM Proprietary and Confidential.
|
||||
---------------------------------------------------------------------------
|
||||
*******************************************************************************/
|
||||
#define LOG_TAG "qmi_secgps_clnt"
|
||||
#include <utils/Log.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "qmi_secgps_clnt.h"
|
||||
|
||||
static qmi_client_type clnt, notifier;
|
||||
|
||||
secgps_set_supported_agps_mode_resp_msg_v01 agps_mode_resp;
|
||||
secgps_set_xtra_enable_resp_msg_v01 xtra_enable_resp;
|
||||
secgps_set_glonass_enable_resp_msg_v01 glonass_enable_resp;
|
||||
secgps_set_cert_type_resp_msg_v01 cert_type_resp;
|
||||
secgps_set_spirent_type_resp_msg_v01 spirent_type_resp;
|
||||
secgps_ftm_resp_msg_v01 ftm_resp;
|
||||
secgps_inject_ni_message_resp_msg_v01 inject_ni_message_resp;
|
||||
// ++ NS-FLP
|
||||
secgps_change_engine_only_mode_resp_msg_v01 change_engine_only_mode_resp;
|
||||
// -- NS-FLP
|
||||
secgps_agnss_config_message_resp_msg_v01 agnss_config_message_resp;
|
||||
|
||||
/*=============================================================================
|
||||
CALLBACK FUNCTION secgps_ind_cb
|
||||
=============================================================================*/
|
||||
/*!
|
||||
@brief
|
||||
This callback function is called by the QCCI infrastructure when
|
||||
infrastructure receives an indication for this client
|
||||
|
||||
@param[in] user_handle Opaque handle used by the infrastructure to
|
||||
identify different services.
|
||||
|
||||
@param[in] msg_id Message ID of the indication
|
||||
|
||||
@param[in] ind_buf Buffer holding the encoded indication
|
||||
|
||||
@param[in] ind_buf_len Length of the encoded indication
|
||||
|
||||
@param[in] ind_cb_data Cookie value supplied by the client during registration
|
||||
|
||||
*/
|
||||
/*=========================================================================*/
|
||||
void secgps_ind_cb
|
||||
(
|
||||
qmi_client_type user_handle,
|
||||
unsigned int msg_id,
|
||||
void *ind_buf,
|
||||
unsigned int ind_buf_len,
|
||||
void *ind_cb_data
|
||||
)
|
||||
{
|
||||
ALOGV("SECGPS: Indication: msg_id=0x%x", msg_id);
|
||||
|
||||
int rc;
|
||||
secgps_ftm_ind_msg_v01 *pData = NULL;
|
||||
secgps_agnss_config_message_ind_msg_v01 *secData = NULL;
|
||||
FILE* fp = NULL;
|
||||
|
||||
switch(msg_id)
|
||||
{
|
||||
case QMI_SECGPS_FTM_IND_V01:
|
||||
{
|
||||
ALOGD("SECGPS: QMI_SEC_FTM_IND_V01 received");
|
||||
|
||||
if((ind_buf != NULL) && (ind_buf_len != 0))
|
||||
{
|
||||
pData = (secgps_ftm_ind_msg_v01*)malloc(sizeof(secgps_ftm_ind_msg_v01));
|
||||
|
||||
if(NULL == pData)
|
||||
{
|
||||
ALOGD("secgps_ind_cb: memory allocation failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
memset(pData, 0, sizeof(secgps_ftm_ind_msg_v01));
|
||||
|
||||
// decode the indication
|
||||
rc = qmi_client_message_decode(
|
||||
user_handle,
|
||||
QMI_IDL_INDICATION,
|
||||
msg_id,
|
||||
ind_buf,
|
||||
ind_buf_len,
|
||||
(void*)pData,
|
||||
sizeof(secgps_ftm_ind_msg_v01));
|
||||
|
||||
if( rc == QMI_NO_ERR )
|
||||
{
|
||||
int system = pData->system_type;
|
||||
int resp = pData->resp;
|
||||
int freq = pData->freq;
|
||||
int cno = pData->cno;
|
||||
|
||||
ALOGD("SECGPS: QMI_SEC_FTM_IND_V01 system_type = %d, resp = %d, freq = %d cno = %d",system, resp, freq, cno);
|
||||
|
||||
fp = fopen("/data/vendor/gps/sv_cno.info","w");
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
ALOGD("SECGPS: QMI_SEC_FTM_IND_V01 file open failed");
|
||||
free(pData);
|
||||
return;
|
||||
}
|
||||
fprintf(fp, "%d\n", cno);
|
||||
fclose(fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
ALOGD("SECGPS: qmi_client_message_decode failed rc = %d",rc);
|
||||
}
|
||||
free(pData);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case QMI_SECGPS_AGNSS_CONFIG_MESSAGE_IND_V01:
|
||||
{
|
||||
ALOGD("SECGPS: QMI_SECGPS_AGNSS_CONFIG_MESSAGE_IND_V01 received");
|
||||
|
||||
if((ind_buf != NULL) && (ind_buf_len != 0))
|
||||
{
|
||||
secData = (secgps_agnss_config_message_ind_msg_v01*)malloc(sizeof(secgps_agnss_config_message_ind_msg_v01));
|
||||
|
||||
if(NULL == secData)
|
||||
{
|
||||
ALOGD("secgps_ind_cb: memory allocation failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
memset(secData, 0, sizeof(secgps_agnss_config_message_ind_msg_v01));
|
||||
|
||||
// decode the indication
|
||||
rc = qmi_client_message_decode(
|
||||
user_handle,
|
||||
QMI_IDL_INDICATION,
|
||||
msg_id,
|
||||
ind_buf,
|
||||
ind_buf_len,
|
||||
(void*)secData,
|
||||
sizeof(secgps_agnss_config_message_ind_msg_v01));
|
||||
|
||||
if( rc == QMI_NO_ERR )
|
||||
{
|
||||
if(secData->agnssConfigMessage_len > 0 && secData->agnssConfigMessage_len < SECGPS_MAX_AGNSS_CONFIG_MSG_SIZE)
|
||||
handleAgnssConfigIndMsg(secData->agnssConfigMessage,secData->agnssConfigMessage_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
ALOGD("SECGPS: qmi_client_message_decode failed rc = %d",rc);
|
||||
}
|
||||
free(secData);
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void secgps_set_agps_mode(int mode){
|
||||
int rc;
|
||||
qmi_txn_handle txn;
|
||||
secgps_set_supported_agps_mode_req_msg_v01 req;
|
||||
|
||||
memset(&agps_mode_resp, 0, sizeof(agps_mode_resp));
|
||||
/* Set the value of the basic secgps request */
|
||||
|
||||
req.agps_mode = mode;
|
||||
ALOGI("SECGPS: Set AGPS Mode : %d\n", mode);
|
||||
|
||||
rc = qmi_client_send_msg_sync(clnt, QMI_SECGPS_SET_SUPPORTED_AGPS_MODE_REQ_V01, &req, sizeof(req),
|
||||
&agps_mode_resp, sizeof(agps_mode_resp),SECGPS_SYNC_REQUEST_TIMEOUT);
|
||||
|
||||
if (rc != 0){
|
||||
ALOGE("SECGPS: send a qmi message to secgps_server error: %d\n",rc);
|
||||
}else{
|
||||
ALOGD("SECGPS: send a qmi message to secgps_server OK");
|
||||
}
|
||||
}
|
||||
|
||||
void secgps_set_xtra_enable(int enable){
|
||||
int rc;
|
||||
qmi_txn_handle txn;
|
||||
secgps_set_xtra_enable_req_msg_v01 req;
|
||||
|
||||
memset(&xtra_enable_resp, 0, sizeof(xtra_enable_resp));
|
||||
/* Set the value of the basic secgps request */
|
||||
if(enable == 0){
|
||||
req.enable = 0;
|
||||
}else{
|
||||
req.enable = 1;
|
||||
}
|
||||
|
||||
ALOGI("SECGPS: Set XTRA enable : %d\n", enable);
|
||||
|
||||
rc = qmi_client_send_msg_sync(clnt, QMI_SECGPS_SET_XTRA_ENABLE_REQ_V01, &req, sizeof(req),
|
||||
&xtra_enable_resp, sizeof(xtra_enable_resp),SECGPS_SYNC_REQUEST_TIMEOUT);
|
||||
|
||||
if (rc != 0){
|
||||
ALOGE("SECGPS: send a qmi message to secgps_server error: %d\n",rc);
|
||||
}else{
|
||||
ALOGD("SECGPS: send a qmi message to secgps_server OK");
|
||||
}
|
||||
}
|
||||
|
||||
void secgps_set_gnss_rf_config(int gnss_cfg){
|
||||
int rc;
|
||||
qmi_txn_handle txn;
|
||||
secgps_set_glonass_enable_req_msg_v01 req;
|
||||
|
||||
memset(&glonass_enable_resp, 0, sizeof(glonass_enable_resp));
|
||||
/* Set the value of the basic secgps request */
|
||||
req.enable = (uint8_t) gnss_cfg;
|
||||
|
||||
ALOGI("SECGPS: Set GNSS RF CONFIG : %d\n", gnss_cfg);
|
||||
|
||||
rc = qmi_client_send_msg_sync(clnt, QMI_SECGPS_SET_GLONASS_ENABLE_REQ_V01, &req, sizeof(req),
|
||||
&glonass_enable_resp, sizeof(glonass_enable_resp),SECGPS_SYNC_REQUEST_TIMEOUT);
|
||||
|
||||
if (rc != 0){
|
||||
ALOGE("SECGPS: send a qmi message to secgps_server error: %d\n",rc);
|
||||
}else{
|
||||
ALOGD("SECGPS: send a qmi message to secgps_server OK");
|
||||
}
|
||||
}
|
||||
|
||||
void secgps_set_spirent_type(int spirent_type){
|
||||
int rc;
|
||||
qmi_txn_handle txn;
|
||||
secgps_set_spirent_type_req_msg_v01 req;
|
||||
|
||||
memset(&spirent_type_resp, 0, sizeof(spirent_type_resp));
|
||||
/* Set the value of the basic secgps request */
|
||||
req.spirent_type = spirent_type;
|
||||
|
||||
ALOGD("SECGPS: Set SPIRENT TYPE %d\n", spirent_type);
|
||||
|
||||
rc = qmi_client_send_msg_sync(clnt, QMI_SECGPS_SET_SPIRENT_TYPE_REQ_V01, &req, sizeof(req),
|
||||
&spirent_type_resp, sizeof(spirent_type_resp),SECGPS_SYNC_REQUEST_TIMEOUT);
|
||||
|
||||
if (rc != 0){
|
||||
ALOGE("SECGPS: send a qmi message to secgps_server error: %d\n",rc);
|
||||
}else{
|
||||
ALOGD("SECGPS: send a qmi message to secgps_server OK");
|
||||
}
|
||||
}
|
||||
|
||||
//In case of models based on WIFI, RIL layer doesn't exit.
|
||||
//Therefore, something is needed to play a role on behalf of RIL, which passes FTM AT command to GPS engine.
|
||||
void secgps_operation_ftm_mode(int action, int system_type, int freq)
|
||||
{
|
||||
int rc;
|
||||
qmi_txn_handle txn;
|
||||
secgps_ftm_req_msg_v01 req;
|
||||
|
||||
memset(&ftm_resp, 0, sizeof(ftm_resp));
|
||||
req.action = action;
|
||||
req.system_type = system_type;
|
||||
req.channel_mode = FTM_SINGLE_CHANNEL_MODE; //multiple channel is not supported by QC.
|
||||
req.freq = freq;
|
||||
|
||||
ALOGD("SECGPS:secgps_operation_ftm_mode action = %d, system = %d, ch_mode = %d, frq = %d\n",req.action, req.system_type, req.channel_mode, req.freq);
|
||||
|
||||
rc = qmi_client_send_msg_sync(clnt, QMI_SECGPS_FTM_REQ_V01, &req, sizeof(req),
|
||||
&ftm_resp, sizeof(ftm_resp), SECGPS_SYNC_REQUEST_TIMEOUT);
|
||||
|
||||
if (rc != QMI_NO_ERR)
|
||||
{
|
||||
ALOGE("SECGPS: send a qmi message to secgps_server error: %d, resp = %d\n",rc, ftm_resp.resp);
|
||||
}
|
||||
else
|
||||
{
|
||||
ALOGD("SECGPS: send a qmi message to secgps_server OK");
|
||||
|
||||
if(ftm_resp.resp == SECGPS_FTM_RESP_OK)
|
||||
{
|
||||
ALOGD("SECGPS: ftm response Success");
|
||||
}
|
||||
else
|
||||
{
|
||||
ALOGD("SECGPS: ftm response Fail");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ++ NS-FLP
|
||||
void secgps_change_engine_only_mode(uint8_t enabled) {
|
||||
int rc;
|
||||
qmi_txn_handle txn;
|
||||
secgps_change_engine_only_mode_req_msg_v01 req;
|
||||
|
||||
memset(&change_engine_only_mode_resp, 0, sizeof(change_engine_only_mode_resp));
|
||||
|
||||
req.change_engine_only_mode = enabled;
|
||||
rc = qmi_client_send_msg_sync(clnt, QMI_SECGPS_CHANGE_ENGINE_ONLY_MODE_REQ_V01, &req, sizeof(req),
|
||||
&change_engine_only_mode_resp, sizeof(change_engine_only_mode_resp), SECGPS_SYNC_REQUEST_TIMEOUT);
|
||||
|
||||
if (rc != 0){
|
||||
ALOGE("SECGPS: send a change_engine_only_mode_resp to secgps_server error: %d\n", rc);
|
||||
}else{
|
||||
ALOGD("SECGPS: send a change_engine_only_mode_resp to secgps_server OK");
|
||||
}
|
||||
}
|
||||
// -- NS-FLP
|
||||
|
||||
void secgps_inject_ni_message(uint8_t* message, uint32_t length, int8_t sub_id){
|
||||
int rc;
|
||||
qmi_txn_handle txn;
|
||||
secgps_inject_ni_message_req_msg_v01 req;
|
||||
|
||||
memset(&inject_ni_message_resp, 0, sizeof(inject_ni_message_resp));
|
||||
/* Set the value of the basic secgps request */
|
||||
req.injectedNIMessageType = 0;
|
||||
req.injectedNIMessage_len= length;
|
||||
if (sub_id >= 0) {
|
||||
req.subid_valid = 1;
|
||||
} else {
|
||||
req.subid_valid = 0;
|
||||
}
|
||||
req.sub_id = sub_id;
|
||||
|
||||
memcpy(req.injectedNIMessage, message, length);
|
||||
|
||||
ALOGI("SECGPS: Inject NI Message sub_id(%d)",sub_id);
|
||||
|
||||
rc = qmi_client_send_msg_sync(clnt, QMI_SECGPS_INJECT_NI_MESSAGE_REQ_V01, &req, sizeof(req),
|
||||
&inject_ni_message_resp, sizeof(inject_ni_message_resp),SECGPS_SYNC_REQUEST_TIMEOUT);
|
||||
|
||||
if (rc != 0){
|
||||
ALOGE("SECGPS: send a qmi message to secgps_server error: %d\n",rc);
|
||||
}else{
|
||||
ALOGD("SECGPS: send a qmi message to secgps_server OK");
|
||||
}
|
||||
}
|
||||
|
||||
void secgps_agnss_config_message(uint8_t* message, uint32_t length){
|
||||
int rc;
|
||||
qmi_txn_handle txn;
|
||||
secgps_agnss_config_message_req_msg_v01 req;
|
||||
|
||||
memset(&agnss_config_message_resp, 0, sizeof(agnss_config_message_resp));
|
||||
/* Set the value of the basic secgps request */
|
||||
req.agnssConfigMessageType = 0;
|
||||
req.agnssConfigMessage_len= length;
|
||||
|
||||
memcpy(req.agnssConfigMessage, message, length);
|
||||
|
||||
ALOGI("SECGPS: AGNSS Config Message");
|
||||
|
||||
rc = qmi_client_send_msg_sync(clnt, QMI_SECGPS_AGNSS_CONFIG_MESSAGE_REQ_V01, &req, sizeof(req),
|
||||
&agnss_config_message_resp, sizeof(agnss_config_message_resp),SECGPS_SYNC_REQUEST_TIMEOUT);
|
||||
|
||||
if (rc != 0){
|
||||
ALOGE("SECGPS: send a qmi message to secgps_server error: %d\n",rc);
|
||||
}else{
|
||||
ALOGD("SECGPS: send a qmi message to secgps_server OK");
|
||||
}
|
||||
}
|
||||
|
||||
int qmi_secgps_client_init()
|
||||
{
|
||||
// qmi_txn_handle txn;
|
||||
uint32_t num_services, num_entries=0;
|
||||
int rc,service_connect;
|
||||
|
||||
qmi_cci_os_signal_type os_params;
|
||||
qmi_service_info info[5];
|
||||
uint32_t port = 10001;
|
||||
uint32_t timeout = 5000; // 5 seconds
|
||||
bool notifierInitFlag = false;
|
||||
|
||||
ALOGD("qmi_secgps_client_init()");
|
||||
|
||||
if(clnt != NULL){
|
||||
ALOGE("SECGPS: client is not null. close it first");
|
||||
qmi_secgps_client_deinit();
|
||||
}
|
||||
|
||||
/* Get the service object for the secgps API */
|
||||
qmi_idl_service_object_type secgps_service_object = secgps_get_service_object_v01();
|
||||
|
||||
|
||||
/* Verify that secgps_get_service_object did not return NULL */
|
||||
if (secgps_service_object == NULL)
|
||||
{
|
||||
ALOGE("SECGPS: secgps_get_service_object failed, verify qmi_secgps_api_v01.h and .c match.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = qmi_client_notifier_init(secgps_service_object, &os_params, ¬ifier);
|
||||
notifierInitFlag = (NULL != notifier);
|
||||
if(rc != QMI_NO_ERR)
|
||||
{
|
||||
ALOGE("SECGPS: qmi_client_notifier_init failed, rc=%d", rc);
|
||||
rc = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
QMI_CCI_OS_SIGNAL_WAIT(&os_params, timeout);
|
||||
|
||||
if(QMI_CCI_OS_SIGNAL_TIMED_OUT(&os_params))
|
||||
{
|
||||
ALOGE("SECGPS: timed out waiting for secgps service");
|
||||
rc = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = qmi_client_get_service_list( secgps_service_object, NULL, NULL, &num_services);
|
||||
ALOGD("SECGPS: qmi_client_get_service_list() returned %d num_services = %d\n", rc, num_services);
|
||||
if(rc != QMI_NO_ERR)
|
||||
{
|
||||
ALOGE("SECGPS: qmi_client_get_service_list() failed even though service is up, rc=%d", rc);
|
||||
rc = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
rc = qmi_client_get_service_list( secgps_service_object, info, &num_entries, &num_services);
|
||||
ALOGD("SECGPS: qmi_client_get_service_list() returned %d num_entries = %d num_services = %d\n", rc, num_entries, num_services);
|
||||
|
||||
num_entries = num_services;
|
||||
/* The server has come up, store the information in info variable */
|
||||
rc = qmi_client_get_service_list( secgps_service_object, info, &num_entries, &num_services);
|
||||
ALOGD("SECGPS: qmi_client_get_service_list() returned %d num_entries = %d num_services = %d\n", rc, num_entries, num_services);
|
||||
|
||||
if(rc != QMI_NO_ERR)
|
||||
{
|
||||
ALOGE("SECGPS: qmi_client_get_service_list Error %d", rc);
|
||||
rc = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
rc = qmi_client_init(&info[0], secgps_service_object, secgps_ind_cb, NULL, NULL, &clnt);
|
||||
if(rc != QMI_NO_ERR)
|
||||
{
|
||||
ALOGE("SECGPS: qmi_client_init failed");
|
||||
rc = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
/* release the notifier handle */
|
||||
|
||||
cleanup:
|
||||
if(true == notifierInitFlag)
|
||||
{
|
||||
qmi_client_release(notifier);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int qmi_secgps_client_deinit(){
|
||||
int rc;
|
||||
rc = qmi_client_release(clnt);
|
||||
ALOGD("SECGPS: qmi_client_release returned %d\n", rc);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/* Copyright (c) 2011, Code Aurora Forum. 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 Code Aurora Forum, Inc. 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.
|
||||
*/
|
||||
|
||||
/** @file qmi_secgps_clnt.h
|
||||
*/
|
||||
|
||||
#ifndef QMI_SECGPS_CLNT_H
|
||||
#define QMI_SECGPS_CLNT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*=============================================================================
|
||||
*
|
||||
* DATA DECLARATION
|
||||
*
|
||||
*============================================================================*/
|
||||
|
||||
//#include "qmi.h"
|
||||
#include "qmi_cci_target.h"
|
||||
#include "qmi_client.h"
|
||||
#include "qmi_idl_lib.h"
|
||||
#include "qmi_cci_common.h"
|
||||
#include <string.h>
|
||||
#include "qmi_secgps_api_v01.h"
|
||||
|
||||
#define SECGPS_SYNC_REQUEST_TIMEOUT 1000 // msec
|
||||
|
||||
//Defining values associated with FTM CW mode.
|
||||
#define SECGPS_FTM_RESP_OK 0
|
||||
#define SECGPS_FTM_RESP_NG_CN0 1
|
||||
#define SECGPS_FTM_RESP_NG_TO 2
|
||||
#define SECGPS_FTM_RESP_NG 3
|
||||
|
||||
#define SECGPS_MAX_AGNSS_CONFIG_MSG_SIZE 2048
|
||||
|
||||
enum secgps_ftm_channel_mode_e_type
|
||||
{
|
||||
FTM_MULTIPLE_CHANNEL_MODE = 0,
|
||||
FTM_SINGLE_CHANNEL_MODE
|
||||
};
|
||||
|
||||
extern int qmi_secgps_client_init();
|
||||
extern int qmi_secgps_client_deinit();
|
||||
extern void secgps_set_agps_mode(int mode);
|
||||
extern void secgps_set_xtra_enable(int enable);
|
||||
extern void secgps_set_gnss_rf_config(int gnss_cfg);
|
||||
extern void secgps_set_spirent_type(int spirent_type);
|
||||
extern void secgps_operation_ftm_mode(int action, int system_type, int freq);
|
||||
extern void secgps_inject_ni_message(uint8_t* message, uint32_t length, int8_t sub_id);
|
||||
// ++ NS-FLP
|
||||
extern void secgps_change_engine_only_mode(uint8_t msg);
|
||||
// -- NS-FLP
|
||||
extern void secgps_agnss_config_message(uint8_t* message, uint32_t length);
|
||||
extern void handleAgnssConfigIndMsg(uint8_t* ind_msg, uint32_t length);
|
||||
#if 0
|
||||
extern void secgps_set_use_ssl(int enable);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LOC_API_V02_CLIENT_H*/
|
||||
Reference in New Issue
Block a user