Package: android.hardware.gnss@1.0

IGnssCallback

interface IGnssCallback

The interface is required for the HAL to communicate certain information like status and location info back to the platform, the platform implements the interfaces and passes a handle to the HAL.

Properties

Capabilities

enum Capabilities: uint32_t

Flags for the gnssSetCapabilities callback.

Details
Members
SCHEDULING = 1 << 0
GNSS HAL schedules fixes for RECURRENCE_PERIODIC mode.If this is not set, then the framework will use 1000ms for minInterval and will call start() and stop() to schedule the GNSS.
MSB = 1 << 1
GNSS supports MS-Based AGNSS mode
MSA = 1 << 2
GNSS supports MS-Assisted AGNSS mode
SINGLE_SHOT = 1 << 3
GNSS supports single-shot fixes
ON_DEMAND_TIME = 1 << 4
GNSS supports on demand time injection
GEOFENCING = 1 << 5
GNSS supports Geofencing
MEASUREMENTS = 1 << 6
GNSS supports Measurements for at least GPS.
NAV_MESSAGES = 1 << 7
GNSS supports Navigation Messages
Annotations
export
name="" , value_prefix="GPS_CAPABILITY_"

GnssStatusValue

enum GnssStatusValue: uint8_t

GNSS status event values.

Details
Members
NONE = 0
GNSS status unknown.
SESSION_BEGIN = 1
GNSS has begun navigating.
SESSION_END = 2
GNSS has stopped navigating.
ENGINE_ON = 3
GNSS has powered on but is not navigating.
ENGINE_OFF = 4
GNSS is powered off.
Annotations
export
name="" , value_prefix="GPS_STATUS_"

GnssSvFlags

enum GnssSvFlags: uint8_t

Flags that indicate information about the satellite

Details
Members
NONE = 0
HAS_EPHEMERIS_DATA = 1 << 0
HAS_ALMANAC_DATA = 1 << 1
USED_IN_FIX = 1 << 2
HAS_CARRIER_FREQUENCY = 1 << 3
Annotations
export
name="" , value_prefix="GNSS_SV_FLAGS_"

GnssSvInfo

struct GnssSvInfo {int16_t svid; GnssConstellationType constellation; float cN0Dbhz; float elevationDegrees; float azimuthDegrees; float carrierFrequencyHz; bitfield svFlag}
Details
Members
svid
Pseudo-random number for the SV, or FCN/OSN number for Glonass.The distinction is made by looking at constellation field.Values must be in the range of:
- GNSS:1-32 - SBAS:120-151, 183-192 - GLONASS:1-24, the orbital slot number(OSN), if known.Or, if not:93-106, the frequency channel number(FCN )(-7 to +6)offset by + 100 i.e.report an FCN of -7 as 93, FCN of 0 as 100, and FCN of +6 as 106.- QZSS:193-200 - Galileo:1-36 - Beidou:1-37
constellation
Defines the constellation of the given SV.
cN0Dbhz
Carrier-to-noise density in dB-Hz, typically in the range[0, 63]. It contains the measured C/N0 value for the signal at the antenna port.
This is a mandatory value.
elevationDegrees
Elevation of SV in degrees.
azimuthDegrees
Azimuth of SV in degrees.
carrierFrequencyHz
Carrier frequency of the signal tracked, for example it can be the GPS central frequency for L1 = 1575.45 MHz, or L2 = 1227.60 MHz, L5 = 1176.45 MHz, varying GLO channels, etc.If the field is not set, it is the primary common use central frequency, e.g.L1 = 1575.45 MHz for GPS.
For an L1, L5 receiver tracking a satellite on L1 and L5 at the same time, two GnssSvInfo structs must be reported for this same satellite, in one of the structs, all the values related to L1 must be filled, and in the other all of the values related to L5 must be filled.
If the data is available, gnssClockFlags must contain HAS_CARRIER_FREQUENCY.
svFlag
Contains additional data about the given SV.

GnssSvStatus

struct GnssSvStatus {uint32_t numSvs; GnssSvInfo gnssSvList}

Represents SV status.

Details
Members
numSvs
Number of GNSS SVs currently visible, refers to the SVs stored in sv_list
gnssSvList
Pointer to an array of SVs information for all GNSS constellations, except GNSS, which is reported using svList

GnssSystemInfo

struct GnssSystemInfo {uint16_t yearOfHw}

Provides information about how new the underlying GPS/GNSS hardware and software is.

This information will be available for Android Test Applications.If a GNSS HAL does not provide this information, it will be considered "2015 or earlier".

If a GNSS HAL does provide this information, then newer years will need to meet newer CTS standards.E.g.if the date are 2016 or above, then N+ level GnssMeasurement support will be verified.

Details
Members
yearOfHw
year in which the last update was made to the underlying hardware/firmware used to capture GNSS signals, e.g.2016

Methods

gnssLocationCb

gnssLocationCb (GnssLocation location)

Called when a GNSS location is available.

Details
Parameters
location
Location information from HAL.

gnssStatusCb

gnssStatusCb (GnssStatusValue status)

Called to communicate the status of the GNSS engine.

Details
Parameters
status
Status information from HAL.

gnssSvStatusCb

gnssSvStatusCb (GnssSvStatus svInfo)
Details
Parameters
svInfo
SV status information from HAL.

gnssNmeaCb

gnssNmeaCb (GnssUtcTime timestamp, string nmea)

Called when NMEA data is available.Callback for reporting NMEA sentences.

Details
Parameters
timestamp
Marks the instance of reporting.
nmea
Follows standard NMEA 0183.Each sentence begins with a '$' and ends with a carriage return/line feed sequence and can be no longer than 80 characters of visible text(plus the line terminators). The data is contained within this single line with data items separated by commas.The data itself is just ascii text and may extend over multiple sentences in certain specialized instances but is normally fully contained in one variable length sentence.The data may vary in the amount of precision contained in the message.For example time might be indicated to decimal parts of a second or location may be shown with 3 or even 4 digits after the decimal point.Programs that read the data must only use the commas to determine the field boundaries and not depend on column positions.There is a provision for a checksum at the end of each sentence which may or may not be checked by the unit that reads the data.The checksum field consists of a '*' and two hex digits representing an 8 bit exclusive OR of all characters between, but not including, the '$' and '*'.

gnssSetCapabilitesCb

gnssSetCapabilitesCb (bitfield<Capabilities> capabilities)

Callback to inform framework of the GNSS engine's capabilities.

Details
Parameters
capabilities
Capability parameter is a bit field of the Capabilities enum.

gnssAcquireWakelockCb

gnssAcquireWakelockCb ()

Callback utility for acquiring the GNSS wakelock.This can be used to prevent the CPU from suspending while handling GNSS events.

Details

gnssReleaseWakelockCb

gnssReleaseWakelockCb ()

Callback utility for releasing the GNSS wakelock.

Details

gnssRequestTimeCb

gnssRequestTimeCb ()

Callback for requesting NTP time

Details

gnssSetSystemInfoCb

gnssSetSystemInfoCb (GnssSystemInfo info)

Callback to inform framework of the engine's hardware version information.

Details
Parameters
info
GnssSystemInfo about the GPS/GNSS hardware.