Android Hardware Abstraction Layer
Data Structures | Macros | Typedefs
gps.h File Reference
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <pthread.h>
#include <hardware/hardware.h>

Go to the source code of this file.

Data Structures

struct  GpsLocation
 
struct  GpsStatus
 
struct  GpsSvInfo
 
struct  GpsSvStatus
 
struct  AGpsRefLocationCellID
 
struct  AGpsRefLocationMac
 
struct  AGpsRefLocation
 
struct  GpsCallbacks
 
struct  GpsInterface
 
struct  GpsXtraCallbacks
 
struct  GpsXtraInterface
 
struct  GpsDebugInterface
 
struct  AGpsStatus
 
struct  AGpsCallbacks
 
struct  AGpsInterface
 
struct  DerEncodedCertificate
 
struct  Sha1CertificateFingerprint
 
struct  SuplCertificateInteface
 
struct  GpsNiNotification
 
struct  GpsNiCallbacks
 
struct  GpsNiInterface
 
struct  gps_device_t
 
struct  AGpsRilCallbacks
 
struct  AGpsRilInterface
 
struct  GpsGeofenceCallbacks
 
struct  GpsGeofencingInterface
 

Macros

#define GPS_HARDWARE_MODULE_ID   "gps"
 
#define GPS_MAX_SVS   32
 
#define GPS_POSITION_MODE_STANDALONE   0
 
#define GPS_POSITION_MODE_MS_BASED   1
 
#define GPS_POSITION_MODE_MS_ASSISTED   2
 
#define GPS_POSITION_RECURRENCE_PERIODIC   0
 
#define GPS_POSITION_RECURRENCE_SINGLE   1
 
#define GPS_STATUS_NONE   0
 
#define GPS_STATUS_SESSION_BEGIN   1
 
#define GPS_STATUS_SESSION_END   2
 
#define GPS_STATUS_ENGINE_ON   3
 
#define GPS_STATUS_ENGINE_OFF   4
 
#define GPS_LOCATION_HAS_LAT_LONG   0x0001
 
#define GPS_LOCATION_HAS_ALTITUDE   0x0002
 
#define GPS_LOCATION_HAS_SPEED   0x0004
 
#define GPS_LOCATION_HAS_BEARING   0x0008
 
#define GPS_LOCATION_HAS_ACCURACY   0x0010
 
#define GPS_CAPABILITY_SCHEDULING   0x0000001
 
#define GPS_CAPABILITY_MSB   0x0000002
 
#define GPS_CAPABILITY_MSA   0x0000004
 
#define GPS_CAPABILITY_SINGLE_SHOT   0x0000008
 
#define GPS_CAPABILITY_ON_DEMAND_TIME   0x0000010
 
#define GPS_CAPABILITY_GEOFENCING   0x0000020
 
#define GPS_DELETE_EPHEMERIS   0x0001
 
#define GPS_DELETE_ALMANAC   0x0002
 
#define GPS_DELETE_POSITION   0x0004
 
#define GPS_DELETE_TIME   0x0008
 
#define GPS_DELETE_IONO   0x0010
 
#define GPS_DELETE_UTC   0x0020
 
#define GPS_DELETE_HEALTH   0x0040
 
#define GPS_DELETE_SVDIR   0x0080
 
#define GPS_DELETE_SVSTEER   0x0100
 
#define GPS_DELETE_SADATA   0x0200
 
#define GPS_DELETE_RTI   0x0400
 
#define GPS_DELETE_CELLDB_INFO   0x8000
 
#define GPS_DELETE_ALL   0xFFFF
 
#define AGPS_TYPE_SUPL   1
 
#define AGPS_TYPE_C2K   2
 
#define AGPS_SETID_TYPE_NONE   0
 
#define AGPS_SETID_TYPE_IMSI   1
 
#define AGPS_SETID_TYPE_MSISDN   2
 
