Package: android.hardware.gnss@1.0

IGnss

interface IGnss

Represents the standard GNSS(Global Navigation Satellite System)interface.

Properties

GnssPositionMode

enum GnssPositionMode: uint8_t

Requested operational mode for GNSS operation.

Details
Members
STANDALONE = 0
Mode for running GNSS standalone(no assistance).
MS_BASED = 1
AGNSS MS-Based mode.
MS_ASSISTED = 2
AGNSS MS-Assisted mode.This mode is not maintained by the platform anymore.It is strongly recommended to use MS_BASED instead.
Annotations
export
name="" , value_prefix="GPS_POSITION_MODE_"

GnssPositionRecurrence

enum GnssPositionRecurrence: uint32_t

Requested recurrence mode for GNSS operation.

Details
Members
RECURRENCE_PERIODIC = 0
Receive GNSS fixes on a recurring basis at a specified period.
RECURRENCE_SINGLE = 1
Request a single shot GNSS fix.
Annotations
export
name="" , value_prefix="GPS_POSITION_"

GnssAidingData

enum GnssAidingData: uint16_t

Flags used to specify which aiding data to delete when calling deleteAidingData().

Details
Members
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
Annotations
export
name="" , value_prefix="GPS_"

Methods

setCallback

setCallback (IGnssCallback callback)
generates (bool success)

Opens the interface and provides the callback routines to the implementation of this interface.

Details
Parameters
callback
Callback interface for IGnss.
Generates
success
Returns true on success.

start

start ()
generates (bool success)

Starts a location output stream using the IGnssCallback gnssLocationCb(), following the settings from the most recent call to setPositionMode().

This output must operate independently of any GNSS location batching operations, see the IGnssBatching.hal for details.

Details
Generates
success
Returns true on success.

stop

stop ()
generates (bool success)

Stops the location output stream.

Details
Generates
success
Returns true on success.

cleanup

cleanup ()

Closes the interface.

Details

injectTime

injectTime (GnssUtcTime timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs)
generates (bool success)

Injects the current time.

Details
Parameters
timeMs
This is the UTC time received from the NTP server, its value is given in milliseconds since January 1, 1970.
timeReferenceMs
The corresponding value of SystemClock.elapsedRealtime() from the device when the NTP response was received in milliseconds.
uncertaintyMs
Uncertainty associated with the value represented by time.Represented in milliseconds.
Generates
success
Returns true if the operation is successful.

injectLocation

injectLocation (double latitudeDegrees, double longitudeDegrees, float accuracyMeters)
generates (bool success)

Injects current location from another location provider(typically cell ID).

Details
Parameters
latitudeDegrees
Measured in Degrees.
longitudeDegrees
Measured in Degrees.
accuracyMeters
Measured in meters.
Generates
success
Returns true if successful.

deleteAidingData

deleteAidingData (GnssAidingData aidingDataFlags)

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.

Details
Parameters
aidingDataFlags
Flags specifying the aiding data to be deleted.

setPositionMode

setPositionMode (GnssPositionMode mode, GnssPositionRecurrence recurrence, uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs)
generates (bool success)

Sets the GnssPositionMode parameter, its associated recurrence value, the time between fixes, requested fix accuracy and time to first fix.

Details
Parameters
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.
recurrence
minIntervalMs
Represents the time between fixes in milliseconds.
preferredAccuracyMeters
Represents the requested fix accuracy in meters.
preferredTimeMs
Represents the requested time to first fix in milliseconds.
Generates
success
Returns true if successful.

getExtensionAGnssRil

getExtensionAGnssRil ()
generates (IAGnssRil aGnssRilIface)

This method returns the IAGnssRil Interface.

Details
Generates
aGnssRilIface
Handle to the IAGnssRil interface.

getExtensionGnssGeofencing

getExtensionGnssGeofencing ()
generates (IGnssGeofencing gnssGeofencingIface)

This method returns the IGnssGeofencing Interface.

Details
Generates
gnssGeofencingIface
Handle to the IGnssGeofencing interface.

getExtensionAGnss

getExtensionAGnss ()
generates (IAGnss aGnssIface)

This method returns the IAGnss Interface.

Details
Generates
aGnssIface
Handle to the IAGnss interface.

getExtensionGnssNi

getExtensionGnssNi ()
generates (IGnssNi gnssNiIface)

This method returns the IGnssNi interface.

Details
Generates
gnssNiIface
Handle to the IGnssNi interface.

getExtensionGnssMeasurement

getExtensionGnssMeasurement ()
generates (IGnssMeasurement gnssMeasurementIface)

This method returns the IGnssMeasurement interface.

Details
Generates
gnssMeasurementIface
Handle to the IGnssMeasurement interface.

getExtensionGnssNavigationMessage

getExtensionGnssNavigationMessage ()
generates (IGnssNavigationMessage gnssNavigationIface)

This method returns the IGnssNavigationMessage interface.

Details
Generates
gnssNavigationIface
gnssNavigationIface to the IGnssNavigationMessage interface.

getExtensionXtra

getExtensionXtra ()
generates (IGnssXtra xtraIface)

This method returns the IGnssXtra interface.

Details
Generates
xtraIface
Handle to the IGnssXtra interface.

getExtensionGnssConfiguration

getExtensionGnssConfiguration ()
generates (IGnssConfiguration gnssConfigIface)

This method returns the IGnssConfiguration interface.

Details
Generates
gnssConfigIface
Handle to the IGnssConfiguration interface.

getExtensionGnssDebug

getExtensionGnssDebug ()
generates (IGnssDebug debugIface)

This method returns the IGnssDebug interface.

Details
Generates
debugIface
Handle to the IGnssDebug interface.

getExtensionGnssBatching

getExtensionGnssBatching ()
generates (IGnssBatching batchingIface)

This method returns the IGnssBatching interface.

Details
Generates
batchingIface
Handle to the IGnssBatching interface.