1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2020 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Worker/** 20*4d7e907cSAndroid Build Coastguard Worker * The callback interface to report GNSS antenna information from the HAL. 21*4d7e907cSAndroid Build Coastguard Worker */ 22*4d7e907cSAndroid Build Coastguard Workerinterface IGnssAntennaInfoCallback { 23*4d7e907cSAndroid Build Coastguard Worker /** 24*4d7e907cSAndroid Build Coastguard Worker * A row of doubles. This is used to represent a row in a 2D array, which are used to 25*4d7e907cSAndroid Build Coastguard Worker * characterize the phase center variation corrections and signal gain corrections. 26*4d7e907cSAndroid Build Coastguard Worker */ 27*4d7e907cSAndroid Build Coastguard Worker struct Row { 28*4d7e907cSAndroid Build Coastguard Worker vec<double> row; 29*4d7e907cSAndroid Build Coastguard Worker }; 30*4d7e907cSAndroid Build Coastguard Worker 31*4d7e907cSAndroid Build Coastguard Worker /** 32*4d7e907cSAndroid Build Coastguard Worker * A point in 3D space, with associated uncertainty. 33*4d7e907cSAndroid Build Coastguard Worker */ 34*4d7e907cSAndroid Build Coastguard Worker struct Coord { 35*4d7e907cSAndroid Build Coastguard Worker double x; 36*4d7e907cSAndroid Build Coastguard Worker 37*4d7e907cSAndroid Build Coastguard Worker double xUncertainty; 38*4d7e907cSAndroid Build Coastguard Worker 39*4d7e907cSAndroid Build Coastguard Worker double y; 40*4d7e907cSAndroid Build Coastguard Worker 41*4d7e907cSAndroid Build Coastguard Worker double yUncertainty; 42*4d7e907cSAndroid Build Coastguard Worker 43*4d7e907cSAndroid Build Coastguard Worker double z; 44*4d7e907cSAndroid Build Coastguard Worker 45*4d7e907cSAndroid Build Coastguard Worker double zUncertainty; 46*4d7e907cSAndroid Build Coastguard Worker }; 47*4d7e907cSAndroid Build Coastguard Worker 48*4d7e907cSAndroid Build Coastguard Worker struct GnssAntennaInfo { 49*4d7e907cSAndroid Build Coastguard Worker /** 50*4d7e907cSAndroid Build Coastguard Worker * The carrier frequency in MHz. 51*4d7e907cSAndroid Build Coastguard Worker */ 52*4d7e907cSAndroid Build Coastguard Worker double carrierFrequencyMHz; 53*4d7e907cSAndroid Build Coastguard Worker 54*4d7e907cSAndroid Build Coastguard Worker /** 55*4d7e907cSAndroid Build Coastguard Worker * Phase center offset (PCO) with associated 1-sigma uncertainty. PCO is defined with 56*4d7e907cSAndroid Build Coastguard Worker * respect to the origin of the Android sensor coordinate system, e.g., center of primary 57*4d7e907cSAndroid Build Coastguard Worker * screen for mobiles - see sensor or form factor documents for details. 58*4d7e907cSAndroid Build Coastguard Worker */ 59*4d7e907cSAndroid Build Coastguard Worker Coord phaseCenterOffsetCoordinateMillimeters; 60*4d7e907cSAndroid Build Coastguard Worker 61*4d7e907cSAndroid Build Coastguard Worker /** 62*4d7e907cSAndroid Build Coastguard Worker * 2D vectors representing the phase center variation (PCV) corrections, in 63*4d7e907cSAndroid Build Coastguard Worker * millimeters, at regularly spaced azimuthal angle (theta) and zenith angle 64*4d7e907cSAndroid Build Coastguard Worker * (phi). The PCV correction is added to the phase measurement to obtain the 65*4d7e907cSAndroid Build Coastguard Worker * corrected value. 66*4d7e907cSAndroid Build Coastguard Worker * 67*4d7e907cSAndroid Build Coastguard Worker * The azimuthal angle, theta, is defined with respect to the X axis of the 68*4d7e907cSAndroid Build Coastguard Worker * Android sensor coordinate system, increasing toward the Y axis. The zenith 69*4d7e907cSAndroid Build Coastguard Worker * angle, phi, is defined with respect to the Z axis of the Android Sensor 70*4d7e907cSAndroid Build Coastguard Worker * coordinate system, increasing toward the X-Y plane. 71*4d7e907cSAndroid Build Coastguard Worker * 72*4d7e907cSAndroid Build Coastguard Worker * Each row vector (outer vectors) represents a fixed theta. The first row 73*4d7e907cSAndroid Build Coastguard Worker * corresponds to a theta angle of 0 degrees. The last row corresponds to a 74*4d7e907cSAndroid Build Coastguard Worker * theta angle of (360 - deltaTheta) degrees, where deltaTheta is the regular 75*4d7e907cSAndroid Build Coastguard Worker * spacing between azimuthal angles, i.e., deltaTheta = 360 / (number of rows). 76*4d7e907cSAndroid Build Coastguard Worker * 77*4d7e907cSAndroid Build Coastguard Worker * The columns (inner vectors) represent fixed zenith angles, beginning at 0 78*4d7e907cSAndroid Build Coastguard Worker * degrees and ending at 180 degrees. They are separated by deltaPhi, the regular 79*4d7e907cSAndroid Build Coastguard Worker * spacing between zenith angles, i.e., deltaPhi = 180 / (number of columns - 1). 80*4d7e907cSAndroid Build Coastguard Worker * 81*4d7e907cSAndroid Build Coastguard Worker * This field is optional, i.e., an empty vector. 82*4d7e907cSAndroid Build Coastguard Worker */ 83*4d7e907cSAndroid Build Coastguard Worker vec<Row> phaseCenterVariationCorrectionMillimeters; 84*4d7e907cSAndroid Build Coastguard Worker 85*4d7e907cSAndroid Build Coastguard Worker /** 86*4d7e907cSAndroid Build Coastguard Worker * 2D vectors of 1-sigma uncertainty in millimeters associated with the PCV 87*4d7e907cSAndroid Build Coastguard Worker * correction values. 88*4d7e907cSAndroid Build Coastguard Worker * 89*4d7e907cSAndroid Build Coastguard Worker * This field is optional, i.e., an empty vector. 90*4d7e907cSAndroid Build Coastguard Worker */ 91*4d7e907cSAndroid Build Coastguard Worker vec<Row> phaseCenterVariationCorrectionUncertaintyMillimeters; 92*4d7e907cSAndroid Build Coastguard Worker 93*4d7e907cSAndroid Build Coastguard Worker /** 94*4d7e907cSAndroid Build Coastguard Worker * 2D vectors representing the signal gain corrections at regularly spaced 95*4d7e907cSAndroid Build Coastguard Worker * azimuthal angle (theta) and zenith angle (phi). The values are calculated or 96*4d7e907cSAndroid Build Coastguard Worker * measured at the antenna feed point without considering the radio and receiver 97*4d7e907cSAndroid Build Coastguard Worker * noise figure and path loss contribution, in dBi, i.e., decibel over isotropic 98*4d7e907cSAndroid Build Coastguard Worker * antenna with the same total power. The signal gain correction is added the 99*4d7e907cSAndroid Build Coastguard Worker * signal gain measurement to obtain the corrected value. 100*4d7e907cSAndroid Build Coastguard Worker * 101*4d7e907cSAndroid Build Coastguard Worker * The azimuthal angle, theta, is defined with respect to the X axis of the 102*4d7e907cSAndroid Build Coastguard Worker * Android sensor coordinate system, increasing toward the Y axis. The zenith 103*4d7e907cSAndroid Build Coastguard Worker * angle, phi, is defined with respect to the Z axis of the Android Sensor 104*4d7e907cSAndroid Build Coastguard Worker * coordinate system, increasing toward the X-Y plane. 105*4d7e907cSAndroid Build Coastguard Worker * 106*4d7e907cSAndroid Build Coastguard Worker * Each row vector (outer vectors) represents a fixed theta. The first row 107*4d7e907cSAndroid Build Coastguard Worker * corresponds to a theta angle of 0 degrees. The last row corresponds to a 108*4d7e907cSAndroid Build Coastguard Worker * theta angle of (360 - deltaTheta) degrees, where deltaTheta is the regular 109*4d7e907cSAndroid Build Coastguard Worker * spacing between azimuthal angles, i.e., deltaTheta = 360 / (number of rows). 110*4d7e907cSAndroid Build Coastguard Worker * 111*4d7e907cSAndroid Build Coastguard Worker * The columns (inner vectors) represent fixed zenith angles, beginning at 0 112*4d7e907cSAndroid Build Coastguard Worker * degrees and ending at 180 degrees. They are separated by deltaPhi, the regular 113*4d7e907cSAndroid Build Coastguard Worker * spacing between zenith angles, i.e., deltaPhi = 180 / (number of columns - 1). 114*4d7e907cSAndroid Build Coastguard Worker * 115*4d7e907cSAndroid Build Coastguard Worker * This field is optional, i.e., an empty vector. 116*4d7e907cSAndroid Build Coastguard Worker */ 117*4d7e907cSAndroid Build Coastguard Worker vec<Row> signalGainCorrectionDbi; 118*4d7e907cSAndroid Build Coastguard Worker 119*4d7e907cSAndroid Build Coastguard Worker /** 120*4d7e907cSAndroid Build Coastguard Worker * 2D vectors of 1-sigma uncertainty in dBi associated with the signal 121*4d7e907cSAndroid Build Coastguard Worker * gain correction values. 122*4d7e907cSAndroid Build Coastguard Worker * 123*4d7e907cSAndroid Build Coastguard Worker * This field is optional, i.e., an empty vector. 124*4d7e907cSAndroid Build Coastguard Worker */ 125*4d7e907cSAndroid Build Coastguard Worker vec<Row> signalGainCorrectionUncertaintyDbi; 126*4d7e907cSAndroid Build Coastguard Worker }; 127*4d7e907cSAndroid Build Coastguard Worker 128*4d7e907cSAndroid Build Coastguard Worker /** 129*4d7e907cSAndroid Build Coastguard Worker * Called when on connection, and on known-change to these values, such as upon a known 130*4d7e907cSAndroid Build Coastguard Worker * GNSS RF antenna tuning change, or a foldable device state change. 131*4d7e907cSAndroid Build Coastguard Worker * 132*4d7e907cSAndroid Build Coastguard Worker * This is optional. It can never be called if the GNSS antenna information is not 133*4d7e907cSAndroid Build Coastguard Worker * available. 134*4d7e907cSAndroid Build Coastguard Worker */ 135*4d7e907cSAndroid Build Coastguard Worker gnssAntennaInfoCb(vec<GnssAntennaInfo> gnssAntennaInfos); 136*4d7e907cSAndroid Build Coastguard Worker}; 137