#define GPS_NI_SHORT_STRING_MAXLEN   256
 
#define GPS_NI_LONG_STRING_MAXLEN   2048
 
#define GPS_NI_TYPE_VOICE   1
 
#define GPS_NI_TYPE_UMTS_SUPL   2
 
#define GPS_NI_TYPE_UMTS_CTRL_PLANE   3
 
#define GPS_NI_NEED_NOTIFY   0x0001
 
#define GPS_NI_NEED_VERIFY   0x0002
 
#define GPS_NI_PRIVACY_OVERRIDE   0x0004
 
#define GPS_NI_RESPONSE_ACCEPT   1
 
#define GPS_NI_RESPONSE_DENY   2
 
#define GPS_NI_RESPONSE_NORESP   3
 
#define GPS_ENC_NONE   0
 
#define GPS_ENC_SUPL_GSM_DEFAULT   1
 
#define GPS_ENC_SUPL_UTF8   2
 
#define GPS_ENC_SUPL_UCS2   3
 
#define GPS_ENC_UNKNOWN   -1
 
#define GPS_REQUEST_AGPS_DATA_CONN   1
 
#define GPS_RELEASE_AGPS_DATA_CONN   2
 
#define GPS_AGPS_DATA_CONNECTED   3
 
#define GPS_AGPS_DATA_CONN_DONE   4
 
#define GPS_AGPS_DATA_CONN_FAILED   5
 
#define AGPS_REF_LOCATION_TYPE_GSM_CELLID   1
 
#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID   2
 
#define AGPS_REG_LOCATION_TYPE_MAC   3
 
#define AGPS_RIL_NETWORK_TYPE_MOBILE   0
 
#define AGPS_RIL_NETWORK_TYPE_WIFI   1
 
#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS   2
 
#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL   3
 
#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN   4
 
#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI   5
 
#define AGPS_RIL_NETWORK_TTYPE_WIMAX   6
 
#define GPS_XTRA_INTERFACE   "gps-xtra"
 
#define GPS_DEBUG_INTERFACE   "gps-debug"
 
#define AGPS_INTERFACE   "agps"
 
#define SUPL_CERTIFICATE_INTERFACE   "supl-certificate"
 
#define GPS_NI_INTERFACE   "gps-ni"
 
#define AGPS_RIL_INTERFACE   "agps_ril"
 
#define GPS_GEOFENCING_INTERFACE   "gps_geofencing"
 
#define AGPS_CERTIFICATE_OPERATION_SUCCESS   0
 
#define AGPS_CERTIFICATE_ERROR_GENERIC   -100
 
#define AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES   -101
 
#define AGPS_RIL_REQUEST_SETID_IMSI   (1<<0L)
 
#define AGPS_RIL_REQUEST_SETID_MSISDN   (1<<1L)
 
#define AGPS_RIL_REQUEST_REFLOC_CELLID   (1<<0L)
 
#define AGPS_RIL_REQUEST_REFLOC_MAC   (1<<1L)
 
#define GPS_GEOFENCE_ENTERED   (1<<0L)
 
#define GPS_GEOFENCE_EXITED   (1<<1L)
 
#define GPS_GEOFENCE_UNCERTAIN   (1<<2L)
 
#define GPS_GEOFENCE_UNAVAILABLE   (1<<0L)
 
#define GPS_GEOFENCE_AVAILABLE   (1<<1L)
 
#define GPS_GEOFENCE_OPERATION_SUCCESS   0
 
#define GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES   -100
 
#define GPS_GEOFENCE_ERROR_ID_EXISTS   -101
 
#define GPS_GEOFENCE_ERROR_ID_UNKNOWN   -102
 
#define GPS_GEOFENCE_ERROR_INVALID_TRANSITION   -103
 
#define GPS_GEOFENCE_ERROR_GENERIC   -149
 

Typedefs

typedef int64_t GpsUtcTime
 
