17 #ifndef ANDROID_INCLUDE_HARDWARE_GPS_H 
   18 #define ANDROID_INCLUDE_HARDWARE_GPS_H 
   21 #include <sys/cdefs.h> 
   22 #include <sys/types.h> 
   25 #include <hardware/hardware.h> 
   32 #define GPS_HARDWARE_MODULE_ID "gps" 
   39 #define GPS_MAX_SVS 32 
   46 #define GPS_POSITION_MODE_STANDALONE    0 
   48 #define GPS_POSITION_MODE_MS_BASED      1 
   50 #define GPS_POSITION_MODE_MS_ASSISTED   2 
   57 #define GPS_POSITION_RECURRENCE_PERIODIC    0 
   59 #define GPS_POSITION_RECURRENCE_SINGLE      1 
   66 #define GPS_STATUS_NONE             0 
   68 #define GPS_STATUS_SESSION_BEGIN    1 
   70 #define GPS_STATUS_SESSION_END      2 
   72 #define GPS_STATUS_ENGINE_ON        3 
   74 #define GPS_STATUS_ENGINE_OFF       4 
   81 #define GPS_LOCATION_HAS_LAT_LONG   0x0001 
   83 #define GPS_LOCATION_HAS_ALTITUDE   0x0002 
   85 #define GPS_LOCATION_HAS_SPEED      0x0004 
   87 #define GPS_LOCATION_HAS_BEARING    0x0008 
   89 #define GPS_LOCATION_HAS_ACCURACY   0x0010 
   97 #define GPS_CAPABILITY_SCHEDULING       0x0000001 
   99 #define GPS_CAPABILITY_MSB              0x0000002 
  101 #define GPS_CAPABILITY_MSA              0x0000004 
  103 #define GPS_CAPABILITY_SINGLE_SHOT      0x0000008 
  105 #define GPS_CAPABILITY_ON_DEMAND_TIME   0x0000010 
  112 #define GPS_DELETE_EPHEMERIS        0x0001 
  113 #define GPS_DELETE_ALMANAC          0x0002 
  114 #define GPS_DELETE_POSITION         0x0004 
  115 #define GPS_DELETE_TIME             0x0008 
  116 #define GPS_DELETE_IONO             0x0010 
  117 #define GPS_DELETE_UTC              0x0020 
  118 #define GPS_DELETE_HEALTH           0x0040 
  119 #define GPS_DELETE_SVDIR            0x0080 
  120 #define GPS_DELETE_SVSTEER          0x0100 
  121 #define GPS_DELETE_SADATA           0x0200 
  122 #define GPS_DELETE_RTI              0x0400 
  123 #define GPS_DELETE_CELLDB_INFO      0x8000 
  124 #define GPS_DELETE_ALL              0xFFFF 
  128 #define AGPS_TYPE_SUPL          1 
  129 #define AGPS_TYPE_C2K           2 
  132 #define AGPS_SETID_TYPE_NONE    0 
  133 #define AGPS_SETID_TYPE_IMSI    1 
  134 #define AGPS_SETID_TYPE_MSISDN  2 
  139 #define GPS_NI_SHORT_STRING_MAXLEN      256 
  140 #define GPS_NI_LONG_STRING_MAXLEN       2048 
  146 #define GPS_NI_TYPE_VOICE              1 
  147 #define GPS_NI_TYPE_UMTS_SUPL          2 
  148 #define GPS_NI_TYPE_UMTS_CTRL_PLANE    3 
  155 #define GPS_NI_NEED_NOTIFY          0x0001 
  157 #define GPS_NI_NEED_VERIFY          0x0002 
  159 #define GPS_NI_PRIVACY_OVERRIDE     0x0004 
  166 #define GPS_NI_RESPONSE_ACCEPT         1 
  167 #define GPS_NI_RESPONSE_DENY           2 
  168 #define GPS_NI_RESPONSE_NORESP         3 
  174 #define GPS_ENC_NONE                   0 
  175 #define GPS_ENC_SUPL_GSM_DEFAULT       1 
  176 #define GPS_ENC_SUPL_UTF8              2 
  177 #define GPS_ENC_SUPL_UCS2              3 
  178 #define GPS_ENC_UNKNOWN                -1 
  183 #define GPS_REQUEST_AGPS_DATA_CONN  1 
  185 #define GPS_RELEASE_AGPS_DATA_CONN  2 
  187 #define GPS_AGPS_DATA_CONNECTED     3 
  189 #define GPS_AGPS_DATA_CONN_DONE     4 
  191 #define GPS_AGPS_DATA_CONN_FAILED   5 
  193 #define AGPS_REF_LOCATION_TYPE_GSM_CELLID   1 
  194 #define AGPS_REF_LOCATION_TYPE_UMTS_CELLID  2 
  195 #define AGPS_REG_LOCATION_TYPE_MAC          3 
  198 #define AGPS_RIL_NETWORK_TYPE_MOBILE        0 
  199 #define AGPS_RIL_NETWORK_TYPE_WIFI          1 
  200 #define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS    2 
  201 #define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL   3 
  202 #define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN   4 
  203 #define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5 
  204 #define AGPS_RIL_NETWORK_TTYPE_WIMAX        6 
  209 #define GPS_XTRA_INTERFACE      "gps-xtra" 
  214 #define GPS_DEBUG_INTERFACE      "gps-debug" 
  219 #define AGPS_INTERFACE      "agps" 
  224 #define GPS_NI_INTERFACE "gps-ni" 
  229 #define AGPS_RIL_INTERFACE      "agps_ril" 
  394     int   (*start)( void );
 
  400     void  (*cleanup)( void );
 
  411     int  (*inject_location)(
double latitude, 
double longitude, 
float accuracy);
 
  426             uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time);
 
  429     const void* (*get_extension)(
const char* name);
 
  454     int  (*inject_xtra_data)( 
char* data, 
int length );
 
  466     size_t (*get_internal_state)(
char* buffer, 
size_t bufferSize);
 
  505     int  (*data_conn_open)( 
const char* apn );
 
  509     int  (*data_conn_closed)();
 
  513     int  (*data_conn_failed)();
 
  517     int  (*set_server)( 
AGpsType type, 
const char* hostname, 
int port );
 
  557     char            requestor_id[GPS_NI_SHORT_STRING_MAXLEN];
 
  562     char            text[GPS_NI_LONG_STRING_MAXLEN];
 
  579     char           extras[GPS_NI_LONG_STRING_MAXLEN];
 
  624 #define AGPS_RIL_REQUEST_SETID_IMSI     (1<<0L) 
  625 #define AGPS_RIL_REQUEST_SETID_MSISDN   (1<<1L) 
  627 #define AGPS_RIL_REQUEST_REFLOC_CELLID  (1<<0L) 
  628 #define AGPS_RIL_REQUEST_REFLOC_MAC     (1<<1L) 
  661     void (*ni_message) (uint8_t *msg, 
size_t len);
 
  667     void (*update_network_state) (
int connected, 
int type, 
int roaming, 
const char* extra_info);
 
  673     void (*update_network_availability) (
int avaiable, 
const char* apn);
 
