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 |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 26 | * Attribute field described in RINEX 3.03, e.g., in Tables 4-10, and Table A2 at the RINEX 3.03 |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 27 | * Update 1 Document. |
| 28 | */ |
| 29 | enum GnssMeasurementCodeType : uint8_t { |
| 30 | /** GALILEO E1A, GALILEO E6A, IRNSS L5A, IRNSS SA. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 31 | A = 0, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 32 | |
| 33 | /** GALILEO E1B, GALILEO E6B, IRNSS L5B, IRNSS SB. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 34 | B = 1, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 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 | */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 40 | C = 2, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 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 | */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 46 | I = 3, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 47 | |
| 48 | /** GPS L1C (P), GPS L2C (L), QZSS L1C (P), QZSS L2C (L), LEX(6) L. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 49 | L = 4, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 50 | |
| 51 | /** GPS L1M, GPS L2M. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 52 | M = 5, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 53 | |
| 54 | /** GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 55 | P = 6, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 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 | */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 61 | Q = 7, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 62 | |
| 63 | /** GPS L1C (D), GPS L2C (M), QZSS L1C (D), QZSS L2C (M), LEX(6) S. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 64 | S = 8, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 65 | |
| 66 | /** GPS L1 Z-tracking, GPS L2 Z-tracking. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 67 | W = 9, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 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 | */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 75 | X = 10, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 76 | |
| 77 | /** GPS L1Y, GPS L2Y. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 78 | Y = 11, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 79 | |
| 80 | /** GALILEO E1 (A+B+C), GALILEO E6 (A+B+C), QZSS L1-SAIF. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 81 | Z = 12, |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 82 | |
| 83 | /** GPS L1 codeless, GPS L2 codeless. */ |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 84 | N = 13, |
| 85 | |
| 86 | /** |
| 87 | * Other code type that does not belong to any of the above code types. |
| 88 | * |
| 89 | * This code type is used in the case that the above code types do not cover all the code |
| 90 | * types introduced in a new version of RINEX standard. When this code type is set, the |
| 91 | * field GnssMeasurement.otherCodeTypeName must specify the new code type. |
| 92 | */ |
| 93 | OTHER = 255 |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | /** |
| 97 | * Extends a GNSS Measurement, adding a GnssMeasurementCodeType. |
| 98 | */ |
| 99 | struct GnssMeasurement { |
| 100 | /** |
| 101 | * GNSS measurement information for a single satellite and frequency, as in the 1.1 |
| 102 | * version of the HAL with further clarification of the value reported in the |
| 103 | * accumulatedDeltaRangeM field, i.e., the alignment of the phase measurement will not be |
| 104 | * adjusted by the receiver so the in-phase and quadrature phase components will have a |
| 105 | * quarter cycle offset as they do when transmitted from the satellites. If the measurement |
| 106 | * is from a combination of the in-phase and quadrature phase components, then the alignment |
| 107 | * of the phase measurement will be aligned to the in-phase component. |
| 108 | */ |
| 109 | @1.1::IGnssMeasurementCallback.GnssMeasurement v1_1; |
| 110 | |
| 111 | /** |
| 112 | * The type of code that is currently being tracked in the GNSS measurement. |
| 113 | * |
| 114 | * For high precision applications the type of code being tracked needs to be considered |
| 115 | * in-order to properly apply code specific corrections to the psuedorange measurements. |
| 116 | */ |
| 117 | GnssMeasurementCodeType codeType; |
Yu-Han Yang | 49cbed0 | 2019-01-23 12:11:01 -0800 | [diff] [blame^] | 118 | |
| 119 | /** |
| 120 | * The name of the code type when codeType is OTHER. |
| 121 | * |
| 122 | * This is used to specify the observation descriptor defined in GNSS Observation Data File |
| 123 | * Header Section Description in the RINEX standard (Version 3.XX). In RINEX Version 3.03, |
| 124 | * in Appendix Table A2 Attributes are listed as uppercase letters (for instance, "A" for |
| 125 | * "A channel"). In the future, if for instance a code "G" was added in the official RINEX |
| 126 | * standard, "G" could be specified here. |
| 127 | */ |
| 128 | string otherCodeTypeName; |
Yu-Han Yang | 9c6c20b | 2018-11-06 14:12:49 -0800 | [diff] [blame] | 129 | }; |
| 130 | |
| 131 | /** |
| 132 | * Complete set of GNSS Measurement data, same as 1.1 with additional enum in measurements. |
| 133 | */ |
| 134 | struct GnssData { |
| 135 | /** The full set of satellite measurement observations. */ |
| 136 | vec<GnssMeasurement> measurements; |
| 137 | |
| 138 | /** The GNSS clock time reading. */ |
| 139 | GnssClock clock; |
| 140 | }; |
| 141 | |
| 142 | /** |
| 143 | * Callback for the hal to pass a GnssData structure back to the client. |
| 144 | * |
| 145 | * @param data Contains a reading of GNSS measurements. |
| 146 | */ |
| 147 | gnssMeasurementCb_2_0(GnssData data); |
| 148 | }; |