typedef uint32_t GpsPositionMode
 
typedef uint32_t GpsPositionRecurrence
 
typedef uint16_t GpsStatusValue
 
typedef uint16_t GpsLocationFlags
 
typedef uint16_t GpsAidingData
 
typedef uint16_t AGpsType
 
typedef uint16_t AGpsSetIDType
 
typedef uint32_t GpsNiType
 
typedef uint32_t GpsNiNotifyFlags
 
typedef int GpsUserResponseType
 
typedef int GpsNiEncodingType
 
typedef uint16_t AGpsStatusValue
 
typedef void(* gps_location_callback )(GpsLocation *location)
 
typedef void(* gps_status_callback )(GpsStatus *status)
 
typedef void(* gps_sv_status_callback )(GpsSvStatus *sv_info)
 
typedef void(* gps_nmea_callback )(GpsUtcTime timestamp, const char *nmea, int length)
 
typedef void(* gps_set_capabilities )(uint32_t capabilities)
 
typedef void(* gps_acquire_wakelock )()
 
typedef void(* gps_release_wakelock )()
 
typedef void(* gps_request_utc_time )()
 
typedef pthread_t(* gps_create_thread )(const char *name, void(*start)(void *), void *arg)
 
typedef void(* gps_xtra_download_request )()
 
typedef void(* agps_status_callback )(AGpsStatus *status)
 
typedef void(* gps_ni_notify_callback )(GpsNiNotification *notification)
 
typedef void(* agps_ril_request_set_id )(uint32_t flags)
 
typedef void(* agps_ril_request_ref_loc )(uint32_t flags)
 
typedef void(* gps_geofence_transition_callback )(int32_t geofence_id, GpsLocation *location, int32_t transition, GpsUtcTime timestamp)
 
typedef void(* gps_geofence_status_callback )(int32_t status, GpsLocation *last_location)
 
typedef void(* gps_geofence_add_callback )(int32_t geofence_id, int32_t status)
 
typedef void(* gps_geofence_remove_callback )(int32_t geofence_id, int32_t status)
 
typedef void(* gps_geofence_pause_callback )(int32_t geofence_id, int32_t status)
 
typedef void(* gps_geofence_resume_callback )(int32_t geofence_id, int32_t status)
 

Macro Definition Documentation

#define AGPS_CERTIFICATE_ERROR_GENERIC   -100

Definition at line 535 of file gps.h.

#define AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES   -101

Definition at line 536 of file gps.h.

#define AGPS_CERTIFICATE_OPERATION_SUCCESS   0

Error codes associated with certificate operations

Definition at line 534 of file gps.h.

#define AGPS_INTERFACE   "agps"

Name for the AGPS interface.

Definition at line 221 of file gps.h.

#define AGPS_REF_LOCATION_TYPE_GSM_CELLID   1

Definition at line 195 of file gps.h.

#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID   2

Definition at line 196 of file gps.h.

#define AGPS_REG_LOCATION_TYPE_MAC   3

Definition at line 197 of file gps.h.

#define AGPS_RIL_INTERFACE   "agps_ril"

Name for the AGPS-RIL interface.

Definition at line 236 of file gps.h.

#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN   4

Definition at line 204 of file gps.h.

#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI   5

Definition at line 205 of file gps.h.

#define AGPS_RIL_NETWORK_TTYPE_WIMAX   6

Definition at line 206 of file gps.h.

#define AGPS_RIL_NETWORK_TYPE_MOBILE   0

Network types for update_network_state "type" parameter

Definition at line 200 of file gps.h.

#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS   2

Definition at line 202 of file gps.h.

#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL   3

Definition at line 203 of file gps.h.

#define AGPS_RIL_NETWORK_TYPE_WIFI   1

Definition at line 201 of file gps.h.

#define AGPS_RIL_REQUEST_REFLOC_CELLID   (1<<0L)

