Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2018 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.0; |
| 18 | |
| 19 | import @1.0::IGnssMeasurementCallback; |
| 20 | import @1.1::IGnssMeasurementCallback; |
| 21 | |
| 22 | /** The callback interface to report measurements from the HAL. */ |
| 23 | interface IGnssMeasurementCallback extends @1.1::IGnssMeasurementCallback { |
| 24 | /** |
| 25 | * Enumeration of available values for the GNSS Measurement's code type. Similar to the |
| 26 | * Attribute field described in Rinex 3.03, e.g., in Tables 4-10, and Table A2 at the Rinex 3.03 |
| 27 | * Update 1 Document. |
| 28 | */ |
| 29 | enum GnssMeasurementCodeType : uint8_t { |
| 30 | /** GALILEO E1A, GALILEO E6A, IRNSS L5A, IRNSS SA. */ |
| 31 | CODE_TYPE_A = 0, |
| 32 | |
| 33 | /** GALILEO E1B, GALILEO E6B, IRNSS L5B, IRNSS SB. */ |
| 34 | CODE_TYPE_B = 1, |
| 35 | |
| 36 | /** |
| 37 | * GPS L1 C/A, GPS L2 C/A, GLONASS G1 C/A, GLONASS G2 C/A, GALILEO E1C, GALILEO E6C, SBAS |
| 38 | * L1 C/A, QZSS L1 C/A, IRNSS L5C. |
| 39 | */ |
| 40 | CODE_TYPE_C = 2, |
| 41 | |
| 42 | /** |
| 43 | * GPS L5 I, GLONASS G3 I, GALILEO E5a I, GALILEO E5b I, GALILEO E5a+b I, SBAS L5 I, QZSS L5 |
| 44 | * I, BDS B1 I, BDS B2 I, BDS B3 I. |
| 45 | */ |
| 46 | CODE_TYPE_I = 3, |
| 47 | |
| 48 | /** GPS L1C (P), GPS L2C (L), QZSS L1C (P), QZSS L2C (L), LEX(6) L. */ |
| 49 | CODE_TYPE_L = 4, |
| 50 | |
| 51 | /** GPS L1M, GPS L2M. */ |
| 52 | CODE_TYPE_M = 5, |
| 53 | |
| 54 | /** GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P. */ |
| 55 | CODE_TYPE_P = 6, |
| 56 | |
| 57 | /** |
| 58 | * GPS L5 Q, GLONASS G3 Q, GALILEO E5a Q, GALILEO E5b Q, GALILEO E5a+b Q, SBAS L5 Q, QZSS L5 |
| 59 | * Q, BDS B1 Q, BDS B2 Q, BDS B3 Q. |
| 60 | */ |
| 61 | CODE_TYPE_Q = 7, |
| 62 | |
| 63 | /** GPS L1C (D), GPS L2C (M), QZSS L1C (D), QZSS L2C (M), LEX(6) S. */ |
| 64 | CODE_TYPE_S = 8, |
| 65 | |
| 66 | /** GPS L1 Z-tracking, GPS L2 Z-tracking. */ |
| 67 | CODE_TYPE_W = 9, |
| 68 | |
| 69 | /** |
| 70 | * GPS L1C (D+P), GPS L2C (M+L), GPS L5 (I+Q), GLONASS G3 (I+Q), GALILEO E1 (B+C), GALILEO |
| 71 | * E5a (I+Q), GALILEO E5b (I+Q), GALILEO E5a+b(I+Q), GALILEO E6 (B+C), SBAS L5 (I+Q), QZSS |
| 72 | * L1C (D+P), QZSS L2C (M+L), QZSS L5 (I+Q), LEX(6) (S+L), BDS B1 (I+Q), BDS B2 (I+Q), BDS |
| 73 | * B3 (I+Q), IRNSS L5 (B+C). |
| 74 | */ |
| 75 | CODE_TYPE_X = 10, |
| 76 | |
| 77 | /** GPS L1Y, GPS L2Y. */ |
| 78 | CODE_TYPE_Y = 11, |
| 79 | |
| 80 | /** GALILEO E1 (A+B+C), GALILEO E6 (A+B+C), QZSS L1-SAIF. */ |
| 81 | CODE_TYPE_Z = 12, |
| 82 | |
| 83 | /** GPS L1 codeless, GPS L2 codeless. */ |
| 84 | CODE_TYPE_CODELESS = 13 |
| 85 | }; |
| 86 | |
| 87 | /** |
| 88 | * Extends a GNSS Measurement, adding a GnssMeasurementCodeType. |
| 89 | */ |
| 90 | struct GnssMeasurement { |
| 91 | /** |
| 92 | * GNSS measurement information for a single satellite and frequency, as in the 1.1 |
| 93 | * version of the HAL with further clarification of the value reported in the |
| 94 | * accumulatedDeltaRangeM field, i.e., the alignment of the phase measurement will not be |
| 95 | * adjusted by the receiver so the in-phase and quadrature phase components will have a |
| 96 | * quarter cycle offset as they do when transmitted from the satellites. If the measurement |
| 97 | * is from a combination of the in-phase and quadrature phase components, then the alignment |
| 98 | * of the phase measurement will be aligned to the in-phase component. |
| 99 | */ |
| 100 | @1.1::IGnssMeasurementCallback.GnssMeasurement v1_1; |
| 101 | |
| 102 | /** |
| 103 | * The type of code that is currently being tracked in the GNSS measurement. |
| 104 | * |
| 105 | * For high precision applications the type of code being tracked needs to be considered |
| 106 | * in-order to properly apply code specific corrections to the psuedorange measurements. |
| 107 | */ |
| 108 | GnssMeasurementCodeType codeType; |
| 109 | }; |
| 110 | |
| 111 | /** |
| 112 | * Complete set of GNSS Measurement data, same as 1.1 with additional enum in measurements. |
| 113 | */ |
| 114 | struct GnssData { |
| 115 | /** The full set of satellite measurement observations. */ |
| 116 | vec<GnssMeasurement> measurements; |
| 117 | |
| 118 | /** The GNSS clock time reading. */ |
| 119 | GnssClock clock; |
| 120 | }; |
| 121 | |
| 122 | /** |
| 123 | * Callback for the hal to pass a GnssData structure back to the client. |
| 124 | * |
| 125 | * @param data Contains a reading of GNSS measurements. |
| 126 | */ |
| 127 | gnssMeasurementCb_2_0(GnssData data); |
| 128 | }; |