sm8450-common: gps: Update to LA.VENDOR.1.0.r1-21900-WAIPIO.0
Change-Id: Ib431364a902ecd9b068e672978f5e24ecbf42160
This commit is contained in:
@@ -26,6 +26,43 @@
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022 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.
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_CtxBase"
|
||||
|
||||
@@ -95,7 +132,6 @@ const loc_param_s_type ContextBase::mGps_conf_table[] =
|
||||
{"NMEA_TAG_BLOCK_GROUPING_ENABLED", &mGps_conf.NMEA_TAG_BLOCK_GROUPING_ENABLED, NULL, 'n'},
|
||||
{"NI_SUPL_DENY_ON_NFW_LOCKED", &mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED, NULL, 'n'},
|
||||
{"ENABLE_NMEA_PRINT", &mGps_conf.ENABLE_NMEA_PRINT, NULL, 'n'},
|
||||
{"ROBUST_LOCATION_ENABLED", &mGps_conf.ROBUST_LOCATION_ENABLED, NULL, 'n'},
|
||||
};
|
||||
|
||||
const loc_param_s_type ContextBase::mSap_conf_table[] =
|
||||
@@ -200,14 +236,6 @@ void ContextBase::readConfig()
|
||||
/* By default NMEA Printing is disabled */
|
||||
mGps_conf.ENABLE_NMEA_PRINT = 0;
|
||||
|
||||
#ifdef USE_GLIB
|
||||
// For LE target, disable by default
|
||||
mGps_conf.ROBUST_LOCATION_ENABLED = 0x0;
|
||||
#else
|
||||
// enable robust location and robust location on E911
|
||||
mGps_conf.ROBUST_LOCATION_ENABLED = 0x11;
|
||||
#endif
|
||||
|
||||
UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table);
|
||||
UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table);
|
||||
|
||||
|
@@ -26,6 +26,43 @@
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022 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_CONTEXT_BASE__
|
||||
#define __LOC_CONTEXT_BASE__
|
||||
|
||||
@@ -84,7 +121,6 @@ typedef struct loc_gps_cfg_s
|
||||
uint32_t NI_SUPL_DENY_ON_NFW_LOCKED;
|
||||
uint32_t ENABLE_NMEA_PRINT;
|
||||
uint32_t NMEA_TAG_BLOCK_GROUPING_ENABLED;
|
||||
uint32_t ROBUST_LOCATION_ENABLED;
|
||||
} loc_gps_cfg_s_type;
|
||||
|
||||
/* NOTE: the implementation of the parser casts number
|
||||
|
@@ -26,6 +26,43 @@
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022 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.
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_LocAdapterBase"
|
||||
|
||||
@@ -439,4 +476,7 @@ bool LocAdapterBase::
|
||||
reportQwesCapabilities(const std::unordered_map<LocationQwesFeatureType, bool> &/*featureMap*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
void LocAdapterBase::reportEngDebugDataInfoEvent(GnssEngineDebugDataInfo& gnssEngineDebugDataInfo)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
} // namespace loc_core
|
||||
|
@@ -26,6 +26,43 @@
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022 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_ADAPTER_BASE_H
|
||||
#define LOC_API_ADAPTER_BASE_H
|
||||
|
||||
@@ -235,6 +272,7 @@ public:
|
||||
void requestCapabilitiesCommand(LocationAPI* client);
|
||||
|
||||
virtual void reportLatencyInfoEvent(const GnssLatencyInfo& gnssLatencyInfo);
|
||||
virtual void reportEngDebugDataInfoEvent(GnssEngineDebugDataInfo& gnssEngineDebugDataInfo);
|
||||
virtual bool reportQwesCapabilities(
|
||||
const std::unordered_map<LocationQwesFeatureType, bool> &featureMap);
|
||||
};
|
||||
|
@@ -40,6 +40,10 @@
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
#define MSEC_IN_ONE_WEEK 604800000LL
|
||||
#define REAL_TIME_ESTIMATOR_TIME_UNC_THRESHOLD_MSEC 20.0f
|
||||
#define UNKNOWN_GPS_WEEK_NUM 65535
|
||||
|
||||
#define TO_ALL_LOCADAPTERS(call) TO_ALL_ADAPTERS(mLocAdapters, (call))
|
||||
#define TO_1ST_HANDLING_LOCADAPTERS(call) TO_1ST_HANDLING_ADAPTER(mLocAdapters, (call))
|
||||
|
||||
@@ -330,7 +334,7 @@ void LocApiBase::reportPosition(UlpLocation& location,
|
||||
LOC_LOGD("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n "
|
||||
"altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n "
|
||||
"timestamp: %" PRId64 "\n"
|
||||
"Session status: %d\n Technology mask: %u\n "
|
||||
"Session status: %d\n Technology mask: %u\n, time bias unc %f msec\n "
|
||||
"SV used in fix (gps/glo/bds/gal/qzss) : \
|
||||
(0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 "/0x%" PRIx64 ")",
|
||||
location.gpsLocation.flags, location.position_source,
|
||||
@@ -338,6 +342,7 @@ void LocApiBase::reportPosition(UlpLocation& location,
|
||||
location.gpsLocation.altitude, location.gpsLocation.speed,
|
||||
location.gpsLocation.bearing, location.gpsLocation.accuracy,
|
||||
location.gpsLocation.timestamp, status, loc_technology_mask,
|
||||
locationExtended.gnssSystemTime.u.gpsSystemTime.systemClkTimeUncMs,
|
||||
locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask,
|
||||
locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask,
|
||||
locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask,
|
||||
@@ -616,6 +621,10 @@ void LocApiBase::reportLatencyInfo(GnssLatencyInfo& gnssLatencyInfo)
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportLatencyInfoEvent(gnssLatencyInfo));
|
||||
}
|
||||
|
||||
void LocApiBase::reportEngDebugDataInfo(GnssEngineDebugDataInfo& gnssEngineDebugDataInfo) {
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportEngDebugDataInfoEvent(gnssEngineDebugDataInfo));
|
||||
}
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
open(LOC_API_ADAPTER_EVENT_MASK_T /*mask*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
@@ -624,12 +633,6 @@ enum loc_api_adapter_err LocApiBase::
|
||||
close()
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
void LocApiBase::startFix(const LocPosMode& /*posMode*/, LocApiResponse* /*adapterResponse*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocApiBase::stopFix(LocApiResponse* /*adapterResponse*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocApiBase::
|
||||
deleteAidingData(const GnssAidingData& /*data*/, LocApiResponse* /*adapterResponse*/)
|
||||
DEFAULT_IMPL()
|
||||
@@ -1040,7 +1043,13 @@ void ElapsedRealtimeEstimator::saveGpsTimeAndQtimerPairInPvtReport(
|
||||
|
||||
// Use GPS timestamp and qtimer tick for 1Hz PVT report for association
|
||||
if ((locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GPS_TIME) &&
|
||||
// 65535 GPS week from modem means unknown
|
||||
(locationExtended.gpsTime.gpsWeek != UNKNOWN_GPS_WEEK_NUM) &&
|
||||
(locationExtended.gpsTime.gpsTimeOfWeekMs % 1000 == 0) &&
|
||||
(locationExtended.gnssSystemTime.u.gpsSystemTime.validityMask &
|
||||
GNSS_SYSTEM_CLK_TIME_BIAS_UNC_VALID) &&
|
||||
(locationExtended.gnssSystemTime.u.gpsSystemTime.systemClkTimeUncMs <
|
||||
REAL_TIME_ESTIMATOR_TIME_UNC_THRESHOLD_MSEC) &&
|
||||
(locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_SYSTEM_TICK) &&
|
||||
(locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_SYSTEM_TICK_UNC)) {
|
||||
mTimePairPVTReport.gpsTime.gpsWeek = locationExtended.gpsTime.gpsWeek;
|
||||
@@ -1062,13 +1071,17 @@ void ElapsedRealtimeEstimator::saveGpsTimeAndQtimerPairInMeasReport(
|
||||
// Use 1Hz measurement report timestamp and qtimer tick for association
|
||||
if ((svMeasurementSet.isNhz == false) &&
|
||||
(svMeasSetHeader.gpsSystemTime.validityMask & GNSS_SYSTEM_TIME_WEEK_VALID) &&
|
||||
(svMeasSetHeader.gpsSystemTime.validityMask & GNSS_SYSTEM_TIME_WEEK_MS_VALID)) {
|
||||
// 65535 GPS week from modem means unknown
|
||||
(svMeasurementSet.svMeasSetHeader.gpsSystemTime.systemWeek != UNKNOWN_GPS_WEEK_NUM) &&
|
||||
(svMeasSetHeader.gpsSystemTime.validityMask & GNSS_SYSTEM_TIME_WEEK_MS_VALID) &&
|
||||
(svMeasSetHeader.gpsSystemTime.validityMask & GNSS_SYSTEM_CLK_TIME_BIAS_UNC_VALID) &&
|
||||
(svMeasSetHeader.gpsSystemTime.systemClkTimeUncMs <
|
||||
REAL_TIME_ESTIMATOR_TIME_UNC_THRESHOLD_MSEC)) {
|
||||
|
||||
LOC_LOGv("gps time %d %d, meas unc %f, ref cnt tick %" PRIi64 ","
|
||||
LOC_LOGv("gps time %d %d, ref cnt tick %" PRIi64 ","
|
||||
"system rtc ms %" PRIi64 ", systemClkTimeUncMs %f",
|
||||
svMeasurementSet.svMeasSetHeader.gpsSystemTime.systemWeek,
|
||||
svMeasurementSet.svMeasSetHeader.gpsSystemTime.systemMsec,
|
||||
svMeasurementSet.svMeasSetHeader.gpsSystemTime.systemClkTimeUncMs,
|
||||
svMeasurementSet.svMeasSetHeader.refCountTicks,
|
||||
svMeasurementSet.svMeasSetHeader.gpsSystemTimeExt.systemRtcMs,
|
||||
svMeasurementSet.svMeasSetHeader.gpsSystemTime.systemClkTimeUncMs);
|
||||
@@ -1079,16 +1092,12 @@ void ElapsedRealtimeEstimator::saveGpsTimeAndQtimerPairInMeasReport(
|
||||
mTimePairMeasReport.qtimerTick = svMeasurementSet.svMeasSetHeader.refCountTicks;
|
||||
mTimePairMeasReport.timeUncMsec = svMeasurementSet.svMeasSetHeader.refCountTicksUnc;
|
||||
}
|
||||
|
||||
LOC_LOGv("gps time (%d, %d), qtimer tick %" PRIi64 ", unc %f",
|
||||
mTimePairMeasReport.gpsTime.gpsWeek, mTimePairMeasReport.gpsTime.gpsTimeOfWeekMs,
|
||||
mTimePairMeasReport.qtimerTick, mTimePairMeasReport.timeUncMsec);
|
||||
}
|
||||
}
|
||||
|
||||
#define MSEC_IN_ONE_WEEK 604800000LL
|
||||
bool ElapsedRealtimeEstimator::getElapsedRealtimeForGpsTime(
|
||||
const GPSTimeStruct& gpsTimeAtOrigin, int64_t &bootTimeNsAtOrigin, float & bootTimeUnc) {
|
||||
const GpsLocationExtended& locationExtended,
|
||||
int64_t &bootTimeNsAtOrigin, float & bootTimeUnc) {
|
||||
struct timespec curBootTime = {};
|
||||
int64_t curBootTimeNs = 0;
|
||||
int64_t curQTimerNSec = 0;
|
||||
@@ -1107,6 +1116,23 @@ bool ElapsedRealtimeEstimator::getElapsedRealtimeForGpsTime(
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (((locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_GPS_TIME) == 0) ||
|
||||
// 65535 GPS week from modem means unknown
|
||||
(locationExtended.gpsTime.gpsWeek == UNKNOWN_GPS_WEEK_NUM) ||
|
||||
((locationExtended.gnssSystemTime.u.gpsSystemTime.validityMask &
|
||||
GNSS_SYSTEM_CLK_TIME_BIAS_UNC_VALID) == 0) ||
|
||||
((locationExtended.gnssSystemTime.u.gpsSystemTime.systemClkTimeUncMs >=
|
||||
REAL_TIME_ESTIMATOR_TIME_UNC_THRESHOLD_MSEC))) {
|
||||
LOC_LOGd("report has invalid gps time, or no time bias unc or large time bias unc, "
|
||||
"gps week %d, gps system time mask 0x%x, clk bias unc %f",
|
||||
locationExtended.gpsTime.gpsWeek,
|
||||
locationExtended.gnssSystemTime.u.gpsSystemTime.validityMask,
|
||||
locationExtended.gnssSystemTime.u.gpsSystemTime.systemClkTimeUncMs);
|
||||
return false;
|
||||
}
|
||||
|
||||
const GPSTimeStruct& gpsTimeAtOrigin = locationExtended.gpsTime;
|
||||
int64_t originMsec = (int64_t)gpsTimeAtOrigin.gpsWeek * (int64_t)MSEC_IN_ONE_WEEK +
|
||||
(int64_t)gpsTimeAtOrigin.gpsTimeOfWeekMs;
|
||||
int64_t timePairMsec = (int64_t)timePair.gpsTime.gpsWeek * (int64_t)MSEC_IN_ONE_WEEK +
|
||||
@@ -1131,7 +1157,11 @@ bool ElapsedRealtimeEstimator::getElapsedRealtimeForGpsTime(
|
||||
timePair.qtimerTick * 100000 / 192,
|
||||
curQTimerNSec, qtimerNsecAtOrigin, curBootTimeNs, bootTimeNsAtOrigin, bootTimeUnc);
|
||||
|
||||
return true;
|
||||
if (bootTimeNsAtOrigin > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -209,6 +209,7 @@ public:
|
||||
void sendNfwNotification(GnssNfwNotification& notification);
|
||||
void reportGnssConfig(uint32_t sessionId, const GnssConfig& gnssConfig);
|
||||
void reportLatencyInfo(GnssLatencyInfo& gnssLatencyInfo);
|
||||
void reportEngDebugDataInfo(GnssEngineDebugDataInfo& gnssEngineDebugDataInfo);
|
||||
void reportQwesCapabilities
|
||||
(
|
||||
const std::unordered_map<LocationQwesFeatureType, bool> &featureMap
|
||||
@@ -228,8 +229,6 @@ public:
|
||||
// downward calls
|
||||
virtual void* getSibling();
|
||||
virtual LocApiProxyBase* getLocApiProxy();
|
||||
virtual void startFix(const LocPosMode& fixCriteria, LocApiResponse* adapterResponse);
|
||||
virtual void stopFix(LocApiResponse* adapterResponse);
|
||||
virtual void deleteAidingData(const GnssAidingData& data, LocApiResponse* adapterResponse);
|
||||
virtual void injectPosition(double latitude, double longitude, float accuracy,
|
||||
bool onDemandCpi);
|
||||
@@ -385,8 +384,8 @@ public:
|
||||
inline int64_t getElapsedRealtimeUncNanos() { return 5000000;}
|
||||
void reset();
|
||||
static int64_t getElapsedRealtimeQtimer(int64_t qtimerTicksAtOrigin);
|
||||
bool getElapsedRealtimeForGpsTime(const GPSTimeStruct& gpsTimeAtOrigin,
|
||||
int64_t &elapsedTime, float & elpasedTimeUnc);
|
||||
bool getElapsedRealtimeForGpsTime(const GpsLocationExtended& locationExtended,
|
||||
int64_t &elapsedTime, float & elpasedTimeUnc);
|
||||
void saveGpsTimeAndQtimerPairInPvtReport(const GpsLocationExtended& locationExtended);
|
||||
void saveGpsTimeAndQtimerPairInMeasReport(const GnssSvMeasurementSet& svMeasurementSet);
|
||||
static bool getCurrentTime(struct timespec& currentTime, int64_t& sinceBootTimeNanos);
|
||||
|
@@ -26,6 +26,43 @@
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022-2023 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_SystemStatus"
|
||||
|
||||
#include <inttypes.h>
|
||||
@@ -93,6 +130,7 @@ public:
|
||||
/******************************************************************************
|
||||
SystemStatusPQWM1
|
||||
******************************************************************************/
|
||||
|
||||
class SystemStatusPQWM1
|
||||
{
|
||||
public:
|
||||
@@ -114,10 +152,10 @@ public:
|
||||
uint32_t mJammerBds; // x10
|
||||
uint32_t mJammerGal; // x11
|
||||
uint32_t mRecErrorRecovery; // x12
|
||||
double mAgcGps; // x13
|
||||
double mAgcGlo; // x14
|
||||
double mAgcBds; // x15
|
||||
double mAgcGal; // x16
|
||||
uint32_t mAgcGps; // x13
|
||||
uint32_t mAgcGlo; // x14
|
||||
uint32_t mAgcBds; // x15
|
||||
uint32_t mAgcGal; // x16
|
||||
int32_t mLeapSeconds;// x17
|
||||
int32_t mLeapSecUnc; // x18
|
||||
uint32_t mGloBpAmpI; // x19
|
||||
@@ -127,8 +165,39 @@ public:
|
||||
uint32_t mGalBpAmpI; // x1D
|
||||
uint32_t mGalBpAmpQ; // x1E
|
||||
uint64_t mTimeUncNs; // x1F
|
||||
uint32_t mJammedSignalsMask;
|
||||
std::vector<GnssJammerData> mJammerData;
|
||||
SystemStatusPQWM1(const GnssEngineDebugDataInfo& info);
|
||||
SystemStatusPQWM1() = default;
|
||||
};
|
||||
|
||||
SystemStatusPQWM1::SystemStatusPQWM1(const GnssEngineDebugDataInfo& info) {
|
||||
mGpsWeek = info.gpsWeek;
|
||||
mGpsTowMs = info.gpsTowMs;
|
||||
mTimeValid = info.timeValid;
|
||||
mTimeSource = info.sourceOfTime;
|
||||
mTimeUnc = info.clkTimeUnc;
|
||||
mClockFreqBias = info.clkFreqBias;
|
||||
mClockFreqBiasUnc = info.clkFreqUnc;
|
||||
mXoState = info.xoState;
|
||||
mRecErrorRecovery = info.rcvrErrRecovery;
|
||||
if (info.jammerData.size() > 0) {
|
||||
mJammerGps = info.jammerData[GNSS_LOC_SIGNAL_TYPE_GPS_L1CA].jammerInd;
|
||||
mJammerGlo = info.jammerData[GNSS_LOC_SIGNAL_TYPE_GLONASS_G1].jammerInd;
|
||||
mJammerBds = info.jammerData[GNSS_LOC_SIGNAL_TYPE_BEIDOU_B1_I].jammerInd;
|
||||
mJammerGal = info.jammerData[GNSS_LOC_SIGNAL_TYPE_GALILEO_E1_C].jammerInd;
|
||||
mAgcGps = info.jammerData[GNSS_LOC_SIGNAL_TYPE_GPS_L1CA].agc;
|
||||
mAgcGlo = info.jammerData[GNSS_LOC_SIGNAL_TYPE_GLONASS_G1].agc;
|
||||
mAgcBds = info.jammerData[GNSS_LOC_SIGNAL_TYPE_BEIDOU_B1_I].agc;
|
||||
mAgcGal = info.jammerData[GNSS_LOC_SIGNAL_TYPE_GALILEO_E1_C].agc;
|
||||
}
|
||||
mLeapSeconds = info.leapSecondInfo.leapSec;
|
||||
mLeapSecUnc = info.leapSecondInfo.leapSecUnc;
|
||||
mTimeUncNs = info.clkTimeUnc * 1000000LL;
|
||||
mJammedSignalsMask = info.jammedSignalsMask;
|
||||
mJammerData = std::move(info.jammerData);
|
||||
}
|
||||
|
||||
// parser
|
||||
class SystemStatusPQWM1parser : public SystemStatusNmeaBase
|
||||
{
|
||||
@@ -232,10 +301,11 @@ public:
|
||||
mM1.mJammerBds = atoi(mField[eJammerBds].c_str());
|
||||
mM1.mJammerGal = atoi(mField[eJammerGal].c_str());
|
||||
mM1.mRecErrorRecovery = atoi(mField[eRecErrorRecovery].c_str());
|
||||
mM1.mAgcGps = atof(mField[eAgcGps].c_str());
|
||||
mM1.mAgcGlo = atof(mField[eAgcGlo].c_str());
|
||||
mM1.mAgcBds = atof(mField[eAgcBds].c_str());
|
||||
mM1.mAgcGal = atof(mField[eAgcGal].c_str());
|
||||
// convert agc db scale to 0.01 db
|
||||
mM1.mAgcGps = (uint32_t)(atof(mField[eAgcGps].c_str()) * 100);
|
||||
mM1.mAgcGlo = (uint32_t)(atof(mField[eAgcGlo].c_str()) * 100);
|
||||
mM1.mAgcBds = (uint32_t)(atof(mField[eAgcBds].c_str()) * 100);
|
||||
mM1.mAgcGal = (uint32_t)(atof(mField[eAgcGal].c_str()) * 100);
|
||||
if (mField.size() > eLeapSecUnc) {
|
||||
mM1.mLeapSeconds = atoi(mField[eLeapSeconds].c_str());
|
||||
mM1.mLeapSecUnc = atoi(mField[eLeapSecUnc].c_str());
|
||||
@@ -269,8 +339,20 @@ public:
|
||||
float mEpiHepe; // x8
|
||||
float mEpiAltUnc; // x9
|
||||
uint8_t mEpiSrc; // x10
|
||||
SystemStatusPQWP1() = default;
|
||||
SystemStatusPQWP1(const GnssEngineDebugDataInfo& info);
|
||||
};
|
||||
|
||||
SystemStatusPQWP1::SystemStatusPQWP1(const GnssEngineDebugDataInfo& info) {
|
||||
mEpiValidity = info.epiValidity;
|
||||
mEpiLat = info.epiLat;
|
||||
mEpiLon = info.epiLon;
|
||||
mEpiAlt = info.epiAlt;
|
||||
mEpiHepe = info.epiHepe;
|
||||
mEpiAltUnc = info.epiAltUnc;
|
||||
mEpiSrc = info.epiSrc;
|
||||
}
|
||||
|
||||
class SystemStatusPQWP1parser : public SystemStatusNmeaBase
|
||||
{
|
||||
private:
|
||||
@@ -328,8 +410,19 @@ public:
|
||||
float mBestAlt; // x6
|
||||
float mBestHepe; // x7
|
||||
float mBestAltUnc; // x8
|
||||
SystemStatusPQWP2() = default;
|
||||
SystemStatusPQWP2(const GnssEngineDebugDataInfo& info);
|
||||
};
|
||||
|
||||
SystemStatusPQWP2::SystemStatusPQWP2(const GnssEngineDebugDataInfo& info){
|
||||
mBestLat = info.bestPosLat;
|
||||
mBestLon = info.bestPosLon;
|
||||
mBestAlt = info.bestPosAlt;
|
||||
mBestHepe = info.bestPosHepe;
|
||||
mBestAltUnc = info.bestPosAltUnc;
|
||||
}
|
||||
|
||||
|
||||
class SystemStatusPQWP2parser : public SystemStatusNmeaBase
|
||||
{
|
||||
private:
|
||||
@@ -389,8 +482,26 @@ public:
|
||||
uint64_t mGalXtraValid;
|
||||
uint8_t mQzssXtraValid;
|
||||
uint32_t mNavicXtraValid;
|
||||
SystemStatusPQWP3() = default;
|
||||
SystemStatusPQWP3(const GnssEngineDebugDataInfo& info);
|
||||
};
|
||||
|
||||
SystemStatusPQWP3::SystemStatusPQWP3(const GnssEngineDebugDataInfo& info){
|
||||
mXtraValidMask = info.xtraValidMask;
|
||||
mGpsXtraAge = info.gpsXtraAge;
|
||||
mGloXtraAge = info.gloXtraAge;
|
||||
mBdsXtraAge = info.bdsXtraAge;
|
||||
mGalXtraAge = info.galXtraAge;
|
||||
mQzssXtraAge = info.qzssXtraAge;
|
||||
mNavicXtraAge = info.navicXtraAge;
|
||||
mGpsXtraValid = info.gpsXtraMask;
|
||||
mGloXtraValid = info.gloXtraMask;
|
||||
mBdsXtraValid = info.gloXtraMask;
|
||||
mGalXtraValid = info.galXtraMask;
|
||||
mQzssXtraValid = info.qzssXtraMask;
|
||||
mNavicXtraValid = info.navicXtraMask;
|
||||
}
|
||||
|
||||
class SystemStatusPQWP3parser : public SystemStatusNmeaBase
|
||||
{
|
||||
private:
|
||||
@@ -464,8 +575,18 @@ public:
|
||||
uint64_t mBdsEpheValid;
|
||||
uint64_t mGalEpheValid;
|
||||
uint8_t mQzssEpheValid;
|
||||
SystemStatusPQWP4() = default;
|
||||
SystemStatusPQWP4(const GnssEngineDebugDataInfo& info);
|
||||
};
|
||||
|
||||
SystemStatusPQWP4::SystemStatusPQWP4(const GnssEngineDebugDataInfo& info) {
|
||||
mGpsEpheValid = info.gpsEphMask;
|
||||
mGloEpheValid = info.gloEphMask;
|
||||
mBdsEpheValid = info.bdsEphMask;
|
||||
mGalEpheValid = info.galEphMask;
|
||||
mQzssEpheValid = info.qzssEphMask;
|
||||
}
|
||||
|
||||
class SystemStatusPQWP4parser : public SystemStatusNmeaBase
|
||||
{
|
||||
private:
|
||||
@@ -530,8 +651,32 @@ public:
|
||||
uint64_t mGalBadMask;
|
||||
uint8_t mQzssBadMask;
|
||||
uint32_t mNavicBadMask;
|
||||
SystemStatusPQWP5() = default;
|
||||
SystemStatusPQWP5(const GnssEngineDebugDataInfo& info);
|
||||
};
|
||||
|
||||
|
||||
SystemStatusPQWP5::SystemStatusPQWP5(const GnssEngineDebugDataInfo& info){
|
||||
mGpsUnknownMask = info.gpsHealthUnknownMask;
|
||||
mGloUnknownMask = info.gloHealthUnknownMask;
|
||||
mBdsUnknownMask = info.bdsHealthUnknownMask;
|
||||
mGalUnknownMask = info.galHealthUnknownMask;
|
||||
mQzssUnknownMask = info.qzssHealthUnknownMask;
|
||||
mNavicUnknownMask = info.navicHealthUnknownMask;
|
||||
mGpsGoodMask = info.gpsHealthGoodMask;
|
||||
mGloGoodMask = info.gloHealthGoodMask;
|
||||
mBdsGoodMask = info.bdsHealthGoodMask;
|
||||
mGalGoodMask = info.galHealthGoodMask;
|
||||
mQzssGoodMask = info.qzssHealthGoodMask;
|
||||
mNavicGoodMask = info.navicHealthGoodMask;
|
||||
mGpsBadMask = info.gpsHealthBadMask;
|
||||
mGloBadMask = info.gloHealthBadMask;
|
||||
mBdsBadMask = info.bdsHealthBadMask;
|
||||
mGalBadMask = info.galHealthBadMask;
|
||||
mQzssBadMask = info.qzssHealthBadMask;
|
||||
mNavicBadMask = info.navicHealthBadMask;
|
||||
}
|
||||
|
||||
class SystemStatusPQWP5parser : public SystemStatusNmeaBase
|
||||
{
|
||||
private:
|
||||
@@ -614,6 +759,10 @@ class SystemStatusPQWP6
|
||||
{
|
||||
public:
|
||||
uint32_t mFixInfoMask;
|
||||
SystemStatusPQWP6() = default;
|
||||
inline SystemStatusPQWP6(const GnssEngineDebugDataInfo& info) {
|
||||
mFixInfoMask = info.fixInfoMask;
|
||||
}
|
||||
};
|
||||
|
||||
class SystemStatusPQWP6parser : public SystemStatusNmeaBase
|
||||
@@ -651,8 +800,47 @@ class SystemStatusPQWP7
|
||||
{
|
||||
public:
|
||||
SystemStatusNav mNav[SV_ALL_NUM];
|
||||
SystemStatusPQWP7() = default;
|
||||
SystemStatusPQWP7(const GnssEngineDebugDataInfo& gnssEngineDebugDataInfo);
|
||||
};
|
||||
|
||||
SystemStatusPQWP7::SystemStatusPQWP7(const GnssEngineDebugDataInfo& gnssEngineDebugDataInfo) {
|
||||
memset(mNav, 0, SV_ALL_NUM_MIN * sizeof(SystemStatusNav));
|
||||
for (int i = 0; i < GNSS_MAX_SV_INFO_LIST_SIZE; i++) {
|
||||
GnssNavDataInfo navInfo = gnssEngineDebugDataInfo.navData[i];
|
||||
int offset = 0;
|
||||
if (0 == navInfo.gnssSvId) continue;
|
||||
// GPS
|
||||
if (navInfo.gnssSvId >= GPS_MIN && navInfo.gnssSvId < (GPS_MIN + GPS_NUM)) {
|
||||
offset = navInfo.gnssSvId - GPS_MIN;
|
||||
}
|
||||
// GLO
|
||||
if (navInfo.gnssSvId >= GLO_MIN && navInfo.gnssSvId < (GLO_MIN + GLO_NUM)) {
|
||||
offset = GPS_NUM + navInfo.gnssSvId - GLO_MIN;
|
||||
}
|
||||
// BDS
|
||||
if (navInfo.gnssSvId >= BDS_MIN && navInfo.gnssSvId < (BDS_MIN + BDS_NUM)) {
|
||||
offset = GPS_NUM + GLO_NUM + navInfo.gnssSvId - BDS_MIN;
|
||||
}
|
||||
// GAL
|
||||
if (navInfo.gnssSvId >= GAL_MIN && navInfo.gnssSvId < (GAL_MIN + GAL_NUM)) {
|
||||
offset = GPS_NUM + GLO_NUM + BDS_NUM + navInfo.gnssSvId - GAL_MIN;
|
||||
}
|
||||
// QZSS
|
||||
if (navInfo.gnssSvId >= QZSS_MIN && navInfo.gnssSvId < (QZSS_MIN + QZSS_NUM)) {
|
||||
offset = GPS_NUM + GLO_NUM + BDS_NUM + GAL_NUM + navInfo.gnssSvId - QZSS_MIN;
|
||||
}
|
||||
//Navic
|
||||
if (navInfo.gnssSvId >= NAVIC_MIN && navInfo.gnssSvId < (NAVIC_MIN + NAVIC_NUM)) {
|
||||
offset = GPS_NUM + GLO_NUM + BDS_NUM + GAL_NUM + QZSS_NUM +
|
||||
navInfo.gnssSvId - NAVIC_MIN;
|
||||
}
|
||||
mNav[offset].mType = GnssEphemerisType(navInfo.type);
|
||||
mNav[offset].mSource = GnssEphemerisSource(navInfo.src);
|
||||
mNav[offset].mAgeSec = navInfo.age;
|
||||
}
|
||||
}
|
||||
|
||||
class SystemStatusPQWP7parser : public SystemStatusNmeaBase
|
||||
{
|
||||
private:
|
||||
@@ -698,6 +886,11 @@ class SystemStatusPQWS1
|
||||
public:
|
||||
uint32_t mFixInfoMask;
|
||||
uint32_t mHepeLimit;
|
||||
SystemStatusPQWS1() = default;
|
||||
inline SystemStatusPQWS1(const GnssEngineDebugDataInfo& info) {
|
||||
mFixInfoMask = info.fixStatusMask;
|
||||
mHepeLimit = info.fixHepeLimit;
|
||||
}
|
||||
};
|
||||
|
||||
class SystemStatusPQWS1parser : public SystemStatusNmeaBase
|
||||
@@ -826,9 +1019,9 @@ SystemStatusRfAndParams::SystemStatusRfAndParams(const SystemStatusPQWM1& nmea)
|
||||
mBdsBpAmpI(nmea.mBdsBpAmpI),
|
||||
mBdsBpAmpQ(nmea.mBdsBpAmpQ),
|
||||
mGalBpAmpI(nmea.mGalBpAmpI),
|
||||
mGalBpAmpQ(nmea.mGalBpAmpQ)
|
||||
{
|
||||
}
|
||||
mGalBpAmpQ(nmea.mGalBpAmpQ),
|
||||
mJammedSignalsMask(nmea.mJammedSignalsMask),
|
||||
mJammerData(std::move(nmea.mJammerData)) {}
|
||||
|
||||
bool SystemStatusRfAndParams::equals(const SystemStatusItemBase& peer) {
|
||||
if ((mPgaGain != ((const SystemStatusRfAndParams&)peer).mPgaGain) ||
|
||||
@@ -849,7 +1042,8 @@ bool SystemStatusRfAndParams::equals(const SystemStatusItemBase& peer) {
|
||||
(mBdsBpAmpI != ((const SystemStatusRfAndParams&)peer).mBdsBpAmpI) ||
|
||||
(mBdsBpAmpQ != ((const SystemStatusRfAndParams&)peer).mBdsBpAmpQ) ||
|
||||
(mGalBpAmpI != ((const SystemStatusRfAndParams&)peer).mGalBpAmpI) ||
|
||||
(mGalBpAmpQ != ((const SystemStatusRfAndParams&)peer).mGalBpAmpQ)) {
|
||||
(mGalBpAmpQ != ((const SystemStatusRfAndParams&)peer).mGalBpAmpQ) ||
|
||||
(mJammedSignalsMask != ((const SystemStatusRfAndParams&)peer).mJammedSignalsMask)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -859,7 +1053,7 @@ void SystemStatusRfAndParams::dump()
|
||||
{
|
||||
LOC_LOGV("RfAndParams: u=%ld:%ld p=%d bi=%d bq=%d ai=%d aq=%d "
|
||||
"jgp=%d jgl=%d jbd=%d jga=%d "
|
||||
"agp=%lf agl=%lf abd=%lf aga=%lf",
|
||||
"agp=%d agl=%d abd=%d aga=%d",
|
||||
mUtcTime.tv_sec, mUtcTime.tv_nsec,
|
||||
mPgaGain,
|
||||
mGpsBpAmpI,
|
||||
@@ -1448,6 +1642,35 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void SystemStatus::setEngineDebugDataInfo(const GnssEngineDebugDataInfo& gnssEngineDebugDataInfo) {
|
||||
pthread_mutex_lock(&mMutexSystemStatus);
|
||||
LOC_LOGd("setEngine data");
|
||||
SystemStatusPQWM1 s(gnssEngineDebugDataInfo);
|
||||
setIteminReport(mCache.mTimeAndClock, SystemStatusTimeAndClock(s));
|
||||
setIteminReport(mCache.mXoState, SystemStatusXoState(s));
|
||||
setIteminReport(mCache.mRfAndParams, SystemStatusRfAndParams(s));
|
||||
setIteminReport(mCache.mErrRecovery, SystemStatusErrRecovery(s));
|
||||
setIteminReport(mCache.mInjectedPosition,
|
||||
SystemStatusInjectedPosition(SystemStatusPQWP1(gnssEngineDebugDataInfo)));
|
||||
setIteminReport(mCache.mBestPosition,
|
||||
SystemStatusBestPosition(SystemStatusPQWP2(gnssEngineDebugDataInfo)));
|
||||
setIteminReport(mCache.mXtra,
|
||||
SystemStatusXtra(SystemStatusPQWP3(gnssEngineDebugDataInfo)));
|
||||
setIteminReport(mCache.mEphemeris,
|
||||
SystemStatusEphemeris(SystemStatusPQWP4(gnssEngineDebugDataInfo)));
|
||||
setIteminReport(mCache.mSvHealth,
|
||||
SystemStatusSvHealth(SystemStatusPQWP5(gnssEngineDebugDataInfo)));
|
||||
setIteminReport(mCache.mPdr,
|
||||
SystemStatusPdr(SystemStatusPQWP6(gnssEngineDebugDataInfo)));
|
||||
setIteminReport(mCache.mNavData,
|
||||
SystemStatusNavData(SystemStatusPQWP7(gnssEngineDebugDataInfo)));
|
||||
setIteminReport(mCache.mPositionFailure,
|
||||
SystemStatusPositionFailure(SystemStatusPQWS1(gnssEngineDebugDataInfo)));
|
||||
pthread_mutex_unlock(&mMutexSystemStatus);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@brief API to set report position data into internal buffer
|
||||
|
||||
@@ -1602,9 +1825,10 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem)
|
||||
|
||||
@return true when successfully done
|
||||
******************************************************************************/
|
||||
bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly) const {
|
||||
bool SystemStatus::getReport(SystemStatusReports& report, bool isLatestOnly,
|
||||
bool inSessionOnly) const {
|
||||
pthread_mutex_lock(&mMutexSystemStatus);
|
||||
if (!mTracking) {
|
||||
if (inSessionOnly && !mTracking) {
|
||||
pthread_mutex_unlock(&mMutexSystemStatus);
|
||||
return true;
|
||||
}
|
||||
@@ -1773,7 +1997,21 @@ bool SystemStatus::updatePowerConnectState(bool charging)
|
||||
******************************************************************************/
|
||||
bool SystemStatus::eventOptInStatus(bool userConsent)
|
||||
{
|
||||
SystemStatusENH s(userConsent);
|
||||
SystemStatusENH s(userConsent, ENHDataItem::FIELD_CONSENT);
|
||||
mSysStatusObsvr.notify({&s.mDataItem});
|
||||
return true;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
@brief API to update Region
|
||||
|
||||
@param[In] region
|
||||
|
||||
@return true when successfully done
|
||||
******************************************************************************/
|
||||
bool SystemStatus::eventRegionStatus(bool region)
|
||||
{
|
||||
SystemStatusENH s(region, ENHDataItem::FIELD_REGION);
|
||||
mSysStatusObsvr.notify({&s.mDataItem});
|
||||
return true;
|
||||
}
|
||||
|
@@ -26,6 +26,43 @@
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
|
||||
Copyright (c) 2022-2023 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 __SYSTEM_STATUS__
|
||||
#define __SYSTEM_STATUS__
|
||||
|
||||
@@ -161,16 +198,18 @@ public:
|
||||
uint32_t mJammerGlo;
|
||||
uint32_t mJammerBds;
|
||||
uint32_t mJammerGal;
|
||||
double mAgcGps;
|
||||
double mAgcGlo;
|
||||
double mAgcBds;
|
||||
double mAgcGal;
|
||||
uint32_t mAgcGps;
|
||||
uint32_t mAgcGlo;
|
||||
uint32_t mAgcBds;
|
||||
uint32_t mAgcGal;
|
||||
uint32_t mGloBpAmpI;
|
||||
uint32_t mGloBpAmpQ;
|
||||
uint32_t mBdsBpAmpI;
|
||||
uint32_t mBdsBpAmpQ;
|
||||
uint32_t mGalBpAmpI;
|
||||
uint32_t mGalBpAmpQ;
|
||||
uint32_t mJammedSignalsMask;
|
||||
std::vector<GnssJammerData> mJammerData;
|
||||
inline SystemStatusRfAndParams() :
|
||||
mPgaGain(0),
|
||||
mGpsBpAmpI(0),
|
||||
@@ -190,7 +229,8 @@ public:
|
||||
mBdsBpAmpI(0),
|
||||
mBdsBpAmpQ(0),
|
||||
mGalBpAmpI(0),
|
||||
mGalBpAmpQ(0) {}
|
||||
mGalBpAmpQ(0),
|
||||
mJammedSignalsMask(0) {}
|
||||
inline SystemStatusRfAndParams(const SystemStatusPQWM1& nmea);
|
||||
bool equals(const SystemStatusItemBase& peer) override;
|
||||
void dump(void) override;
|
||||
@@ -423,10 +463,16 @@ public:
|
||||
class SystemStatusENH : public SystemStatusItemBase {
|
||||
public:
|
||||
ENHDataItem mDataItem;
|
||||
inline SystemStatusENH(bool enabled=false): mDataItem(enabled) {}
|
||||
inline SystemStatusENH(bool enabled, ENHDataItem::Fields updateBit = ENHDataItem::FIELD_MAX):
|
||||
mDataItem(enabled, updateBit) {}
|
||||
inline SystemStatusENH(const ENHDataItem& itemBase): mDataItem(itemBase) {}
|
||||
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& peer) {
|
||||
mDataItem.mEnhFields = ((const SystemStatusENH&)peer).mDataItem.mEnhFields;
|
||||
mDataItem.updateFields();
|
||||
return *this;
|
||||
}
|
||||
inline bool equals(const SystemStatusItemBase& peer) override {
|
||||
return mDataItem.mEnabled == ((const SystemStatusENH&)peer).mDataItem.mEnabled;
|
||||
return mDataItem.mEnhFields == ((const SystemStatusENH&)peer).mDataItem.mEnhFields;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -887,13 +933,16 @@ public:
|
||||
bool eventPosition(const UlpLocation& location,const GpsLocationExtended& locationEx);
|
||||
bool eventDataItemNotify(IDataItemCore* dataitem);
|
||||
bool setNmeaString(const char *data, uint32_t len);
|
||||
bool getReport(SystemStatusReports& reports, bool isLatestonly = false) const;
|
||||
bool getReport(SystemStatusReports& reports, bool isLatestonly = false,
|
||||
bool inSessionOnly = true) const;
|
||||
void setEngineDebugDataInfo(const GnssEngineDebugDataInfo& gnssEngineDebugDataInfo);
|
||||
bool setDefaultGnssEngineStates(void);
|
||||
bool eventConnectionStatus(bool connected, int8_t type,
|
||||
bool roaming, NetworkHandle networkHandle, string& apn);
|
||||
bool updatePowerConnectState(bool charging);
|
||||
void resetNetworkInfo();
|
||||
bool eventOptInStatus(bool userConsent);
|
||||
bool eventRegionStatus(bool region);
|
||||
bool eventInEmergencyCall(bool isEmergency);
|
||||
void setTracking(bool tracking);
|
||||
};
|
||||
|
@@ -27,6 +27,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
*/
|
||||
|
||||
#include "DataItemConcreteTypes.h"
|
||||
#include <inttypes.h>
|
||||
#include <log_util.h>
|
||||
@@ -146,8 +152,26 @@ void ENHDataItem::stringify(string& valueStr) {
|
||||
STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(ENHDataItem, ENH_DATA_ITEM_ID);
|
||||
valueStr.clear ();
|
||||
valueStr = ENH_FIELD_ENABLED;
|
||||
valueStr += ": ";
|
||||
valueStr += (d->mEnabled) ? ("true") : ("false");
|
||||
if (!d->isEnabled()) {
|
||||
Fields field = FIELD_MAX;
|
||||
switch (mFieldUpdate) {
|
||||
case FIELD_CONSENT:
|
||||
valueStr += "_FIELD_CONSENT";
|
||||
field = FIELD_CONSENT;
|
||||
break;
|
||||
case FIELD_REGION:
|
||||
valueStr += "_FIELD_REGION";
|
||||
field = FIELD_REGION;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
valueStr += ": ";
|
||||
valueStr += (((1 << field) & d->mEnhFields) != 0) ? "true" : "false";
|
||||
} else {
|
||||
valueStr += ": ";
|
||||
valueStr += "true";
|
||||
}
|
||||
} while (0);
|
||||
EXIT_LOG_WITH_ERROR("%d", result);
|
||||
}
|
||||
@@ -582,8 +606,17 @@ int32_t ENHDataItem::copyFrom(IDataItemCore* src) {
|
||||
ENTRY_LOG();
|
||||
do {
|
||||
COPIER_ERROR_CHECK_AND_DOWN_CAST(ENHDataItem, ENH_DATA_ITEM_ID);
|
||||
if (s->mEnabled == d->mEnabled) { result = true; break; }
|
||||
s->mEnabled = d->mEnabled;
|
||||
if (s->mEnhFields == d->mEnhFields) { result = true; break; }
|
||||
switch (d->mAction) {
|
||||
case SET:
|
||||
s->mEnhFields |= (1 << d->mFieldUpdate);
|
||||
break;
|
||||
case CLEAR:
|
||||
s->mEnhFields &= ~(1 << d->mFieldUpdate);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
result = 0;
|
||||
} while (0);
|
||||
EXIT_LOG_WITH_ERROR("%d", result);
|
||||
|
@@ -27,6 +27,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from Qualcomm Innovation Center are provided under the following license:
|
||||
Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
*/
|
||||
|
||||
#ifndef DATAITEM_CONCRETETYPES_H
|
||||
#define DATAITEM_CONCRETETYPES_H
|
||||
|
||||
@@ -143,13 +149,46 @@ public:
|
||||
|
||||
class ENHDataItem: public IDataItemCore {
|
||||
public:
|
||||
ENHDataItem(bool enabled = false) :
|
||||
mEnabled(enabled) {mId = ENH_DATA_ITEM_ID;}
|
||||
enum Fields { FIELD_CONSENT, FIELD_REGION, FIELD_MAX };
|
||||
enum Actions { NO_OP, SET, CLEAR };
|
||||
ENHDataItem(bool enabled = false, Fields updateBit = FIELD_MAX) :
|
||||
mEnhFields(0), mFieldUpdate(updateBit) {
|
||||
mId = ENH_DATA_ITEM_ID;
|
||||
setAction(enabled ? SET : CLEAR);
|
||||
}
|
||||
virtual ~ENHDataItem() {}
|
||||
virtual void stringify(string& /*valueStr*/) override;
|
||||
virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
|
||||
// Data members
|
||||
bool mEnabled;
|
||||
inline bool isEnabled() const {
|
||||
uint8_t combinedBits = (1 << FIELD_MAX) - 1;
|
||||
return (combinedBits == (mEnhFields & combinedBits));
|
||||
}
|
||||
void setAction(Actions action = NO_OP) {
|
||||
mAction = action;
|
||||
if (NO_OP != mAction) {
|
||||
updateFields();
|
||||
}
|
||||
}
|
||||
void updateFields() {
|
||||
if (FIELD_MAX > mFieldUpdate) {
|
||||
switch (mAction) {
|
||||
case SET:
|
||||
mEnhFields |= (1 << mFieldUpdate);
|
||||
break;
|
||||
case CLEAR:
|
||||
mEnhFields &= ~(1 << mFieldUpdate);
|
||||
break;
|
||||
case NO_OP:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Data members
|
||||
uint32_t mEnhFields;
|
||||
private:
|
||||
Actions mAction;
|
||||
Fields mFieldUpdate;
|
||||
};
|
||||
|
||||
class GPSStateDataItem: public IDataItemCore {
|
||||
|
Reference in New Issue
Block a user