summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Torroja <migueltb@broadcom.com>2010-07-27 06:34:15 +0200
committerMike Lockwood <lockwood@android.com>2010-10-05 08:05:08 -0400
commit5f404f58df329e7676f8fd47bb9bb82f9dc047f1 (patch)
tree7afaef34f46133acccdccd21839d6de9c841561e
parente755bd4038cab69f98f7cf17e41f493296ec62ab (diff)
downloadlibhardware-5f404f58df329e7676f8fd47bb9bb82f9dc047f1.tar.gz
gps: Adding AgpsRilInterface extension
Change-Id: Iddc10906ca4bd59fef25d51068e0c69998aae13f Signed-off-by: Mike Lockwood <lockwood@android.com>
-rw-r--r--include/hardware/gps.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/include/hardware/gps.h b/include/hardware/gps.h
index 40776324..8b633028 100644
--- a/include/hardware/gps.h
+++ b/include/hardware/gps.h
@@ -126,6 +126,11 @@ typedef uint16_t AGpsType;
#define AGPS_TYPE_SUPL 1
#define AGPS_TYPE_C2K 2
+typedef uint16_t AGpsSetIDType;
+#define AGPS_SETID_TYPE_NONE 0
+#define AGPS_SETID_TYPE_IMSI 1
+#define AGPS_SETID_TYPE_MSISDN 2
+
/**
* String length constants
*/
@@ -183,6 +188,10 @@ typedef uint16_t AGpsStatusValue;
/** AGPS data connection failed */
#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
+
/**
* Name for the GPS XTRA interface.
*/
@@ -203,6 +212,11 @@ typedef uint16_t AGpsStatusValue;
*/
#define GPS_NI_INTERFACE "gps-ni"
+/**
+ * Name for the AGPS-RIL interface.
+ */
+#define AGPS_RIL_INTERFACE "agps_ril"
+
/** Represents a location. */
typedef struct {
/** set to sizeof(GpsLocation) */
@@ -275,6 +289,29 @@ typedef struct {
uint32_t used_in_fix_mask;
} GpsSvStatus;
+/* 2G and 3G */
+/* In 3G lac is discarded */
+typedef struct {
+ uint16_t type;
+ uint16_t mcc;
+ uint16_t mnc;
+ uint16_t lac;
+ uint32_t cid;
+} AGpsRefLocationCellID;
+
+typedef struct {
+ uint8_t mac[6];
+} AGpsRefLocationMac;
+
+/** Represents ref locations */
+typedef struct {
+ uint16_t type;
+ union {
+ AGpsRefLocationCellID cellID;
+ AGpsRefLocationMac mac;
+ } u;
+} AGpsRefLocation;
+
/** Callback with location information.
* Can only be called from a thread created by create_thread_cb.
*/
@@ -568,6 +605,46 @@ struct gps_device_t {
const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev);
};
+#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)
+
+typedef void (*agps_ril_request_set_id)(uint32_t flags);
+typedef void (*agps_ril_request_ref_loc)(uint32_t flags);
+
+typedef struct {
+ agps_ril_request_set_id request_setid;
+ agps_ril_request_ref_loc request_refloc;
+ gps_create_thread create_thread_cb;
+} AGpsRilCallbacks;
+
+/** Extended interface for AGPS_RIL support. */
+typedef struct {
+ /** set to sizeof(AGpsRilInterface) */
+ size_t size;
+ /**
+ * Opens the AGPS interface and provides the callback routines
+ * to the implemenation of this interface.
+ */
+ void (*init)( AGpsRilCallbacks* callbacks );
+
+ /**
+ * Sets the reference location.
+ */
+ void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct);
+ /**
+ * Sets the set ID.
+ */
+ void (*set_set_id) (AGpsSetIDType type, const char* setid);
+
+ /**
+ * Send network initiated message.
+ */
+ void (*ni_message) (uint8_t *msg, size_t len);
+} AGpsRilInterface;
+
__END_DECLS
#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */