blob: 8b633028d40951d3f84d7deef93706f3a7d12b44 [file] [log] [blame]
Mike Lockwood9b0b1c32010-02-23 18:42:37 -05001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_INCLUDE_HARDWARE_GPS_H
18#define ANDROID_INCLUDE_HARDWARE_GPS_H
19
20#include <stdint.h>
21#include <sys/cdefs.h>
22#include <sys/types.h>
Mike Lockwood4453b5b2010-06-20 14:23:10 -070023#include <pthread.h>
Mike Lockwood9b0b1c32010-02-23 18:42:37 -050024
25#include <hardware/hardware.h>
26
27__BEGIN_DECLS
28
29/**
30 * The id of this module
31 */
32#define GPS_HARDWARE_MODULE_ID "gps"
33
34
35/** Milliseconds since January 1, 1970 */
36typedef int64_t GpsUtcTime;
37
38/** Maximum number of SVs for gps_sv_status_callback(). */
39#define GPS_MAX_SVS 32
40
Mike Lockwoodb15879a2010-04-14 15:36:34 -040041/** Requested operational mode for GPS operation. */
Mike Lockwood9b0b1c32010-02-23 18:42:37 -050042typedef uint32_t GpsPositionMode;
43// IMPORTANT: Note that the following values must match
44// constants in GpsLocationProvider.java.
45/** Mode for running GPS standalone (no assistance). */
46#define GPS_POSITION_MODE_STANDALONE 0
47/** AGPS MS-Based mode. */
48#define GPS_POSITION_MODE_MS_BASED 1
49/** AGPS MS-Assisted mode. */
50#define GPS_POSITION_MODE_MS_ASSISTED 2
51
Mike Lockwoodb15879a2010-04-14 15:36:34 -040052/** Requested recurrence mode for GPS operation. */
53typedef uint32_t GpsPositionRecurrence;
54// IMPORTANT: Note that the following values must match
55// constants in GpsLocationProvider.java.
56/** Receive GPS fixes on a recurring basis at a specified period. */
57#define GPS_POSITION_RECURRENCE_PERIODIC 0
58/** Request a single shot GPS fix. */
59#define GPS_POSITION_RECURRENCE_SINGLE 1
60
Mike Lockwood9b0b1c32010-02-23 18:42:37 -050061/** GPS status event values. */
62typedef uint16_t GpsStatusValue;
63// IMPORTANT: Note that the following values must match
64// constants in GpsLocationProvider.java.
65/** GPS status unknown. */
66#define GPS_STATUS_NONE 0
67/** GPS has begun navigating. */
68#define GPS_STATUS_SESSION_BEGIN 1
69/** GPS has stopped navigating. */
70#define GPS_STATUS_SESSION_END 2
71/** GPS has powered on but is not navigating. */
72#define GPS_STATUS_ENGINE_ON 3
73/** GPS is powered off. */
74#define GPS_STATUS_ENGINE_OFF 4
75
76/** Flags to indicate which values are valid in a GpsLocation. */
77typedef uint16_t GpsLocationFlags;
78// IMPORTANT: Note that the following values must match
79// constants in GpsLocationProvider.java.
80/** GpsLocation has valid latitude and longitude. */
81#define GPS_LOCATION_HAS_LAT_LONG 0x0001
82/** GpsLocation has valid altitude. */
83#define GPS_LOCATION_HAS_ALTITUDE 0x0002
84/** GpsLocation has valid speed. */
85#define GPS_LOCATION_HAS_SPEED 0x0004
86/** GpsLocation has valid bearing. */
87#define GPS_LOCATION_HAS_BEARING 0x0008
88/** GpsLocation has valid accuracy. */
89#define GPS_LOCATION_HAS_ACCURACY 0x0010
90
Mike Lockwoodb15879a2010-04-14 15:36:34 -040091/** Flags for the gps_set_capabilities callback. */
92
93/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode.
94 If this is not set, then the framework will use 1000ms for min_interval
95 and will start and call start() and stop() to schedule the GPS.
96 */
97#define GPS_CAPABILITY_SCHEDULING 0x0000001
98/** GPS supports MS-Based AGPS mode */
99#define GPS_CAPABILITY_MSB 0x0000002
100/** GPS supports MS-Assisted AGPS mode */
101#define GPS_CAPABILITY_MSA 0x0000004
102/** GPS supports single-shot fixes */
103#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008
104
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500105/** Flags used to specify which aiding data to delete
106 when calling delete_aiding_data(). */
107typedef uint16_t GpsAidingData;
108// IMPORTANT: Note that the following values must match
109// constants in GpsLocationProvider.java.
110#define GPS_DELETE_EPHEMERIS 0x0001
111#define GPS_DELETE_ALMANAC 0x0002
112#define GPS_DELETE_POSITION 0x0004
113#define GPS_DELETE_TIME 0x0008
114#define GPS_DELETE_IONO 0x0010
115#define GPS_DELETE_UTC 0x0020
116#define GPS_DELETE_HEALTH 0x0040
117#define GPS_DELETE_SVDIR 0x0080
118#define GPS_DELETE_SVSTEER 0x0100
119#define GPS_DELETE_SADATA 0x0200
120#define GPS_DELETE_RTI 0x0400
121#define GPS_DELETE_CELLDB_INFO 0x8000
122#define GPS_DELETE_ALL 0xFFFF
123
124/** AGPS type */
125typedef uint16_t AGpsType;
126#define AGPS_TYPE_SUPL 1
127#define AGPS_TYPE_C2K 2
128
Miguel Torroja5f404f52010-07-27 06:34:15 +0200129typedef uint16_t AGpsSetIDType;
130#define AGPS_SETID_TYPE_NONE 0
131#define AGPS_SETID_TYPE_IMSI 1
132#define AGPS_SETID_TYPE_MSISDN 2
133
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500134/**
135 * String length constants
136 */
137#define GPS_NI_SHORT_STRING_MAXLEN 256
138#define GPS_NI_LONG_STRING_MAXLEN 2048
139
140/**
141 * GpsNiType constants
142 */
143typedef uint32_t GpsNiType;
144#define GPS_NI_TYPE_VOICE 1
145#define GPS_NI_TYPE_UMTS_SUPL 2
146#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3
147
148/**
149 * GpsNiNotifyFlags constants
150 */
151typedef uint32_t GpsNiNotifyFlags;
152/** NI requires notification */
153#define GPS_NI_NEED_NOTIFY 0x0001
154/** NI requires verification */
155#define GPS_NI_NEED_VERIFY 0x0002
156/** NI requires privacy override, no notification/minimal trace */
157#define GPS_NI_PRIVACY_OVERRIDE 0x0004
158
159/**
160 * GPS NI responses, used to define the response in
161 * NI structures
162 */
163typedef int GpsUserResponseType;
164#define GPS_NI_RESPONSE_ACCEPT 1
165#define GPS_NI_RESPONSE_DENY 2
166#define GPS_NI_RESPONSE_NORESP 3
167
168/**
169 * NI data encoding scheme
170 */
171typedef int GpsNiEncodingType;
172#define GPS_ENC_NONE 0
173#define GPS_ENC_SUPL_GSM_DEFAULT 1
174#define GPS_ENC_SUPL_UTF8 2
175#define GPS_ENC_SUPL_UCS2 3
176#define GPS_ENC_UNKNOWN -1
177
178/** AGPS status event values. */
179typedef uint16_t AGpsStatusValue;
180/** GPS requests data connection for AGPS. */
181#define GPS_REQUEST_AGPS_DATA_CONN 1
182/** GPS releases the AGPS data connection. */
183#define GPS_RELEASE_AGPS_DATA_CONN 2
184/** AGPS data connection initiated */
185#define GPS_AGPS_DATA_CONNECTED 3
186/** AGPS data connection completed */
187#define GPS_AGPS_DATA_CONN_DONE 4
188/** AGPS data connection failed */
189#define GPS_AGPS_DATA_CONN_FAILED 5
190
Miguel Torroja5f404f52010-07-27 06:34:15 +0200191#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1
192#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2
193#define AGPS_REG_LOCATION_TYPE_MAC 3
194
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500195/**
196 * Name for the GPS XTRA interface.
197 */
198#define GPS_XTRA_INTERFACE "gps-xtra"
199
200/**
201 * Name for the GPS DEBUG interface.
202 */
203#define GPS_DEBUG_INTERFACE "gps-debug"
204
205/**
206 * Name for the AGPS interface.
207 */
208#define AGPS_INTERFACE "agps"
209
210/**
211 * Name for NI interface
212 */
213#define GPS_NI_INTERFACE "gps-ni"
214
Miguel Torroja5f404f52010-07-27 06:34:15 +0200215/**
216 * Name for the AGPS-RIL interface.
217 */
218#define AGPS_RIL_INTERFACE "agps_ril"
219
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500220/** Represents a location. */
221typedef struct {
222 /** set to sizeof(GpsLocation) */
223 size_t size;
224 /** Contains GpsLocationFlags bits. */
225 uint16_t flags;
226 /** Represents latitude in degrees. */
227 double latitude;
228 /** Represents longitude in degrees. */
229 double longitude;
230 /** Represents altitude in meters above the WGS 84 reference
231 * ellipsoid. */
232 double altitude;
233 /** Represents speed in meters per second. */
234 float speed;
235 /** Represents heading in degrees. */
236 float bearing;
237 /** Represents expected accuracy in meters. */
238 float accuracy;
239 /** Timestamp for the location fix. */
240 GpsUtcTime timestamp;
241} GpsLocation;
242
243/** Represents the status. */
244typedef struct {
245 /** set to sizeof(GpsStatus) */
246 size_t size;
247 GpsStatusValue status;
248} GpsStatus;
249
250/** Represents SV information. */
251typedef struct {
252 /** set to sizeof(GpsSvInfo) */
253 size_t size;
254 /** Pseudo-random number for the SV. */
255 int prn;
256 /** Signal to noise ratio. */
257 float snr;
258 /** Elevation of SV in degrees. */
259 float elevation;
260 /** Azimuth of SV in degrees. */
261 float azimuth;
262} GpsSvInfo;
263
264/** Represents SV status. */
265typedef struct {
266 /** set to sizeof(GpsSvStatus) */
267 size_t size;
268
269 /** Number of SVs currently visible. */
270 int num_svs;
271
272 /** Contains an array of SV information. */
273 GpsSvInfo sv_list[GPS_MAX_SVS];
274
275 /** Represents a bit mask indicating which SVs
276 * have ephemeris data.
277 */
278 uint32_t ephemeris_mask;
279
280 /** Represents a bit mask indicating which SVs
281 * have almanac data.
282 */
283 uint32_t almanac_mask;
284
285 /**
286 * Represents a bit mask indicating which SVs
287 * were used for computing the most recent position fix.
288 */
289 uint32_t used_in_fix_mask;
290} GpsSvStatus;
291
Miguel Torroja5f404f52010-07-27 06:34:15 +0200292/* 2G and 3G */
293/* In 3G lac is discarded */
294typedef struct {
295 uint16_t type;
296 uint16_t mcc;
297 uint16_t mnc;
298 uint16_t lac;
299 uint32_t cid;
300} AGpsRefLocationCellID;
301
302typedef struct {
303 uint8_t mac[6];
304} AGpsRefLocationMac;
305
306/** Represents ref locations */
307typedef struct {
308 uint16_t type;
309 union {
310 AGpsRefLocationCellID cellID;
311 AGpsRefLocationMac mac;
312 } u;
313} AGpsRefLocation;
314
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700315/** Callback with location information.
316 * Can only be called from a thread created by create_thread_cb.
317 */
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500318typedef void (* gps_location_callback)(GpsLocation* location);
319
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700320/** Callback with status information.
321 * Can only be called from a thread created by create_thread_cb.
322 */
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500323typedef void (* gps_status_callback)(GpsStatus* status);
324
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700325/** Callback with SV status information.
326 * Can only be called from a thread created by create_thread_cb.
327 */
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500328typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info);
329
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700330/** Callback for reporting NMEA sentences.
331 * Can only be called from a thread created by create_thread_cb.
332 */
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500333typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length);
334
Mike Lockwoodb15879a2010-04-14 15:36:34 -0400335/** Callback to inform framework of the GPS engine's capabilities.
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700336 * Capability parameter is a bit field of GPS_CAPABILITY_* flags.
337 */
Mike Lockwoodb15879a2010-04-14 15:36:34 -0400338typedef void (* gps_set_capabilities)(uint32_t capabilities);
339
Mike Lockwoodd20bbae2010-04-07 09:04:25 -0400340/** Callback utility for acquiring the GPS wakelock.
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700341 * This can be used to prevent the CPU from suspending while handling GPS events.
342 */
Mike Lockwoodd20bbae2010-04-07 09:04:25 -0400343typedef void (* gps_acquire_wakelock)();
344
345/** Callback utility for releasing the GPS wakelock. */
346typedef void (* gps_release_wakelock)();
347
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700348/** Callback for creating a thread that can call into the Java framework code.
349 * This must be used to create any threads that report events up to the framework.
350 */
351typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg);
352
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500353/** GPS callback structure. */
354typedef struct {
Mike Lockwoodd20bbae2010-04-07 09:04:25 -0400355 /** set to sizeof(GpsCallbacks) */
356 size_t size;
357 gps_location_callback location_cb;
358 gps_status_callback status_cb;
359 gps_sv_status_callback sv_status_cb;
360 gps_nmea_callback nmea_cb;
Mike Lockwoodb15879a2010-04-14 15:36:34 -0400361 gps_set_capabilities set_capabilities_cb;
Mike Lockwoodd20bbae2010-04-07 09:04:25 -0400362 gps_acquire_wakelock acquire_wakelock_cb;
363 gps_release_wakelock release_wakelock_cb;
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700364 gps_create_thread create_thread_cb;
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500365} GpsCallbacks;
366
367
368/** Represents the standard GPS interface. */
369typedef struct {
370 /** set to sizeof(GpsInterface) */
371 size_t size;
372 /**
373 * Opens the interface and provides the callback routines
374 * to the implemenation of this interface.
375 */
376 int (*init)( GpsCallbacks* callbacks );
377
378 /** Starts navigating. */
379 int (*start)( void );
380
381 /** Stops navigating. */
382 int (*stop)( void );
383
384 /** Closes the interface. */
385 void (*cleanup)( void );
386
387 /** Injects the current time. */
388 int (*inject_time)(GpsUtcTime time, int64_t timeReference,
389 int uncertainty);
390
391 /** Injects current location from another location provider
392 * (typically cell ID).
393 * latitude and longitude are measured in degrees
394 * expected accuracy is measured in meters
395 */
396 int (*inject_location)(double latitude, double longitude, float accuracy);
397
398 /**
399 * Specifies that the next call to start will not use the
400 * information defined in the flags. GPS_DELETE_ALL is passed for
401 * a cold start.
402 */
403 void (*delete_aiding_data)(GpsAidingData flags);
404
405 /**
Mike Lockwoodb15879a2010-04-14 15:36:34 -0400406 * min_interval represents the time between fixes in milliseconds.
407 * preferred_accuracy represents the requested fix accuracy in meters.
408 * preferred_time represents the requested time to first fix in milliseconds.
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500409 */
Mike Lockwoodb15879a2010-04-14 15:36:34 -0400410 int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence,
411 uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time);
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500412
413 /** Get a pointer to extension information. */
414 const void* (*get_extension)(const char* name);
415} GpsInterface;
416
417/** Callback to request the client to download XTRA data.
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700418 * The client should download XTRA data and inject it by calling inject_xtra_data().
419 * Can only be called from a thread created by create_thread_cb.
420 */
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500421typedef void (* gps_xtra_download_request)();
422
423/** Callback structure for the XTRA interface. */
424typedef struct {
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700425 gps_xtra_download_request download_request_cb;
426 gps_create_thread create_thread_cb;
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500427} GpsXtraCallbacks;
428
429/** Extended interface for XTRA support. */
430typedef struct {
431 /** set to sizeof(GpsXtraInterface) */
432 size_t size;
433 /**
434 * Opens the XTRA interface and provides the callback routines
435 * to the implemenation of this interface.
436 */
437 int (*init)( GpsXtraCallbacks* callbacks );
438 /** Injects XTRA data into the GPS. */
439 int (*inject_xtra_data)( char* data, int length );
440} GpsXtraInterface;
441
442/** Extended interface for DEBUG support. */
443typedef struct {
444 /** set to sizeof(GpsDebugInterface) */
445 size_t size;
446
447 /**
448 * This function should return any information that the native
449 * implementation wishes to include in a bugreport.
450 */
451 size_t (*get_internal_state)(char* buffer, size_t bufferSize);
452} GpsDebugInterface;
453
454/** Represents the status of AGPS. */
455typedef struct {
456 /** set to sizeof(AGpsStatus) */
457 size_t size;
458
459 AGpsType type;
460 AGpsStatusValue status;
461} AGpsStatus;
462
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700463/** Callback with AGPS status information.
464 * Can only be called from a thread created by create_thread_cb.
465 */
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500466typedef void (* agps_status_callback)(AGpsStatus* status);
467
468/** Callback structure for the AGPS interface. */
469typedef struct {
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700470 agps_status_callback status_cb;
471 gps_create_thread create_thread_cb;
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500472} AGpsCallbacks;
473
474
475/** Extended interface for AGPS support. */
476typedef struct {
477 /** set to sizeof(AGpsInterface) */
478 size_t size;
479
480 /**
481 * Opens the AGPS interface and provides the callback routines
482 * to the implemenation of this interface.
483 */
484 void (*init)( AGpsCallbacks* callbacks );
485 /**
486 * Notifies that a data connection is available and sets
487 * the name of the APN to be used for SUPL.
488 */
489 int (*data_conn_open)( const char* apn );
490 /**
491 * Notifies that the AGPS data connection has been closed.
492 */
493 int (*data_conn_closed)();
494 /**
495 * Notifies that a data connection is not available for AGPS.
496 */
497 int (*data_conn_failed)();
498 /**
499 * Sets the hostname and port for the AGPS server.
500 */
501 int (*set_server)( AGpsType type, const char* hostname, int port );
502} AGpsInterface;
503
504
505/** Represents an NI request */
506typedef struct {
507 /** set to sizeof(GpsNiNotification) */
508 size_t size;
509
510 /**
511 * An ID generated by HAL to associate NI notifications and UI
512 * responses
513 */
514 int notification_id;
515
516 /**
517 * An NI type used to distinguish different categories of NI
518 * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ...
519 */
520 GpsNiType ni_type;
521
522 /**
523 * Notification/verification options, combinations of GpsNiNotifyFlags constants
524 */
525 GpsNiNotifyFlags notify_flags;
526
527 /**
528 * Timeout period to wait for user response.
529 * Set to 0 for no time out limit.
530 */
531 int timeout;
532
533 /**
534 * Default response when time out.
535 */
536 GpsUserResponseType default_response;
537
538 /**
539 * Requestor ID
540 */
541 char requestor_id[GPS_NI_SHORT_STRING_MAXLEN];
542
543 /**
544 * Notification message. It can also be used to store client_id in some cases
545 */
546 char text[GPS_NI_LONG_STRING_MAXLEN];
547
548 /**
549 * Client name decoding scheme
550 */
551 GpsNiEncodingType requestor_id_encoding;
552
553 /**
554 * Client name decoding scheme
555 */
556 GpsNiEncodingType text_encoding;
557
558 /**
559 * A pointer to extra data. Format:
560 * key_1 = value_1
561 * key_2 = value_2
562 */
563 char extras[GPS_NI_LONG_STRING_MAXLEN];
564
565} GpsNiNotification;
566
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700567/** Callback with NI notification.
568 * Can only be called from a thread created by create_thread_cb.
569 */
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500570typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification);
571
572/** GPS NI callback structure. */
573typedef struct
574{
Mike Lockwood4453b5b2010-06-20 14:23:10 -0700575 /**
576 * Sends the notification request from HAL to GPSLocationProvider.
577 */
578 gps_ni_notify_callback notify_cb;
579 gps_create_thread create_thread_cb;
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500580} GpsNiCallbacks;
581
582/**
583 * Extended interface for Network-initiated (NI) support.
584 */
585typedef struct
586{
587 /** set to sizeof(GpsNiInterface) */
588 size_t size;
589
590 /** Registers the callbacks for HAL to use. */
591 void (*init) (GpsNiCallbacks *callbacks);
592
593 /** Sends a response to HAL. */
594 void (*respond) (int notif_id, GpsUserResponseType user_response);
595} GpsNiInterface;
596
597struct gps_device_t {
598 struct hw_device_t common;
599
600 /**
601 * Set the provided lights to the provided values.
602 *
603 * Returns: 0 on succes, error code on failure.
604 */
605 const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev);
606};
607
Miguel Torroja5f404f52010-07-27 06:34:15 +0200608#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L)
609#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L)
610
611#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L)
612#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L)
613
614typedef void (*agps_ril_request_set_id)(uint32_t flags);
615typedef void (*agps_ril_request_ref_loc)(uint32_t flags);
616
617typedef struct {
618 agps_ril_request_set_id request_setid;
619 agps_ril_request_ref_loc request_refloc;
620 gps_create_thread create_thread_cb;
621} AGpsRilCallbacks;
622
623/** Extended interface for AGPS_RIL support. */
624typedef struct {
625 /** set to sizeof(AGpsRilInterface) */
626 size_t size;
627 /**
628 * Opens the AGPS interface and provides the callback routines
629 * to the implemenation of this interface.
630 */
631 void (*init)( AGpsRilCallbacks* callbacks );
632
633 /**
634 * Sets the reference location.
635 */
636 void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct);
637 /**
638 * Sets the set ID.
639 */
640 void (*set_set_id) (AGpsSetIDType type, const char* setid);
641
642 /**
643 * Send network initiated message.
644 */
645 void (*ni_message) (uint8_t *msg, size_t len);
646} AGpsRilInterface;
647
Mike Lockwood9b0b1c32010-02-23 18:42:37 -0500648__END_DECLS
649
650#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */
651