Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0469ebe authored by Yu-Han Yang's avatar Yu-Han Yang Committed by Android (Google) Code Review
Browse files

Merge "Add GNSS HAL v2.0"

parents 8dc5ab28 9c6c20b5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@
    <hal format="hidl" optional="true">
        <name>android.hardware.gnss</name>
        <version>1.0-1</version>
        <version>2.0</version>
        <interface>
            <name>IGnss</name>
            <instance>default</instance>

gnss/2.0/Android.bp

0 → 100644
+21 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen -Landroidbp.

hidl_interface {
    name: "android.hardware.gnss@2.0",
    root: "android.hardware",
    vndk: {
        enabled: true,
    },
    srcs: [
        "IGnss.hal",
        "IGnssMeasurement.hal",
        "IGnssMeasurementCallback.hal",
    ],
    interfaces: [
        "android.hardware.gnss@1.0",
        "android.hardware.gnss@1.1",
        "android.hidl.base@1.0",
    ],
    gen_java: true,
}

gnss/2.0/IGnss.hal

0 → 100644
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.0;

import @1.1::IGnss;

import IGnssMeasurement;

/** Represents the standard GNSS (Global Navigation Satellite System) interface. */
interface IGnss extends @1.1::IGnss {
    /**
     * This method returns the IGnssMeasurement interface.
     *
     * Exactly one of getExtensionGnssMeasurement_1_1() and getExtensionGnssMeasurement_2_0() must
     * return a non-null handle, and the other method must return nullptr.
     *
     * @return gnssMeasurementIface Handle to the IGnssMeasurement interface.
     */
    getExtensionGnssMeasurement_2_0() generates (IGnssMeasurement gnssMeasurementIface);
};
 No newline at end of file
+51 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.0;

import @1.0::IGnssMeasurement;
import @1.1::IGnssMeasurement;
import IGnssMeasurementCallback;

/**
 * Extended interface for GNSS Measurements support.
 */
interface IGnssMeasurement extends @1.1::IGnssMeasurement {

    /**
     * Initializes the interface and registers the callback routines with the HAL. After a
     * successful call to 'setCallback_2_0' the HAL must begin to provide updates at an average
     * output rate of 1Hz (occasional intra-measurement time offsets in the range from 0-2000msec
     * can be tolerated.)
     *
     * @param callback Handle to GnssMeasurement callback interface.
     * @param enableFullTracking If true, GNSS chipset must switch off duty cycling. In such mode
     *     no clock discontinuities are expected and, when supported, carrier phase should be
     *     continuous in good signal conditions. All non-blacklisted, healthy constellations,
     *     satellites and frequency bands that the chipset supports must be reported in this mode.
     *     The GNSS chipset is allowed to consume more power in this mode. If false, API must behave
     *     as in HAL V1_0, optimizing power via duty cycling, constellations and frequency limits,
     *     etc.
     *
     * @return initRet Returns SUCCESS if successful. Returns ERROR_ALREADY_INIT if a callback has
     *     already been registered without a corresponding call to 'close'. Returns ERROR_GENERIC
     *     for any other error. The HAL must not generate any other updates upon returning this
     *     error code.
     */
    setCallback_2_0(IGnssMeasurementCallback callback, bool enableFullTracking)
         generates (GnssMeasurementStatus initRet);

};
+128 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.0;

import @1.0::IGnssMeasurementCallback;
import @1.1::IGnssMeasurementCallback;

/** The callback interface to report measurements from the HAL. */
interface IGnssMeasurementCallback extends @1.1::IGnssMeasurementCallback {
    /**
     * Enumeration of available values for the GNSS Measurement's code type. Similar to the
     * Attribute field described in Rinex 3.03, e.g., in Tables 4-10, and Table A2 at the Rinex 3.03
     * Update 1 Document.
     */
    enum GnssMeasurementCodeType : uint8_t {
        /** GALILEO E1A, GALILEO E6A, IRNSS L5A, IRNSS SA. */
        CODE_TYPE_A = 0,

        /** GALILEO E1B, GALILEO E6B, IRNSS L5B, IRNSS SB. */
        CODE_TYPE_B = 1,