Definition at line 706 of file gps.h.

#define AGPS_RIL_REQUEST_REFLOC_MAC   (1<<1L)

Definition at line 707 of file gps.h.

#define AGPS_RIL_REQUEST_SETID_IMSI   (1<<0L)

Definition at line 703 of file gps.h.

#define AGPS_RIL_REQUEST_SETID_MSISDN   (1<<1L)

Definition at line 704 of file gps.h.

#define AGPS_SETID_TYPE_IMSI   1

Definition at line 135 of file gps.h.

#define AGPS_SETID_TYPE_MSISDN   2

Definition at line 136 of file gps.h.

#define AGPS_SETID_TYPE_NONE   0

Definition at line 134 of file gps.h.

#define AGPS_TYPE_C2K   2

Definition at line 131 of file gps.h.

#define AGPS_TYPE_SUPL   1

Definition at line 130 of file gps.h.

#define GPS_AGPS_DATA_CONN_DONE   4

AGPS data connection completed

Definition at line 191 of file gps.h.

#define GPS_AGPS_DATA_CONN_FAILED   5

AGPS data connection failed

Definition at line 193 of file gps.h.

#define GPS_AGPS_DATA_CONNECTED   3

AGPS data connection initiated

Definition at line 189 of file gps.h.

#define GPS_CAPABILITY_GEOFENCING   0x0000020

GPS supports Geofencing

Definition at line 107 of file gps.h.

#define GPS_CAPABILITY_MSA   0x0000004

GPS supports MS-Assisted AGPS mode

Definition at line 101 of file gps.h.

#define GPS_CAPABILITY_MSB   0x0000002

GPS supports MS-Based AGPS mode

Definition at line 99 of file gps.h.

#define GPS_CAPABILITY_ON_DEMAND_TIME   0x0000010

GPS supports on demand time injection

Definition at line 105 of file gps.h.

#define GPS_CAPABILITY_SCHEDULING   0x0000001

Flags for the gps_set_capabilities callback. GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode. If this is not set, then the framework will use 1000ms for min_interval and will start and call start() and stop() to schedule the GPS.

Definition at line 97 of file gps.h.

#define GPS_CAPABILITY_SINGLE_SHOT   0x0000008

GPS supports single-shot fixes

Definition at line 103 of file gps.h.

#define GPS_DEBUG_INTERFACE   "gps-debug"

Name for the GPS DEBUG interface.

Definition at line 216 of file gps.h.

#define GPS_DELETE_ALL   0xFFFF

Definition at line 126 of file gps.h.

#define GPS_DELETE_ALMANAC   0x0002

Definition at line 115 of file gps.h.

#define GPS_DELETE_CELLDB_INFO   0x8000

Definition at line 125 of file gps.h.

#define GPS_DELETE_EPHEMERIS   0x0001

Definition at line 114 of file gps.h.

#define GPS_DELETE_HEALTH   0x0040

Definition at line 120 of file gps.h.

#define GPS_DELETE_IONO   0x0010

Definition at line 118 of file gps.h.

#define GPS_DELETE_POSITION   0x0004

Definition at line 116 of file gps.h.

#define GPS_DELETE_RTI   0x0400

Definition at line 124 of file gps.h.

#define GPS_DELETE_SADATA   0x0200

Definition at line 123 of file gps.h.

#define GPS_DELETE_SVDIR   0x0080

Definition at line 121 of file gps.h.

#define GPS_DELETE_SVSTEER   0x0100

Definition at line 122 of file gps.h.

#define GPS_DELETE_TIME   0x0008

Definition at line 117 of file gps.h.

#define GPS_DELETE_UTC   0x0020

Definition at line 119 of file gps.h.

#define GPS_ENC_NONE   0

Definition at line 176 of file gps.h.

#define GPS_ENC_SUPL_GSM_DEFAULT   1

Definition at line 177 of file gps.h.

#define GPS_ENC_SUPL_UCS2   3

Definition at line 179 of file gps.h.

#define GPS_ENC_SUPL_UTF8   2

Definition at line 178 of file gps.h.

#define GPS_ENC_UNKNOWN   -1

Definition at line 180 of file gps.h.

#define GPS_GEOFENCE_AVAILABLE   (1<<1L)

Definition at line 833 of file gps.h.

#define GPS_GEOFENCE_ENTERED   (1<<0L)

GPS Geofence. There are 3 states associated with a Geofence: Inside, Outside, Unknown. There are 3 transitions: ENTERED, EXITED, UNCERTAIN.

An example state diagram with confidence level: 95% and Unknown time limit set as 30 secs is shown below. (confidence level and Unknown time limit are explained latter)


| Unknown (30 secs) | """""""""""""""""""""""""""" ^ | | ^ UNCERTAIN| |ENTERED EXITED| |UNCERTAIN | v v | ________ EXITED _________ | Inside | --------—> | Outside | | | <--------— | | """""""" ENTERED """""""""

Inside state: We are 95% confident that the user is inside the geofence. Outside state: We are 95% confident that the user is outside the geofence Unknown state: Rest of the time.

The Unknown state is better explained with an example:

                       __________
                      |         c|
                      |  ___     |    _______
                      |  |a|     |   |   b   |
                      |  """     |    """""""
                      |          |
                       """"""""""

In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy circle reported by the GPS subsystem. Now with regard to "b", the system is confident that the user is outside. But with regard to "a" is not confident whether it is inside or outside the geofence. If the accuracy remains the same for a sufficient period of time, the UNCERTAIN transition would be triggered with the state set to Unknown. If the accuracy improves later, an appropriate transition should be triggered. This "sufficient period of time" is defined by the parameter in the add_geofence_area API. In other words, Unknown state can be interpreted as a state in which the GPS subsystem isn't confident enough that the user is either inside or outside the Geofence. It moves to Unknown state only after the expiry of the timeout.

The geofence callback needs to be triggered for the ENTERED and EXITED transitions, when the GPS system is confident that the user has entered (Inside state) or exited (Outside state) the Geofence. An implementation which uses a value of 95% as the confidence is recommended. The callback should be triggered only for the transitions requested by the add_geofence_area call.

Even though the diagram and explanation talks about states and transitions, the callee is only interested in the transistions. The states are mentioned here for illustrative purposes.

Startup Scenario: When the device boots up, if an application adds geofences, and then we get an accurate GPS location fix, it needs to trigger the appropriate (ENTERED or EXITED) transition for every Geofence it knows about. By default, all the Geofences will be in the Unknown state.

When the GPS system is unavailable, gps_geofence_status_callback should be called to inform the upper layers of the same. Similarly, when it becomes available the callback should be called. This is a global state while the UNKNOWN transition described above is per geofence.

An important aspect to note is that users of this API (framework), will use other subsystems like wifi, sensors, cell to handle Unknown case and hopefully provide a definitive state transition to the third party application. GPS Geofence will just be a signal indicating what the GPS subsystem knows about the Geofence.

Definition at line 828 of file gps.h.

#define GPS_GEOFENCE_ERROR_GENERIC   -149

Definition at line 840 of file gps.h.

#define GPS_GEOFENCE_ERROR_ID_EXISTS   -101

Definition at line 837 of file gps.h.

#define GPS_GEOFENCE_ERROR_ID_UNKNOWN   -102

Definition at line 838 of file gps.h.

#define GPS_GEOFENCE_ERROR_INVALID_TRANSITION   -103

Definition at line 839 of file gps.h.

#define GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES   -100

Definition at line 836 of file gps.h.

#define GPS_GEOFENCE_EXITED   (1<<1L)

Definition at line 829 of file gps.h.

#define GPS_GEOFENCE_OPERATION_SUCCESS   0

Definition at line 835 of file gps.h.

#define GPS_GEOFENCE_UNAVAILABLE   (1<<0L)

Definition at line 832 of file gps.h.

#define GPS_GEOFENCE_UNCERTAIN   (1<<2L)

Definition at line 830 of file gps.h.

#define GPS_GEOFENCING_INTERFACE   "gps_geofencing"

Name for the GPS_Geofencing interface.

Definition at line 241 of file gps.h.

#define GPS_HARDWARE_MODULE_ID   "gps"

The id of this module

Definition at line 32 of file gps.h.

#define GPS_LOCATION_HAS_ACCURACY   0x0010

GpsLocation has valid accuracy.

Definition at line 89 of file gps.h.

#define GPS_LOCATION_HAS_ALTITUDE   0x0002

GpsLocation has valid altitude.

Definition at line 83 of file gps.h.

#define GPS_LOCATION_HAS_BEARING   0x0008

GpsLocation has valid bearing.

Definition at line 87 of file gps.h.

#define GPS_LOCATION_HAS_LAT_LONG   0x0001

GpsLocation has valid latitude and longitude.

Definition at line 81 of file gps.h.

#define GPS_LOCATION_HAS_SPEED   0x0004

GpsLocation has valid speed.

Definition at line 85 of file gps.h.

#define GPS_MAX_SVS   32

Maximum number of SVs for gps_sv_status_callback().

Definition at line 39 of file gps.h.

#define GPS_NI_INTERFACE   "gps-ni"

Name for NI interface

Definition at line 231 of file gps.h.

#define GPS_NI_LONG_STRING_MAXLEN   2048

Definition at line 142 of file gps.h.

#define GPS_NI_NEED_NOTIFY   0x0001

NI requires notification

Definition at line 157 of file gps.h.

#define GPS_NI_NEED_VERIFY   0x0002

NI requires verification

Definition at line 159 of file gps.h.

#define GPS_NI_PRIVACY_OVERRIDE   0x0004

NI requires privacy override, no notification/minimal trace

Definition at line 161 of file gps.h.

#define GPS_NI_RESPONSE_ACCEPT   1

Definition at line 168 of file gps.h.

#define GPS_NI_RESPONSE_DENY   2

Definition at line 169 of file gps.h.

#define GPS_NI_RESPONSE_NORESP   3

Definition at line 170 of file gps.h.

#define GPS_NI_SHORT_STRING_MAXLEN   256

String length constants

Definition at line 141 of file gps.h.

#define GPS_NI_TYPE_UMTS_CTRL_PLANE   3

Definition at line 150 of file gps.h.

#define GPS_NI_TYPE_UMTS_SUPL   2

Definition at line 149 of file gps.h.

#define GPS_NI_TYPE_VOICE   1

Definition at line 148 of file gps.h.

#define GPS_POSITION_MODE_MS_ASSISTED   2

AGPS MS-Assisted mode.

Definition at line 50 of file gps.h.

#define GPS_POSITION_MODE_MS_BASED   1

AGPS MS-Based mode.

Definition at line 48 of file gps.h.

#define GPS_POSITION_MODE_STANDALONE   0

Mode for running GPS standalone (no assistance).

Definition at line 46 of file gps.h.

#define GPS_POSITION_RECURRENCE_PERIODIC   0

Receive GPS fixes on a recurring basis at a specified period.

Definition at line 57 of file gps.h.

#define GPS_POSITION_RECURRENCE_SINGLE   1

Request a single shot GPS fix.

Definition at line 59 of file gps.h.

#define GPS_RELEASE_AGPS_DATA_CONN   2

GPS releases the AGPS data connection.

Definition at line 187 of file gps.h.

#define GPS_REQUEST_AGPS_DATA_CONN   1

GPS requests data connection for AGPS.

Definition at line 185 of file gps.h.

#define GPS_STATUS_ENGINE_OFF   4

GPS is powered off.

Definition at line 74 of file gps.h.

#define GPS_STATUS_ENGINE_ON   3

GPS has powered on but is not navigating.

Definition at line 72 of file gps.h.

#define GPS_STATUS_NONE   0

GPS status unknown.

Definition at line 66 of file gps.h.

#define GPS_STATUS_SESSION_BEGIN   1

GPS has begun navigating.

Definition at line 68 of file gps.h.

#define GPS_STATUS_SESSION_END   2

GPS has stopped navigating.

Definition at line 70 of file gps.h.

#define GPS_XTRA_INTERFACE   "gps-xtra"

Name for the GPS XTRA interface.

Definition at line 211 of file gps.h.

#define SUPL_CERTIFICATE_INTERFACE   "supl-certificate"

Name of the Supl Certificate interface.

Definition at line 226 of file gps.h.

Typedef Documentation

typedef void(* agps_ril_request_ref_loc)(uint32_t flags)

Definition at line 710 of file gps.h.

typedef void(* agps_ril_request_set_id)(uint32_t flags)

Definition at line 709 of file gps.h.

typedef void(* agps_status_callback)(AGpsStatus *status)

Callback with AGPS status information. Can only be called from a thread created by create_thread_cb.

Definition at line 495 of file gps.h.

typedef uint16_t AGpsSetIDType

Definition at line 133 of file gps.h.

typedef uint16_t AGpsStatusValue

AGPS status event values.

Definition at line 183 of file gps.h.

typedef uint16_t AGpsType

AGPS type

Definition at line 129 of file gps.h.

typedef void(* gps_acquire_wakelock)()

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

Definition at line 367 of file gps.h.

typedef pthread_t(* gps_create_thread)(const char *name, void(*start)(void *), void *arg)

Callback for creating a thread that can call into the Java framework code. This must be used to create any threads that report events up to the framework.

Definition at line 378 of file gps.h.

typedef void(* gps_geofence_add_callback)(int32_t geofence_id, int32_t status)

The callback associated with the add_geofence call.

Parameter: geofence_id - Id of the geofence. status - GPS_GEOFENCE_OPERATION_SUCCESS GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached. GPS_GEOFENCE_ERROR_ID_EXISTS - geofence with id already exists GPS_GEOFENCE_ERROR_INVALID_TRANSITION - the monitorTransition contains an invalid transition GPS_GEOFENCE_ERROR_GENERIC - for other errors.

Definition at line 886 of file gps.h.

typedef void(* gps_geofence_pause_callback)(int32_t geofence_id, int32_t status)

The callback associated with the pause_geofence call.

Parameter: geofence_id - Id of the geofence. status - GPS_GEOFENCE_OPERATION_SUCCESS GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id GPS_GEOFENCE_ERROR_INVALID_TRANSITION - when monitor_transitions is invalid GPS_GEOFENCE_ERROR_GENERIC for others.

Definition at line 911 of file gps.h.

typedef void(* gps_geofence_remove_callback)(int32_t geofence_id, int32_t status)

The callback associated with the remove_geofence call.

Parameter: geofence_id - Id of the geofence. status - GPS_GEOFENCE_OPERATION_SUCCESS GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id GPS_GEOFENCE_ERROR_GENERIC for others.

Definition at line 897 of file gps.h.

typedef void(* gps_geofence_resume_callback)(int32_t geofence_id, int32_t status)

The callback associated with the resume_geofence call.

Parameter: geofence_id - Id of the geofence. status - GPS_GEOFENCE_OPERATION_SUCCESS GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id GPS_GEOFENCE_ERROR_GENERIC for others.

Definition at line 922 of file gps.h.

typedef void(* gps_geofence_status_callback)(int32_t status, GpsLocation *last_location)

The callback associated with the availablity of the GPS system for geofencing monitoring. If the GPS system determines that it cannot monitor geofences because of lack of reliability or unavailability of the GPS signals, it will call this callback with GPS_GEOFENCE_UNAVAILABLE parameter.

