summaryrefslogtreecommitdiff
path: root/android/2.0
diff options
context:
space:
mode:
authorKatz Yamada <kyamada@codeaurora.org>2018-05-11 14:59:44 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-05-01 13:42:21 -0700
commit2c71ec9e02ea234106d520717fc36eb4f3ad7c48 (patch)
treec2382520b4b40ec1107b11e8bb660e4f512b7002 /android/2.0
parente7c30fa882af46d23f9eddf78fd66cd1bf89a65c (diff)
downloadgps-2c71ec9e02ea234106d520717fc36eb4f3ad7c48.tar.gz
feat: Add timeuncNs in PQWM1 message
Add timeuncNs field in PQWM1 of debug NMEA message generated by modem. SystemStaus to parse it. GnssDebug adds this value in timeunc when it generates GNSS debug report. Change-Id: I649915f95730dc8db22e8b4cb88008edc6d8b9d0 CRs-Fixed: 2236950
Diffstat (limited to 'android/2.0')
-rw-r--r--android/2.0/GnssDebug.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/android/2.0/GnssDebug.cpp b/android/2.0/GnssDebug.cpp
index b6b9bfe..dc0d9f4 100644
--- a/android/2.0/GnssDebug.cpp
+++ b/android/2.0/GnssDebug.cpp
@@ -41,7 +41,8 @@ using ::android::hardware::gnss::V2_0::IGnssDebug;
#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180)
#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT
-#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns
+#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN (999) // 999 ns
+#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX (1.57783680E17) // 5 years in ns
#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm
GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss)
@@ -130,9 +131,10 @@ Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) {
data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME;
}
- if (data.time.timeUncertaintyNs <= 0 ||
- data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) {
- data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC;
+ if (data.time.timeUncertaintyNs <= 0) {
+ data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN;
+ } else if (data.time.timeUncertaintyNs > GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX) {
+ data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX;
}
if (data.time.frequencyUncertaintyNsPerSec <= 0 ||
data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) {
@@ -247,9 +249,11 @@ Return<void> GnssDebug::getDebugData_2_0(getDebugData_2_0_cb _hidl_cb)
if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) {
data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME;
}
- if (data.time.timeUncertaintyNs <= 0 ||
- data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) {
- data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC;
+ if (data.time.timeUncertaintyNs <= 0) {
+ data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MIN;
+ }
+ else if (data.time.timeUncertaintyNs > GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX) {
+ data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC_MAX;
}
if (data.time.frequencyUncertaintyNsPerSec <= 0 ||
data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) {