How to determine SNR for specific GNSS satellite/constellation in Android 7.0?
I'm in the process of updating GPSTest (https://github.com/barbeau/gpstest), an open-source app that I maintain, to support the new GnssStatus and GnssMeasurement callbacks available in Android 7.0 Nougat.
In Android 6.0 and lower, using the GPSStatus.Listener you were able to get SNR, Elevation, Azimuth, and ephemeris/almanac/usedInFix info from the GpsStatus object. In GPSTest this info is visualized in a list and sky (compass) format.
In Android 7.0, GnssStatus largely replaces GPSStatus - all the same information is available, with the exception of SNR. SNR is available from a separate callback in GnssMeasurement updates.
However, it's not clear to me how to connect the SNR information from the GnssMeasurement callbacks to the elevation, azimuth, and ephemeris/almanac/usedInFix info in the GnssStatus callback. Satellite ID and constellation type is available from GnssStatus, but GnssMeasurement only provides satellite ID. Without constellation type in GnssMeasurement, satellite ID alone isn't sufficient to identify a satellite - from GnssStatus.getSvid():
The distinction is made by looking at constellation field getConstellationType(int). Expected values are in the range of:
SBAS: 120-151, 183-192
GLONASS: One of: OSN, or FCN+100
1-24 as the orbital slot number (OSN) (preferred, if known)
93-106 as the frequency channel number (FCN) (-7 to +6) plus 100. i.e. encode FCN of -7 as 93, 0 as 100, and +6 as 106
So a satellite ID of 1 could refer to a GPS, GLONASS, Galileo, or Beidou satellite. And, because GPS and GLONASS, for example, can both be visible to a device at the same time, you could potentially get two GnssMeasurements with svid=1.
There seems to be some implicit information of constellation type encoded via GnssMeasurement.getState(), as there are states that reference Galileo, GLONASS, and Beidou, but other states just reference a generic "GNSS". So it doesn't seem like this is enough information to get a constellation type for a GnssMeasurement, and therefore you can't unambiguously link a GnssMeasurement to a GnssStatus.
Am I missing something? Is there another way to tell constellation type of a GnssMeasurement? Or another way to get an SNR to link to a GnssStatus update?
Re: How to determine SNR for specific GNSS satellite/constellation in Android 7.0?
To close the loop on this old thread (sorry, I thought I posted this back in 2016) - in Android 7.0 and higher, you should be using C/N0 instead of SNR for signal quality information. C/N0 is exposed within the GnssStatus object: