Yu-Han Yang | c06b536 | 2019-10-25 14:14:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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 | |
| 17 | package android.hardware.gnss@2.1; |
| 18 | |
| 19 | import @1.0::IGnssMeasurementCallback; |
| 20 | import @1.1::IGnssMeasurementCallback; |
| 21 | import @2.0::IGnssMeasurementCallback; |
| 22 | import @2.0::ElapsedRealtime; |
| 23 | |
| 24 | /** The callback interface to report measurements from the HAL. */ |
| 25 | interface IGnssMeasurementCallback extends @2.0::IGnssMeasurementCallback { |
| 26 | |
| 27 | /** |
| 28 | * Extends a GNSS Measurement, adding a basebandCN0DbHz. |
| 29 | */ |
| 30 | struct GnssMeasurement { |
| 31 | /** |
| 32 | * GNSS measurement information for a single satellite and frequency, as in the 2.0 version |
| 33 | * of the HAL. |
| 34 | */ |
| 35 | @2.0::IGnssMeasurementCallback.GnssMeasurement v2_0; |
| 36 | |
| 37 | /** |
| 38 | * Baseband Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. It contains |
| 39 | * the measured C/N0 value for the signal measured at the baseband. |
| 40 | * |
| 41 | * This is typically a few dB weaker than the value estimated for C/N0 at the antenna port, |
| 42 | * which is reported in cN0DbHz. |
| 43 | * |
| 44 | * If a signal has separate components (e.g. Pilot and Data channels) and the receiver only |
| 45 | * processes one of the components, then the reported basebandCN0DbHz reflects only the |
| 46 | * component that is processed. |
| 47 | * |
| 48 | * This value is mandatory. |
| 49 | */ |
| 50 | double basebandCN0DbHz; |
| 51 | }; |
| 52 | |
| 53 | /** |
| 54 | * Complete set of GNSS Measurement data, same as 2.0 with additional double (i.e., |
| 55 | * basebandCN0DbHz) in measurements. |
| 56 | */ |
| 57 | struct GnssData { |
| 58 | /** The full set of satellite measurement observations. */ |
| 59 | vec<GnssMeasurement> measurements; |
| 60 | |
| 61 | /** The GNSS clock time reading. */ |
| 62 | GnssClock clock; |
| 63 | |
| 64 | /** |
| 65 | * Timing information of the GNSS data synchronized with SystemClock.elapsedRealtimeNanos() |
| 66 | * clock. |
| 67 | */ |
| 68 | ElapsedRealtime elapsedRealtime; |
| 69 | }; |
| 70 | |
| 71 | /** |
| 72 | * Callback for the hal to pass a GnssData structure back to the client. |
| 73 | * |
| 74 | * @param data Contains a reading of GNSS measurements. |
| 75 | */ |
| 76 | gnssMeasurementCb_2_1(GnssData data); |
| 77 | }; |