        /**
         *  GPS L1 C/A,  GPS L2 C/A, GLONASS G1 C/A, GLONASS G2 C/A, GALILEO E1C, GALILEO E6C, SBAS
         *  L1 C/A, QZSS L1 C/A, IRNSS L5C.
         */
        CODE_TYPE_C = 2,

        /**
         * GPS L5 I, GLONASS G3 I, GALILEO E5a I, GALILEO E5b I, GALILEO E5a+b I, SBAS L5 I, QZSS L5
         * I, BDS B1 I, BDS B2 I, BDS B3 I.
         */
        CODE_TYPE_I = 3,

        /** GPS L1C (P), GPS L2C (L), QZSS L1C (P), QZSS L2C (L), LEX(6) L. */
        CODE_TYPE_L = 4,

        /** GPS L1M, GPS L2M. */
        CODE_TYPE_M = 5,

        /** GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P. */
        CODE_TYPE_P = 6,

        /**
         * GPS L5 Q, GLONASS G3 Q, GALILEO E5a Q, GALILEO E5b Q, GALILEO E5a+b Q, SBAS L5 Q, QZSS L5
         * Q, BDS B1 Q, BDS B2 Q, BDS B3 Q.
         */
        CODE_TYPE_Q = 7,

        /** GPS L1C (D), GPS L2C (M), QZSS L1C (D), QZSS L2C (M), LEX(6) S. */
        CODE_TYPE_S = 8,

        /** GPS L1 Z-tracking, GPS L2 Z-tracking. */
        CODE_TYPE_W = 9,

        /**
         * GPS L1C (D+P), GPS L2C (M+L), GPS L5 (I+Q), GLONASS G3 (I+Q), GALILEO E1 (B+C), GALILEO
         * E5a (I+Q), GALILEO E5b (I+Q), GALILEO E5a+b(I+Q), GALILEO E6 (B+C), SBAS L5 (I+Q), QZSS
         * L1C (D+P), QZSS L2C (M+L), QZSS L5 (I+Q), LEX(6) (S+L), BDS B1 (I+Q), BDS B2 (I+Q), BDS
         * B3 (I+Q), IRNSS L5 (B+C).
         */
        CODE_TYPE_X = 10,

        /** GPS L1Y, GPS L2Y. */
        CODE_TYPE_Y = 11,

        /** GALILEO E1 (A+B+C), GALILEO E6 (A+B+C), QZSS L1-SAIF. */
        CODE_TYPE_Z = 12,

        /** GPS L1 codeless, GPS L2 codeless. */
        CODE_TYPE_CODELESS = 13
    };

    /**
     * Extends a GNSS Measurement, adding a GnssMeasurementCodeType.
     */
    struct GnssMeasurement {
        /**
         * GNSS measurement information for a single satellite and frequency, as in the 1.1
         * version of the HAL with further clarification of the value reported in the
         * accumulatedDeltaRangeM field, i.e., the alignment of the phase measurement will not be
         * adjusted by the receiver so the in-phase and quadrature phase components will have a
         * quarter cycle offset as they do when transmitted from the satellites. If the measurement
         * is from a combination of the in-phase and quadrature phase components, then the alignment
         * of the phase measurement will be aligned to the in-phase component.
         */
        @1.1::IGnssMeasurementCallback.GnssMeasurement v1_1;

        /**
         * The type of code that is currently being tracked in the GNSS measurement.
         *
         * For high precision applications the type of code being tracked needs to be considered
         * in-order to properly apply code specific corrections to the psuedorange measurements.
         */
        GnssMeasurementCodeType codeType;
    };

    /**
     * Complete set of GNSS Measurement data, same as 1.1 with additional enum in measurements.
     */
    struct GnssData {
        /** The full set of satellite measurement observations. */
        vec<GnssMeasurement> measurements;

        /** The GNSS clock time reading. */
        GnssClock clock;
    };

    /**
     * Callback for the hal to pass a GnssData structure back to the client.
     *
     * @param data Contains a reading of GNSS measurements.
     */
    gnssMeasurementCb_2_0(GnssData data);
};
Loading