blob: bc19e786469402d2c6f997e9006c3f8af2c47e36 [file] [log] [blame]
/*
* Copyright (C) 2016 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@1.0;
import IAGnss;
import IAGnssRil;
import IGnssCallback;
import IGnssDebug;
import IGnssMeasurement;
import IGnssNavigationMessage;
import IGnssGeofencing;
import IGnssNi;
import IGnssXtra;
/* Represents the standard GNSS interface. */
interface IGnss {
/* Requested operational mode for GNSS operation. */
enum GnssPositionMode : uint32_t {
/** Mode for running GNSS standalone (no assistance). */
STANDALONE = 0,
/** AGNSS MS-Based mode. */
MS_BASED = 1,
/*
* AGNSS MS-Assisted mode. This mode is not maintained by the platform anymore.
* It is strongly recommended to use MS_BASED instead.
*/
MS_ASSISTED = 2,
};
/* Requested recurrence mode for GNSS operation. */
enum GnssPositionRecurrence : uint32_t {
/** Receive GNSS fixes on a recurring basis at a specified period. */
RECURRENCE_PERIODIC = 0,
/** Request a single shot GNSS fix. */
RECURRENCE_SINGLE = 1
};
/*
* Flags used to specify which aiding data to delete when calling
* deleteAidingData().
*/
enum GnssAidingData : uint16_t {
DELETE_EPHEMERIS = 0x0001,
DELETE_ALMANAC = 0x0002,
DELETE_POSITION = 0x0004,
DELETE_TIME = 0x0008,
DELETE_IONO = 0x0010,
DELETE_UTC = 0x0020,
DELETE_HEALTH = 0x0040,
DELETE_SVDIR = 0x0080,
DELETE_SVSTEER = 0x0100,
DELETE_SADATA = 0x0200,
DELETE_RTI = 0x0400,
DELETE_CELLDB_INFO = 0x8000,
DELETE_ALL = 0xFFFF
};
/*
* Opens the interface and provides the callback routines
* to the implementation of this interface.
*
* @param callback Callback interface for IGnss.
*
* @return success Returns true on success.
*/
setCallback(IGnssCallback callback) generates (bool success);
/*
* Starts navigating.
*
* @return success Returns true on success.
*/
start() generates (bool success);
/*
* Stops navigating.
*
* @return success Returns true on success.
*/
stop() generates (bool success);
/*
* Closes the interface.
*/
cleanup();
/*
* Injects the current time.
*
* @param timeMs This is the UTC time received from the NTP server, its value
* is given in milliseconds since January 1, 1970.
* @param timeReferenceMs The corresponding value of
* SystemClock.elapsedRealtime() from the device when the NTP response was
* received in milliseconds.
* @param uncertaintyMs Uncertainty associated with the value represented by
* time. Represented in milliseconds.
*
* @return success Returns true if the operation is successful.
*
injectTime(GnssUtcTime timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs)
generates (bool success);
/*
* Injects current location from another location provider (typically cell
* ID).
*
* @param latitudeDegrees Measured in Degrees.
* @param longitudeDegrees Measured in Degrees.
* @param accuracyMeters Measured in meters.
*
* @return success Returns true if successful.
*/
injectLocation(double latitudeDegrees, double longitudeDegrees, float accuracyMeters)
generates (bool success);
/*
* Specifies that the next call to start will not use the
* information defined in the flags. GnssAidingData value of DELETE_ALL is
* passed for a cold start.
*
* @param aidingDataFlags Flags specifying the aiding data to be deleted.
*/
deleteAidingData(GnssAidingData aidingDataFlags);
/*
* @param mode Parameter must be one of MS_BASED or STANDALONE.
* It is allowed by the platform (and it is recommended) to fallback to
* MS_BASED if MS_ASSISTED is passed in, and MS_BASED is supported.
* @recurrence GNSS postion recurrence value, either periodic or single.
* @param minIntervalMs Represents the time between fixes in milliseconds.
* @param preferredAccuracyMeters Represents the requested fix accuracy in meters.
* @param preferredTimeMs Represents the requested time to first fix in milliseconds.
* @return success Returns true if successful.
*/
setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence,
uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs)
generates (bool success);
/*
* This method returns the IAGnssRil Interface.
*
* @return infc Handle to the IAGnssRil interface.
*/
getExtensionAGnssRil() generates (IAGnssRil infc);
/*
* This method returns the IGnssGeofencing Interface.
*
* @return infc Handle to the IGnssGeofencing interface.
*/
getExtensionGnssGeofencing() generates(IGnssGeofencing infc);
/*
* This method returns the IAGnss Interface.
*
* @return infc Handle to the IAGnss interface.
*/
getExtensionAGnss() generates (IAGnss infc);
/*
* This method returns the IGnssNi interface.
*
* @return infc Handle to the IGnssNi interface.
*/
getExtensionGnssNi() generates (IGnssNi infc);
/*
* This method returns the IGnssMeasurement interface.
*
* @return infc Handle to the IGnssMeasurement interface.
*/
getExtensionGnssMeasurement() generates (IGnssMeasurement infc);
/*
* This method returns the IGnssNavigationMessage interface.
*
* @return infc Handle to the IGnssNavigationMessage interface.
*/
getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage infc);
/*
* This method returns the IGnssXtra interface.
*
* @return infc Handle to the IGnssXtra interface.
*/
getExtensionXtra() generates (IGnssXtra infc);
/*
* This method returns the IGnssDebug interface.
*
* @return infc Handle to the IGnssDebug interface.
*/
getExtensionGnssDebug() generates (IGnssDebug infc);
};