summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Torroja <migueltb@broadcom.com>2010-10-05 12:38:42 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-05 12:38:42 -0700
commitb15cd546e2043b7530c8eabf235820906e42eaa3 (patch)
tree7afaef34f46133acccdccd21839d6de9c841561e
parent26ad39290948f7728b613208e5b8dc311029ebfe (diff)
parent5f404f58df329e7676f8fd47bb9bb82f9dc047f1 (diff)
downloadlibhardware-b15cd546e2043b7530c8eabf235820906e42eaa3.tar.gz
am 5f404f58: gps: Adding AgpsRilInterface extension
Merge commit '5f404f58df329e7676f8fd47bb9bb82f9dc047f1' into gingerbread-plus-aosp * commit '5f404f58df329e7676f8fd47bb9bb82f9dc047f1': gps: Adding AgpsRilInterface extension
-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 */