1/* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.hardware.gnss@1.0; 18 19/** The callback interface to report measurements from the HAL. */ 20interface IGnssMeasurementCallback { 21 /** 22 * Flags to indicate what fields in GnssClock are valid. 23 */ 24 @export(name="", value_prefix="GNSS_CLOCK_") 25 enum GnssClockFlags : uint16_t { 26 /** A valid 'leap second' is stored in the data structure. */ 27 HAS_LEAP_SECOND = 1 << 0, 28 /** A valid 'time uncertainty' is stored in the data structure. */ 29 HAS_TIME_UNCERTAINTY = 1 << 1, 30 /** A valid 'full bias' is stored in the data structure. */ 31 HAS_FULL_BIAS = 1 << 2, 32 /** A valid 'bias' is stored in the data structure. */ 33 HAS_BIAS = 1 << 3, 34 /** A valid 'bias uncertainty' is stored in the data structure. */ 35 HAS_BIAS_UNCERTAINTY = 1 << 4, 36 /** A valid 'drift' is stored in the data structure. */ 37 HAS_DRIFT = 1 << 5, 38 /** A valid 'drift uncertainty' is stored in the data structure. */ 39 HAS_DRIFT_UNCERTAINTY = 1 << 6 40 }; 41 42 /** 43 * Flags to indicate what fields in GnssMeasurement are valid. 44 */ 45 @export(name="", value_prefix="GNSS_MEASUREMENT_") 46 enum GnssMeasurementFlags : uint32_t { 47 /** A valid 'snr' is stored in the data structure. */ 48 HAS_SNR = 1 << 0, 49 /** A valid 'carrier frequency' is stored in the data structure. */ 50 HAS_CARRIER_FREQUENCY = 1 << 9, 51 /** A valid 'carrier cycles' is stored in the data structure. */ 52 HAS_CARRIER_CYCLES = 1 << 10, 53 /** A valid 'carrier phase' is stored in the data structure. */ 54 HAS_CARRIER_PHASE = 1 << 11, 55 /** A valid 'carrier phase uncertainty' is stored in the data structure. */ 56 HAS_CARRIER_PHASE_UNCERTAINTY = 1 << 12, 57 /** A valid automatic gain control is stored in the data structure. */ 58 HAS_AUTOMATIC_GAIN_CONTROL = 1 << 13 59 }; 60 61 /** 62 * Enumeration of available values for the GNSS Measurement's multipath 63 * indicator. 64 */ 65 @export(name="", value_prefix="GNSS_MULTIPATH_") 66 enum GnssMultipathIndicator : uint8_t { 67 /** The indicator is not available or unknown. */ 68 INDICATOR_UNKNOWN = 0, 69 /** The measurement is indicated to be affected by multipath. */ 70 INDICATOR_PRESENT = 1, 71 /** The measurement is indicated to be not affected by multipath. */ 72 INDICATIOR_NOT_PRESENT = 2 73 }; 74 75 /** 76 * Flags indicating the GNSS measurement state. 77 * 78 * The expected behavior here is for GNSS HAL to set all the flags that applies. 79 * For example, if the state for a satellite is only C/A code locked and bit 80 * synchronized, and there is still millisecond ambiguity, the state must be 81 * set as: 82 * 83 * STATE_CODE_LOCK | STATE_BIT_SYNC | STATE_MSEC_AMBIGUOUS 84 * 85 * If GNSS is still searching for a satellite, the corresponding state must be 86 * set to STATE_UNKNOWN(0). 87 */ 88 @export(name="", value_prefix="GNSS_MEASUREMENT_") 89 enum GnssMeasurementState : uint32_t { 90 STATE_UNKNOWN = 0, 91 STATE_CODE_LOCK = 1 << 0, 92 STATE_BIT_SYNC = 1 << 1, 93 STATE_SUBFRAME_SYNC = 1 << 2, 94 STATE_TOW_DECODED = 1 << 3, 95 STATE_MSEC_AMBIGUOUS = 1 << 4, 96 STATE_SYMBOL_SYNC = 1 << 5, 97 STATE_GLO_STRING_SYNC = 1 << 6, 98 STATE_GLO_TOD_DECODED = 1 << 7, 99 STATE_BDS_D2_BIT_SYNC = 1 << 8, 100 STATE_BDS_D2_SUBFRAME_SYNC = 1 << 9, 101 STATE_GAL_E1BC_CODE_LOCK = 1 << 10, 102 STATE_GAL_E1C_2ND_CODE_LOCK = 1 << 11, 103 STATE_GAL_E1B_PAGE_SYNC = 1 << 12, 104 STATE_SBAS_SYNC = 1 << 13, 105 STATE_TOW_KNOWN = 1 << 14, 106 STATE_GLO_TOD_KNOWN = 1 << 15, 107 }; 108 109 /** 110 * Flags indicating the Accumulated Delta Range's states. 111 */ 112 @export(name="", value_prefix="GNSS_") 113 enum GnssAccumulatedDeltaRangeState : uint16_t { 114 ADR_STATE_UNKNOWN = 0, 115 ADR_STATE_VALID = 1 << 0, 116 ADR_STATE_RESET = 1 << 1, 117 ADR_STATE_CYCLE_SLIP = 1 << 2, 118 }; 119 120 /** 121 * Represents an estimate of the GNSS clock time. 122 */ 123 struct GnssClock { 124 /** 125 * A set of flags indicating the validity of the fields in this data 126 * structure. 127 * 128 * Fields for which there is no corresponding flag must be filled in 129 * with a valid value. For convenience, these are marked as mandatory. 130 * 131 * Others fields may have invalid information in them, if not marked as 132 * valid by the corresponding bit in gnssClockFlags. 133 */ 134 bitfield<GnssClockFlags> gnssClockFlags; 135 136 /** 137 * Leap second data. 138 * The sign of the value is defined by the following equation: 139 * utcTimeNs = timeNs - (fullBiasNs + biasNs) - leapSecond * 140 * 1,000,000,000 141 * 142 * If this data is available, gnssClockFlags must contain 143 * HAS_LEAP_SECOND. 144 */ 145 int16_t leapSecond; 146 147 /** 148 * The GNSS receiver internal clock value. This is the local hardware clock 149 * value. 150 * 151 * For local hardware clock, this value is expected to be monotonically 152 * increasing while the hardware clock remains powered on. (For the case of a 153 * HW clock that is not continuously on, see the 154 * hwClockDiscontinuityCount field). The receiver's estimate of GNSS time 155 * can be derived by subtracting the sum of fullBiasNs and biasNs (when 156 * available) from this value. 157 * 158 * This GNSS time must be the best estimate of current GNSS time 159 * that GNSS receiver can achieve. 160 * 161 * Sub-nanosecond accuracy can be provided by means of the 'biasNs' field. 162 * The value contains the timeUncertaintyNs in it. 163 * 164 * This value is mandatory. 165 */ 166 int64_t timeNs; 167 168 /** 169 * 1-Sigma uncertainty associated with the clock's time in nanoseconds. 170 * The uncertainty is represented as an absolute (single sided) value. 171 * 172 * If the data is available, gnssClockFlags must contain 173 * HAS_TIME_UNCERTAINTY. Ths value is ideally zero, as the time 174 * 'latched' by timeNs is defined as the reference clock vs. which all 175 * other times (and corresponding uncertainties) are measured. 176 */ 177 double timeUncertaintyNs; 178 179 /** 180 * The difference between hardware clock ('time' field) inside GNSS receiver 181 * and the true GPS time since 0000Z, January 6, 1980, in nanoseconds. 182 * 183 * The sign of the value is defined by the following equation: 184 * local estimate of GPS time = timeNs - (fullBiasNs + biasNs) 185 * 186 * If receiver has computed time for a non-GPS constellation, the time offset of 187 * that constellation versus GPS time must be applied to fill this value. 188 * 189 * The error estimate for the sum of this and the biasNs is the biasUncertaintyNs. 190 * 191 * If the data is available gnssClockFlags must contain HAS_FULL_BIAS. 192 * 193 * This value is mandatory if the receiver has estimated GPS time. 194 */ 195 int64_t fullBiasNs; 196 197 /** 198 * Sub-nanosecond bias - used with fullBiasNS, see fullBiasNs for details. 199 * 200 * The error estimate for the sum of this and the fullBiasNs is the 201 * biasUncertaintyNs. 202 * 203 * If the data is available gnssClockFlags must contain HAS_BIAS. 204 * 205 * This value is mandatory if the receiver has estimated GPS time. 206 */ 207 double biasNs; 208 209 /** 210 * 1-Sigma uncertainty associated with the local estimate of GNSS time (clock 211 * bias) in nanoseconds. The uncertainty is represented as an absolute 212 * (single sided) value. 213 * 214 * The caller is responsible for using this uncertainty (it can be very 215 * large before the GPS time has been fully resolved.) 216 * 217 * If the data is available gnssClockFlags must contain HAS_BIAS_UNCERTAINTY. 218 * 219 * This value is mandatory if the receiver has estimated GPS time. 220 */ 221 double biasUncertaintyNs; 222 223 /** 224 * The clock's drift in nanoseconds (per second). 225 * 226 * A positive value means that the frequency is higher than the nominal 227 * frequency, and that the (fullBiasNs + biasNs) is growing more positive 228 * over time. 229 * 230 * If the data is available gnssClockFlags must contain HAS_DRIFT. 231 * 232 * This value is mandatory if the receiver has estimated GPS time. 233 */ 234 double driftNsps; 235 236 /** 237 * 1-Sigma uncertainty associated with the clock's drift in nanoseconds (per 238 * second). 239 * The uncertainty is represented as an absolute (single sided) value. 240 * 241 * If the data is available gnssClockFlags must contain HAS_DRIFT_UNCERTAINTY. 242 * 243 * This value is mandatory if the receiver has estimated GPS time. 244 */ 245 double driftUncertaintyNsps; 246 247 /** 248 * This field must be incremented, when there are discontinuities in the 249 * hardware clock. 250 * 251 * A "discontinuity" is meant to cover the case of a switch from one source 252 * of clock to another. A single free-running crystal oscillator (XO) 253 * will generally not have any discontinuities, and this can be set and 254 * left at 0. 255 * 256 * If, however, the timeNs value (HW clock) is derived from a composite of 257 * sources, that is not as smooth as a typical XO, or is otherwise stopped & 258 * restarted, then this value shall be incremented each time a discontinuity 259 * occurs. (E.g. this value can start at zero at device boot-up and 260 * increment each time there is a change in clock continuity. In the 261 * unlikely event that this value reaches full scale, rollover (not 262 * clamping) is required, such that this value continues to change, during 263 * subsequent discontinuity events.) 264 * 265 * While this number stays the same, between GnssClock reports, it can be 266 * safely assumed that the timeNs value has been running continuously, e.g. 267 * derived from a single, high quality clock (XO like, or better, that is 268 * typically used during continuous GNSS signal sampling.) 269 * 270 * It is expected, esp. during periods where there are few GNSS signals 271 * available, that the HW clock be discontinuity-free as long as possible, 272 * as this avoids the need to use (waste) a GNSS measurement to fully 273 * re-solve for the GNSS clock bias and drift, when using the accompanying 274 * measurements, from consecutive GnssData reports. 275 * 276 * This value is mandatory. 277 */ 278 uint32_t hwClockDiscontinuityCount; 279 280 }; 281 282 /** 283 * Represents a GNSS Measurement, it contains raw and computed information. 284 * 285 * All signal measurement information (e.g. svTime, 286 * pseudorangeRate, multipathIndicator) reported in this struct must be 287 * based on GNSS signal measurements only. You must not synthesize measurements 288 * by calculating or reporting expected measurements based on known or estimated 289 * position, velocity, or time. 290 */ 291 struct GnssMeasurement{ 292 /** 293 * A set of flags indicating the validity of the fields in this data 294 * structure. 295 * 296 * Fields for which there is no corresponding flag must be filled in 297 * with a valid value. For convenience, these are marked as mandatory. 298 * 299 * Others fields may have invalid information in them, if not marked as 300 * valid by the corresponding bit in flags. 301 */ 302 bitfield<GnssMeasurementFlags> flags; 303 304 /** 305 * Satellite vehicle ID number, as defined in GnssSvInfo::svid 306 * 307 * This value is mandatory. 308 */ 309 int16_t svid; 310 311 /** 312 * Defines the constellation of the given SV. 313 * 314 * This value is mandatory. 315 */ 316 GnssConstellationType constellation; 317 318 /** 319 * Time offset at which the measurement was taken in nanoseconds. 320 * The reference receiver's time is specified by GnssData::clock::timeNs. 321 * 322 * The sign of timeOffsetNs is given by the following equation: 323 * measurement time = GnssClock::timeNs + timeOffsetNs 324 * 325 * It provides an individual time-stamp for the measurement, and allows 326 * sub-nanosecond accuracy. It may be zero if all measurements are 327 * aligned to a common time. 328 * 329 * This value is mandatory. 330 */ 331 double timeOffsetNs; 332 333 /** 334 * Per satellite sync state. It represents the current sync state for the 335 * associated satellite. 336 * Based on the sync state, the 'received GNSS tow' field must be interpreted 337 * accordingly. 338 * 339 * This value is mandatory. 340 */ 341 bitfield<GnssMeasurementState> state; 342 343 /** 344 * The received GNSS Time-of-Week at the measurement time, in nanoseconds. 345 * For GNSS & QZSS, this is the received GNSS Time-of-Week at the 346 * measurement time, in nanoseconds. The value is relative to the 347 * beginning of the current GNSS week. 348 * 349 * Given the highest sync state that can be achieved, per each satellite, 350 * valid range for this field can be: 351 * Searching : [ 0 ] : STATE_UNKNOWN 352 * C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK set 353 * Bit sync : [ 0 20ms ] : STATE_BIT_SYNC set 354 * Subframe sync : [ 0 6s ] : STATE_SUBFRAME_SYNC set 355 * TOW decoded : [ 0 1week ] : STATE_TOW_DECODED set 356 * TOW Known : [ 0 1week ] : STATE_TOW_KNOWN set 357 * 358 * Note: TOW Known refers to the case where TOW is possibly not decoded 359 * over the air but has been determined from other sources. If TOW 360 * decoded is set then TOW Known must also be set. 361 * 362 * Note: If there is any ambiguity in integer millisecond, 363 * GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS must be set accordingly, in the 364 * 'state' field. 365 * 366 * This value must be populated if 'state' != STATE_UNKNOWN. 367 * 368 * For Glonass, this is the received Glonass time of day, at the 369 * measurement time in nanoseconds. 370 * 371 * Given the highest sync state that can be achieved, per each satellite, 372 * valid range for this field can be: 373 * Searching : [ 0 ] : STATE_UNKNOWN set 374 * C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK set 375 * Symbol sync : [ 0 10ms ] : STATE_SYMBOL_SYNC set 376 * Bit sync : [ 0 20ms ] : STATE_BIT_SYNC set 377 * String sync : [ 0 2s ] : STATE_GLO_STRING_SYNC set 378 * Time of day decoded : [ 0 1day ] : STATE_GLO_TOD_DECODED set 379 * Time of day known : [ 0 1day ] : STATE_GLO_TOD_KNOWN set 380 * 381 * Note: Time of day known refers to the case where it is possibly not 382 * decoded over the air but has been determined from other sources. If 383 * Time of day decoded is set then Time of day known must also be set. 384 * 385 * For Beidou, this is the received Beidou time of week, 386 * at the measurement time in nanoseconds. 387 * 388 * Given the highest sync state that can be achieved, per each satellite, 389 * valid range for this field can be: 390 * Searching : [ 0 ] : STATE_UNKNOWN set. 391 * C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK set. 392 * Bit sync (D2) : [ 0 2ms ] : STATE_BDS_D2_BIT_SYNC set. 393 * Bit sync (D1) : [ 0 20ms ] : STATE_BIT_SYNC set. 394 * Subframe (D2) : [ 0 0.6s ] : STATE_BDS_D2_SUBFRAME_SYNC set. 395 * Subframe (D1) : [ 0 6s ] : STATE_SUBFRAME_SYNC set. 396 * Time of week decoded : [ 0 1week ] : STATE_TOW_DECODED set. 397 * Time of week known : [ 0 1week ] : STATE_TOW_KNOWN set 398 * 399 * Note: TOW Known refers to the case where TOW is possibly not decoded 400 * over the air but has been determined from other sources. If TOW 401 * decoded is set then TOW Known must also be set. 402 * 403 * For Galileo, this is the received Galileo time of week, 404 * at the measurement time in nanoseconds. 405 * 406 * E1BC code lock : [ 0 4ms ] : STATE_GAL_E1BC_CODE_LOCK set. 407 * E1C 2nd code lock : [ 0 100ms] : STATE_GAL_E1C_2ND_CODE_LOCK set. 408 * E1B page : [ 0 2s ] : STATE_GAL_E1B_PAGE_SYNC set. 409 * Time of week decoded : [ 0 1week] : STATE_TOW_DECODED is set. 410 * Time of week known : [ 0 1week] : STATE_TOW_KNOWN set 411 * 412 * Note: TOW Known refers to the case where TOW is possibly not decoded 413 * over the air but has been determined from other sources. If TOW 414 * decoded is set then TOW Known must also be set. 415 * 416 * For SBAS, this is received SBAS time, at the measurement time in 417 * nanoseconds. 418 * 419 * Given the highest sync state that can be achieved, per each satellite, 420 * valid range for this field can be: 421 * Searching : [ 0 ] : STATE_UNKNOWN 422 * C/A code lock: [ 0 1ms ] : STATE_CODE_LOCK is set 423 * Symbol sync : [ 0 2ms ] : STATE_SYMBOL_SYNC is set 424 * Message : [ 0 1s ] : STATE_SBAS_SYNC is set 425 */ 426 int64_t receivedSvTimeInNs; 427 428 /** 429 * 1-Sigma uncertainty of the Received GNSS Time-of-Week in nanoseconds. 430 * 431 * This value must be populated if 'state' != STATE_UNKNOWN. 432 */ 433 int64_t receivedSvTimeUncertaintyInNs; 434 435 /** 436 * Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. 437 * It contains the measured C/N0 value for the signal at the antenna port. 438 * 439 * If a signal has separate components (e.g. Pilot and Data channels) and 440 * the receiver only processes one of the components, then the reported 441 * cN0DbHz reflects only the component that is processed. 442 * 443 * This value is mandatory. 444 */ 445 double cN0DbHz; 446 447 /** 448 * Pseudorange rate at the timestamp in m/s. The correction of a given 449 * Pseudorange Rate value includes corrections for receiver and satellite 450 * clock frequency errors. Ensure that this field is independent (see 451 * comment at top of GnssMeasurement struct.) 452 * 453 * It is mandatory to provide the 'uncorrected' 'pseudorange rate', and 454 * provide GnssClock's 'drift' field as well. When providing the 455 * uncorrected pseudorange rate, do not apply the corrections described above.) 456 * 457 * The value includes the 'pseudorange rate uncertainty' in it. 458 * A positive 'uncorrected' value indicates that the SV is moving away from 459 * the receiver. 460 * 461 * The sign of the 'uncorrected' 'pseudorange rate' and its relation to the 462 * sign of 'doppler shift' is given by the equation: 463 * pseudorange rate = -k * doppler shift (where k is a constant) 464 * 465 * This must be the most accurate pseudorange rate available, based on 466 * fresh signal measurements from this channel. 467 * 468 * It is mandatory that this value be provided at typical carrier phase PRR 469 * quality (few cm/sec per second of uncertainty, or better) - when signals 470 * are sufficiently strong & stable, e.g. signals from a GNSS simulator at >= 471 * 35 dB-Hz. 472 */ 473 double pseudorangeRateMps; 474 475 /** 476 * 1-Sigma uncertainty of the pseudorangeRateMps. 477 * The uncertainty is represented as an absolute (single sided) value. 478 * 479 * This value is mandatory. 480 */ 481 double pseudorangeRateUncertaintyMps; 482 483 /** 484 * Accumulated delta range's state. It indicates whether ADR is reset or 485 * there is a cycle slip(indicating loss of lock). 486 * 487 * This value is mandatory. 488 */ 489 bitfield<GnssAccumulatedDeltaRangeState> accumulatedDeltaRangeState; 490 491 /** 492 * Accumulated delta range since the last channel reset in meters. 493 * A positive value indicates that the SV is moving away from the receiver. 494 * 495 * The sign of the 'accumulated delta range' and its relation to the sign of 496 * 'carrier phase' is given by the equation: 497 * accumulated delta range = -k * carrier phase (where k is a constant) 498 * 499 * This value must be populated if 'accumulated delta range state' != 500 * ADR_STATE_UNKNOWN. 501 * However, it is expected that the data is only accurate when: 502 * 'accumulated delta range state' == ADR_STATE_VALID. 503 */ 504 double accumulatedDeltaRangeM; 505 506 /** 507 * 1-Sigma uncertainty of the accumulated delta range in meters. 508 * This value must be populated if 'accumulated delta range state' != 509 * ADR_STATE_UNKNOWN. 510 */ 511 double accumulatedDeltaRangeUncertaintyM; 512 513 /** 514 * Carrier frequency of the signal tracked, for example it can be the 515 * GPS central frequency for L1 = 1575.45 MHz, or L2 = 1227.60 MHz, L5 = 516 * 1176.45 MHz, varying GLO channels, etc. If the field is not set, it 517 * is the primary common use central frequency, e.g. L1 = 1575.45 MHz 518 * for GPS. 519 * 520 * For an L1, L5 receiver tracking a satellite on L1 and L5 at the same 521 * time, two raw measurement structs must be reported for this same 522 * satellite, in one of the measurement structs, all the values related 523 * to L1 must be filled, and in the other all of the values related to 524 * L5 must be filled. 525 * 526 * If the data is available, gnssMeasurementFlags must contain 527 * HAS_CARRIER_FREQUENCY. 528 */ 529 float carrierFrequencyHz; 530 531 /** 532 * The number of full carrier cycles between the satellite and the 533 * receiver. The reference frequency is given by the field 534 * 'carrierFrequencyHz'. Indications of possible cycle slips and 535 * resets in the accumulation of this value can be inferred from the 536 * accumulatedDeltaRangeState flags. 537 * 538 * If the data is available, gnssMeasurementFlags must contain 539 * HAS_CARRIER_CYCLES. 540 */ 541 int64_t carrierCycles; 542 543 /** 544 * The RF phase detected by the receiver, in the range [0.0, 1.0]. 545 * This is usually the fractional part of the complete carrier phase 546 * measurement. 547 * 548 * The reference frequency is given by the field 'carrierFrequencyHz'. 549 * The value contains the 'carrier-phase uncertainty' in it. 550 * 551 * If the data is available, gnssMeasurementFlags must contain 552 * HAS_CARRIER_PHASE. 553 */ 554 double carrierPhase; 555 556 /** 557 * 1-Sigma uncertainty of the carrier-phase. 558 * If the data is available, gnssMeasurementFlags must contain 559 * HAS_CARRIER_PHASE_UNCERTAINTY. 560 */ 561 double carrierPhaseUncertainty; 562 563 /** 564 * An enumeration that indicates the 'multipath' state of the event. 565 * 566 * The multipath Indicator is intended to report the presence of overlapping 567 * signals that manifest as distorted correlation peaks. 568 * 569 * - if there is a distorted correlation peak shape, report that multipath 570 * is MULTIPATH_INDICATOR_PRESENT. 571 * - if there is no distorted correlation peak shape, report 572 * MULTIPATH_INDICATOR_NOT_PRESENT 573 * - if signals are too weak to discern this information, report 574 * MULTIPATH_INDICATOR_UNKNOWN 575 * 576 * Example: when doing the standardized overlapping Multipath Performance 577 * test (3GPP TS 34.171) the Multipath indicator must report 578 * MULTIPATH_INDICATOR_PRESENT for those signals that are tracked, and 579 * contain multipath, and MULTIPATH_INDICATOR_NOT_PRESENT for those 580 * signals that are tracked and do not contain multipath. 581 */ 582 GnssMultipathIndicator multipathIndicator; 583 584 /** 585 * Signal-to-noise ratio at correlator output in dB. 586 * If the data is available, GnssMeasurementFlags must contain HAS_SNR. 587 * This is the power ratio of the "correlation peak height above the 588 * observed noise floor" to "the noise RMS". 589 */ 590 double snrDb; 591 592 /** 593 * Automatic gain control (AGC) level. AGC acts as a variable gain 594 * amplifier adjusting the power of the incoming signal. The AGC level 595 * may be used to indicate potential interference. When AGC is at a 596 * nominal level, this value must be set as 0. Higher gain (and/or lower 597 * input power) must be output as a positive number. Hence in cases of 598 * strong jamming, in the band of this signal, this value must go more 599 * negative. 600 * 601 * Note: Different hardware designs (e.g. antenna, pre-amplification, or 602 * other RF HW components) may also affect the typical output of of this 603 * value on any given hardware design in an open sky test - the 604 * important aspect of this output is that changes in this value are 605 * indicative of changes on input signal power in the frequency band for 606 * this measurement. 607 */ 608 double agcLevelDb; 609 }; 610 611 /** 612 * Represents a reading of GNSS measurements. For devices where GnssSystemInfo's 613 * yearOfHw is set to 2016+, it is mandatory that these be provided, on 614 * request, when the GNSS receiver is searching/tracking signals. 615 * 616 * - Reporting of GNSS constellation measurements is mandatory. 617 * - Reporting of all tracked constellations are encouraged. 618 */ 619 struct GnssData { 620 /** Number of GnssMeasurement elements. */ 621 uint32_t measurementCount; 622 623 /** The array of measurements. */ 624 GnssMeasurement[GnssMax:SVS_COUNT] measurements; 625 626 /** The GNSS clock time reading. */ 627 GnssClock clock; 628 }; 629 630 /** 631 * Callback for the hal to pass a GnssData structure back to the client. 632 * 633 * @param data Contains a reading of GNSS measurements. 634 */ 635 GnssMeasurementCb(GnssData data); 636}; 637