Parameters: status - GPS_GEOFENCE_UNAVAILABLE or GPS_GEOFENCE_AVAILABLE. last_location - Last known location.

Definition at line 872 of file gps.h.

typedef void(* gps_geofence_transition_callback)(int32_t geofence_id, GpsLocation *location, int32_t transition, GpsUtcTime timestamp)

The callback associated with the geofence. Parameters: geofence_id - The id associated with the add_geofence_area. location - The current GPS location. transition - Can be one of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, GPS_GEOFENCE_UNCERTAIN. timestamp - Timestamp when the transition was detected.

The callback should only be called when the caller is interested in that particular transition. For instance, if the caller is interested only in ENTERED transition, then the callback should NOT be called with the EXITED transition.

IMPORTANT: If a transition is triggered resulting in this callback, the GPS subsystem will wake up the application processor, if its in suspend state.

Definition at line 859 of file gps.h.

typedef void(* gps_location_callback)(GpsLocation *location)

Callback with location information. Can only be called from a thread created by create_thread_cb.

Definition at line 342 of file gps.h.

typedef void(* gps_ni_notify_callback)(GpsNiNotification *notification)

Callback with NI notification. Can only be called from a thread created by create_thread_cb.

Definition at line 665 of file gps.h.

typedef void(* gps_nmea_callback)(GpsUtcTime timestamp, const char *nmea, int length)

Callback for reporting NMEA sentences. Can only be called from a thread created by create_thread_cb.

Definition at line 357 of file gps.h.

typedef void(* gps_release_wakelock)()

Callback utility for releasing the GPS wakelock.

Definition at line 370 of file gps.h.

typedef void(* gps_request_utc_time)()

Callback for requesting NTP time

Definition at line 373 of file gps.h.

typedef void(* gps_set_capabilities)(uint32_t capabilities)

Callback to inform framework of the GPS engine's capabilities. Capability parameter is a bit field of GPS_CAPABILITY_* flags.

Definition at line 362 of file gps.h.

typedef void(* gps_status_callback)(GpsStatus *status)

Callback with status information. Can only be called from a thread created by create_thread_cb.

Definition at line 347 of file gps.h.

typedef void(* gps_sv_status_callback)(GpsSvStatus *sv_info)

Callback with SV status information. Can only be called from a thread created by create_thread_cb.

Definition at line 352 of file gps.h.

typedef void(* gps_xtra_download_request)()

Callback to request the client to download XTRA data. The client should download XTRA data and inject it by calling inject_xtra_data(). Can only be called from a thread created by create_thread_cb.

Definition at line 449 of file gps.h.

typedef uint16_t GpsAidingData

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

Definition at line 111 of file gps.h.

typedef uint16_t GpsLocationFlags

Flags to indicate which values are valid in a GpsLocation.

Definition at line 77 of file gps.h.

typedef int GpsNiEncodingType

NI data encoding scheme

Definition at line 175 of file gps.h.

typedef uint32_t GpsNiNotifyFlags

GpsNiNotifyFlags constants

Definition at line 155 of file gps.h.

typedef uint32_t GpsNiType

GpsNiType constants

Definition at line 147 of file gps.h.

typedef uint32_t GpsPositionMode

Requested operational mode for GPS operation.

Definition at line 42 of file gps.h.

typedef uint32_t GpsPositionRecurrence

Requested recurrence mode for GPS operation.

Definition at line 53 of file gps.h.

typedef uint16_t GpsStatusValue

GPS status event values.

Definition at line 62 of file gps.h.

typedef int GpsUserResponseType

GPS NI responses, used to define the response in NI structures

Definition at line 167 of file gps.h.

typedef int64_t GpsUtcTime

Milliseconds since January 1, 1970

Definition at line 36 of file gps.h.