From 1ea5429e78e31e0c60cab468cba18fa0fc6552e4 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Tue, 14 Apr 2009 16:21:50 -0400 Subject: [PATCH] gps: Add support for bringing up a GSM data connection on demand for SUPL. Signed-off-by: Mike Lockwood --- include/hardware_legacy/gps.h | 45 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/include/hardware_legacy/gps.h b/include/hardware_legacy/gps.h index eb70119..fa61d7f 100644 --- a/include/hardware_legacy/gps.h +++ b/include/hardware_legacy/gps.h @@ -89,6 +89,19 @@ typedef uint16_t GpsAidingData; #define GPS_DELETE_CELLDB_INFO 0x8000 #define GPS_DELETE_ALL 0xFFFF +/** SUPL status event values. */ +typedef uint16_t GpsSuplStatusValue; +/** GPS requests data connection for SUPL. */ +#define GPS_REQUEST_SUPL_DATA_CONN 1 +/** GPS releases the SUPL data connection. */ +#define GPS_RELEASE_SUPL_DATA_CONN 2 +/** SUPL data connection initiated */ +#define GPS_SUPL_DATA_CONNECTED 3 +/** SUPL data connection completed */ +#define GPS_SUPL_DATA_CONN_DONE 4 +/** SUPL data connection failed */ +#define GPS_SUPL_DATA_CONN_FAILED 5 + /** * Name for the GPS XTRA interface. */ @@ -241,12 +254,40 @@ typedef struct { int (*inject_xtra_data)( char* data, int length ); } GpsXtraInterface; +/** Represents the status of SUPL. */ +typedef struct { + GpsSuplStatusValue status; +} GpsSuplStatus; + +/** Callback with SUPL status information. */ +typedef void (* gps_supl_status_callback)(GpsSuplStatus* status); + +/** Callback structure for the SUPL interface. */ +typedef struct { + gps_supl_status_callback status_cb; +} GpsSuplCallbacks; + + /** Extended interface for SUPL support. */ typedef struct { /** - * Sets the name of the APN to be used for SUPL. + * Opens the SUPL interface and provides the callback routines + * to the implemenation of this interface. + */ + void (*init)( GpsSuplCallbacks* callbacks ); + /** + * Notifies that a data connection is available and sets + * the name of the APN to be used for SUPL. + */ + int (*data_conn_open)( const char* apn ); + /** + * Notifies that the SUPL data connection has been closed. + */ + int (*data_conn_closed)(); + /** + * Notifies that a data connection is not available for SUPL. */ - int (*set_apn)( const char* apn ); + int (*data_conn_failed)(); /** * Sets the IP address and port for the SUPL server. */ -- 2.11.0