Extended interface for AGPS_RIL support. 
GpsNiEncodingType requestor_id_encoding
Client name decoding scheme. 
Represents an NI request. 
gps_nmea_callback nmea_cb
size_t size
set to sizeof(GpsCallbacks) 
uint32_t ephemeris_mask
Represents a bit mask indicating which SVs have ephemeris data. 
int prn
Pseudo-random number for the SV. 
float azimuth
Azimuth of SV in degrees. 
gps_status_callback status_cb
void(* gps_acquire_wakelock)()
Callback utility for acquiring the GPS wakelock. 
void(* gps_ni_notify_callback)(GpsNiNotification *notification)
Callback with NI notification. 
uint16_t flags
Contains GpsLocationFlags bits. 
size_t size
set to sizeof(GpsXtraInterface) 
GpsNiType ni_type
An NI type used to distinguish different categories of NI events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ... 
gps_location_callback location_cb
Represents ref locations. 
size_t size
set to sizeof(GpsDebugInterface) 
uint32_t GpsNiType
GpsNiType constants. 
gps_create_thread create_thread_cb
agps_ril_request_set_id request_setid
uint32_t GpsPositionMode
Requested operational mode for GPS operation. 
Extended interface for Network-initiated (NI) support. 
int GpsUserResponseType
GPS NI responses, used to define the response in NI structures. 
double altitude
Represents altitude in meters above the WGS 84 reference ellipsoid. 
Extended interface for DEBUG support. 
size_t size
set to sizeof(GpsNiInterface) 
int64_t GpsUtcTime
Milliseconds since January 1, 1970. 
float speed
Represents speed in meters per second. 
size_t size
set to sizeof(AGpsInterface) 
void(* agps_status_callback)(AGpsStatus *status)
Callback with AGPS status information. 
uint32_t almanac_mask
Represents a bit mask indicating which SVs have almanac data. 
int notification_id
An ID generated by HAL to associate NI notifications and UI responses. 
uint16_t AGpsStatusValue
AGPS status event values. 
GpsUserResponseType default_response
Default response when time out. 
void(* agps_ril_request_set_id)(uint32_t flags)
gps_create_thread create_thread_cb
size_t size
set to sizeof(GpsSvStatus) 
Callback structure for the AGPS interface. 
GpsNiNotifyFlags notify_flags
Notification/verification options, combinations of GpsNiNotifyFlags constants. 
size_t size
set to sizeof(AGpsRilInterface) 
gps_release_wakelock release_wakelock_cb
void(* agps_ril_request_ref_loc)(uint32_t flags)
void(* gps_location_callback)(GpsLocation *location)
Callback with location information. 
void(* gps_sv_status_callback)(GpsSvStatus *sv_info)
Callback with SV status information. 
AGpsRefLocationCellID cellID
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. 
gps_create_thread create_thread_cb
size_t size
set to sizeof(GpsNiNotification) 
uint16_t GpsAidingData
Flags used to specify which aiding data to delete when calling delete_aiding_data(). 
void(* gps_status_callback)(GpsStatus *status)
Callback with status information. 
uint16_t GpsLocationFlags
Flags to indicate which values are valid in a GpsLocation. 
float accuracy
Represents expected accuracy in meters. 
GPS NI callback structure. 
uint16_t AGpsType
AGPS type. 
float bearing
Represents heading in degrees. 
void(* gps_nmea_callback)(GpsUtcTime timestamp, const char *nmea, int length)
Callback for reporting NMEA sentences. 
size_t size
set to sizeof(GpsLocation) 
void(* gps_release_wakelock)()
Callback utility for releasing the GPS wakelock. 
Extended interface for XTRA support. 
int num_svs
Number of SVs currently visible. 
float snr
Signal to noise ratio. 
gps_request_utc_time request_utc_time_cb
size_t size
set to sizeof(GpsSvInfo) 
double longitude
Represents longitude in degrees. 
uint16_t GpsStatusValue
GPS status event values. 
Represents the standard GPS interface. 
void(* gps_set_capabilities)(uint32_t capabilities)
Callback to inform framework of the GPS engine's capabilities. 
Represents the status of AGPS. 
int GpsNiEncodingType
NI data encoding scheme. 
gps_sv_status_callback sv_status_cb
GpsUtcTime timestamp
Timestamp for the location fix. 
Extended interface for AGPS support. 
void(* gps_xtra_download_request)()
Callback to request the client to download XTRA data. 
int timeout
Timeout period to wait for user response. 
gps_xtra_download_request download_request_cb
gps_acquire_wakelock acquire_wakelock_cb
gps_ni_notify_callback notify_cb
Sends the notification request from HAL to GPSLocationProvider. 
size_t size
set to sizeof(GpsStatus) 
uint32_t GpsNiNotifyFlags
GpsNiNotifyFlags constants. 
uint32_t used_in_fix_mask
Represents a bit mask indicating which SVs were used for computing the most recent position fix...
uint32_t GpsPositionRecurrence
Requested recurrence mode for GPS operation. 
gps_create_thread create_thread_cb
struct hw_device_t common
gps_set_capabilities set_capabilities_cb
size_t size
set to sizeof(AGpsStatus) 
size_t size
set to sizeof(GpsInterface) 
void(* gps_request_utc_time)()
Callback for requesting NTP time. 
Represents SV information. 
gps_create_thread create_thread_cb
Callback structure for the XTRA interface. 
GpsNiEncodingType text_encoding
Client name decoding scheme. 
agps_ril_request_ref_loc request_refloc
float elevation
Elevation of SV in degrees. 
agps_status_callback status_cb
double latitude
Represents latitude in degrees.