diff options
author | Wink Saville <wink@google.com> | 2013-04-09 12:11:38 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2013-04-09 12:11:38 -0700 |
commit | 8a9e02161271505de274db0c3a88087056dd5dfc (patch) | |
tree | a8ec0b9631452fc050bd00a672f8b5790c3e1d37 /include/telephony/ril.h | |
parent | 18e4ab167c7d8549a360ab5ae1fadddcad8c0523 (diff) | |
download | android_hardware_ril-8a9e02161271505de274db0c3a88087056dd5dfc.tar.gz android_hardware_ril-8a9e02161271505de274db0c3a88087056dd5dfc.tar.bz2 android_hardware_ril-8a9e02161271505de274db0c3a88087056dd5dfc.zip |
Add support for CellInfo RIL commands.
These commands allow for more precise location determination.
To support CellInfo I created librilutils which adds ril_nano_time
over time librilutils will be expanded to have other common methods
that would be used by ril implementations.
Bug: 8235566
Change-Id: I7ad7dabc4b6c38bfba4461b08e6e30d0eb9efea1
Diffstat (limited to 'include/telephony/ril.h')
-rw-r--r-- | include/telephony/ril.h | 164 |
1 files changed, 162 insertions, 2 deletions
diff --git a/include/telephony/ril.h b/include/telephony/ril.h index 76db7ba..a73343b 100644 --- a/include/telephony/ril.h +++ b/include/telephony/ril.h @@ -18,6 +18,7 @@ #define ANDROID_RIL_H 1 #include <stdlib.h> +#include <stdint.h> #ifndef FEATURE_UNIT_TEST #include <sys/time.h> #endif /* !FEATURE_UNIT_TEST */ @@ -26,7 +27,7 @@ extern "C" { #endif -#define RIL_VERSION 7 /* Current version */ +#define RIL_VERSION 8 /* Current version */ #define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */ #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64 @@ -208,7 +209,7 @@ typedef struct { The unit is miliseconds. The value < 0 means no value is suggested. The value 0 means retry should be done ASAP. - The value of MAX_INT(0x7fffffff) means no retry. */ + The value of INT_MAX(0x7fffffff) means no retry. */ int cid; /* Context ID, uniquely identifies this call */ int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */ char * type; /* One of the PDP_type values in TS 27.007 section 10.1.1. @@ -681,6 +682,32 @@ typedef struct { * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */ } RIL_LTE_SignalStrength; +typedef struct { + int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */ + int rsrp; /* The current Reference Signal Receive Power in dBm multipled by -1. + * Range: 44 to 140 dBm + * INT_MAX: 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.133 9.1.4 */ + int rsrq; /* The current Reference Signal Receive Quality in dB multiplied by -1. + * Range: 20 to 3 dB. + * INT_MAX: 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.133 9.1.7 */ + int rssnr; /* The current reference signal signal-to-noise ratio in 0.1 dB units. + * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB). + * INT_MAX : 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.101 8.1.1 */ + int cqi; /* The current Channel Quality Indicator. + * Range: 0 to 15. + * INT_MAX : 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */ + int timingAdvance; /* timing advance in micro seconds for a one way trip from cell to device. + * Approximate distance can be calculated using 300m/us * timingAdvance. + * Range: 0 to 0x7FFFFFFE + * INT_MAX : 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP 36.321 section 6.1.3.5 + * also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html */ +} RIL_LTE_SignalStrength_v8; + /* Deprecated, use RIL_SignalStrength_v6 */ typedef struct { RIL_GW_SignalStrength GW_SignalStrength; @@ -695,6 +722,95 @@ typedef struct { RIL_LTE_SignalStrength LTE_SignalStrength; } RIL_SignalStrength_v6; +typedef struct { + RIL_GW_SignalStrength GW_SignalStrength; + RIL_CDMA_SignalStrength CDMA_SignalStrength; + RIL_EVDO_SignalStrength EVDO_SignalStrength; + RIL_LTE_SignalStrength_v8 LTE_SignalStrength; +} RIL_SignalStrength_v8; + +/** RIL_CellIdentityGsm */ +typedef struct { + int mcc; /* 3-digit Mobile Country Code, 0..999 */ + int mnc; /* 2 or 3-digit Mobile Network Code, 0..999 */ + int lac; /* 16-bit Location Area Code, 0..65535 */ + int cid; /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535 + * 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455 */ + int psc; /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511 */ +} RIL_CellIdentityGsm; + +/** RIL_CellIdentityCdma */ +typedef struct { + int networkId; /* Network Id 0..65535 */ + int systemId; /* CDMA System Id 0..32767 */ + int basestationId; /* Base Station Id 0..65535 */ + int longitude; /* Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. + * It is represented in units of 0.25 seconds and ranges from -2592000 + * to 2592000, both values inclusive (corresponding to a range of -180 + * to +180 degrees). */ + + int latitude; /* Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. + * It is represented in units of 0.25 seconds and ranges from -1296000 + * to 1296000, both values inclusive (corresponding to a range of -90 + * to +90 degrees). */ +} RIL_CellIdentityCdma; + +/** RIL_CellIdentityLte */ +typedef struct { + int mcc; /* 3-digit Mobile Country Code, 0..999 */ + int mnc; /* 2 or 3-digit Mobile Network Code, 0..999 */ + int ci; /* 28-bit Cell Identity described in TS ??? */ + int pci; /* physical cell id 0..503 */ + int tac; /* 16-bit tracking area code */ +} RIL_CellIdentityLte; + +/** RIL_CellInfoGsm */ +typedef struct { + RIL_CellIdentityGsm cellIdentityGsm; + RIL_GW_SignalStrength signalStrengthGsm; +} RIL_CellInfoGsm; + +/** RIL_CellInfoCdma */ +typedef struct { + RIL_CellIdentityCdma cellIdentityCdma; + RIL_CDMA_SignalStrength signalStrengthCdma; + RIL_EVDO_SignalStrength signalStrengthEvdo; +} RIL_CellInfoCdma; + +/** RIL_CellInfoLte */ +typedef struct { + RIL_CellIdentityLte cellIdentityLte; + RIL_LTE_SignalStrength_v8 signalStrengthLte; +} RIL_CellInfoLte; + +// Must be the same as CellInfo.TYPE_XXX +typedef enum { + RIL_CELL_INFO_TYPE_GSM = 1, + RIL_CELL_INFO_TYPE_CDMA = 2, + RIL_CELL_INFO_TYPE_LTE = 3, +} RIL_CellInfoType; + +// Must be the same as CellInfo.TIMESTAMP_TYPE_XXX +typedef enum { + RIL_TIMESTAMP_TYPE_UNKNOWN = 0, + RIL_TIMESTAMP_TYPE_ANTENNA = 1, + RIL_TIMESTAMP_TYPE_MODEM = 2, + RIL_TIMESTAMP_TYPE_OEM_RIL = 3, + RIL_TIMESTAMP_TYPE_JAVA_RIL = 4, +} RIL_TimeStampType; + +typedef struct { + RIL_CellInfoType cellInfoType; /* cell type for selecting from union CellInfo */ + int registered; /* !0 if this cell is registered 0 if not registered */ + RIL_TimeStampType timeStampType; /* type of time stamp represented by timeStamp */ + uint64_t timeStamp; /* Time in nanos as returned by ril_nano_time */ + union { + RIL_CellInfoGsm gsm; + RIL_CellInfoCdma cdma; + RIL_CellInfoLte lte; + } CellInfo; +} RIL_CellInfo; + /* Names of the CDMA info records (C.S0005 section 3.7.5) */ typedef enum { RIL_CDMA_DISPLAY_INFO_REC, @@ -3313,6 +3429,39 @@ typedef struct { */ #define RIL_REQUEST_VOICE_RADIO_TECH 108 +/** + * RIL_REQUEST_GET_CELL_INFO_LIST + * + * Request all of the current cell information known to the radio. The radio + * must a list of all current cells, including the neighboring cells. If for a particular + * cell information isn't known then the appropriate unknown value will be returned. + * This does not cause or change the rate of RIL_UNSOL_CELL_INFO_LIST. + * + * "data" is NULL + * + * "response" is an array of RIL_CellInfo. + */ +#define RIL_REQUEST_GET_CELL_INFO_LIST 109 + +/** + * RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE + * + * Sets the minimum time between when RIL_UNSOL_CELL_INFO_LIST should be invoked. + * The default, 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported + * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue + * a RIL_UNSOL_CELL_INFO_LIST. + * + * "data" is int * + * ((int *)data)[0] is minimum time in milliseconds + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * GENERIC_FAILURE + */ +#define RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 110 /***********************************************************************/ @@ -3792,6 +3941,17 @@ typedef struct { */ #define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035 +/** + * RIL_UNSOL_CELL_INFO_LIST + * + * Same information as returned by RIL_REQUEST_GET_CELL_INFO_LIST, but returned + * at the rate no greater than specified by RIL_REQUEST_SET_UNSOL_CELL_INFO_RATE. + * + * "data" is NULL + * + * "response" is an array of RIL_CellInfo. + */ +#define RIL_UNSOL_CELL_INFO_LIST 1036 /***********************************************************************/ |