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

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

Add ephSource, toc, toe, IODC, IODE to SatellitePvt

(hardware/interfaces)

Bug: 206670536
Test: atest VtsHalGnssTargetTest
Change-Id: I564e9e0f48d5a22d40f103286d0d7553006be1de
parent 90736694
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -42,13 +42,6 @@ interface IGnssDebug {
    NOT_AVAILABLE = 2,
  }
  @Backing(type="int") @VintfStability
  enum SatelliteEphemerisSource {
    DEMODULATED = 0,
    SUPL_PROVIDED = 1,
    OTHER_SERVER_PROVIDED = 2,
    OTHER = 3,
  }
  @Backing(type="int") @VintfStability
  enum SatelliteEphemerisHealth {
    GOOD = 0,
    BAD = 1,
@@ -79,7 +72,7 @@ interface IGnssDebug {
    int svid;
    android.hardware.gnss.GnssConstellationType constellation;
    android.hardware.gnss.IGnssDebug.SatelliteEphemerisType ephemerisType;
    android.hardware.gnss.IGnssDebug.SatelliteEphemerisSource ephemerisSource;
    android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource;
    android.hardware.gnss.IGnssDebug.SatelliteEphemerisHealth ephemerisHealth;
    float ephemerisAgeSeconds;
    boolean serverPredictionIsAvailable;
+12 −0
Original line number Diff line number Diff line
@@ -40,7 +40,19 @@ parcelable SatellitePvt {
  android.hardware.gnss.SatelliteClockInfo satClockInfo;
  double ionoDelayMeters;
  double tropoDelayMeters;
  int TOC;
  int IODC;
  int TOE;
  int IODE;
  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;
  const int HAS_TROPO = 4;
  @Backing(type="int") @VintfStability
  enum SatelliteEphemerisSource {
    DEMODULATED = 0,
    SERVER_NORMAL = 1,
    SERVER_LONG_TERM = 2,
    OTHER = 3,
  }
}
+1 −10
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.hardware.gnss;

import android.hardware.gnss.GnssConstellationType;
import android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource;

/**
 * Extended interface for GNSS Debug support
@@ -35,16 +36,6 @@ interface IGnssDebug {
        NOT_AVAILABLE = 2,
    }

    /** Satellite's ephemeris source */
    @VintfStability
    @Backing(type="int")
    enum SatelliteEphemerisSource {
        DEMODULATED = 0,
        SUPL_PROVIDED = 1,
        OTHER_SERVER_PROVIDED = 2,
        OTHER = 3,
    }

    /** Satellite's ephemeris health */
    @VintfStability
    @Backing(type="int")
+58 −0
Original line number Diff line number Diff line
@@ -74,4 +74,62 @@ parcelable SatellitePvt {

    /** Tropospheric delay in meters. */
    double tropoDelayMeters;

    /**
     * Time of Clock.
     *
     * This is defined in GPS ICD200 documentation
     * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf).
     */
    int TOC;

    /**
     * Issue of Data, Clock.
     *
     * This is defined in GPS ICD200 documentation
     * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf).
     *
     * The field must be set to 0 if it is not supported.
     */
    int IODC;

    /**
     * Time of Ephemeris.
     *
     * This is defined in GPS ICD200 documentation
     * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf).
     */
    int TOE;

    /**
     * Issue of Data, Ephemeris.
     *
     * This is defined in GPS ICD200 documentation
     * (e.g., https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf).
     *
     * The field must be set to 0 if it is not supported.
     */
    int IODE;

    /** Satellite's ephemeris source */
    @VintfStability
    @Backing(type="int")
    enum SatelliteEphemerisSource {
        // Demodulated from broadcast signals
        DEMODULATED = 0,
        // Server provided Normal type ephemeris data, which is similar to broadcast ephemeris in
        // longevity (e.g. SUPL) - lasting for few hours and providing satellite orbit and clock
        // with accuracy of 1 - 2 meters.
        SERVER_NORMAL = 1,
        // Server provided Long-Term type ephemeris data, which lasts for many hours to several days
        // and often provides satellite orbit and clock accuracy of 2 - 20 meters.
        SERVER_LONG_TERM = 2,
        // Other source
        OTHER = 3,
    }

    /**
     * Source of the ephemeris.
     */
    SatelliteEphemerisSource ephemerisSource = SatelliteEphemerisSource.OTHER;
}
+10 −2
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ TEST_P(GnssHalTest, TestPsdsExtension) {
    }
}

void CheckSatellitePvt(const SatellitePvt& satellitePvt) {
void CheckSatellitePvt(const SatellitePvt& satellitePvt, const int interfaceVersion) {
    const double kMaxOrbitRadiusMeters = 43000000.0;
    const double kMaxVelocityMps = 4000.0;
    // The below values are determined using GPS ICD Table 20-1
@@ -147,6 +147,14 @@ void CheckSatellitePvt(const SatellitePvt& satellitePvt) {
        ALOGD("Found HAS_TROPO");
        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);
        // IODC has 10 bits
        ASSERT_TRUE(satellitePvt.IODC >= 0 && satellitePvt.IODC <= 1023);
        // IODE has 8 bits
        ASSERT_TRUE(satellitePvt.IODE >= 0 && satellitePvt.IODE <= 255);
    }
}

void CheckGnssMeasurementClockFields(const GnssData& measurement) {
@@ -226,7 +234,7 @@ TEST_P(GnssHalTest, TestGnssMeasurementExtensionAndSatellitePvt) {
                kIsSatellitePvtSupported == true) {
                ALOGD("Found a measurement with SatellitePvt");
                satellitePvtFound = true;
                CheckSatellitePvt(measurement.satellitePvt);
                CheckSatellitePvt(measurement.satellitePvt, aidl_gnss_hal_->getInterfaceVersion());
            }
        }
    }
Loading