From c2fb31847191cbdc47a7d2861a23b237c7dc8f88 Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Mon, 14 Feb 2022 14:20:14 -0800 Subject: [PATCH] Change TOC and TOE to long Change TOC and TOE definition to 1. long 2. time in seconds since GPS epoch, regardless of constellation 3. must not be encoded 4. rename to timeOfClockSeconds and timeOfEphemerisSeconds Bug: 219575003 Test: on device Change-Id: Icb75a3397d3bf41c91e2a19bbec8a95a97100a07 (cherry picked from commit f20e55cf4654662b8ab730bca3ded1c3e26c55c1) --- .../android/hardware/gnss/SatellitePvt.aidl | 8 +++---- .../android/hardware/gnss/SatellitePvt.aidl | 22 ++++++++++--------- gnss/aidl/vts/gnss_hal_test_cases.cpp | 9 ++++---- gnss/common/utils/default/Utils.cpp | 8 +++---- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl index 21a2520b4e..dc875fae8b 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl @@ -40,10 +40,10 @@ parcelable SatellitePvt { android.hardware.gnss.SatelliteClockInfo satClockInfo; double ionoDelayMeters; double tropoDelayMeters; - int TOC; - int IODC; - int TOE; - int IODE; + long timeOfClockSeconds; + int issueOfDataClock; + long timeOfEphemerisSeconds; + int issueOfDataEphemeris; android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource = android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource.OTHER; const int HAS_POSITION_VELOCITY_CLOCK_INFO = 1; const int HAS_IONO = 2; diff --git a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl index e79249df63..d9f767ab05 100644 --- a/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl +++ b/gnss/aidl/android/hardware/gnss/SatellitePvt.aidl @@ -76,12 +76,13 @@ parcelable SatellitePvt { double tropoDelayMeters; /** - * Time of Clock. + * Time of Clock in seconds. * - * This is defined in GPS ICD200 documentation - * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf). + * This value is defined in seconds since GPS epoch, regardless of the constellation. + * + * The value must not be encoded as in GPS ICD200 documentation. */ - int TOC; + long timeOfClockSeconds; /** * Issue of Data, Clock. @@ -91,15 +92,16 @@ parcelable SatellitePvt { * * The field must be set to 0 if it is not supported. */ - int IODC; + int issueOfDataClock; /** - * Time of Ephemeris. + * Time of Ephemeris in seconds. * - * This is defined in GPS ICD200 documentation - * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf). + * This value is defined in seconds since GPS epoch, regardless of the constellation. + * + * The value must not be encoded as in GPS ICD200 documentation. */ - int TOE; + long timeOfEphemerisSeconds; /** * Issue of Data, Ephemeris. @@ -109,7 +111,7 @@ parcelable SatellitePvt { * * The field must be set to 0 if it is not supported. */ - int IODE; + int issueOfDataEphemeris; /** Satellite's ephemeris source */ @VintfStability diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index 365f9d355e..54946fb64f 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -366,12 +366,13 @@ void CheckSatellitePvt(const SatellitePvt& satellitePvt, const int interfaceVers ASSERT_TRUE(satellitePvt.tropoDelayMeters > 0 && satellitePvt.tropoDelayMeters < 100); } if (interfaceVersion >= 2) { - ASSERT_TRUE(satellitePvt.TOC >= 0 && satellitePvt.TOC <= 604784); - ASSERT_TRUE(satellitePvt.TOE >= 0 && satellitePvt.TOE <= 604784); + ASSERT_TRUE(satellitePvt.timeOfClockSeconds >= 0); + ASSERT_TRUE(satellitePvt.timeOfEphemerisSeconds >= 0); // IODC has 10 bits - ASSERT_TRUE(satellitePvt.IODC >= 0 && satellitePvt.IODC <= 1023); + ASSERT_TRUE(satellitePvt.issueOfDataClock >= 0 && satellitePvt.issueOfDataClock <= 1023); // IODE has 8 bits - ASSERT_TRUE(satellitePvt.IODE >= 0 && satellitePvt.IODE <= 255); + ASSERT_TRUE(satellitePvt.issueOfDataEphemeris >= 0 && + satellitePvt.issueOfDataEphemeris <= 255); } } diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp index a519d3acfb..4de49f376c 100644 --- a/gnss/common/utils/default/Utils.cpp +++ b/gnss/common/utils/default/Utils.cpp @@ -201,10 +201,10 @@ GnssData Utils::getMockMeasurement(const bool enableCorrVecOutputs) { .tropoDelayMeters = 3.882265204404031, .ephemerisSource = SatellitePvt::SatelliteEphemerisSource::SERVER_LONG_TERM, - .TOC = 12345, - .IODC = 143, - .TOE = 9876, - .IODE = 48, + .timeOfClockSeconds = 12345, + .issueOfDataClock = 143, + .timeOfEphemerisSeconds = 9876, + .issueOfDataEphemeris = 48, }, .correlationVectors = {}};