/libril/telephony/ril.h

https://github.com/VanirAOSP/device_htc_msm8960-common · C Header · 4551 lines · 931 code · 355 blank · 3265 comment · 0 complexity · 702de109ebded32910fce9f44f1f608d MD5 · raw file

Large files are truncated click here to view the full file

  1. /*
  2. * Copyright (C) 2006 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. #ifndef ANDROID_RIL_H
  17. #define ANDROID_RIL_H 1
  18. #include <stdlib.h>
  19. #include <stdint.h>
  20. #include "ril_cdma_sms.h"
  21. #include <telephony/ril_msim.h>
  22. #ifndef FEATURE_UNIT_TEST
  23. #include <sys/time.h>
  24. #endif /* !FEATURE_UNIT_TEST */
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #define RIL_VERSION 9 /* Current version */
  29. #define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */
  30. #define RIL_QCOM_VERSION 3 /* Qualcomm internal RIL version */
  31. #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
  32. #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
  33. #define MAX_RILDS 3
  34. #define MAX_SOCKET_NAME_LENGTH 6
  35. #define MAX_CLIENT_ID_LENGTH 2
  36. #define MAX_DEBUG_SOCKET_NAME_LENGTH 12
  37. #define MAX_QEMU_PIPE_NAME_LENGTH 11
  38. typedef void * RIL_Token;
  39. typedef enum {
  40. RIL_E_SUCCESS = 0,
  41. RIL_E_RADIO_NOT_AVAILABLE = 1, /* If radio did not start or is resetting */
  42. RIL_E_GENERIC_FAILURE = 2,
  43. RIL_E_PASSWORD_INCORRECT = 3, /* for PIN/PIN2 methods only! */
  44. RIL_E_SIM_PIN2 = 4, /* Operation requires SIM PIN2 to be entered */
  45. RIL_E_SIM_PUK2 = 5, /* Operation requires SIM PIN2 to be entered */
  46. RIL_E_REQUEST_NOT_SUPPORTED = 6,
  47. RIL_E_CANCELLED = 7,
  48. RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
  49. call on a Class C GPRS device */
  50. RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, /* data ops are not allowed before device
  51. registers in network */
  52. RIL_E_SMS_SEND_FAIL_RETRY = 10, /* fail to send sms and need retry */
  53. RIL_E_SIM_ABSENT = 11, /* fail to set the location where CDMA subscription
  54. shall be retrieved because of SIM or RUIM
  55. card absent */
  56. RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12, /* fail to find CDMA subscription from specified
  57. location */
  58. RIL_E_MODE_NOT_SUPPORTED = 13, /* HW does not support preferred network type */
  59. RIL_E_FDN_CHECK_FAILURE = 14, /* command failed because recipient is not on FDN list */
  60. RIL_E_ILLEGAL_SIM_OR_ME = 15, /* network selection failed due to
  61. illegal SIM or ME */
  62. RIL_E_UNUSED = 16,
  63. RIL_E_DIAL_MODIFIED_TO_USSD = 17, /* DIAL request modified to USSD */
  64. RIL_E_DIAL_MODIFIED_TO_SS = 18, /* DIAL request modified to SS */
  65. RIL_E_DIAL_MODIFIED_TO_DIAL = 19, /* DIAL request modified to DIAL with different data */
  66. RIL_E_USSD_MODIFIED_TO_DIAL = 20, /* USSD request modified to DIAL */
  67. RIL_E_USSD_MODIFIED_TO_SS = 21, /* USSD request modified to SS */
  68. RIL_E_USSD_MODIFIED_TO_USSD = 22, /* USSD request modified to different USSD request */
  69. RIL_E_SS_MODIFIED_TO_DIAL = 23, /* SS request modified to DIAL */
  70. RIL_E_SS_MODIFIED_TO_USSD = 24, /* SS request modified to USSD */
  71. RIL_E_SS_MODIFIED_TO_SS = 25, /* SS request modified to different SS request */
  72. RIL_E_SUBSCRIPTION_NOT_SUPPORTED = 26 /* Subscription not supported by RIL */
  73. } RIL_Errno;
  74. typedef enum {
  75. RIL_CALL_ACTIVE = 0,
  76. RIL_CALL_HOLDING = 1,
  77. RIL_CALL_DIALING = 2, /* MO call only */
  78. RIL_CALL_ALERTING = 3, /* MO call only */
  79. RIL_CALL_INCOMING = 4, /* MT call only */
  80. RIL_CALL_WAITING = 5 /* MT call only */
  81. } RIL_CallState;
  82. typedef enum {
  83. RADIO_STATE_OFF = 0, /* Radio explictly powered off (eg CFUN=0) */
  84. RADIO_STATE_UNAVAILABLE = 1, /* Radio unavailable (eg, resetting or not booted) */
  85. /* States 2-9 below are deprecated. Just leaving them here for backward compatibility. */
  86. RADIO_STATE_SIM_NOT_READY = 2, /* Radio is on, but the SIM interface is not ready */
  87. RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3, /* SIM PIN locked, PUK required, network
  88. personalization locked, or SIM absent */
  89. RADIO_STATE_SIM_READY = 4, /* Radio is on and SIM interface is available */
  90. RADIO_STATE_RUIM_NOT_READY = 5, /* Radio is on, but the RUIM interface is not ready */
  91. RADIO_STATE_RUIM_READY = 6, /* Radio is on and the RUIM interface is available */
  92. RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network
  93. personalization locked, or RUIM absent */
  94. RADIO_STATE_NV_NOT_READY = 8, /* Radio is on, but the NV interface is not available */
  95. RADIO_STATE_NV_READY = 9, /* Radio is on and the NV interface is available */
  96. RADIO_STATE_ON = 10 /* Radio is on */
  97. } RIL_RadioState;
  98. typedef enum {
  99. RADIO_TECH_UNKNOWN = 0,
  100. RADIO_TECH_GPRS = 1,
  101. RADIO_TECH_EDGE = 2,
  102. RADIO_TECH_UMTS = 3,
  103. RADIO_TECH_IS95A = 4,
  104. RADIO_TECH_IS95B = 5,
  105. RADIO_TECH_1xRTT = 6,
  106. RADIO_TECH_EVDO_0 = 7,
  107. RADIO_TECH_EVDO_A = 8,
  108. RADIO_TECH_HSDPA = 9,
  109. RADIO_TECH_HSUPA = 10,
  110. RADIO_TECH_HSPA = 11,
  111. RADIO_TECH_EVDO_B = 12,
  112. RADIO_TECH_EHRPD = 13,
  113. RADIO_TECH_LTE = 14,
  114. RADIO_TECH_HSPAP = 15, // HSPA+
  115. RADIO_TECH_GSM = 16, // Only supports voice
  116. RADIO_TECH_TD_SCDMA = 17,
  117. RADIO_TECH_IWLAN = 18,
  118. RADIO_TECH_DCHSPAP = 30
  119. } RIL_RadioTechnology;
  120. // Do we want to split Data from Voice and the use
  121. // RIL_RadioTechnology for get/setPreferredVoice/Data ?
  122. typedef enum {
  123. PREF_NET_TYPE_GSM_WCDMA = 0, /* GSM/WCDMA (WCDMA preferred) */
  124. PREF_NET_TYPE_GSM_ONLY = 1, /* GSM only */
  125. PREF_NET_TYPE_WCDMA = 2, /* WCDMA */
  126. PREF_NET_TYPE_GSM_WCDMA_AUTO = 3, /* GSM/WCDMA (auto mode, according to PRL) */
  127. PREF_NET_TYPE_CDMA_EVDO_AUTO = 4, /* CDMA and EvDo (auto mode, according to PRL) */
  128. PREF_NET_TYPE_CDMA_ONLY = 5, /* CDMA only */
  129. PREF_NET_TYPE_EVDO_ONLY = 6, /* EvDo only */
  130. PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */
  131. PREF_NET_TYPE_LTE_CDMA_EVDO = 8, /* LTE, CDMA and EvDo */
  132. PREF_NET_TYPE_LTE_GSM_WCDMA = 9, /* LTE, GSM/WCDMA */
  133. PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */
  134. PREF_NET_TYPE_LTE_ONLY = 11, /* LTE only */
  135. PREF_NET_TYPE_LTE_WCDMA = 12, /* LTE/WCDMA */
  136. PREF_NET_TYPE_TD_SCDMA_ONLY = 13, /* TD-SCDMA only */
  137. PREF_NET_TYPE_TD_SCDMA_WCDMA = 14, /* TD-SCDMA and WCDMA */
  138. PREF_NET_TYPE_TD_SCDMA_LTE = 15, /* TD-SCDMA and LTE */
  139. PREF_NET_TYPE_TD_SCDMA_GSM = 16, /* TD-SCDMA and GSM */
  140. PREF_NET_TYPE_TD_SCDMA_GSM_LTE = 17, /* TD-SCDMA,GSM and LTE */
  141. PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA = 18, /* TD-SCDMA, GSM/WCDMA */
  142. PREF_NET_TYPE_TD_SCDMA_WCDMA_LTE = 19, /* TD-SCDMA, WCDMA and LTE */
  143. PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_LTE = 20, /* TD-SCDMA, GSM/WCDMA and LTE */
  144. PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO = 21, /* TD-SCDMA, GSM/WCDMA, CDMA and EvDo */
  145. PREF_NET_TYPE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA = 22 /* TD-SCDMA, LTE, CDMA, EvDo GSM/WCDMA */
  146. } RIL_PreferredNetworkType;
  147. /* Source for cdma subscription */
  148. typedef enum {
  149. CDMA_SUBSCRIPTION_SOURCE_RUIM_SIM = 0,
  150. CDMA_SUBSCRIPTION_SOURCE_NV = 1
  151. } RIL_CdmaSubscriptionSource;
  152. /* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
  153. typedef enum {
  154. RIL_UUS_TYPE1_IMPLICIT = 0,
  155. RIL_UUS_TYPE1_REQUIRED = 1,
  156. RIL_UUS_TYPE1_NOT_REQUIRED = 2,
  157. RIL_UUS_TYPE2_REQUIRED = 3,
  158. RIL_UUS_TYPE2_NOT_REQUIRED = 4,
  159. RIL_UUS_TYPE3_REQUIRED = 5,
  160. RIL_UUS_TYPE3_NOT_REQUIRED = 6
  161. } RIL_UUS_Type;
  162. /* User-to-User Signaling Information data coding schemes. Possible values for
  163. * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
  164. * specified in section 10.5.4.25 of 3GPP TS 24.008 */
  165. typedef enum {
  166. RIL_UUS_DCS_USP = 0, /* User specified protocol */
  167. RIL_UUS_DCS_OSIHLP = 1, /* OSI higher layer protocol */
  168. RIL_UUS_DCS_X244 = 2, /* X.244 */
  169. RIL_UUS_DCS_RMCF = 3, /* Reserved for system mangement
  170. convergence function */
  171. RIL_UUS_DCS_IA5c = 4 /* IA5 characters */
  172. } RIL_UUS_DCS;
  173. /* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
  174. * This data is passed in RIL_ExtensionRecord and rec contains this
  175. * structure when type is RIL_UUS_INFO_EXT_REC */
  176. typedef struct {
  177. RIL_UUS_Type uusType; /* UUS Type */
  178. RIL_UUS_DCS uusDcs; /* UUS Data Coding Scheme */
  179. int uusLength; /* Length of UUS Data */
  180. char * uusData; /* UUS Data */
  181. } RIL_UUS_Info;
  182. /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
  183. typedef struct {
  184. char isPresent; /* non-zero if signal information record is present */
  185. char signalType; /* as defined 3.7.5.5-1 */
  186. char alertPitch; /* as defined 3.7.5.5-2 */
  187. char signal; /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */
  188. } RIL_CDMA_SignalInfoRecord;
  189. typedef struct {
  190. RIL_CallState state;
  191. int index; /* Connection Index for use with, eg, AT+CHLD */
  192. int toa; /* type of address, eg 145 = intl */
  193. char isMpty; /* nonzero if is mpty call */
  194. char isMT; /* nonzero if call is mobile terminated */
  195. char als; /* ALS line indicator if available
  196. (0 = line 1) */
  197. char isVoice; /* nonzero if this is is a voice call */
  198. char isVoicePrivacy; /* nonzero if CDMA voice privacy mode is active */
  199. char * number; /* Remote party number */
  200. int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
  201. char * name; /* Remote party name */
  202. int namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
  203. RIL_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */
  204. } RIL_Call;
  205. /* Deprecated, use RIL_Data_Call_Response_v6 */
  206. typedef struct {
  207. int cid; /* Context ID, uniquely identifies this call */
  208. int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
  209. char * type; /* One of the PDP_type values in TS 27.007 section 10.1.1.
  210. For example, "IP", "IPV6", "IPV4V6", or "PPP". */
  211. char * apn; /* ignored */
  212. char * address; /* An address, e.g., "192.0.1.3" or "2001:db8::1". */
  213. } RIL_Data_Call_Response_v4;
  214. /*
  215. * Returned by RIL_REQUEST_SETUP_DATA_CALL, RIL_REQUEST_DATA_CALL_LIST
  216. * and RIL_UNSOL_DATA_CALL_LIST_CHANGED, on error status != 0.
  217. */
  218. typedef struct {
  219. int status; /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
  220. #ifndef HCRADIO
  221. int suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
  222. back-off timer value RIL wants to override the one
  223. pre-configured in FW.
  224. The unit is miliseconds.
  225. The value < 0 means no value is suggested.
  226. The value 0 means retry should be done ASAP.
  227. The value of INT_MAX(0x7fffffff) means no retry. */
  228. #endif
  229. int cid; /* Context ID, uniquely identifies this call */
  230. int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
  231. char * type; /* One of the PDP_type values in TS 27.007 section 10.1.1.
  232. For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
  233. PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
  234. such as "IP" or "IPV6" */
  235. char * ifname; /* The network interface name */
  236. char * addresses; /* A space-delimited list of addresses with optional "/" prefix length,
  237. e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
  238. May not be empty, typically 1 IPv4 or 1 IPv6 or
  239. one of each. If the prefix length is absent the addresses
  240. are assumed to be point to point with IPv4 having a prefix
  241. length of 32 and IPv6 128. */
  242. char * dnses; /* A space-delimited list of DNS server addresses,
  243. e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
  244. May be empty. */
  245. char * gateways; /* A space-delimited list of default gateway addresses,
  246. e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
  247. May be empty in which case the addresses represent point
  248. to point connections. */
  249. } RIL_Data_Call_Response_v6;
  250. typedef enum {
  251. RADIO_TECH_3GPP = 1, /* 3GPP Technologies - GSM, WCDMA */
  252. RADIO_TECH_3GPP2 = 2 /* 3GPP2 Technologies - CDMA */
  253. } RIL_RadioTechnologyFamily;
  254. typedef struct {
  255. RIL_RadioTechnologyFamily tech;
  256. unsigned char retry; /* 0 == not retry, nonzero == retry */
  257. int messageRef; /* Valid field if retry is set to nonzero.
  258. Contains messageRef from RIL_SMS_Response
  259. corresponding to failed MO SMS.
  260. */
  261. union {
  262. /* Valid field if tech is RADIO_TECH_3GPP2. See RIL_REQUEST_CDMA_SEND_SMS */
  263. RIL_CDMA_SMS_Message* cdmaMessage;
  264. /* Valid field if tech is RADIO_TECH_3GPP. See RIL_REQUEST_SEND_SMS */
  265. char** gsmMessage;
  266. } message;
  267. } RIL_IMS_SMS_Message;
  268. typedef struct {
  269. int messageRef; /* TP-Message-Reference for GSM,
  270. and BearerData MessageId for CDMA
  271. (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
  272. char *ackPDU; /* or NULL if n/a */
  273. int errorCode; /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
  274. 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
  275. -1 if unknown or not applicable*/
  276. } RIL_SMS_Response;
  277. /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
  278. typedef struct {
  279. int status; /* Status of message. See TS 27.005 3.1, "<stat>": */
  280. /* 0 = "REC UNREAD" */
  281. /* 1 = "REC READ" */
  282. /* 2 = "STO UNSENT" */
  283. /* 3 = "STO SENT" */
  284. char * pdu; /* PDU of message to write, as an ASCII hex string less the SMSC address,
  285. the TP-layer length is "strlen(pdu)/2". */
  286. char * smsc; /* SMSC address in GSM BCD format prefixed by a length byte
  287. (as expected by TS 27.005) or NULL for default SMSC */
  288. } RIL_SMS_WriteArgs;
  289. /** Used by RIL_REQUEST_DIAL */
  290. typedef struct {
  291. char * address;
  292. int clir;
  293. /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
  294. * clir == 0 on "use subscription default value"
  295. * clir == 1 on "CLIR invocation" (restrict CLI presentation)
  296. * clir == 2 on "CLIR suppression" (allow CLI presentation)
  297. */
  298. RIL_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */
  299. } RIL_Dial;
  300. typedef struct {
  301. int command; /* one of the commands listed for TS 27.007 +CRSM*/
  302. int fileid; /* EF id */
  303. char *path; /* "pathid" from TS 27.007 +CRSM command.
  304. Path is in hex asciii format eg "7f205f70"
  305. Path must always be provided.
  306. */
  307. int p1;
  308. int p2;
  309. int p3;
  310. char *data; /* May be NULL*/
  311. char *pin2; /* May be NULL*/
  312. } RIL_SIM_IO_v5;
  313. typedef struct {
  314. int command; /* one of the commands listed for TS 27.007 +CRSM*/
  315. int fileid; /* EF id */
  316. char *path; /* "pathid" from TS 27.007 +CRSM command.
  317. Path is in hex asciii format eg "7f205f70"
  318. Path must always be provided.
  319. */
  320. int p1;
  321. int p2;
  322. int p3;
  323. char *data; /* May be NULL*/
  324. char *pin2; /* May be NULL*/
  325. char *aidPtr; /* AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. */
  326. } RIL_SIM_IO_v6;
  327. typedef struct {
  328. int sw1;
  329. int sw2;
  330. char *simResponse; /* In hex string format ([a-fA-F0-9]*). */
  331. } RIL_SIM_IO_Response;
  332. /* See also com.android.internal.telephony.gsm.CallForwardInfo */
  333. typedef struct {
  334. int status; /*
  335. * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
  336. * status 1 = active, 0 = not active
  337. *
  338. * For RIL_REQUEST_SET_CALL_FORWARD:
  339. * status is:
  340. * 0 = disable
  341. * 1 = enable
  342. * 2 = interrogate
  343. * 3 = registeration
  344. * 4 = erasure
  345. */
  346. int reason; /* from TS 27.007 7.11 "reason" */
  347. int serviceClass;/* From 27.007 +CCFC/+CLCK "class"
  348. See table for Android mapping from
  349. MMI service code
  350. 0 means user doesn't input class */
  351. int toa; /* "type" from TS 27.007 7.11 */
  352. char * number; /* "number" from TS 27.007 7.11. May be NULL */
  353. int timeSeconds; /* for CF no reply only */
  354. }RIL_CallForwardInfo;
  355. typedef struct {
  356. char * cid; /* Combination of LAC and Cell Id in 32 bits in GSM.
  357. * Upper 16 bits is LAC and lower 16 bits
  358. * is CID (as described in TS 27.005)
  359. * Primary Scrambling Code (as described in TS 25.331)
  360. * in 9 bits in UMTS
  361. * Valid values are hexadecimal 0x0000 - 0xffffffff.
  362. */
  363. int rssi; /* Received RSSI in GSM,
  364. * Level index of CPICH Received Signal Code Power in UMTS
  365. */
  366. } RIL_NeighboringCell;
  367. /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
  368. typedef enum {
  369. CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
  370. CALL_FAIL_NORMAL = 16,
  371. CALL_FAIL_BUSY = 17,
  372. CALL_FAIL_CONGESTION = 34,
  373. CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
  374. CALL_FAIL_CALL_BARRED = 240,
  375. CALL_FAIL_FDN_BLOCKED = 241,
  376. CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
  377. CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
  378. CALL_FAIL_DIAL_MODIFIED_TO_USSD = 244, /* STK Call Control */
  379. CALL_FAIL_DIAL_MODIFIED_TO_SS = 245,
  380. CALL_FAIL_DIAL_MODIFIED_TO_DIAL = 246,
  381. CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
  382. CALL_FAIL_CDMA_DROP = 1001,
  383. CALL_FAIL_CDMA_INTERCEPT = 1002,
  384. CALL_FAIL_CDMA_REORDER = 1003,
  385. CALL_FAIL_CDMA_SO_REJECT = 1004,
  386. CALL_FAIL_CDMA_RETRY_ORDER = 1005,
  387. CALL_FAIL_CDMA_ACCESS_FAILURE = 1006,
  388. CALL_FAIL_CDMA_PREEMPTED = 1007,
  389. CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
  390. during emergency callback mode */
  391. CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
  392. CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
  393. } RIL_LastCallFailCause;
  394. /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
  395. typedef enum {
  396. PDP_FAIL_NONE = 0, /* No error, connection ok */
  397. /* an integer cause code defined in TS 24.008
  398. section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B.
  399. If the implementation does not have access to the exact cause codes,
  400. then it should return one of the following values,
  401. as the UI layer needs to distinguish these
  402. cases for error notification and potential retries. */
  403. PDP_FAIL_OPERATOR_BARRED = 0x08, /* no retry */
  404. PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A,
  405. PDP_FAIL_MISSING_UKNOWN_APN = 0x1B, /* no retry */
  406. PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C, /* no retry */
  407. PDP_FAIL_USER_AUTHENTICATION = 0x1D, /* no retry */
  408. PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E, /* no retry */
  409. PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
  410. PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20, /* no retry */
  411. PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */
  412. PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
  413. PDP_FAIL_NSAPI_IN_USE = 0x23, /* no retry */
  414. PDP_FAIL_REGULAR_DEACTIVATION = 0x24, /* restart radio */
  415. PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32, /* no retry */
  416. PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33, /* no retry */
  417. PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
  418. PDP_FAIL_PROTOCOL_ERRORS = 0x6F, /* no retry */
  419. /* Not mentioned in the specification */
  420. PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
  421. PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
  422. /* reasons for data call drop - network/modem disconnect */
  423. PDP_FAIL_SIGNAL_LOST = -3,
  424. PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry
  425. with parameters appropriate for new technology */
  426. PDP_FAIL_RADIO_POWER_OFF = -5, /* data call was disconnected because radio was resetting,
  427. powered off - no retry */
  428. PDP_FAIL_TETHERED_CALL_ACTIVE = -6, /* data call was disconnected by modem because tethered
  429. mode was up on same APN/data profile - no retry until
  430. tethered call is off */
  431. PDP_FAIL_ERROR_UNSPECIFIED = 0xffff, /* retry silently */
  432. } RIL_DataCallFailCause;
  433. /* See RIL_REQUEST_SETUP_DATA_CALL */
  434. typedef enum {
  435. RIL_DATA_PROFILE_DEFAULT = 0,
  436. RIL_DATA_PROFILE_TETHERED = 1,
  437. RIL_DATA_PROFILE_OEM_BASE = 1000 /* Start of OEM-specific profiles */
  438. } RIL_DataProfile;
  439. /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
  440. typedef struct {
  441. int notificationType; /*
  442. * 0 = MO intermediate result code
  443. * 1 = MT unsolicited result code
  444. */
  445. int code; /* See 27.007 7.17
  446. "code1" for MO
  447. "code2" for MT. */
  448. int index; /* CUG index. See 27.007 7.17. */
  449. int type; /* "type" from 27.007 7.17 (MT only). */
  450. char * number; /* "number" from 27.007 7.17
  451. (MT only, may be NULL). */
  452. } RIL_SuppSvcNotification;
  453. #define RIL_CARD_MAX_APPS 8
  454. typedef enum {
  455. RIL_CARDSTATE_ABSENT = 0,
  456. RIL_CARDSTATE_PRESENT = 1,
  457. RIL_CARDSTATE_ERROR = 2
  458. } RIL_CardState;
  459. typedef enum {
  460. RIL_PERSOSUBSTATE_UNKNOWN = 0, /* initial state */
  461. RIL_PERSOSUBSTATE_IN_PROGRESS = 1, /* in between each lock transition */
  462. RIL_PERSOSUBSTATE_READY = 2, /* when either SIM or RUIM Perso is finished
  463. since each app can only have 1 active perso
  464. involved */
  465. RIL_PERSOSUBSTATE_SIM_NETWORK = 3,
  466. RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET = 4,
  467. RIL_PERSOSUBSTATE_SIM_CORPORATE = 5,
  468. RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER = 6,
  469. RIL_PERSOSUBSTATE_SIM_SIM = 7,
  470. RIL_PERSOSUBSTATE_SIM_NETWORK_PUK = 8, /* The corresponding perso lock is blocked */
  471. RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK = 9,
  472. RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK = 10,
  473. RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK = 11,
  474. RIL_PERSOSUBSTATE_SIM_SIM_PUK = 12,
  475. RIL_PERSOSUBSTATE_RUIM_NETWORK1 = 13,
  476. RIL_PERSOSUBSTATE_RUIM_NETWORK2 = 14,
  477. RIL_PERSOSUBSTATE_RUIM_HRPD = 15,
  478. RIL_PERSOSUBSTATE_RUIM_CORPORATE = 16,
  479. RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER = 17,
  480. RIL_PERSOSUBSTATE_RUIM_RUIM = 18,
  481. RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK = 19, /* The corresponding perso lock is blocked */
  482. RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK = 20,
  483. RIL_PERSOSUBSTATE_RUIM_HRPD_PUK = 21,
  484. RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK = 22,
  485. RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
  486. RIL_PERSOSUBSTATE_RUIM_RUIM_PUK = 24
  487. } RIL_PersoSubstate;
  488. typedef enum {
  489. RIL_APPSTATE_UNKNOWN = 0,
  490. RIL_APPSTATE_DETECTED = 1,
  491. RIL_APPSTATE_PIN = 2, /* If PIN1 or UPin is required */
  492. RIL_APPSTATE_PUK = 3, /* If PUK1 or Puk for UPin is required */
  493. RIL_APPSTATE_SUBSCRIPTION_PERSO = 4, /* perso_substate should be look at
  494. when app_state is assigned to this value */
  495. RIL_APPSTATE_READY = 5
  496. } RIL_AppState;
  497. typedef enum {
  498. RIL_PINSTATE_UNKNOWN = 0,
  499. RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
  500. RIL_PINSTATE_ENABLED_VERIFIED = 2,
  501. RIL_PINSTATE_DISABLED = 3,
  502. RIL_PINSTATE_ENABLED_BLOCKED = 4,
  503. RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
  504. } RIL_PinState;
  505. typedef enum {
  506. RIL_APPTYPE_UNKNOWN = 0,
  507. RIL_APPTYPE_SIM = 1,
  508. RIL_APPTYPE_USIM = 2,
  509. RIL_APPTYPE_RUIM = 3,
  510. RIL_APPTYPE_CSIM = 4,
  511. RIL_APPTYPE_ISIM = 5
  512. } RIL_AppType;
  513. typedef struct
  514. {
  515. RIL_AppType app_type;
  516. RIL_AppState app_state;
  517. RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
  518. RIL_APPSTATE_SUBSCRIPTION_PERSO */
  519. char *aid_ptr; /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
  520. 0x30, 0x30, 0x30 */
  521. char *app_label_ptr; /* null terminated string */
  522. int pin1_replaced; /* applicable to USIM, CSIM & ISIM */
  523. RIL_PinState pin1;
  524. RIL_PinState pin2;
  525. } RIL_AppStatus;
  526. /* Deprecated, use RIL_CardStatus_v6 */
  527. typedef struct
  528. {
  529. RIL_CardState card_state;
  530. RIL_PinState universal_pin_state; /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
  531. int gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
  532. int cdma_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
  533. int num_applications; /* value <= RIL_CARD_MAX_APPS */
  534. RIL_AppStatus applications[RIL_CARD_MAX_APPS];
  535. } RIL_CardStatus_v5;
  536. typedef struct
  537. {
  538. RIL_CardState card_state;
  539. RIL_PinState universal_pin_state; /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
  540. int gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
  541. int cdma_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
  542. int ims_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
  543. int num_applications; /* value <= RIL_CARD_MAX_APPS */
  544. RIL_AppStatus applications[RIL_CARD_MAX_APPS];
  545. } RIL_CardStatus_v6;
  546. /** The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH
  547. * or as part of RIL_SimRefreshResponse_v7
  548. */
  549. typedef enum {
  550. /* A file on SIM has been updated. data[1] contains the EFID. */
  551. SIM_FILE_UPDATE = 0,
  552. /* SIM initialized. All files should be re-read. */
  553. SIM_INIT = 1,
  554. /* SIM reset. SIM power required, SIM may be locked and all files should be re-read. */
  555. SIM_RESET = 2
  556. } RIL_SimRefreshResult;
  557. typedef struct {
  558. RIL_SimRefreshResult result;
  559. int ef_id; /* is the EFID of the updated file if the result is */
  560. /* SIM_FILE_UPDATE or 0 for any other result. */
  561. char * aid; /* is AID(application ID) of the card application */
  562. /* See ETSI 102.221 8.1 and 101.220 4 */
  563. /* For SIM_FILE_UPDATE result it can be set to AID of */
  564. /* application in which updated EF resides or it can be */
  565. /* NULL if EF is outside of an application. */
  566. /* For SIM_INIT result this field is set to AID of */
  567. /* application that caused REFRESH */
  568. /* For SIM_RESET result it is NULL. */
  569. } RIL_SimRefreshResponse_v7;
  570. /* Deprecated, use RIL_CDMA_CallWaiting_v6 */
  571. typedef struct {
  572. char * number; /* Remote party number */
  573. int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
  574. char * name; /* Remote party name */
  575. RIL_CDMA_SignalInfoRecord signalInfoRecord;
  576. } RIL_CDMA_CallWaiting_v5;
  577. typedef struct {
  578. char * number; /* Remote party number */
  579. int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
  580. char * name; /* Remote party name */
  581. RIL_CDMA_SignalInfoRecord signalInfoRecord;
  582. /* Number type/Number plan required to support International Call Waiting */
  583. int number_type; /* 0=Unknown, 1=International, 2=National,
  584. 3=Network specific, 4=subscriber */
  585. int number_plan; /* 0=Unknown, 1=ISDN, 3=Data, 4=Telex, 8=Nat'l, 9=Private */
  586. } RIL_CDMA_CallWaiting_v6;
  587. /**
  588. * Which types of Cell Broadcast Message (CBM) are to be received by the ME
  589. *
  590. * uFromServiceID - uToServiceID defines a range of CBM message identifiers
  591. * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
  592. * and 9.4.4.2.2 for UMTS. All other values can be treated as empty
  593. * CBM message ID.
  594. *
  595. * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
  596. * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
  597. * and 9.4.4.2.3 for UMTS.
  598. * All other values can be treated as empty CBM data coding scheme.
  599. *
  600. * selected 0 means message types specified in <fromServiceId, toServiceId>
  601. * and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted.
  602. *
  603. * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and
  604. * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG.
  605. */
  606. typedef struct {
  607. int fromServiceId;
  608. int toServiceId;
  609. int fromCodeScheme;
  610. int toCodeScheme;
  611. unsigned char selected;
  612. } RIL_GSM_BroadcastSmsConfigInfo;
  613. /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
  614. #define RIL_RESTRICTED_STATE_NONE 0x00
  615. /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
  616. #define RIL_RESTRICTED_STATE_CS_EMERGENCY 0x01
  617. /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
  618. #define RIL_RESTRICTED_STATE_CS_NORMAL 0x02
  619. /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
  620. #define RIL_RESTRICTED_STATE_CS_ALL 0x04
  621. /* Block packet data access due to restriction. */
  622. #define RIL_RESTRICTED_STATE_PS_ALL 0x10
  623. /* The status for an OTASP/OTAPA session */
  624. typedef enum {
  625. CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED,
  626. CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED,
  627. CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED,
  628. CDMA_OTA_PROVISION_STATUS_SSD_UPDATED,
  629. CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED,
  630. CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED,
  631. CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED,
  632. CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED,
  633. CDMA_OTA_PROVISION_STATUS_COMMITTED,
  634. CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED,
  635. CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED,
  636. CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED
  637. } RIL_CDMA_OTA_ProvisionStatus;
  638. typedef struct {
  639. int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
  640. int bitErrorRate; /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
  641. } RIL_GW_SignalStrength;
  642. typedef struct {
  643. int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
  644. int bitErrorRate; /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
  645. } RIL_SignalStrengthWcdma;
  646. typedef struct {
  647. int dbm; /* Valid values are positive integers. This value is the actual RSSI value
  648. * multiplied by -1. Example: If the actual RSSI is -75, then this response
  649. * value will be 75.
  650. */
  651. int ecio; /* Valid values are positive integers. This value is the actual Ec/Io multiplied
  652. * by -10. Example: If the actual Ec/Io is -12.5 dB, then this response value
  653. * will be 125.
  654. */
  655. } RIL_CDMA_SignalStrength;
  656. typedef struct {
  657. int dbm; /* Valid values are positive integers. This value is the actual RSSI value
  658. * multiplied by -1. Example: If the actual RSSI is -75, then this response
  659. * value will be 75.
  660. */
  661. int ecio; /* Valid values are positive integers. This value is the actual Ec/Io multiplied
  662. * by -10. Example: If the actual Ec/Io is -12.5 dB, then this response value
  663. * will be 125.
  664. */
  665. int signalNoiseRatio; /* Valid values are 0-8. 8 is the highest signal to noise ratio. */
  666. } RIL_EVDO_SignalStrength;
  667. typedef struct {
  668. int dbm;
  669. int ecno;
  670. } RIL_ATT_SignalStrength;
  671. typedef struct {
  672. int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
  673. int rsrp; /* The current Reference Signal Receive Power in dBm multipled by -1.
  674. * Range: 44 to 140 dBm
  675. * INT_MAX: 0x7FFFFFFF denotes invalid value.
  676. * Reference: 3GPP TS 36.133 9.1.4 */
  677. int rsrq; /* The current Reference Signal Receive Quality in dB multiplied by -1.
  678. * Range: 20 to 3 dB.
  679. * INT_MAX: 0x7FFFFFFF denotes invalid value.
  680. * Reference: 3GPP TS 36.133 9.1.7 */
  681. int rssnr; /* The current reference signal signal-to-noise ratio in 0.1 dB units.
  682. * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
  683. * INT_MAX : 0x7FFFFFFF denotes invalid value.
  684. * Reference: 3GPP TS 36.101 8.1.1 */
  685. int cqi; /* The current Channel Quality Indicator.
  686. * Range: 0 to 15.
  687. * INT_MAX : 0x7FFFFFFF denotes invalid value.
  688. * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
  689. } RIL_LTE_SignalStrength;
  690. typedef struct {
  691. int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
  692. int rsrp; /* The current Reference Signal Receive Power in dBm multipled by -1.
  693. * Range: 44 to 140 dBm
  694. * INT_MAX: 0x7FFFFFFF denotes invalid value.
  695. * Reference: 3GPP TS 36.133 9.1.4 */
  696. int rsrq; /* The current Reference Signal Receive Quality in dB multiplied by -1.
  697. * Range: 20 to 3 dB.
  698. * INT_MAX: 0x7FFFFFFF denotes invalid value.
  699. * Reference: 3GPP TS 36.133 9.1.7 */
  700. int rssnr; /* The current reference signal signal-to-noise ratio in 0.1 dB units.
  701. * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
  702. * INT_MAX : 0x7FFFFFFF denotes invalid value.
  703. * Reference: 3GPP TS 36.101 8.1.1 */
  704. int cqi; /* The current Channel Quality Indicator.
  705. * Range: 0 to 15.
  706. * INT_MAX : 0x7FFFFFFF denotes invalid value.
  707. * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
  708. int timingAdvance; /* timing advance in micro seconds for a one way trip from cell to device.
  709. * Approximate distance can be calculated using 300m/us * timingAdvance.
  710. * Range: 0 to 0x7FFFFFFE
  711. * INT_MAX : 0x7FFFFFFF denotes invalid value.
  712. * Reference: 3GPP 36.321 section 6.1.3.5
  713. * also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html */
  714. } RIL_LTE_SignalStrength_v8;
  715. typedef struct {
  716. int rscp; /* The Received Signal Code Power in dBm multipled by -1.
  717. * Range : 25 to 120
  718. * INT_MAX: 0x7FFFFFFF denotes invalid value.
  719. * Reference: 3GPP TS 25.123, section 9.1.1.1 */
  720. } RIL_TD_SCDMA_SignalStrength_CAF;
  721. /* Deprecated, use RIL_SignalStrength_v6 */
  722. typedef struct {
  723. RIL_GW_SignalStrength GW_SignalStrength;
  724. RIL_CDMA_SignalStrength CDMA_SignalStrength;
  725. RIL_EVDO_SignalStrength EVDO_SignalStrength;
  726. } RIL_SignalStrength_v5;
  727. typedef struct {
  728. RIL_GW_SignalStrength GW_SignalStrength;
  729. RIL_CDMA_SignalStrength CDMA_SignalStrength;
  730. RIL_EVDO_SignalStrength EVDO_SignalStrength;
  731. RIL_LTE_SignalStrength LTE_SignalStrength;
  732. } RIL_SignalStrength_v6;
  733. typedef struct {
  734. RIL_GW_SignalStrength GW_SignalStrength;
  735. RIL_CDMA_SignalStrength CDMA_SignalStrength;
  736. RIL_EVDO_SignalStrength EVDO_SignalStrength;
  737. RIL_LTE_SignalStrength_v8 LTE_SignalStrength;
  738. } RIL_SignalStrength_v8;
  739. typedef struct {
  740. RIL_GW_SignalStrength GW_SignalStrength;
  741. RIL_CDMA_SignalStrength CDMA_SignalStrength;
  742. RIL_EVDO_SignalStrength EVDO_SignalStrength;
  743. RIL_LTE_SignalStrength_v8 LTE_SignalStrength;
  744. RIL_TD_SCDMA_SignalStrength_CAF TD_SCDMA_SignalStrength;
  745. } RIL_SignalStrength_v9_CAF;
  746. typedef struct {
  747. RIL_GW_SignalStrength GW_SignalStrength;
  748. RIL_CDMA_SignalStrength CDMA_SignalStrength;
  749. RIL_EVDO_SignalStrength EVDO_SignalStrength;
  750. RIL_ATT_SignalStrength ATT_SignalStrength;
  751. RIL_LTE_SignalStrength LTE_SignalStrength;
  752. } RIL_SignalStrength_HTC;
  753. /** RIL_CellIdentityGsm */
  754. typedef struct {
  755. int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
  756. int mnc; /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
  757. int lac; /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown */
  758. int cid; /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown */
  759. } RIL_CellIdentityGsm;
  760. /** RIL_CellIdentityWcdma */
  761. typedef struct {
  762. int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
  763. int mnc; /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
  764. int lac; /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown */
  765. int cid; /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown */
  766. int psc; /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */
  767. } RIL_CellIdentityWcdma;
  768. /** RIL_CellIdentityCdma */
  769. typedef struct {
  770. int networkId; /* Network Id 0..65535, INT_MAX if unknown */
  771. int systemId; /* CDMA System Id 0..32767, INT_MAX if unknown */
  772. int basestationId; /* Base Station Id 0..65535, INT_MAX if unknown */
  773. int longitude; /* Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
  774. * It is represented in units of 0.25 seconds and ranges from -2592000
  775. * to 2592000, both values inclusive (corresponding to a range of -180
  776. * to +180 degrees). INT_MAX if unknown */
  777. int latitude; /* Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
  778. * It is represented in units of 0.25 seconds and ranges from -1296000
  779. * to 1296000, both values inclusive (corresponding to a range of -90
  780. * to +90 degrees). INT_MAX if unknown */
  781. } RIL_CellIdentityCdma;
  782. /** RIL_CellIdentityLte */
  783. typedef struct {
  784. int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
  785. int mnc; /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
  786. int ci; /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */
  787. int pci; /* physical cell id 0..503, INT_MAX if unknown */
  788. int tac; /* 16-bit tracking area code, INT_MAX if unknown */
  789. } RIL_CellIdentityLte;
  790. /** RIL_CellInfoGsm */
  791. typedef struct {
  792. RIL_CellIdentityGsm cellIdentityGsm;
  793. RIL_GW_SignalStrength signalStrengthGsm;
  794. } RIL_CellInfoGsm;
  795. /** RIL_CellInfoWcdma */
  796. typedef struct {
  797. RIL_CellIdentityWcdma cellIdentityWcdma;
  798. RIL_SignalStrengthWcdma signalStrengthWcdma;
  799. } RIL_CellInfoWcdma;
  800. /** RIL_CellInfoCdma */
  801. typedef struct {
  802. RIL_CellIdentityCdma cellIdentityCdma;
  803. RIL_CDMA_SignalStrength signalStrengthCdma;
  804. RIL_EVDO_SignalStrength signalStrengthEvdo;
  805. } RIL_CellInfoCdma;
  806. /** RIL_CellInfoLte */
  807. typedef struct {
  808. RIL_CellIdentityLte cellIdentityLte;
  809. RIL_LTE_SignalStrength_v8 signalStrengthLte;
  810. } RIL_CellInfoLte;
  811. // Must be the same as CellInfo.TYPE_XXX
  812. typedef enum {
  813. RIL_CELL_INFO_TYPE_GSM = 1,
  814. RIL_CELL_INFO_TYPE_CDMA = 2,
  815. RIL_CELL_INFO_TYPE_LTE = 3,
  816. RIL_CELL_INFO_TYPE_WCDMA = 4,
  817. } RIL_CellInfoType;
  818. // Must be the same as CellInfo.TIMESTAMP_TYPE_XXX
  819. typedef enum {
  820. RIL_TIMESTAMP_TYPE_UNKNOWN = 0,
  821. RIL_TIMESTAMP_TYPE_ANTENNA = 1,
  822. RIL_TIMESTAMP_TYPE_MODEM = 2,
  823. RIL_TIMESTAMP_TYPE_OEM_RIL = 3,
  824. RIL_TIMESTAMP_TYPE_JAVA_RIL = 4,
  825. } RIL_TimeStampType;
  826. typedef struct {
  827. RIL_CellInfoType cellInfoType; /* cell type for selecting from union CellInfo */
  828. int registered; /* !0 if this cell is registered 0 if not registered */
  829. RIL_TimeStampType timeStampType; /* type of time stamp represented by timeStamp */
  830. uint64_t timeStamp; /* Time in nanos as returned by ril_nano_time */
  831. union {
  832. RIL_CellInfoGsm gsm;
  833. RIL_CellInfoCdma cdma;
  834. RIL_CellInfoLte lte;
  835. RIL_CellInfoWcdma wcdma;
  836. } CellInfo;
  837. } RIL_CellInfo;
  838. /* Names of the CDMA info records (C.S0005 section 3.7.5) */
  839. typedef enum {
  840. RIL_CDMA_DISPLAY_INFO_REC,
  841. RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC,
  842. RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC,
  843. RIL_CDMA_CONNECTED_NUMBER_INFO_REC,
  844. RIL_CDMA_SIGNAL_INFO_REC,
  845. RIL_CDMA_REDIRECTING_NUMBER_INFO_REC,
  846. RIL_CDMA_LINE_CONTROL_INFO_REC,
  847. RIL_CDMA_EXTENDED_DISPLAY_INFO_REC,
  848. RIL_CDMA_T53_CLIR_INFO_REC,
  849. RIL_CDMA_T53_RELEASE_INFO_REC,
  850. RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC
  851. } RIL_CDMA_InfoRecName;
  852. /* Display Info Rec as defined in C.S0005 section 3.7.5.1
  853. Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
  854. Note: the Extended Display info rec contains multiple records of the
  855. form: display_tag, display_len, and display_len occurrences of the
  856. chari field if the display_tag is not 10000000 or 10000001.
  857. To save space, the records are stored consecutively in a byte buffer.
  858. The display_tag, display_len and chari fields are all 1 byte.
  859. */
  860. typedef struct {
  861. char alpha_len;
  862. char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH];
  863. } RIL_CDMA_DisplayInfoRecord;
  864. /* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
  865. Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
  866. Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
  867. */
  868. typedef struct {
  869. char len;
  870. char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH];
  871. char number_type;
  872. char number_plan;
  873. char pi;
  874. char si;
  875. } RIL_CDMA_NumberInfoRecord;
  876. /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
  877. typedef enum {
  878. RIL_REDIRECTING_REASON_UNKNOWN = 0,
  879. RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1,
  880. RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2,
  881. RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9,
  882. RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
  883. RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15,
  884. RIL_REDIRECTING_REASON_RESERVED
  885. } RIL_CDMA_RedirectingReason;
  886. typedef struct {
  887. RIL_CDMA_NumberInfoRecord redirectingNumber;
  888. /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */
  889. RIL_CDMA_RedirectingReason redirectingReason;
  890. } RIL_CDMA_RedirectingNumberInfoRecord;
  891. /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
  892. typedef struct {
  893. char lineCtrlPolarityIncluded;
  894. char lineCtrlToggle;
  895. char lineCtrlReverse;
  896. char lineCtrlPowerDenial;
  897. } RIL_CDMA_LineControlInfoRecord;
  898. /* T53 CLIR Information Record */
  899. typedef struct {
  900. char cause;
  901. } RIL_CDMA_T53_CLIRInfoRecord;
  902. /* T53 Audio Control Information Record */
  903. typedef struct {
  904. char upLink;
  905. char downLink;
  906. } RIL_CDMA_T53_AudioControlInfoRecord;
  907. typedef struct {
  908. RIL_CDMA_InfoRecName name;
  909. union {
  910. /* Display and Extended Display Info Rec */
  911. RIL_CDMA_DisplayInfoRecord display;
  912. /* Called Party Number, Calling Party Number, Connected Number Info Rec */
  913. RIL_CDMA_NumberInfoRecord number;
  914. /* Signal Info Rec */
  915. RIL_CDMA_SignalInfoRecord signal;
  916. /* Redirecting Number Info Rec */
  917. RIL_CDMA_RedirectingNumberInfoRecord redir;
  918. /* Line Control Info Rec */
  919. RIL_CDMA_LineControlInfoRecord lineCtrl;
  920. /* T53 CLIR Info Rec */
  921. RIL_CDMA_T53_CLIRInfoRecord clir;
  922. /* T53 Audio Control Info Rec */
  923. RIL_CDMA_T53_AudioControlInfoRecord audioCtrl;
  924. } rec;
  925. } RIL_CDMA_InformationRecord;
  926. #define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10
  927. typedef struct {
  928. char numberOfInfoRecs;
  929. RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS];
  930. } RIL_CDMA_InformationRecords;
  931. /* Data Call Profile: Simple IP User Profile Parameters*/
  932. typedef struct {
  933. int profileId;
  934. int priority; /* priority. [0..255], 0 - highest */
  935. } RIL_DataCallProfileInfo;
  936. typedef enum {
  937. SS_CFU,
  938. SS_CF_BUSY,
  939. SS_CF_NO_REPLY,
  940. SS_CF_NOT_REACHABLE,
  941. SS_CF_ALL,
  942. SS_CF_ALL_CONDITIONAL,
  943. SS_CLIP,
  944. SS_CLIR,
  945. SS_COLP,
  946. SS_COLR,
  947. SS_WAIT,
  948. SS_BAOC,
  949. SS_BAOIC,
  950. SS_BAOIC_EXC_HOME,
  951. SS_BAIC,
  952. SS_BAIC_ROAMING,
  953. SS_ALL_BARRING,
  954. SS_OUTGOING_BARRING,
  955. SS_INCOMING_BARRING
  956. } RIL_SsServiceType;
  957. typedef enum {
  958. SS_ACTIVATION,
  959. SS_DEACTIVATION,
  960. SS_INTERROGATION,
  961. SS_REGISTRATION,
  962. SS_ERASURE
  963. } RIL_SsRequestType;
  964. typedef enum {
  965. SS_ALL_TELE_AND_BEARER_SERVICES,
  966. SS_ALL_TELESEVICES,
  967. SS_TELEPHONY,
  968. SS_ALL_DATA_TELESERVICES,
  969. SS_SMS_SERVICES,
  970. SS_ALL_TELESERVICES_EXCEPT_SMS
  971. } RIL_SsTeleserviceType;
  972. #define SS_INFO_MAX 4
  973. #define NUM_SERVICE_CLASSES 7
  974. typedef struct {
  975. int numValidIndexes; /* This gives the number of valid values in cfInfo.
  976. For example if voice is forwarded to one number and data
  977. is forwarded to a different one then numValidIndexes will be
  978. 2 indicating total number of valid values in cfInfo.
  979. Similarly if all the services are forwarded to the same
  980. number then the value of numValidIndexes will be 1. */
  981. RIL_CallForwardInfo cfInfo[NUM_SERVICE_CLASSES]; /* This is the response data
  982. for SS request to query call
  983. forward status. see
  984. RIL_REQUEST_QUERY_CALL_FORWARD_STATUS */
  985. } RIL_CfData;
  986. typedef struct {
  987. RIL_SsServiceType serviceType;
  988. RIL_SsRequestType requestType;
  989. RIL_SsTeleserviceType teleserviceType;
  990. int serviceClass;
  991. RIL_Errno result;
  992. union {
  993. int ssInfo[SS_INFO_MAX]; /* This is the response data for most of the SS GET/SET
  994. RIL requests. E.g. RIL_REQUSET_GET_CLIR returns
  995. two ints, so first two values of ssInfo[] will be
  996. used for response if serviceType is SS_CLIR and
  997. requestType is SS_INTERROGATION */
  998. RIL_CfData cfData;
  999. };
  1000. } RIL_StkCcUnsolSsResponse;
  1001. /**
  1002. * RIL_REQUEST_GET_SIM_STATUS
  1003. *
  1004. * Requests status of the SIM interface and the SIM card
  1005. *
  1006. * "data" is NULL
  1007. *
  1008. * "response" is const RIL_CardStatus_v6 *
  1009. *
  1010. * Valid errors:
  1011. * Must never fail
  1012. */
  1013. #define RIL_REQUEST_GET_SIM_STATUS 1
  1014. /**
  1015. * RIL_REQUEST_ENTER_SIM_PIN
  1016. *
  1017. * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
  1018. *
  1019. * "data" is con…