Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2fb3184 authored by Yu-Han Yang's avatar Yu-Han Yang
Browse files

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 f20e55cf)
parent dceca455
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;
+12 −10
Original line number Diff line number Diff line
@@ -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
+5 −4
Original line number Diff line number Diff line
@@ -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);
    }
}

+4 −4
Original line number Diff line number Diff line
@@ -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 = {}};