2019-10-25 23:14:35 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package android.hardware.gnss@2.1;
|
|
|
|
|
|
|
|
import @1.0::IGnssMeasurementCallback;
|
|
|
|
import @2.0::IGnssMeasurementCallback;
|
|
|
|
import @2.0::ElapsedRealtime;
|
2019-12-04 05:54:53 +01:00
|
|
|
import GnssSignalType;
|
2019-10-25 23:14:35 +02:00
|
|
|
|
2020-02-11 07:00:10 +01:00
|
|
|
/**
|
|
|
|
* The callback interface to report measurements from the HAL.
|
|
|
|
*/
|
2019-10-25 23:14:35 +02:00
|
|
|
interface IGnssMeasurementCallback extends @2.0::IGnssMeasurementCallback {
|
|
|
|
/**
|
2019-12-04 05:54:53 +01:00
|
|
|
* Flags to indicate what fields in GnssMeasurement are valid.
|
|
|
|
*/
|
2020-02-13 23:19:09 +01:00
|
|
|
enum GnssMeasurementFlags : @1.0::IGnssMeasurementCallback.GnssMeasurementFlags {
|
2020-02-11 07:00:10 +01:00
|
|
|
/**
|
2020-03-04 00:23:50 +01:00
|
|
|
* A valid full inter-signal bias is stored in the data structure.
|
2020-02-11 07:00:10 +01:00
|
|
|
*/
|
2020-03-04 00:23:50 +01:00
|
|
|
HAS_FULL_ISB = 1 << 16,
|
2020-02-11 07:00:10 +01:00
|
|
|
/**
|
2020-03-04 00:23:50 +01:00
|
|
|
* A valid full inter-signal bias uncertainty is stored in the data structure.
|
2020-02-11 07:00:10 +01:00
|
|
|
*/
|
2020-03-04 00:23:50 +01:00
|
|
|
HAS_FULL_ISB_UNCERTAINTY = 1 << 17,
|
2020-02-11 07:00:10 +01:00
|
|
|
/**
|
|
|
|
* A valid satellite inter-signal bias is stored in the data structure.
|
|
|
|
*/
|
|
|
|
HAS_SATELLITE_ISB = 1 << 18,
|
|
|
|
/**
|
|
|
|
* A valid satellite inter-signal bias uncertainty is stored in the data structure.
|
|
|
|
*/
|
|
|
|
HAS_SATELLITE_ISB_UNCERTAINTY = 1 << 19,
|
2019-12-04 05:54:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extends a GNSS Measurement, adding basebandCN0DbHz, GnssMeasurementFlags,
|
|
|
|
* receiverInterSignalBiasNs, receiverInterSignalBiasUncertaintyNs, satelliteInterSignalBiasNs
|
|
|
|
* and satelliteInterSignalBiasUncertaintyNs.
|
2019-10-25 23:14:35 +02:00
|
|
|
*/
|
|
|
|
struct GnssMeasurement {
|
|
|
|
/**
|
|
|
|
* GNSS measurement information for a single satellite and frequency, as in the 2.0 version
|
|
|
|
* of the HAL.
|
2019-12-04 05:54:53 +01:00
|
|
|
*
|
|
|
|
* In this version of the HAL, the field 'flags' in the v2_0.v1_1.v1_0 struct is deprecated,
|
|
|
|
* and is no longer used by the framework. The GNSS measurement flags are instead reported
|
|
|
|
* in @2.1::IGnssMeasurementCallback.GnssMeasurement.flags.
|
|
|
|
*
|
2019-10-25 23:14:35 +02:00
|
|
|
*/
|
|
|
|
@2.0::IGnssMeasurementCallback.GnssMeasurement v2_0;
|
|
|
|
|
2019-12-04 05:54:53 +01:00
|
|
|
/**
|
|
|
|
* A set of flags indicating the validity of the fields in this data
|
|
|
|
* structure.
|
|
|
|
*
|
|
|
|
* Fields for which there is no corresponding flag must be filled in
|
|
|
|
* with a valid value. For convenience, these are marked as mandatory.
|
|
|
|
*
|
|
|
|
* Others fields may have invalid information in them, if not marked as
|
|
|
|
* valid by the corresponding bit in flags.
|
|
|
|
*/
|
|
|
|
bitfield<GnssMeasurementFlags> flags;
|
|
|
|
|
|
|
|
/**
|
2020-03-04 00:23:50 +01:00
|
|
|
* The full inter-signal bias (ISB) in nanoseconds.
|
2019-12-04 05:54:53 +01:00
|
|
|
*
|
2020-03-04 00:23:50 +01:00
|
|
|
* This value is the sum of the estimated receiver-side and the space-segment-side
|
|
|
|
* inter-system bias, inter-frequency bias and inter-code bias, including
|
2019-12-04 05:54:53 +01:00
|
|
|
*
|
2020-03-04 00:23:50 +01:00
|
|
|
* - Receiver inter-constellation bias (with respect to the constellation in
|
|
|
|
* GnssClock.referenceSignalTypeForIsb)
|
|
|
|
* - Receiver inter-frequency bias (with respect to the carrier frequency in
|
|
|
|
* GnssClock.referenceSignalTypeForIsb)
|
|
|
|
* - Receiver inter-code bias (with respect to the code type in
|
|
|
|
* GnssClock.referenceSignalTypeForIsb)
|
|
|
|
* - Master clock bias (e.g., GPS-GAL Time Offset (GGTO), GPS-UTC Time Offset
|
|
|
|
* (TauGps), BDS-GLO Time Offset (BGTO)) (with respect to the constellation in
|
|
|
|
* GnssClock.referenceSignalTypeForIsb)
|
|
|
|
* - Group delay (e.g., Total Group Delay (TGD))
|
|
|
|
* - Satellite inter-frequency bias (GLO only) (with respect to the carrier frequency in
|
|
|
|
* GnssClock.referenceSignalTypeForIsb)
|
|
|
|
* - Satellite inter-code bias (e.g., Differential Code Bias (DCB)) (with respect to the
|
|
|
|
* code type in GnssClock.referenceSignalTypeForIsb)
|
|
|
|
*
|
|
|
|
* If a component of the above is already compensated in the provided
|
|
|
|
* GnssMeasurement.receivedSvTimeInNs, then it must not be included in the reported full
|
|
|
|
* ISB.
|
2019-12-04 05:54:53 +01:00
|
|
|
*
|
|
|
|
* The value does not include the inter-frequency Ionospheric bias.
|
|
|
|
*
|
2021-04-27 18:31:49 +02:00
|
|
|
* The sign of the value is defined by the following equation:
|
|
|
|
* corrected pseudorange = raw pseudorange - fullInterSignalBias
|
|
|
|
*
|
2020-03-04 00:23:50 +01:00
|
|
|
* The full ISB of GnssClock.referenceSignalTypeForIsb is defined to be 0.0 nanoseconds.
|
2019-12-04 05:54:53 +01:00
|
|
|
*/
|
2020-03-04 00:23:50 +01:00
|
|
|
double fullInterSignalBiasNs;
|
2019-12-04 05:54:53 +01:00
|
|
|
|
|
|
|
/**
|
2020-03-04 00:23:50 +01:00
|
|
|
* 1-sigma uncertainty associated with the full inter-signal bias in nanoseconds.
|
2019-12-04 05:54:53 +01:00
|
|
|
*/
|
2020-03-04 00:23:50 +01:00
|
|
|
double fullInterSignalBiasUncertaintyNs;
|
2019-12-04 05:54:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The satellite inter-signal bias in nanoseconds.
|
|
|
|
*
|
2020-03-04 00:23:50 +01:00
|
|
|
* This value is the sum of the space-segment-side inter-system bias, inter-frequency bias
|
|
|
|
* and inter-code bias, including
|
2019-12-04 05:54:53 +01:00
|
|
|
*
|
2020-03-04 00:23:50 +01:00
|
|
|
* - Master clock bias (e.g., GPS-GAL Time Offset (GGTO), GPS-UTC Time Offset
|
|
|
|
* (TauGps), BDS-GLO Time Offset (BGTO)) (with respect to the constellation in
|
|
|
|
* GnssClock.referenceSignalTypeForIsb)
|
2019-12-04 05:54:53 +01:00
|
|
|
* - Group delay (e.g., Total Group Delay (TGD))
|
2020-03-04 00:23:50 +01:00
|
|
|
* - Satellite inter-frequency bias (GLO only) (with respect to the carrier frequency in
|
|
|
|
* GnssClock.referenceSignalTypeForIsb)
|
|
|
|
* - Satellite inter-code bias (e.g., Differential Code Bias (DCB)) (with respect to the
|
|
|
|
* code type in GnssClock.referenceSignalTypeForIsb)
|
2019-12-04 05:54:53 +01:00
|
|
|
*
|
2021-04-27 18:31:49 +02:00
|
|
|
* The sign of the value is defined by the following equation:
|
|
|
|
* corrected pseudorange = raw pseudorange - satelliteInterSignalBias
|
|
|
|
*
|
2020-03-04 00:23:50 +01:00
|
|
|
* The satellite ISB of GnssClock.referenceSignalTypeForIsb is defined to be 0.0
|
|
|
|
* nanoseconds.
|
2019-12-04 05:54:53 +01:00
|
|
|
*/
|
|
|
|
double satelliteInterSignalBiasNs;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 1-sigma uncertainty associated with the satellite inter-signal bias in nanoseconds.
|
|
|
|
*/
|
|
|
|
double satelliteInterSignalBiasUncertaintyNs;
|
|
|
|
|
2019-10-25 23:14:35 +02:00
|
|
|
/**
|
|
|
|
* Baseband Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. It contains
|
|
|
|
* the measured C/N0 value for the signal measured at the baseband.
|
|
|
|
*
|
|
|
|
* This is typically a few dB weaker than the value estimated for C/N0 at the antenna port,
|
|
|
|
* which is reported in cN0DbHz.
|
|
|
|
*
|
|
|
|
* If a signal has separate components (e.g. Pilot and Data channels) and the receiver only
|
|
|
|
* processes one of the components, then the reported basebandCN0DbHz reflects only the
|
|
|
|
* component that is processed.
|
|
|
|
*
|
|
|
|
* This value is mandatory.
|
|
|
|
*/
|
|
|
|
double basebandCN0DbHz;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2019-12-04 05:54:53 +01:00
|
|
|
* Extends a GNSS clock time, adding a referenceSignalTypeForIsb.
|
|
|
|
*/
|
|
|
|
struct GnssClock {
|
|
|
|
/**
|
|
|
|
* GNSS clock time information, as in the 1.0 version of the HAL.
|
|
|
|
*/
|
|
|
|
@1.0::IGnssMeasurementCallback.GnssClock v1_0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reference GNSS signal type for inter-signal bias.
|
|
|
|
*/
|
|
|
|
GnssSignalType referenceSignalTypeForIsb;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Complete set of GNSS Measurement data, same as 2.0 with additional fields in measurements.
|
2019-10-25 23:14:35 +02:00
|
|
|
*/
|
|
|
|
struct GnssData {
|
2020-02-11 07:00:10 +01:00
|
|
|
/**
|
|
|
|
* The full set of satellite measurement observations.
|
|
|
|
*/
|
2019-10-25 23:14:35 +02:00
|
|
|
vec<GnssMeasurement> measurements;
|
|
|
|
|
2020-02-11 07:00:10 +01:00
|
|
|
/**
|
|
|
|
* The GNSS clock time reading.
|
|
|
|
*/
|
2019-10-25 23:14:35 +02:00
|
|
|
GnssClock clock;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Timing information of the GNSS data synchronized with SystemClock.elapsedRealtimeNanos()
|
|
|
|
* clock.
|
|
|
|
*/
|
|
|
|
ElapsedRealtime elapsedRealtime;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback for the hal to pass a GnssData structure back to the client.
|
|
|
|
*
|
|
|
|
* @param data Contains a reading of GNSS measurements.
|
|
|
|
*/
|
|
|
|
gnssMeasurementCb_2_1(GnssData data);
|
|
|
|
};
|