/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

  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 const char **
  1020. * ((const char **)data)[0] is PIN value
  1021. * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1022. *
  1023. * "response" is int *
  1024. * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1025. *
  1026. * Valid errors:
  1027. *
  1028. * SUCCESS
  1029. * RADIO_NOT_AVAILABLE (radio resetting)
  1030. * GENERIC_FAILURE
  1031. * PASSWORD_INCORRECT
  1032. */
  1033. #define RIL_REQUEST_ENTER_SIM_PIN 2
  1034. /**
  1035. * RIL_REQUEST_ENTER_SIM_PUK
  1036. *
  1037. * Supplies SIM PUK and new PIN.
  1038. *
  1039. * "data" is const char **
  1040. * ((const char **)data)[0] is PUK value
  1041. * ((const char **)data)[1] is new PIN value
  1042. * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1043. *
  1044. * "response" is int *
  1045. * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1046. *
  1047. * Valid errors:
  1048. *
  1049. * SUCCESS
  1050. * RADIO_NOT_AVAILABLE (radio resetting)
  1051. * GENERIC_FAILURE
  1052. * PASSWORD_INCORRECT
  1053. * (PUK is invalid)
  1054. */
  1055. #define RIL_REQUEST_ENTER_SIM_PUK 3
  1056. /**
  1057. * RIL_REQUEST_ENTER_SIM_PIN2
  1058. *
  1059. * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
  1060. * returned as a a failure from a previous operation.
  1061. *
  1062. * "data" is const char **
  1063. * ((const char **)data)[0] is PIN2 value
  1064. * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1065. *
  1066. * "response" is int *
  1067. * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1068. *
  1069. * Valid errors:
  1070. *
  1071. * SUCCESS
  1072. * RADIO_NOT_AVAILABLE (radio resetting)
  1073. * GENERIC_FAILURE
  1074. * PASSWORD_INCORRECT
  1075. */
  1076. #define RIL_REQUEST_ENTER_SIM_PIN2 4
  1077. /**
  1078. * RIL_REQUEST_ENTER_SIM_PUK2
  1079. *
  1080. * Supplies SIM PUK2 and new PIN2.
  1081. *
  1082. * "data" is const char **
  1083. * ((const char **)data)[0] is PUK2 value
  1084. * ((const char **)data)[1] is new PIN2 value
  1085. * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1086. *
  1087. * "response" is int *
  1088. * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1089. *
  1090. * Valid errors:
  1091. *
  1092. * SUCCESS
  1093. * RADIO_NOT_AVAILABLE (radio resetting)
  1094. * GENERIC_FAILURE
  1095. * PASSWORD_INCORRECT
  1096. * (PUK2 is invalid)
  1097. */
  1098. #define RIL_REQUEST_ENTER_SIM_PUK2 5
  1099. /**
  1100. * RIL_REQUEST_CHANGE_SIM_PIN
  1101. *
  1102. * Supplies old SIM PIN and new PIN.
  1103. *
  1104. * "data" is const char **
  1105. * ((const char **)data)[0] is old PIN value
  1106. * ((const char **)data)[1] is new PIN value
  1107. * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1108. *
  1109. * "response" is int *
  1110. * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1111. *
  1112. * Valid errors:
  1113. *
  1114. * SUCCESS
  1115. * RADIO_NOT_AVAILABLE (radio resetting)
  1116. * GENERIC_FAILURE
  1117. * PASSWORD_INCORRECT
  1118. * (old PIN is invalid)
  1119. *
  1120. */
  1121. #define RIL_REQUEST_CHANGE_SIM_PIN 6
  1122. /**
  1123. * RIL_REQUEST_CHANGE_SIM_PIN2
  1124. *
  1125. * Supplies old SIM PIN2 and new PIN2.
  1126. *
  1127. * "data" is const char **
  1128. * ((const char **)data)[0] is old PIN2 value
  1129. * ((const char **)data)[1] is new PIN2 value
  1130. * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1131. *
  1132. * "response" is int *
  1133. * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1134. *
  1135. * Valid errors:
  1136. *
  1137. * SUCCESS
  1138. * RADIO_NOT_AVAILABLE (radio resetting)
  1139. * GENERIC_FAILURE
  1140. * PASSWORD_INCORRECT
  1141. * (old PIN2 is invalid)
  1142. *
  1143. */
  1144. #define RIL_REQUEST_CHANGE_SIM_PIN2 7
  1145. /**
  1146. * RIL_REQUEST_ENTER_DEPERSONALIZATION_CODE
  1147. *
  1148. * Requests that personlization be deactivated
  1149. *
  1150. * "data" is const char **
  1151. * ((const char **)(data))[0]] is personlization type
  1152. * ((const char **)(data))[1]] is depersonlization code
  1153. *
  1154. * "response" is int *
  1155. * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1156. *
  1157. * Valid errors:
  1158. *
  1159. * SUCCESS
  1160. * RADIO_NOT_AVAILABLE (radio resetting)
  1161. * GENERIC_FAILURE
  1162. * PASSWORD_INCORRECT
  1163. * (code is invalid)
  1164. */
  1165. #define RIL_REQUEST_ENTER_DEPERSONALIZATION_CODE 8
  1166. /**
  1167. * RIL_REQUEST_GET_CURRENT_CALLS
  1168. *
  1169. * Requests current call list
  1170. *
  1171. * "data" is NULL
  1172. *
  1173. * "response" must be a "const RIL_Call **"
  1174. *
  1175. * Valid errors:
  1176. *
  1177. * SUCCESS
  1178. * RADIO_NOT_AVAILABLE (radio resetting)
  1179. * GENERIC_FAILURE
  1180. * (request will be made again in a few hundred msec)
  1181. */
  1182. #define RIL_REQUEST_GET_CURRENT_CALLS 9
  1183. /**
  1184. * RIL_REQUEST_DIAL
  1185. *
  1186. * Initiate voice call
  1187. *
  1188. * "data" is const RIL_Dial *
  1189. * "response" is NULL
  1190. *
  1191. * This method is never used for supplementary service codes
  1192. *
  1193. * Valid errors:
  1194. * SUCCESS
  1195. * RADIO_NOT_AVAILABLE (radio resetting)
  1196. * DIAL_MODIFIED_TO_USSD
  1197. * DIAL_MODIFIED_TO_SS
  1198. * DIAL_MODIFIED_TO_DIAL
  1199. * GENERIC_FAILURE
  1200. */
  1201. #define RIL_REQUEST_DIAL 10
  1202. /**
  1203. * RIL_REQUEST_GET_IMSI
  1204. *
  1205. * Get the SIM IMSI
  1206. *
  1207. * Only valid when radio state is "RADIO_STATE_ON"
  1208. *
  1209. * "data" is const char **
  1210. * ((const char **)data)[0] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1211. * "response" is a const char * containing the IMSI
  1212. *
  1213. * Valid errors:
  1214. * SUCCESS
  1215. * RADIO_NOT_AVAILABLE (radio resetting)
  1216. * GENERIC_FAILURE
  1217. */
  1218. #define RIL_REQUEST_GET_IMSI 11
  1219. /**
  1220. * RIL_REQUEST_HANGUP
  1221. *
  1222. * Hang up a specific line (like AT+CHLD=1x)
  1223. *
  1224. * After this HANGUP request returns, RIL should show the connection is NOT
  1225. * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
  1226. *
  1227. * "data" is an int *
  1228. * (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
  1229. *
  1230. * "response" is NULL
  1231. *
  1232. * Valid errors:
  1233. * SUCCESS
  1234. * RADIO_NOT_AVAILABLE (radio resetting)
  1235. * GENERIC_FAILURE
  1236. */
  1237. #define RIL_REQUEST_HANGUP 12
  1238. /**
  1239. * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
  1240. *
  1241. * Hang up waiting or held (like AT+CHLD=0)
  1242. *
  1243. * After this HANGUP request returns, RIL should show the connection is NOT
  1244. * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
  1245. *
  1246. * "data" is NULL
  1247. * "response" is NULL
  1248. *
  1249. * Valid errors:
  1250. * SUCCESS
  1251. * RADIO_NOT_AVAILABLE (radio resetting)
  1252. * GENERIC_FAILURE
  1253. */
  1254. #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
  1255. /**
  1256. * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
  1257. *
  1258. * Hang up waiting or held (like AT+CHLD=1)
  1259. *
  1260. * After this HANGUP request returns, RIL should show the connection is NOT
  1261. * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
  1262. *
  1263. * "data" is NULL
  1264. * "response" is NULL
  1265. *
  1266. * Valid errors:
  1267. * SUCCESS
  1268. * RADIO_NOT_AVAILABLE (radio resetting)
  1269. * GENERIC_FAILURE
  1270. */
  1271. #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
  1272. /**
  1273. * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
  1274. *
  1275. * Switch waiting or holding call and active call (like AT+CHLD=2)
  1276. *
  1277. * State transitions should be is follows:
  1278. *
  1279. * If call 1 is waiting and call 2 is active, then if this re
  1280. *
  1281. * BEFORE AFTER
  1282. * Call 1 Call 2 Call 1 Call 2
  1283. * ACTIVE HOLDING HOLDING ACTIVE
  1284. * ACTIVE WAITING HOLDING ACTIVE
  1285. * HOLDING WAITING HOLDING ACTIVE
  1286. * ACTIVE IDLE HOLDING IDLE
  1287. * IDLE IDLE IDLE IDLE
  1288. *
  1289. * "data" is NULL
  1290. * "response" is NULL
  1291. *
  1292. * Valid errors:
  1293. * SUCCESS
  1294. * RADIO_NOT_AVAILABLE (radio resetting)
  1295. * GENERIC_FAILURE
  1296. */
  1297. #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
  1298. #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
  1299. /**
  1300. * RIL_REQUEST_CONFERENCE
  1301. *
  1302. * Conference holding and active (like AT+CHLD=3)
  1303. * "data" is NULL
  1304. * "response" is NULL
  1305. *
  1306. * Valid errors:
  1307. * SUCCESS
  1308. * RADIO_NOT_AVAILABLE (radio resetting)
  1309. * GENERIC_FAILURE
  1310. */
  1311. #define RIL_REQUEST_CONFERENCE 16
  1312. /**
  1313. * RIL_REQUEST_UDUB
  1314. *
  1315. * Send UDUB (user determined used busy) to ringing or
  1316. * waiting call answer)(RIL_BasicRequest r);
  1317. *
  1318. * "data" is NULL
  1319. * "response" is NULL
  1320. *
  1321. * Valid errors:
  1322. * SUCCESS
  1323. * RADIO_NOT_AVAILABLE (radio resetting)
  1324. * GENERIC_FAILURE
  1325. */
  1326. #define RIL_REQUEST_UDUB 17
  1327. /**
  1328. * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
  1329. *
  1330. * Requests the failure cause code for the most recently terminated call
  1331. *
  1332. * "data" is NULL
  1333. * "response" is a "int *"
  1334. * ((int *)response)[0] is RIL_LastCallFailCause. GSM failure reasons are
  1335. * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
  1336. * failure reasons are derived from the possible call failure scenarios
  1337. * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
  1338. *
  1339. * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
  1340. * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
  1341. *
  1342. * If the implementation does not have access to the exact cause codes,
  1343. * then it should return one of the values listed in RIL_LastCallFailCause,
  1344. * as the UI layer needs to distinguish these cases for tone generation or
  1345. * error notification.
  1346. *
  1347. * Valid errors:
  1348. * SUCCESS
  1349. * RADIO_NOT_AVAILABLE
  1350. * GENERIC_FAILURE
  1351. *
  1352. * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
  1353. */
  1354. #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
  1355. /**
  1356. * RIL_REQUEST_SIGNAL_STRENGTH
  1357. *
  1358. * Requests current signal strength and associated information
  1359. *
  1360. * Must succeed if radio is on.
  1361. *
  1362. * "data" is NULL
  1363. *
  1364. * "response" is a const RIL_SignalStrength *
  1365. *
  1366. * Valid errors:
  1367. * SUCCESS
  1368. * RADIO_NOT_AVAILABLE
  1369. */
  1370. #define RIL_REQUEST_SIGNAL_STRENGTH 19
  1371. /**
  1372. * RIL_REQUEST_VOICE_REGISTRATION_STATE
  1373. *
  1374. * Request current registration state
  1375. *
  1376. * "data" is NULL
  1377. * "response" is a "char **"
  1378. * ((const char **)response)[0] is registration state 0-6,
  1379. * 0 - Not registered, MT is not currently searching
  1380. * a new operator to register
  1381. * 1 - Registered, home network
  1382. * 2 - Not registered, but MT is currently searching
  1383. * a new operator to register
  1384. * 3 - Registration denied
  1385. * 4 - Unknown
  1386. * 5 - Registered, roaming
  1387. * 10 - Same as 0, but indicates that emergency calls
  1388. * are enabled.
  1389. * 12 - Same as 2, but indicates that emergency calls
  1390. * are enabled.
  1391. * 13 - Same as 3, but indicates that emergency calls
  1392. * are enabled.
  1393. * 14 - Same as 4, but indicates that emergency calls
  1394. * are enabled.
  1395. *
  1396. * ((const char **)response)[1] is LAC if registered on a GSM/WCDMA system or
  1397. * NULL if not.Valid LAC are 0x0000 - 0xffff
  1398. * ((const char **)response)[2] is CID if registered on a * GSM/WCDMA or
  1399. * NULL if not.
  1400. * Valid CID are 0x00000000 - 0xffffffff
  1401. * In GSM, CID is Cell ID (see TS 27.007)
  1402. * in 16 bits
  1403. * In UMTS, CID is UMTS Cell Identity
  1404. * (see TS 25.331) in 28 bits
  1405. * ((const char **)response)[3] indicates the available voice radio technology,
  1406. * valid values as defined by RIL_RadioTechnology.
  1407. * ((const char **)response)[4] is Base Station ID if registered on a CDMA
  1408. * system or NULL if not. Base Station ID in
  1409. * decimal format
  1410. * ((const char **)response)[5] is Base Station latitude if registered on a
  1411. * CDMA system or NULL if not. Base Station
  1412. * latitude is a decimal number as specified in
  1413. * 3GPP2 C.S0005-A v6.0. It is represented in
  1414. * units of 0.25 seconds and ranges from -1296000
  1415. * to 1296000, both values inclusive (corresponding
  1416. * to a range of -90 to +90 degrees).
  1417. * ((const char **)response)[6] is Base Station longitude if registered on a
  1418. * CDMA system or NULL if not. Base Station
  1419. * longitude is a decimal number as specified in
  1420. * 3GPP2 C.S0005-A v6.0. It is represented in
  1421. * units of 0.25 seconds and ranges from -2592000
  1422. * to 2592000, both values inclusive (corresponding
  1423. * to a range of -180 to +180 degrees).
  1424. * ((const char **)response)[7] is concurrent services support indicator if
  1425. * registered on a CDMA system 0-1.
  1426. * 0 - Concurrent services not supported,
  1427. * 1 - Concurrent services supported
  1428. * ((const char **)response)[8] is System ID if registered on a CDMA system or
  1429. * NULL if not. Valid System ID are 0 - 32767
  1430. * ((const char **)response)[9] is Network ID if registered on a CDMA system or
  1431. * NULL if not. Valid System ID are 0 - 65535
  1432. * ((const char **)response)[10] is the TSB-58 Roaming Indicator if registered
  1433. * on a CDMA or EVDO system or NULL if not. Valid values
  1434. * are 0-255.
  1435. * ((const char **)response)[11] indicates whether the current system is in the
  1436. * PRL if registered on a CDMA or EVDO system or NULL if
  1437. * not. 0=not in the PRL, 1=in the PRL
  1438. * ((const char **)response)[12] is the default Roaming Indicator from the PRL,
  1439. * if registered on a CDMA or EVDO system or NULL if not.
  1440. * Valid values are 0-255.
  1441. * ((const char **)response)[13] if registration state is 3 (Registration
  1442. * denied) this is an enumerated reason why
  1443. * registration was denied. See 3GPP TS 24.008,
  1444. * 10.5.3.6 and Annex G.
  1445. * 0 - General
  1446. * 1 - Authentication Failure
  1447. * 2 - IMSI unknown in HLR
  1448. * 3 - Illegal MS
  1449. * 4 - Illegal ME
  1450. * 5 - PLMN not allowed
  1451. * 6 - Location area not allowed
  1452. * 7 - Roaming not allowed
  1453. * 8 - No Suitable Cells in this Location Area
  1454. * 9 - Network failure
  1455. * 10 - Persistent location update reject
  1456. * 11 - PLMN not allowed
  1457. * 12 - Location area not allowed
  1458. * 13 - Roaming not allowed in this Location Area
  1459. * 15 - No Suitable Cells in this Location Area
  1460. * 17 - Network Failure
  1461. * 20 - MAC Failure
  1462. * 21 - Sync Failure
  1463. * 22 - Congestion
  1464. * 23 - GSM Authentication unacceptable
  1465. * 25 - Not Authorized for this CSG
  1466. * 32 - Service option not supported
  1467. * 33 - Requested service option not subscribed
  1468. * 34 - Service option temporarily out of order
  1469. * 38 - Call cannot be identified
  1470. * 48-63 - Retry upon entry into a new cell
  1471. * 95 - Semantically incorrect message
  1472. * 96 - Invalid mandatory information
  1473. * 97 - Message type non-existent or not implemented
  1474. * 98 - Message not compatible with protocol state
  1475. * 99 - Information element non-existent or not implemented
  1476. * 100 - Conditional IE error
  1477. * 101 - Message not compatible with protocol state
  1478. * 111 - Protocol error, unspecified
  1479. * ((const char **)response)[14] is the Primary Scrambling Code of the current
  1480. * cell as described in TS 25.331, in hexadecimal
  1481. * format, or NULL if unknown or not registered
  1482. * to a UMTS network.
  1483. *
  1484. * Please note that registration state 4 ("unknown") is treated
  1485. * as "out of service" in the Android telephony system
  1486. *
  1487. * Registration state 3 can be returned if Location Update Reject
  1488. * (with cause 17 - Network Failure) is received repeatedly from the network,
  1489. * to facilitate "managed roaming"
  1490. *
  1491. * Valid errors:
  1492. * SUCCESS
  1493. * RADIO_NOT_AVAILABLE
  1494. * GENERIC_FAILURE
  1495. */
  1496. #define RIL_REQUEST_VOICE_REGISTRATION_STATE 20
  1497. /**
  1498. * RIL_REQUEST_DATA_REGISTRATION_STATE
  1499. *
  1500. * Request current DATA registration state
  1501. *
  1502. * "data" is NULL
  1503. * "response" is a "char **"
  1504. * ((const char **)response)[0] is registration state 0-5 from TS 27.007 10.1.20 AT+CGREG
  1505. * ((const char **)response)[1] is LAC if registered or NULL if not
  1506. * ((const char **)response)[2] is CID if registered or NULL if not
  1507. * ((const char **)response)[3] indicates the available data radio technology,
  1508. * valid values as defined by RIL_RadioTechnology.
  1509. * ((const char **)response)[4] if registration state is 3 (Registration
  1510. * denied) this is an enumerated reason why
  1511. * registration was denied. See 3GPP TS 24.008,
  1512. * Annex G.6 "Additonal cause codes for GMM".
  1513. * 7 == GPRS services not allowed
  1514. * 8 == GPRS services and non-GPRS services not allowed
  1515. * 9 == MS identity cannot be derived by the network
  1516. * 10 == Implicitly detached
  1517. * 14 == GPRS services not allowed in this PLMN
  1518. * 16 == MSC temporarily not reachable
  1519. * 40 == No PDP context activated
  1520. * ((const char **)response)[5] The maximum number of simultaneous Data Calls that can be
  1521. * established using RIL_REQUEST_SETUP_DATA_CALL.
  1522. *
  1523. * The values at offsets 6..10 are optional LTE location information in decimal.
  1524. * If a value is unknown that value may be NULL. If all values are NULL,
  1525. * none need to be present.
  1526. * ((const char **)response)[6] is TAC, a 16-bit Tracking Area Code.
  1527. * ((const char **)response)[7] is CID, a 0-503 Physical Cell Identifier.
  1528. * ((const char **)response)[8] is ECI, a 28-bit E-UTRAN Cell Identifier.
  1529. * ((const char **)response)[9] is CSGID, a 27-bit Closed Subscriber Group Identity.
  1530. * ((const char **)response)[10] is TADV, a 6-bit timing advance value.
  1531. *
  1532. * LAC and CID are in hexadecimal format.
  1533. * valid LAC are 0x0000 - 0xffff
  1534. * valid CID are 0x00000000 - 0x0fffffff
  1535. *
  1536. * Please note that registration state 4 ("unknown") is treated
  1537. * as "out of service" in the Android telephony system
  1538. *
  1539. * Valid errors:
  1540. * SUCCESS
  1541. * RADIO_NOT_AVAILABLE
  1542. * GENERIC_FAILURE
  1543. */
  1544. #define RIL_REQUEST_DATA_REGISTRATION_STATE 21
  1545. /**
  1546. * RIL_REQUEST_OPERATOR
  1547. *
  1548. * Request current operator ONS or EONS
  1549. *
  1550. * "data" is NULL
  1551. * "response" is a "const char **"
  1552. * ((const char **)response)[0] is long alpha ONS or EONS
  1553. * or NULL if unregistered
  1554. *
  1555. * ((const char **)response)[1] is short alpha ONS or EONS
  1556. * or NULL if unregistered
  1557. * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
  1558. * or NULL if unregistered
  1559. *
  1560. * Valid errors:
  1561. * SUCCESS
  1562. * RADIO_NOT_AVAILABLE
  1563. * GENERIC_FAILURE
  1564. */
  1565. #define RIL_REQUEST_OPERATOR 22
  1566. /**
  1567. * RIL_REQUEST_RADIO_POWER
  1568. *
  1569. * Toggle radio on and off (for "airplane" mode)
  1570. * If the radio is is turned off/on the radio modem subsystem
  1571. * is expected return to an initialized state. For instance,
  1572. * any voice and data calls will be terminated and all associated
  1573. * lists emptied.
  1574. *
  1575. * "data" is int *
  1576. * ((int *)data)[0] is > 0 for "Radio On"
  1577. * ((int *)data)[0] is == 0 for "Radio Off"
  1578. *
  1579. * "response" is NULL
  1580. *
  1581. * Turn radio on if "on" > 0
  1582. * Turn radio off if "on" == 0
  1583. *
  1584. * Valid errors:
  1585. * SUCCESS
  1586. * RADIO_NOT_AVAILABLE
  1587. * GENERIC_FAILURE
  1588. */
  1589. #define RIL_REQUEST_RADIO_POWER 23
  1590. /**
  1591. * RIL_REQUEST_DTMF
  1592. *
  1593. * Send a DTMF tone
  1594. *
  1595. * If the implementation is currently playing a tone requested via
  1596. * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
  1597. * should be played instead
  1598. *
  1599. * "data" is a char * containing a single character with one of 12 values: 0-9,*,#
  1600. * "response" is NULL
  1601. *
  1602. * FIXME should this block/mute microphone?
  1603. * How does this interact with local DTMF feedback?
  1604. *
  1605. * Valid errors:
  1606. * SUCCESS
  1607. * RADIO_NOT_AVAILABLE
  1608. * GENERIC_FAILURE
  1609. *
  1610. * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
  1611. *
  1612. */
  1613. #define RIL_REQUEST_DTMF 24
  1614. /**
  1615. * RIL_REQUEST_SEND_SMS
  1616. *
  1617. * Send an SMS message
  1618. *
  1619. * "data" is const char **
  1620. * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
  1621. * by a length byte (as expected by TS 27.005) or NULL for default SMSC
  1622. * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
  1623. * less the SMSC address
  1624. * TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
  1625. *
  1626. * "response" is a const RIL_SMS_Response *
  1627. *
  1628. * Based on the return error, caller decides to resend if sending sms
  1629. * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
  1630. * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
  1631. *
  1632. * Valid errors:
  1633. * SUCCESS
  1634. * RADIO_NOT_AVAILABLE
  1635. * SMS_SEND_FAIL_RETRY
  1636. * FDN_CHECK_FAILURE
  1637. * GENERIC_FAILURE
  1638. *
  1639. * FIXME how do we specify TP-Message-Reference if we need to resend?
  1640. */
  1641. #define RIL_REQUEST_SEND_SMS 25
  1642. /**
  1643. * RIL_REQUEST_SEND_SMS_EXPECT_MORE
  1644. *
  1645. * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
  1646. * except that more messages are expected to be sent soon. If possible,
  1647. * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
  1648. *
  1649. * "data" is const char **
  1650. * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
  1651. * by a length byte (as expected by TS 27.005) or NULL for default SMSC
  1652. * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
  1653. * less the SMSC address
  1654. * TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
  1655. *
  1656. * "response" is a const RIL_SMS_Response *
  1657. *
  1658. * Based on the return error, caller decides to resend if sending sms
  1659. * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
  1660. * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
  1661. *
  1662. * Valid errors:
  1663. * SUCCESS
  1664. * RADIO_NOT_AVAILABLE
  1665. * SMS_SEND_FAIL_RETRY
  1666. * GENERIC_FAILURE
  1667. *
  1668. */
  1669. #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
  1670. /**
  1671. * RIL_REQUEST_SETUP_DATA_CALL
  1672. *
  1673. * Setup a packet data connection. If RIL_Data_Call_Response_v6.status
  1674. * return success it is added to the list of data calls and a
  1675. * RIL_UNSOL_DATA_CALL_LIST_CHANGED is sent. The call remains in the
  1676. * list until RIL_REQUEST_DEACTIVATE_DATA_CALL is issued or the
  1677. * radio is powered off/on. This list is returned by RIL_REQUEST_DATA_CALL_LIST
  1678. * and RIL_UNSOL_DATA_CALL_LIST_CHANGED.
  1679. *
  1680. * The RIL is expected to:
  1681. * - Create one data call context.
  1682. * - Create and configure a dedicated interface for the context
  1683. * - The interface must be point to point.
  1684. * - The interface is configured with one or more addresses and
  1685. * is capable of sending and receiving packets. The prefix length
  1686. * of the addresses must be /32 for IPv4 and /128 for IPv6.
  1687. * - Must NOT change the linux routing table.
  1688. * - Support up to RIL_REQUEST_DATA_REGISTRATION_STATE response[5]
  1689. * number of simultaneous data call contexts.
  1690. *
  1691. * "data" is a const char **
  1692. * ((const char **)data)[0] Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2...
  1693. * for values above 2 this is RIL_RadioTechnology + 2.
  1694. * ((const char **)data)[1] is a RIL_DataProfile (support is optional)
  1695. * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will
  1696. * override the one in the profile. NULL indicates no APN overrride.
  1697. * ((const char **)data)[3] is the username for APN, or NULL
  1698. * ((const char **)data)[4] is the password for APN, or NULL
  1699. * ((const char **)data)[5] is the PAP / CHAP auth type. Values:
  1700. * 0 => PAP and CHAP is never performed.
  1701. * 1 => PAP may be performed; CHAP is never performed.
  1702. * 2 => CHAP may be performed; PAP is never performed.
  1703. * 3 => PAP / CHAP may be performed - baseband dependent.
  1704. * ((const char **)data)[6] is the connection type to request must be one of the
  1705. * PDP_type values in TS 27.007 section 10.1.1.
  1706. * For example, "IP", "IPV6", "IPV4V6", or "PPP".
  1707. * ((const char **)data)[7] Optional connection property parameters, format to be defined.
  1708. *
  1709. * "response" is a RIL_Data_Call_Response_v6
  1710. *
  1711. * FIXME may need way to configure QoS settings
  1712. *
  1713. * Valid errors:
  1714. * SUCCESS should be returned on both success and failure of setup with
  1715. * the RIL_Data_Call_Response_v6.status containing the actual status.
  1716. * For all other errors the RIL_Data_Call_Resonse_v6 is ignored.
  1717. *
  1718. * Other errors could include:
  1719. * RADIO_NOT_AVAILABLE, GENERIC_FAILURE, OP_NOT_ALLOWED_BEFORE_REG_TO_NW,
  1720. * OP_NOT_ALLOWED_DURING_VOICE_CALL and REQUEST_NOT_SUPPORTED.
  1721. *
  1722. * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL
  1723. */
  1724. #define RIL_REQUEST_SETUP_DATA_CALL 27
  1725. /**
  1726. * RIL_REQUEST_SIM_IO
  1727. *
  1728. * Request SIM I/O operation.
  1729. * This is similar to the TS 27.007 "restricted SIM" operation
  1730. * where it assumes all of the EF selection will be done by the
  1731. * callee.
  1732. *
  1733. * "data" is a const RIL_SIM_IO_v6 *
  1734. * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
  1735. * or may specify a PIN2 for operations that require a PIN2 (eg
  1736. * updating FDN records)
  1737. *
  1738. * "response" is a const RIL_SIM_IO_Response *
  1739. *
  1740. * Arguments and responses that are unused for certain
  1741. * values of "command" should be ignored or set to NULL
  1742. *
  1743. * Valid errors:
  1744. * SUCCESS
  1745. * RADIO_NOT_AVAILABLE
  1746. * GENERIC_FAILURE
  1747. * SIM_PIN2
  1748. * SIM_PUK2
  1749. */
  1750. #define RIL_REQUEST_SIM_IO 28
  1751. /**
  1752. * RIL_REQUEST_SEND_USSD
  1753. *
  1754. * Send a USSD message
  1755. *
  1756. * If a USSD session already exists, the message should be sent in the
  1757. * context of that session. Otherwise, a new session should be created.
  1758. *
  1759. * The network reply should be reported via RIL_UNSOL_ON_USSD
  1760. *
  1761. * Only one USSD session may exist at a time, and the session is assumed
  1762. * to exist until:
  1763. * a) The android system invokes RIL_REQUEST_CANCEL_USSD
  1764. * b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
  1765. * of "0" (USSD-Notify/no further action) or "2" (session terminated)
  1766. *
  1767. * "data" is a const char * containing the USSD request in UTF-8 format
  1768. * "response" is NULL
  1769. *
  1770. * Valid errors:
  1771. * SUCCESS
  1772. * RADIO_NOT_AVAILABLE
  1773. * FDN_CHECK_FAILURE
  1774. * USSD_MODIFIED_TO_DIAL
  1775. * USSD_MODIFIED_TO_SS
  1776. * USSD_MODIFIED_TO_USSD
  1777. * GENERIC_FAILURE
  1778. *
  1779. * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
  1780. */
  1781. #define RIL_REQUEST_SEND_USSD 29
  1782. /**
  1783. * RIL_REQUEST_CANCEL_USSD
  1784. *
  1785. * Cancel the current USSD session if one exists
  1786. *
  1787. * "data" is null
  1788. * "response" is NULL
  1789. *
  1790. * Valid errors:
  1791. * SUCCESS
  1792. * RADIO_NOT_AVAILABLE
  1793. * GENERIC_FAILURE
  1794. */
  1795. #define RIL_REQUEST_CANCEL_USSD 30
  1796. /**
  1797. * RIL_REQUEST_GET_CLIR
  1798. *
  1799. * Gets current CLIR status
  1800. * "data" is NULL
  1801. * "response" is int *
  1802. * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
  1803. * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
  1804. *
  1805. * Valid errors:
  1806. * SUCCESS
  1807. * RADIO_NOT_AVAILABLE
  1808. * SS_MODIFIED_TO_DIAL
  1809. * SS_MODIFIED_TO_USSD
  1810. * SS_MODIFIED_TO_SS
  1811. * GENERIC_FAILURE
  1812. */
  1813. #define RIL_REQUEST_GET_CLIR 31
  1814. /**
  1815. * RIL_REQUEST_SET_CLIR
  1816. *
  1817. * "data" is int *
  1818. * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
  1819. *
  1820. * "response" is NULL
  1821. *
  1822. * Valid errors:
  1823. * SUCCESS
  1824. * RADIO_NOT_AVAILABLE
  1825. * SS_MODIFIED_TO_DIAL
  1826. * SS_MODIFIED_TO_USSD
  1827. * SS_MODIFIED_TO_SS
  1828. * GENERIC_FAILURE
  1829. */
  1830. #define RIL_REQUEST_SET_CLIR 32
  1831. /**
  1832. * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
  1833. *
  1834. * "data" is const RIL_CallForwardInfo *
  1835. *
  1836. * "response" is const RIL_CallForwardInfo **
  1837. * "response" points to an array of RIL_CallForwardInfo *'s, one for
  1838. * each distinct registered phone number.
  1839. *
  1840. * For example, if data is forwarded to +18005551212 and voice is forwarded
  1841. * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
  1842. *
  1843. * If, however, both data and voice are forwarded to +18005551212, then
  1844. * a single RIL_CallForwardInfo can be returned with the service class
  1845. * set to "data + voice = 3")
  1846. *
  1847. * Valid errors:
  1848. * SUCCESS
  1849. * RADIO_NOT_AVAILABLE
  1850. * SS_MODIFIED_TO_DIAL
  1851. * SS_MODIFIED_TO_USSD
  1852. * SS_MODIFIED_TO_SS
  1853. * GENERIC_FAILURE
  1854. */
  1855. #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
  1856. /**
  1857. * RIL_REQUEST_SET_CALL_FORWARD
  1858. *
  1859. * Configure call forward rule
  1860. *
  1861. * "data" is const RIL_CallForwardInfo *
  1862. * "response" is NULL
  1863. *
  1864. * Valid errors:
  1865. * SUCCESS
  1866. * RADIO_NOT_AVAILABLE
  1867. * SS_MODIFIED_TO_DIAL
  1868. * SS_MODIFIED_TO_USSD
  1869. * SS_MODIFIED_TO_SS
  1870. * GENERIC_FAILURE
  1871. */
  1872. #define RIL_REQUEST_SET_CALL_FORWARD 34
  1873. /**
  1874. * RIL_REQUEST_QUERY_CALL_WAITING
  1875. *
  1876. * Query current call waiting state
  1877. *
  1878. * "data" is const int *
  1879. * ((const int *)data)[0] is the TS 27.007 service class to query.
  1880. * "response" is a const int *
  1881. * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
  1882. *
  1883. * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
  1884. * must follow, with the TS 27.007 service class bit vector of services
  1885. * for which call waiting is enabled.
  1886. *
  1887. * For example, if ((const int *)response)[0] is 1 and
  1888. * ((const int *)response)[1] is 3, then call waiting is enabled for data
  1889. * and voice and disabled for everything else
  1890. *
  1891. * Valid errors:
  1892. * SUCCESS
  1893. * RADIO_NOT_AVAILABLE
  1894. * SS_MODIFIED_TO_DIAL
  1895. * SS_MODIFIED_TO_USSD
  1896. * SS_MODIFIED_TO_SS
  1897. * GENERIC_FAILURE
  1898. */
  1899. #define RIL_REQUEST_QUERY_CALL_WAITING 35
  1900. /**
  1901. * RIL_REQUEST_SET_CALL_WAITING
  1902. *
  1903. * Configure current call waiting state
  1904. *
  1905. * "data" is const int *
  1906. * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
  1907. * ((const int *)data)[1] is the TS 27.007 service class bit vector of
  1908. * services to modify
  1909. * "response" is NULL
  1910. *
  1911. * Valid errors:
  1912. * SUCCESS
  1913. * RADIO_NOT_AVAILABLE
  1914. * SS_MODIFIED_TO_DIAL
  1915. * SS_MODIFIED_TO_USSD
  1916. * SS_MODIFIED_TO_SS
  1917. * GENERIC_FAILURE
  1918. */
  1919. #define RIL_REQUEST_SET_CALL_WAITING 36
  1920. /**
  1921. * RIL_REQUEST_SMS_ACKNOWLEDGE
  1922. *
  1923. * Acknowledge successful or failed receipt of SMS previously indicated
  1924. * via RIL_UNSOL_RESPONSE_NEW_SMS
  1925. *
  1926. * "data" is int *
  1927. * ((int *)data)[0] is 1 on successful receipt
  1928. * (basically, AT+CNMA=1 from TS 27.005
  1929. * is 0 on failed receipt
  1930. * (basically, AT+CNMA=2 from TS 27.005)
  1931. * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined
  1932. * in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory
  1933. * capacity exceeded) and 0xFF (unspecified error) are
  1934. * reported.
  1935. *
  1936. * "response" is NULL
  1937. *
  1938. * FIXME would like request that specified RP-ACK/RP-ERROR PDU
  1939. *
  1940. * Valid errors:
  1941. * SUCCESS
  1942. * RADIO_NOT_AVAILABLE
  1943. * GENERIC_FAILURE
  1944. */
  1945. #define RIL_REQUEST_SMS_ACKNOWLEDGE 37
  1946. /**
  1947. * RIL_REQUEST_GET_IMEI - DEPRECATED
  1948. *
  1949. * Get the device IMEI, including check digit
  1950. *
  1951. * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
  1952. * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
  1953. *
  1954. * "data" is NULL
  1955. * "response" is a const char * containing the IMEI
  1956. *
  1957. * Valid errors:
  1958. * SUCCESS
  1959. * RADIO_NOT_AVAILABLE (radio resetting)
  1960. * GENERIC_FAILURE
  1961. */
  1962. #define RIL_REQUEST_GET_IMEI 38
  1963. /**
  1964. * RIL_REQUEST_GET_IMEISV - DEPRECATED
  1965. *
  1966. * Get the device IMEISV, which should be two decimal digits
  1967. *
  1968. * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
  1969. * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
  1970. *
  1971. * "data" is NULL
  1972. * "response" is a const char * containing the IMEISV
  1973. *
  1974. * Valid errors:
  1975. * SUCCESS
  1976. * RADIO_NOT_AVAILABLE (radio resetting)
  1977. * GENERIC_FAILURE
  1978. */
  1979. #define RIL_REQUEST_GET_IMEISV 39
  1980. /**
  1981. * RIL_REQUEST_ANSWER
  1982. *
  1983. * Answer incoming call
  1984. *
  1985. * Will not be called for WAITING calls.
  1986. * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
  1987. * instead
  1988. *
  1989. * "data" is NULL
  1990. * "response" is NULL
  1991. *
  1992. * Valid errors:
  1993. * SUCCESS
  1994. * RADIO_NOT_AVAILABLE (radio resetting)
  1995. * GENERIC_FAILURE
  1996. */
  1997. #define RIL_REQUEST_ANSWER 40
  1998. /**
  1999. * RIL_REQUEST_DEACTIVATE_DATA_CALL
  2000. *
  2001. * Deactivate packet data connection and remove from the
  2002. * data call list if SUCCESS is returned. Any other return
  2003. * values should also try to remove the call from the list,
  2004. * but that may not be possible. In any event a
  2005. * RIL_REQUEST_RADIO_POWER off/on must clear the list. An
  2006. * RIL_UNSOL_DATA_CALL_LIST_CHANGED is not expected to be
  2007. * issued because of an RIL_REQUEST_DEACTIVATE_DATA_CALL.
  2008. *
  2009. * "data" is const char **
  2010. * ((char**)data)[0] indicating CID
  2011. * ((char**)data)[1] indicating Disconnect Reason
  2012. * 0 => No specific reason specified
  2013. * 1 => Radio shutdown requested
  2014. *
  2015. * "response" is NULL
  2016. *
  2017. * Valid errors:
  2018. * SUCCESS
  2019. * RADIO_NOT_AVAILABLE
  2020. * GENERIC_FAILURE
  2021. *
  2022. * See also: RIL_REQUEST_SETUP_DATA_CALL
  2023. */
  2024. #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41
  2025. /**
  2026. * RIL_REQUEST_QUERY_FACILITY_LOCK
  2027. *
  2028. * Query the status of a facility lock state
  2029. *
  2030. * "data" is const char **
  2031. * ((const char **)data)[0] is the facility string code from TS 27.007 7.4
  2032. * (eg "AO" for BAOC, "SC" for SIM lock)
  2033. * ((const char **)data)[1] is the password, or "" if not required
  2034. * ((const char **)data)[2] is the TS 27.007 service class bit vector of
  2035. * services to query
  2036. * ((const char **)data)[3] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  2037. * This is only applicable in the case of Fixed Dialing Numbers
  2038. * (FDN) requests.
  2039. *
  2040. * "response" is an int *
  2041. * ((const int *)response) 0 is the TS 27.007 service class bit vector of
  2042. * services for which the specified barring facility
  2043. * is active. "0" means "disabled for all"
  2044. *
  2045. *
  2046. * Valid errors:
  2047. * SUCCESS
  2048. * RADIO_NOT_AVAILABLE
  2049. * SS_MODIFIED_TO_DIAL
  2050. * SS_MODIFIED_TO_USSD
  2051. * SS_MODIFIED_TO_SS
  2052. * GENERIC_FAILURE
  2053. *
  2054. */
  2055. #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
  2056. /**
  2057. * RIL_REQUEST_SET_FACILITY_LOCK
  2058. *
  2059. * Enable/disable one facility lock
  2060. *
  2061. * "data" is const char **
  2062. *
  2063. * ((const char **)data)[0] = facility string code from TS 27.007 7.4
  2064. * (eg "AO" for BAOC)
  2065. * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
  2066. * ((const char **)data)[2] = password
  2067. * ((const char **)data)[3] = string representation of decimal TS 27.007
  2068. * service class bit vector. Eg, the string
  2069. * "1" means "set this facility for voice services"
  2070. * ((const char **)data)[4] = AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  2071. * This is only applicable in the case of Fixed Dialing Numbers
  2072. * (FDN) requests.
  2073. *
  2074. * "response" is int *
  2075. * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  2076. *
  2077. * Valid errors:
  2078. * SUCCESS
  2079. * RADIO_NOT_AVAILABLE
  2080. * SS_MODIFIED_TO_DIAL
  2081. * SS_MODIFIED_TO_USSD
  2082. * SS_MODIFIED_TO_SS
  2083. * GENERIC_FAILURE
  2084. *
  2085. */
  2086. #define RIL_REQUEST_SET_FACILITY_LOCK 43
  2087. /**
  2088. * RIL_REQUEST_CHANGE_BARRING_PASSWORD
  2089. *
  2090. * Change call barring facility password
  2091. *
  2092. * "data" is const char **
  2093. *
  2094. * ((const char **)data)[0] = facility string code from TS 27.007 7.4
  2095. * (eg "AO" for BAOC)
  2096. * ((const char **)data)[1] = old password
  2097. * ((const char **)data)[2] = new password
  2098. *
  2099. * "response" is NULL
  2100. *
  2101. * Valid errors:
  2102. * SUCCESS
  2103. * RADIO_NOT_AVAILABLE
  2104. * SS_MODIFIED_TO_DIAL
  2105. * SS_MODIFIED_TO_USSD
  2106. * SS_MODIFIED_TO_SS
  2107. * GENERIC_FAILURE
  2108. *
  2109. */
  2110. #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
  2111. /**
  2112. * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
  2113. *
  2114. * Query current network selectin mode
  2115. *
  2116. * "data" is NULL
  2117. *
  2118. * "response" is int *
  2119. * ((const int *)response)[0] is
  2120. * 0 for automatic selection
  2121. * 1 for manual selection
  2122. *
  2123. * Valid errors:
  2124. * SUCCESS
  2125. * RADIO_NOT_AVAILABLE
  2126. * GENERIC_FAILURE
  2127. *
  2128. */
  2129. #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
  2130. /**
  2131. * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
  2132. *
  2133. * Specify that the network should be selected automatically
  2134. *
  2135. * "data" is NULL
  2136. * "response" is NULL
  2137. *
  2138. * This request must not respond until the new operator is selected
  2139. * and registered
  2140. *
  2141. * Valid errors:
  2142. * SUCCESS
  2143. * RADIO_NOT_AVAILABLE
  2144. * ILLEGAL_SIM_OR_ME
  2145. * GENERIC_FAILURE
  2146. *
  2147. * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
  2148. * no retries needed, such as illegal SIM or ME.
  2149. * Returns GENERIC_FAILURE for all other causes that might be
  2150. * fixed by retries.
  2151. *
  2152. */
  2153. #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
  2154. /**
  2155. * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
  2156. *
  2157. * Manually select a specified network.
  2158. *
  2159. * "data" is const char * specifying MCCMNC of network to select (eg "310170")
  2160. * "response" is NULL
  2161. *
  2162. * This request must not respond until the new operator is selected
  2163. * and registered
  2164. *
  2165. * Valid errors:
  2166. * SUCCESS
  2167. * RADIO_NOT_AVAILABLE
  2168. * ILLEGAL_SIM_OR_ME
  2169. * GENERIC_FAILURE
  2170. *
  2171. * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
  2172. * no retries needed, such as illegal SIM or ME.
  2173. * Returns GENERIC_FAILURE for all other causes that might be
  2174. * fixed by retries.
  2175. *
  2176. */
  2177. #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
  2178. /**
  2179. * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
  2180. *
  2181. * Scans for available networks
  2182. *
  2183. * "data" is NULL
  2184. * "response" is const char ** that should be an array of n*4 strings, where
  2185. * n is the number of available networks
  2186. * For each available network:
  2187. *
  2188. * ((const char **)response)[n+0] is long alpha ONS or EONS
  2189. * ((const char **)response)[n+1] is short alpha ONS or EONS
  2190. * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
  2191. * ((const char **)response)[n+3] is a string value of the status:
  2192. * "unknown"
  2193. * "available"
  2194. * "current"
  2195. * "forbidden"
  2196. *
  2197. * This request must not respond until the new operator is selected
  2198. * and registered
  2199. *
  2200. * Valid errors:
  2201. * SUCCESS
  2202. * RADIO_NOT_AVAILABLE
  2203. * GENERIC_FAILURE
  2204. *
  2205. */
  2206. #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
  2207. /**
  2208. * RIL_REQUEST_DTMF_START
  2209. *
  2210. * Start playing a DTMF tone. Continue playing DTMF tone until
  2211. * RIL_REQUEST_DTMF_STOP is received
  2212. *
  2213. * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
  2214. * it should cancel the previous tone and play the new one.
  2215. *
  2216. * "data" is a char *
  2217. * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
  2218. * "response" is NULL
  2219. *
  2220. * Valid errors:
  2221. * SUCCESS
  2222. * RADIO_NOT_AVAILABLE
  2223. * GENERIC_FAILURE
  2224. *
  2225. * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
  2226. */
  2227. #define RIL_REQUEST_DTMF_START 49
  2228. /**
  2229. * RIL_REQUEST_DTMF_STOP
  2230. *
  2231. * Stop playing a currently playing DTMF tone.
  2232. *
  2233. * "data" is NULL
  2234. * "response" is NULL
  2235. *
  2236. * Valid errors:
  2237. * SUCCESS
  2238. * RADIO_NOT_AVAILABLE
  2239. * GENERIC_FAILURE
  2240. *
  2241. * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
  2242. */
  2243. #define RIL_REQUEST_DTMF_STOP 50
  2244. /**
  2245. * RIL_REQUEST_BASEBAND_VERSION
  2246. *
  2247. * Return string value indicating baseband version, eg
  2248. * response from AT+CGMR
  2249. *
  2250. * "data" is NULL
  2251. * "response" is const char * containing version string for log reporting
  2252. *
  2253. * Valid errors:
  2254. * SUCCESS
  2255. * RADIO_NOT_AVAILABLE
  2256. * GENERIC_FAILURE
  2257. *
  2258. */
  2259. #define RIL_REQUEST_BASEBAND_VERSION 51
  2260. /**
  2261. * RIL_REQUEST_SEPARATE_CONNECTION
  2262. *
  2263. * Separate a party from a multiparty call placing the multiparty call
  2264. * (less the specified party) on hold and leaving the specified party
  2265. * as the only other member of the current (active) call
  2266. *
  2267. * Like AT+CHLD=2x
  2268. *
  2269. * See TS 22.084 1.3.8.2 (iii)
  2270. * TS 22.030 6.5.5 "Entering "2X followed by send"
  2271. * TS 27.007 "AT+CHLD=2x"
  2272. *
  2273. * "data" is an int *
  2274. * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL
  2275. *
  2276. * "response" is NULL
  2277. *
  2278. * Valid errors:
  2279. * SUCCESS
  2280. * RADIO_NOT_AVAILABLE (radio resetting)
  2281. * GENERIC_FAILURE
  2282. */
  2283. #define RIL_REQUEST_SEPARATE_CONNECTION 52
  2284. /**
  2285. * RIL_REQUEST_SET_MUTE
  2286. *
  2287. * Turn on or off uplink (microphone) mute.
  2288. *
  2289. * Will only be sent while voice call is active.
  2290. * Will always be reset to "disable mute" when a new voice call is initiated
  2291. *
  2292. * "data" is an int *
  2293. * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
  2294. *
  2295. * "response" is NULL
  2296. *
  2297. * Valid errors:
  2298. * SUCCESS
  2299. * RADIO_NOT_AVAILABLE (radio resetting)
  2300. * GENERIC_FAILURE
  2301. */
  2302. #define RIL_REQUEST_SET_MUTE 53
  2303. /**
  2304. * RIL_REQUEST_GET_MUTE
  2305. *
  2306. * Queries the current state of the uplink mute setting
  2307. *
  2308. * "data" is NULL
  2309. * "response" is an int *
  2310. * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
  2311. *
  2312. * Valid errors:
  2313. * SUCCESS
  2314. * RADIO_NOT_AVAILABLE (radio resetting)
  2315. * SS_MODIFIED_TO_DIAL
  2316. * SS_MODIFIED_TO_USSD
  2317. * SS_MODIFIED_TO_SS
  2318. * GENERIC_FAILURE
  2319. */
  2320. #define RIL_REQUEST_GET_MUTE 54
  2321. /**
  2322. * RIL_REQUEST_QUERY_CLIP
  2323. *
  2324. * Queries the status of the CLIP supplementary service
  2325. *
  2326. * (for MMI code "*#30#")
  2327. *
  2328. * "data" is NULL
  2329. * "response" is an int *
  2330. * (int *)response)[0] is 1 for "CLIP provisioned"
  2331. * and 0 for "CLIP not provisioned"
  2332. * and 2 for "unknown, e.g. no network etc"
  2333. *
  2334. * Valid errors:
  2335. * SUCCESS
  2336. * RADIO_NOT_AVAILABLE (radio resetting)
  2337. * GENERIC_FAILURE
  2338. */
  2339. #define RIL_REQUEST_QUERY_CLIP 55
  2340. /**
  2341. * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE - Deprecated use the status
  2342. * field in RIL_Data_Call_Response_v6.
  2343. *
  2344. * Requests the failure cause code for the most recently failed PDP
  2345. * context or CDMA data connection active
  2346. * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE
  2347. *
  2348. * "data" is NULL
  2349. *
  2350. * "response" is a "int *"
  2351. * ((int *)response)[0] is an integer cause code defined in TS 24.008
  2352. * section 6.1.3.1.3 or close approximation
  2353. *
  2354. * If the implementation does not have access to the exact cause codes,
  2355. * then it should return one of the values listed in
  2356. * RIL_DataCallFailCause, as the UI layer needs to distinguish these
  2357. * cases for error notification
  2358. * and potential retries.
  2359. *
  2360. * Valid errors:
  2361. * SUCCESS
  2362. * RADIO_NOT_AVAILABLE
  2363. * GENERIC_FAILURE
  2364. *
  2365. * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
  2366. *
  2367. * Deprecated use the status field in RIL_Data_Call_Response_v6.
  2368. */
  2369. #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56
  2370. /**
  2371. * RIL_REQUEST_DATA_CALL_LIST
  2372. *
  2373. * Returns the data call list. An entry is added when a
  2374. * RIL_REQUEST_SETUP_DATA_CALL is issued and removed on a
  2375. * RIL_REQUEST_DEACTIVATE_DATA_CALL. The list is emptied
  2376. * when RIL_REQUEST_RADIO_POWER off/on is issued.
  2377. *
  2378. * "data" is NULL
  2379. * "response" is an array of RIL_Data_Call_Response_v6
  2380. *
  2381. * Valid errors:
  2382. * SUCCESS
  2383. * RADIO_NOT_AVAILABLE (radio resetting)
  2384. * GENERIC_FAILURE
  2385. *
  2386. * See also: RIL_UNSOL_DATA_CALL_LIST_CHANGED
  2387. */
  2388. #define RIL_REQUEST_DATA_CALL_LIST 57
  2389. /**
  2390. * RIL_REQUEST_RESET_RADIO - DEPRECATED
  2391. *
  2392. * Request a radio reset. The RIL implementation may postpone
  2393. * the reset until after this request is responded to if the baseband
  2394. * is presently busy.
  2395. *
  2396. * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER
  2397. *
  2398. * "data" is NULL
  2399. * "response" is NULL
  2400. *
  2401. * Valid errors:
  2402. * SUCCESS
  2403. * RADIO_NOT_AVAILABLE (radio resetting)
  2404. * GENERIC_FAILURE
  2405. * REQUEST_NOT_SUPPORTED
  2406. */
  2407. #define RIL_REQUEST_RESET_RADIO 58
  2408. /**
  2409. * RIL_REQUEST_OEM_HOOK_RAW
  2410. *
  2411. * This request reserved for OEM-specific uses. It passes raw byte arrays
  2412. * back and forth.
  2413. *
  2414. * It can be invoked on the Java side from
  2415. * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
  2416. *
  2417. * "data" is a char * of bytes copied from the byte[] data argument in java
  2418. * "response" is a char * of bytes that will returned via the
  2419. * caller's "response" Message here:
  2420. * (byte[])(((AsyncResult)response.obj).result)
  2421. *
  2422. * An error response here will result in
  2423. * (((AsyncResult)response.obj).result) == null and
  2424. * (((AsyncResult)response.obj).exception) being an instance of
  2425. * com.android.internal.telephony.gsm.CommandException
  2426. *
  2427. * Valid errors:
  2428. * All
  2429. */
  2430. #define RIL_REQUEST_OEM_HOOK_RAW 59
  2431. /**
  2432. * RIL_REQUEST_OEM_HOOK_STRINGS
  2433. *
  2434. * This request reserved for OEM-specific uses. It passes strings
  2435. * back and forth.
  2436. *
  2437. * It can be invoked on the Java side from
  2438. * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
  2439. *
  2440. * "data" is a const char **, representing an array of null-terminated UTF-8
  2441. * strings copied from the "String[] strings" argument to
  2442. * invokeOemRilRequestStrings()
  2443. *
  2444. * "response" is a const char **, representing an array of null-terminated UTF-8
  2445. * stings that will be returned via the caller's response message here:
  2446. *
  2447. * (String[])(((AsyncResult)response.obj).result)
  2448. *
  2449. * An error response here will result in
  2450. * (((AsyncResult)response.obj).result) == null and
  2451. * (((AsyncResult)response.obj).exception) being an instance of
  2452. * com.android.internal.telephony.gsm.CommandException
  2453. *
  2454. * Valid errors:
  2455. * All
  2456. */
  2457. #define RIL_REQUEST_OEM_HOOK_STRINGS 60
  2458. /**
  2459. * RIL_REQUEST_SCREEN_STATE
  2460. *
  2461. * Indicates the current state of the screen. When the screen is off, the
  2462. * RIL should notify the baseband to suppress certain notifications (eg,
  2463. * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
  2464. * in an effort to conserve power. These notifications should resume when the
  2465. * screen is on.
  2466. *
  2467. * "data" is int *
  2468. * ((int *)data)[0] is == 1 for "Screen On"
  2469. * ((int *)data)[0] is == 0 for "Screen Off"
  2470. *
  2471. * "response" is NULL
  2472. *
  2473. * Valid errors:
  2474. * SUCCESS
  2475. * GENERIC_FAILURE
  2476. */
  2477. #define RIL_REQUEST_SCREEN_STATE 61
  2478. /**
  2479. * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
  2480. *
  2481. * Enables/disables supplementary service related notifications
  2482. * from the network.
  2483. *
  2484. * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
  2485. *
  2486. * "data" is int *
  2487. * ((int *)data)[0] is == 1 for notifications enabled
  2488. * ((int *)data)[0] is == 0 for notifications disabled
  2489. *
  2490. * "response" is NULL
  2491. *
  2492. * Valid errors:
  2493. * SUCCESS
  2494. * RADIO_NOT_AVAILABLE
  2495. * GENERIC_FAILURE
  2496. *
  2497. * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
  2498. */
  2499. #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
  2500. /**
  2501. * RIL_REQUEST_WRITE_SMS_TO_SIM
  2502. *
  2503. * Stores a SMS message to SIM memory.
  2504. *
  2505. * "data" is RIL_SMS_WriteArgs *
  2506. *
  2507. * "response" is int *
  2508. * ((const int *)response)[0] is the record index where the message is stored.
  2509. *
  2510. * Valid errors:
  2511. * SUCCESS
  2512. * GENERIC_FAILURE
  2513. *
  2514. */
  2515. #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
  2516. /**
  2517. * RIL_REQUEST_DELETE_SMS_ON_SIM
  2518. *
  2519. * Deletes a SMS message from SIM memory.
  2520. *
  2521. * "data" is int *
  2522. * ((int *)data)[0] is the record index of the message to delete.
  2523. *
  2524. * "response" is NULL
  2525. *
  2526. * Valid errors:
  2527. * SUCCESS
  2528. * GENERIC_FAILURE
  2529. *
  2530. */
  2531. #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
  2532. /**
  2533. * RIL_REQUEST_SET_BAND_MODE
  2534. *
  2535. * Assign a specified band for RF configuration.
  2536. *
  2537. * "data" is int *
  2538. * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
  2539. * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
  2540. * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
  2541. * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
  2542. * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
  2543. * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
  2544. * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
  2545. * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
  2546. * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
  2547. * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
  2548. * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
  2549. * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
  2550. * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
  2551. * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
  2552. * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
  2553. * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
  2554. * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
  2555. * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
  2556. * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
  2557. *
  2558. * "response" is NULL
  2559. *
  2560. * Valid errors:
  2561. * SUCCESS
  2562. * RADIO_NOT_AVAILABLE
  2563. * GENERIC_FAILURE
  2564. */
  2565. #define RIL_REQUEST_SET_BAND_MODE 65
  2566. /**
  2567. * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
  2568. *
  2569. * Query the list of band mode supported by RF.
  2570. *
  2571. * "data" is NULL
  2572. *
  2573. * "response" is int *
  2574. * "response" points to an array of int's, the int[0] is the size of array, reset is one for
  2575. * each available band mode.
  2576. *
  2577. * 0 for "unspecified" (selected by baseband automatically)
  2578. * 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
  2579. * 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
  2580. * 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
  2581. * 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
  2582. * 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
  2583. * 6 for "Cellular (800-MHz Band)"
  2584. * 7 for "PCS (1900-MHz Band)"
  2585. * 8 for "Band Class 3 (JTACS Band)"
  2586. * 9 for "Band Class 4 (Korean PCS Band)"
  2587. * 10 for "Band Class 5 (450-MHz Band)"
  2588. * 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
  2589. * 12 for "Band Class 7 (Upper 700-MHz Band)"
  2590. * 13 for "Band Class 8 (1800-MHz Band)"
  2591. * 14 for "Band Class 9 (900-MHz Band)"
  2592. * 15 for "Band Class 10 (Secondary 800-MHz Band)"
  2593. * 16 for "Band Class 11 (400-MHz European PAMR Band)"
  2594. * 17 for "Band Class 15 (AWS Band)"
  2595. * 18 for "Band Class 16 (US 2.5-GHz Band)"
  2596. *
  2597. * Valid errors:
  2598. * SUCCESS
  2599. * RADIO_NOT_AVAILABLE
  2600. * GENERIC_FAILURE
  2601. *
  2602. * See also: RIL_REQUEST_SET_BAND_MODE
  2603. */
  2604. #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
  2605. /**
  2606. * RIL_REQUEST_STK_GET_PROFILE
  2607. *
  2608. * Requests the profile of SIM tool kit.
  2609. * The profile indicates the SAT/USAT features supported by ME.
  2610. * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
  2611. *
  2612. * "data" is NULL
  2613. *
  2614. * "response" is a const char * containing SAT/USAT profile
  2615. * in hexadecimal format string starting with first byte of terminal profile
  2616. *
  2617. * Valid errors:
  2618. * RIL_E_SUCCESS
  2619. * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2620. * RIL_E_GENERIC_FAILURE
  2621. */
  2622. #define RIL_REQUEST_STK_GET_PROFILE 67
  2623. /**
  2624. * RIL_REQUEST_STK_SET_PROFILE
  2625. *
  2626. * Download the STK terminal profile as part of SIM initialization
  2627. * procedure
  2628. *
  2629. * "data" is a const char * containing SAT/USAT profile
  2630. * in hexadecimal format string starting with first byte of terminal profile
  2631. *
  2632. * "response" is NULL
  2633. *
  2634. * Valid errors:
  2635. * RIL_E_SUCCESS
  2636. * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2637. * RIL_E_GENERIC_FAILURE
  2638. */
  2639. #define RIL_REQUEST_STK_SET_PROFILE 68
  2640. /**
  2641. * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
  2642. *
  2643. * Requests to send a SAT/USAT envelope command to SIM.
  2644. * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
  2645. *
  2646. * "data" is a const char * containing SAT/USAT command
  2647. * in hexadecimal format string starting with command tag
  2648. *
  2649. * "response" is a const char * containing SAT/USAT response
  2650. * in hexadecimal format string starting with first byte of response
  2651. * (May be NULL)
  2652. *
  2653. * Valid errors:
  2654. * RIL_E_SUCCESS
  2655. * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2656. * RIL_E_GENERIC_FAILURE
  2657. */
  2658. #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
  2659. /**
  2660. * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
  2661. *
  2662. * Requests to send a terminal response to SIM for a received
  2663. * proactive command
  2664. *
  2665. * "data" is a const char * containing SAT/USAT response
  2666. * in hexadecimal format string starting with first byte of response data
  2667. *
  2668. * "response" is NULL
  2669. *
  2670. * Valid errors:
  2671. * RIL_E_SUCCESS
  2672. * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2673. * RIL_E_GENERIC_FAILURE
  2674. */
  2675. #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
  2676. /**
  2677. * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
  2678. *
  2679. * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
  2680. * been initialized by ME already. (We could see the call has been in the 'call
  2681. * list') So, STK application needs to accept/reject the call according as user
  2682. * operations.
  2683. *
  2684. * "data" is int *
  2685. * ((int *)data)[0] is > 0 for "accept" the call setup
  2686. * ((int *)data)[0] is == 0 for "reject" the call setup
  2687. *
  2688. * "response" is NULL
  2689. *
  2690. * Valid errors:
  2691. * RIL_E_SUCCESS
  2692. * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2693. * RIL_E_GENERIC_FAILURE
  2694. */
  2695. #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
  2696. /**
  2697. * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
  2698. *
  2699. * Connects the two calls and disconnects the subscriber from both calls.
  2700. *
  2701. * "data" is NULL
  2702. * "response" is NULL
  2703. *
  2704. * Valid errors:
  2705. * SUCCESS
  2706. * RADIO_NOT_AVAILABLE (radio resetting)
  2707. * GENERIC_FAILURE
  2708. */
  2709. #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
  2710. /**
  2711. * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
  2712. *
  2713. * Requests to set the preferred network type for searching and registering
  2714. * (CS/PS domain, RAT, and operation mode)
  2715. *
  2716. * "data" is int * which is RIL_PreferredNetworkType
  2717. *
  2718. * "response" is NULL
  2719. *
  2720. * Valid errors:
  2721. * SUCCESS
  2722. * RADIO_NOT_AVAILABLE (radio resetting)
  2723. * GENERIC_FAILURE
  2724. * MODE_NOT_SUPPORTED
  2725. */
  2726. #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
  2727. /**
  2728. * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
  2729. *
  2730. * Query the preferred network type (CS/PS domain, RAT, and operation mode)
  2731. * for searching and registering
  2732. *
  2733. * "data" is NULL
  2734. *
  2735. * "response" is int *
  2736. * ((int *)reponse)[0] is == RIL_PreferredNetworkType
  2737. *
  2738. * Valid errors:
  2739. * SUCCESS
  2740. * RADIO_NOT_AVAILABLE
  2741. * GENERIC_FAILURE
  2742. *
  2743. * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
  2744. */
  2745. #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
  2746. /**
  2747. * RIL_REQUEST_NEIGHBORING_CELL_IDS
  2748. *
  2749. * Request neighboring cell id in GSM network
  2750. *
  2751. * "data" is NULL
  2752. * "response" must be a " const RIL_NeighboringCell** "
  2753. *
  2754. * Valid errors:
  2755. * SUCCESS
  2756. * RADIO_NOT_AVAILABLE
  2757. * GENERIC_FAILURE
  2758. */
  2759. #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
  2760. /**
  2761. * RIL_REQUEST_SET_LOCATION_UPDATES
  2762. *
  2763. * Enables/disables network state change notifications due to changes in
  2764. * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
  2765. * Basically +CREG=2 vs. +CREG=1 (TS 27.007).
  2766. *
  2767. * Note: The RIL implementation should default to "updates enabled"
  2768. * when the screen is on and "updates disabled" when the screen is off.
  2769. *
  2770. * "data" is int *
  2771. * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
  2772. * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
  2773. *
  2774. * "response" is NULL
  2775. *
  2776. * Valid errors:
  2777. * SUCCESS
  2778. * RADIO_NOT_AVAILABLE
  2779. * GENERIC_FAILURE
  2780. *
  2781. * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
  2782. */
  2783. #define RIL_REQUEST_SET_LOCATION_UPDATES 76
  2784. /**
  2785. * RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
  2786. *
  2787. * Request to set the location where the CDMA subscription shall
  2788. * be retrieved
  2789. *
  2790. * "data" is int *
  2791. * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
  2792. *
  2793. * "response" is NULL
  2794. *
  2795. * Valid errors:
  2796. * SUCCESS
  2797. * RADIO_NOT_AVAILABLE
  2798. * GENERIC_FAILURE
  2799. * SIM_ABSENT
  2800. * SUBSCRIPTION_NOT_AVAILABLE
  2801. *
  2802. * See also: RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
  2803. */
  2804. #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 77
  2805. /**
  2806. * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE
  2807. *
  2808. * Request to set the roaming preferences in CDMA
  2809. *
  2810. * "data" is int *
  2811. * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL
  2812. * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
  2813. * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL
  2814. *
  2815. * "response" is NULL
  2816. *
  2817. * Valid errors:
  2818. * SUCCESS
  2819. * RADIO_NOT_AVAILABLE
  2820. * GENERIC_FAILURE
  2821. */
  2822. #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78
  2823. /**
  2824. * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE
  2825. *
  2826. * Request the actual setting of the roaming preferences in CDMA in the modem
  2827. *
  2828. * "data" is NULL
  2829. *
  2830. * "response" is int *
  2831. * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL
  2832. * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
  2833. * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL
  2834. *
  2835. * "response" is NULL
  2836. *
  2837. * Valid errors:
  2838. * SUCCESS
  2839. * RADIO_NOT_AVAILABLE
  2840. * GENERIC_FAILURE
  2841. */
  2842. #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79
  2843. /**
  2844. * RIL_REQUEST_SET_TTY_MODE
  2845. *
  2846. * Request to set the TTY mode
  2847. *
  2848. * "data" is int *
  2849. * ((int *)data)[0] is == 0 for TTY off
  2850. * ((int *)data)[0] is == 1 for TTY Full
  2851. * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover)
  2852. * ((int *)data)[0] is == 3 for TTY VCO (voice carryover)
  2853. *
  2854. * "response" is NULL
  2855. *
  2856. * Valid errors:
  2857. * SUCCESS
  2858. * RADIO_NOT_AVAILABLE
  2859. * GENERIC_FAILURE
  2860. */
  2861. #define RIL_REQUEST_SET_TTY_MODE 80
  2862. /**
  2863. * RIL_REQUEST_QUERY_TTY_MODE
  2864. *
  2865. * Request the setting of TTY mode
  2866. *
  2867. * "data" is NULL
  2868. *
  2869. * "response" is int *
  2870. * ((int *)response)[0] is == 0 for TTY off
  2871. * ((int *)response)[0] is == 1 for TTY Full
  2872. * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover)
  2873. * ((int *)response)[0] is == 3 for TTY VCO (voice carryover)
  2874. *
  2875. * "response" is NULL
  2876. *
  2877. * Valid errors:
  2878. * SUCCESS
  2879. * RADIO_NOT_AVAILABLE
  2880. * GENERIC_FAILURE
  2881. */
  2882. #define RIL_REQUEST_QUERY_TTY_MODE 81
  2883. /**
  2884. * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE
  2885. *
  2886. * Request to set the preferred voice privacy mode used in voice
  2887. * scrambling
  2888. *
  2889. * "data" is int *
  2890. * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
  2891. * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
  2892. *
  2893. * "response" is NULL
  2894. *
  2895. * Valid errors:
  2896. * SUCCESS
  2897. * RADIO_NOT_AVAILABLE
  2898. * GENERIC_FAILURE
  2899. */
  2900. #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82
  2901. /**
  2902. * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE
  2903. *
  2904. * Request the setting of preferred voice privacy mode
  2905. *
  2906. * "data" is NULL
  2907. *
  2908. * "response" is int *
  2909. * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
  2910. * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
  2911. *
  2912. * "response" is NULL
  2913. *
  2914. * Valid errors:
  2915. * SUCCESS
  2916. * RADIO_NOT_AVAILABLE
  2917. * GENERIC_FAILURE
  2918. */
  2919. #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83
  2920. /**
  2921. * RIL_REQUEST_CDMA_FLASH
  2922. *
  2923. * Send FLASH
  2924. *
  2925. * "data" is const char *
  2926. * ((const char *)data)[0] is a FLASH string
  2927. *
  2928. * "response" is NULL
  2929. *
  2930. * Valid errors:
  2931. * SUCCESS
  2932. * RADIO_NOT_AVAILABLE
  2933. * GENERIC_FAILURE
  2934. *
  2935. */
  2936. #define RIL_REQUEST_CDMA_FLASH 84
  2937. /**
  2938. * RIL_REQUEST_CDMA_BURST_DTMF
  2939. *
  2940. * Send DTMF string
  2941. *
  2942. * "data" is const char **
  2943. * ((const char **)data)[0] is a DTMF string
  2944. * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use
  2945. * default
  2946. * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use
  2947. * default
  2948. *
  2949. * "response" is NULL
  2950. *
  2951. * Valid errors:
  2952. * SUCCESS
  2953. * RADIO_NOT_AVAILABLE
  2954. * GENERIC_FAILURE
  2955. *
  2956. */
  2957. #define RIL_REQUEST_CDMA_BURST_DTMF 85
  2958. /**
  2959. * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY
  2960. *
  2961. * Takes a 26 digit string (20 digit AKEY + 6 digit checksum).
  2962. * If the checksum is valid the 20 digit AKEY is written to NV,
  2963. * replacing the existing AKEY no matter what it was before.
  2964. *
  2965. * "data" is const char *
  2966. * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9')
  2967. * where the last 6 digits are a checksum of the
  2968. * first 20, as specified in TR45.AHAG
  2969. * "Common Cryptographic Algorithms, Revision D.1
  2970. * Section 2.2"
  2971. *
  2972. * "response" is NULL
  2973. *
  2974. * Valid errors:
  2975. * SUCCESS
  2976. * RADIO_NOT_AVAILABLE
  2977. * GENERIC_FAILURE
  2978. *
  2979. */
  2980. #define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86
  2981. /**
  2982. * RIL_REQUEST_CDMA_SEND_SMS
  2983. *
  2984. * Send a CDMA SMS message
  2985. *
  2986. * "data" is const RIL_CDMA_SMS_Message *
  2987. *
  2988. * "response" is a const RIL_SMS_Response *
  2989. *
  2990. * Based on the return error, caller decides to resend if sending sms
  2991. * fails. The CDMA error class is derived as follows,
  2992. * SUCCESS is error class 0 (no error)
  2993. * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure)
  2994. * and GENERIC_FAILURE is error class 3 (permanent and no retry)
  2995. *
  2996. * Valid errors:
  2997. * SUCCESS
  2998. * RADIO_NOT_AVAILABLE
  2999. * SMS_SEND_FAIL_RETRY
  3000. * GENERIC_FAILURE
  3001. *
  3002. */
  3003. #define RIL_REQUEST_CDMA_SEND_SMS 87
  3004. /**
  3005. * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
  3006. *
  3007. * Acknowledge the success or failure in the receipt of SMS
  3008. * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
  3009. *
  3010. * "data" is const RIL_CDMA_SMS_Ack *
  3011. *
  3012. * "response" is NULL
  3013. *
  3014. * Valid errors:
  3015. * SUCCESS
  3016. * RADIO_NOT_AVAILABLE
  3017. * GENERIC_FAILURE
  3018. *
  3019. */
  3020. #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88
  3021. /**
  3022. * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG
  3023. *
  3024. * Request the setting of GSM/WCDMA Cell Broadcast SMS config.
  3025. *
  3026. * "data" is NULL
  3027. *
  3028. * "response" is a const RIL_GSM_BroadcastSmsConfigInfo **
  3029. * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *)
  3030. *
  3031. * Valid errors:
  3032. * SUCCESS
  3033. * RADIO_NOT_AVAILABLE
  3034. * GENERIC_FAILURE
  3035. *
  3036. */
  3037. #define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89
  3038. /**
  3039. * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG
  3040. *
  3041. * Set GSM/WCDMA Cell Broadcast SMS config
  3042. *
  3043. * "data" is a const RIL_GSM_BroadcastSmsConfigInfo **
  3044. * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *)
  3045. *
  3046. * "response" is NULL
  3047. *
  3048. * Valid errors:
  3049. * SUCCESS
  3050. * RADIO_NOT_AVAILABLE
  3051. * GENERIC_FAILURE
  3052. *
  3053. */
  3054. #define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90
  3055. /**
  3056. * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION
  3057. *
  3058. * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
  3059. *
  3060. * "data" is const int *
  3061. * (const int *)data[0] indicates to activate or turn off the
  3062. * reception of GSM/WCDMA Cell Broadcast SMS, 0-1,
  3063. * 0 - Activate, 1 - Turn off
  3064. *
  3065. * "response" is NULL
  3066. *
  3067. * Valid errors:
  3068. * SUCCESS
  3069. * RADIO_NOT_AVAILABLE
  3070. * GENERIC_FAILURE
  3071. *
  3072. */
  3073. #define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91
  3074. /**
  3075. * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG
  3076. *
  3077. * Request the setting of CDMA Broadcast SMS config
  3078. *
  3079. * "data" is NULL
  3080. *
  3081. * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo **
  3082. * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *)
  3083. *
  3084. * Valid errors:
  3085. * SUCCESS
  3086. * RADIO_NOT_AVAILABLE
  3087. * GENERIC_FAILURE
  3088. *
  3089. */
  3090. #define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92
  3091. /**
  3092. * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG
  3093. *
  3094. * Set CDMA Broadcast SMS config
  3095. *
  3096. * "data" is an const RIL_CDMA_BroadcastSmsConfigInfo **
  3097. * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *)
  3098. *
  3099. * "response" is NULL
  3100. *
  3101. * Valid errors:
  3102. * SUCCESS
  3103. * RADIO_NOT_AVAILABLE
  3104. * GENERIC_FAILURE
  3105. *
  3106. */
  3107. #define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93
  3108. /**
  3109. * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION
  3110. *
  3111. * Enable or disable the reception of CDMA Broadcast SMS
  3112. *
  3113. * "data" is const int *
  3114. * (const int *)data[0] indicates to activate or turn off the
  3115. * reception of CDMA Broadcast SMS, 0-1,
  3116. * 0 - Activate, 1 - Turn off
  3117. *
  3118. * "response" is NULL
  3119. *
  3120. * Valid errors:
  3121. * SUCCESS
  3122. * RADIO_NOT_AVAILABLE
  3123. * GENERIC_FAILURE
  3124. *
  3125. */
  3126. #define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94
  3127. /**
  3128. * RIL_REQUEST_CDMA_SUBSCRIPTION
  3129. *
  3130. * Request the device MDN / H_SID / H_NID.
  3131. *
  3132. * The request is only allowed when CDMA subscription is available. When CDMA
  3133. * subscription is changed, application layer should re-issue the request to
  3134. * update the subscription information.
  3135. *
  3136. * If a NULL value is returned for any of the device id, it means that error
  3137. * accessing the device.
  3138. *
  3139. * "response" is const char **
  3140. * ((const char **)response)[0] is MDN if CDMA subscription is available
  3141. * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if
  3142. * CDMA subscription is available, in decimal format
  3143. * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if
  3144. * CDMA subscription is available, in decimal format
  3145. * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
  3146. * ((const char **)response)[4] is PRL version if CDMA subscription is available
  3147. *
  3148. * Valid errors:
  3149. * SUCCESS
  3150. * RIL_E_SUBSCRIPTION_NOT_AVAILABLE
  3151. */
  3152. #define RIL_REQUEST_CDMA_SUBSCRIPTION 95
  3153. /**
  3154. * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
  3155. *
  3156. * Stores a CDMA SMS message to RUIM memory.
  3157. *
  3158. * "data" is RIL_CDMA_SMS_WriteArgs *
  3159. *
  3160. * "response" is int *
  3161. * ((const int *)response)[0] is the record index where the message is stored.
  3162. *
  3163. * Valid errors:
  3164. * SUCCESS
  3165. * RADIO_NOT_AVAILABLE
  3166. * GENERIC_FAILURE
  3167. *
  3168. */
  3169. #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96
  3170. /**
  3171. * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
  3172. *
  3173. * Deletes a CDMA SMS message from RUIM memory.
  3174. *
  3175. * "data" is int *
  3176. * ((int *)data)[0] is the record index of the message to delete.
  3177. *
  3178. * "response" is NULL
  3179. *
  3180. * Valid errors:
  3181. * SUCCESS
  3182. * RADIO_NOT_AVAILABLE
  3183. * GENERIC_FAILURE
  3184. *
  3185. */
  3186. #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97
  3187. /**
  3188. * RIL_REQUEST_DEVICE_IDENTITY
  3189. *
  3190. * Request the device ESN / MEID / IMEI / IMEISV.
  3191. *
  3192. * The request is always allowed and contains GSM and CDMA device identity;
  3193. * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and
  3194. * RIL_REQUEST_GET_IMEISV.
  3195. *
  3196. * If a NULL value is returned for any of the device id, it means that error
  3197. * accessing the device.
  3198. *
  3199. * When CDMA subscription is changed the ESN/MEID may change. The application
  3200. * layer should re-issue the request to update the device identity in this case.
  3201. *
  3202. * "response" is const char **
  3203. * ((const char **)response)[0] is IMEI if GSM subscription is available
  3204. * ((const char **)response)[1] is IMEISV if GSM subscription is available
  3205. * ((const char **)response)[2] is ESN if CDMA subscription is available
  3206. * ((const char **)response)[3] is MEID if CDMA subscription is available
  3207. *
  3208. * Valid errors:
  3209. * SUCCESS
  3210. * RADIO_NOT_AVAILABLE
  3211. * GENERIC_FAILURE
  3212. */
  3213. #define RIL_REQUEST_DEVICE_IDENTITY 98
  3214. /**
  3215. * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE
  3216. *
  3217. * Request the radio's system selection module to exit emergency
  3218. * callback mode. RIL will not respond with SUCCESS until the modem has
  3219. * completely exited from Emergency Callback Mode.
  3220. *
  3221. * "data" is NULL
  3222. *
  3223. * "response" is NULL
  3224. *
  3225. * Valid errors:
  3226. * SUCCESS
  3227. * RADIO_NOT_AVAILABLE
  3228. * GENERIC_FAILURE
  3229. *
  3230. */
  3231. #define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99
  3232. /**
  3233. * RIL_REQUEST_GET_SMSC_ADDRESS
  3234. *
  3235. * Queries the default Short Message Service Center address on the device.
  3236. *
  3237. * "data" is NULL
  3238. *
  3239. * "response" is const char * containing the SMSC address.
  3240. *
  3241. * Valid errors:
  3242. * SUCCESS
  3243. * RADIO_NOT_AVAILABLE
  3244. * GENERIC_FAILURE
  3245. *
  3246. */
  3247. #define RIL_REQUEST_GET_SMSC_ADDRESS 100
  3248. /**
  3249. * RIL_REQUEST_SET_SMSC_ADDRESS
  3250. *
  3251. * Sets the default Short Message Service Center address on the device.
  3252. *
  3253. * "data" is const char * containing the SMSC address.
  3254. *
  3255. * "response" is NULL
  3256. *
  3257. * Valid errors:
  3258. * SUCCESS
  3259. * RADIO_NOT_AVAILABLE
  3260. * GENERIC_FAILURE
  3261. *
  3262. */
  3263. #define RIL_REQUEST_SET_SMSC_ADDRESS 101
  3264. /**
  3265. * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS
  3266. *
  3267. * Indicates whether there is storage available for new SMS messages.
  3268. *
  3269. * "data" is int *
  3270. * ((int *)data)[0] is 1 if memory is available for storing new messages
  3271. * is 0 if memory capacity is exceeded
  3272. *
  3273. * "response" is NULL
  3274. *
  3275. * Valid errors:
  3276. * SUCCESS
  3277. * RADIO_NOT_AVAILABLE
  3278. * GENERIC_FAILURE
  3279. *
  3280. */
  3281. #define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102
  3282. /**
  3283. * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING
  3284. *
  3285. * Indicates that the StkSerivce is running and is
  3286. * ready to receive RIL_UNSOL_STK_XXXXX commands.
  3287. *
  3288. * "data" is NULL
  3289. * "response" is NULL
  3290. *
  3291. * Valid errors:
  3292. * SUCCESS
  3293. * RADIO_NOT_AVAILABLE
  3294. * GENERIC_FAILURE
  3295. *
  3296. */
  3297. #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103
  3298. /**
  3299. * RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
  3300. *
  3301. * Request to query the location where the CDMA subscription shall
  3302. * be retrieved
  3303. *
  3304. * "data" is NULL
  3305. *
  3306. * "response" is int *
  3307. * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
  3308. *
  3309. * Valid errors:
  3310. * SUCCESS
  3311. * RADIO_NOT_AVAILABLE
  3312. * GENERIC_FAILURE
  3313. * SUBSCRIPTION_NOT_AVAILABLE
  3314. *
  3315. * See also: RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
  3316. */
  3317. #define RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 104
  3318. /**
  3319. * RIL_REQUEST_ISIM_AUTHENTICATION
  3320. *
  3321. * Request the ISIM application on the UICC to perform AKA
  3322. * challenge/response algorithm for IMS authentication
  3323. *
  3324. * "data" is a const char * containing the challenge string in Base64 format
  3325. * "response" is a const char * containing the response in Base64 format
  3326. *
  3327. * Valid errors:
  3328. * SUCCESS
  3329. * RADIO_NOT_AVAILABLE
  3330. * GENERIC_FAILURE
  3331. */
  3332. #define RIL_REQUEST_ISIM_AUTHENTICATION 105
  3333. /**
  3334. * RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU
  3335. *
  3336. * Acknowledge successful or failed receipt of SMS previously indicated
  3337. * via RIL_UNSOL_RESPONSE_NEW_SMS, including acknowledgement TPDU to send
  3338. * as the RP-User-Data element of the RP-ACK or RP-ERROR PDU.
  3339. *
  3340. * "data" is const char **
  3341. * ((const char **)data)[0] is "1" on successful receipt (send RP-ACK)
  3342. * is "0" on failed receipt (send RP-ERROR)
  3343. * ((const char **)data)[1] is the acknowledgement TPDU in hexadecimal format
  3344. *
  3345. * "response" is NULL
  3346. *
  3347. * Valid errors:
  3348. * SUCCESS
  3349. * RADIO_NOT_AVAILABLE
  3350. * GENERIC_FAILURE
  3351. */
  3352. #define RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 106
  3353. /**
  3354. * RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS
  3355. *
  3356. * Requests to send a SAT/USAT envelope command to SIM.
  3357. * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111.
  3358. *
  3359. * This request has one difference from RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND:
  3360. * the SW1 and SW2 status bytes from the UICC response are returned along with
  3361. * the response data, using the same structure as RIL_REQUEST_SIM_IO.
  3362. *
  3363. * The RIL implementation shall perform the normal processing of a '91XX'
  3364. * response in SW1/SW2 to retrieve the pending proactive command and send it
  3365. * as an unsolicited response, as RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND does.
  3366. *
  3367. * "data" is a const char * containing the SAT/USAT command
  3368. * in hexadecimal format starting with command tag
  3369. *
  3370. * "response" is a const RIL_SIM_IO_Response *
  3371. *
  3372. * Valid errors:
  3373. * RIL_E_SUCCESS
  3374. * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  3375. * RIL_E_GENERIC_FAILURE
  3376. */
  3377. #define RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 107
  3378. /**
  3379. * RIL_REQUEST_VOICE_RADIO_TECH
  3380. *
  3381. * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only
  3382. * when radio state is RADIO_STATE_ON
  3383. *
  3384. * "data" is NULL
  3385. * "response" is int *
  3386. * ((int *) response)[0] is of type const RIL_RadioTechnology
  3387. *
  3388. * Valid errors:
  3389. * SUCCESS
  3390. * RADIO_NOT_AVAILABLE
  3391. * GENERIC_FAILURE
  3392. */
  3393. #define RIL_REQUEST_VOICE_RADIO_TECH 108
  3394. /**
  3395. * RIL_REQUEST_GET_CELL_INFO_LIST
  3396. *
  3397. * Request all of the current cell information known to the radio. The radio
  3398. * must a list of all current cells, including the neighboring cells. If for a particular
  3399. * cell information isn't known then the appropriate unknown value will be returned.
  3400. * This does not cause or change the rate of RIL_UNSOL_CELL_INFO_LIST.
  3401. *
  3402. * "data" is NULL
  3403. *
  3404. * "response" is an array of RIL_CellInfo.
  3405. */
  3406. #define RIL_REQUEST_GET_CELL_INFO_LIST 109
  3407. /**
  3408. * RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE
  3409. *
  3410. * Sets the minimum time between when RIL_UNSOL_CELL_INFO_LIST should be invoked.
  3411. * A value of 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported
  3412. * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
  3413. * a RIL_UNSOL_CELL_INFO_LIST.
  3414. *
  3415. * "data" is int *
  3416. * ((int *)data)[0] is minimum time in milliseconds
  3417. *
  3418. * "response" is NULL
  3419. *
  3420. * Valid errors:
  3421. * SUCCESS
  3422. * RADIO_NOT_AVAILABLE
  3423. * GENERIC_FAILURE
  3424. */
  3425. #define RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 110
  3426. /**
  3427. * RIL_REQUEST_SET_INITIAL_ATTACH_APN
  3428. *
  3429. * Set an apn to initial attach network
  3430. * "response" is NULL
  3431. *
  3432. * Valid errors:
  3433. * SUCCESS
  3434. * RADIO_NOT_AVAILABLE (radio resetting)
  3435. * GENERIC_FAILURE
  3436. * SUBSCRIPTION_NOT_AVAILABLE
  3437. */
  3438. #define RIL_REQUEST_SET_INITIAL_ATTACH_APN 111
  3439. /**
  3440. * RIL_REQUEST_IMS_REGISTRATION_STATE
  3441. *
  3442. * Request current IMS registration state
  3443. *
  3444. * "data" is NULL
  3445. *
  3446. * "response" is int *
  3447. * ((int *)response)[0] is registration state:
  3448. * 0 - Not registered
  3449. * 1 - Registered
  3450. *
  3451. * If ((int*)response)[0] is = 1, then ((int *) response)[1]
  3452. * must follow with IMS SMS format:
  3453. *
  3454. * ((int *) response)[1] is of type RIL_RadioTechnologyFamily
  3455. *
  3456. * Valid errors:
  3457. * SUCCESS
  3458. * RADIO_NOT_AVAILABLE
  3459. * GENERIC_FAILURE
  3460. */
  3461. #define RIL_REQUEST_IMS_REGISTRATION_STATE 112
  3462. /**
  3463. * RIL_REQUEST_IMS_SEND_SMS
  3464. *
  3465. * Send a SMS message over IMS
  3466. *
  3467. * "data" is const RIL_IMS_SMS_Message *
  3468. *
  3469. * "response" is a const RIL_SMS_Response *
  3470. *
  3471. * Based on the return error, caller decides to resend if sending sms
  3472. * fails. SMS_SEND_FAIL_RETRY means retry, and other errors means no retry.
  3473. * In case of retry, data is encoded based on Voice Technology available.
  3474. *
  3475. * Valid errors:
  3476. * SUCCESS
  3477. * RADIO_NOT_AVAILABLE
  3478. * SMS_SEND_FAIL_RETRY
  3479. * FDN_CHECK_FAILURE
  3480. * GENERIC_FAILURE
  3481. *
  3482. */
  3483. #define RIL_REQUEST_IMS_SEND_SMS 113
  3484. /**
  3485. * RIL_REQUEST_GET_DATA_CALL_PROFILE
  3486. *
  3487. * Get the Data Call Profile for a particular app type
  3488. *
  3489. * "data" is const int*
  3490. * (const int*)data[0] - App type. Value is specified the RUIM spec C.S0023-D
  3491. *
  3492. *
  3493. * "response" is a const char * containing the count and the array of profiles
  3494. * ((const int *)response)[0] Number RIL_DataCallProfileInfo structs(count)
  3495. * ((const char *)response)[1] is the buffer that contains 'count' number of
  3496. * RIL_DataCallProfileInfo structs.
  3497. *
  3498. * Valid errors:
  3499. * SUCCESS
  3500. * GENERIC_FAILURE
  3501. * RIL_E_DATA_CALL_PROFILE_ERROR
  3502. * RIL_E_DATA_CALL_PROFILE_NOT_AVAILABLE
  3503. *
  3504. */
  3505. #define RIL_REQUEST_GET_DATA_CALL_PROFILE 114
  3506. /**
  3507. * RIL_REQUEST_SET_UICC_SUBSCRIPTION
  3508. *
  3509. * Selection/de-selection of a subscription from a SIM card
  3510. * "data" is const RIL_SelectUiccSub*
  3511. *
  3512. * "response" is NULL
  3513. *
  3514. * Valid errors:
  3515. * SUCCESS
  3516. * RADIO_NOT_AVAILABLE (radio resetting)
  3517. * GENERIC_FAILURE
  3518. * SUBSCRIPTION_NOT_SUPPORTED
  3519. *
  3520. */
  3521. #define RIL_REQUEST_SET_UICC_SUBSCRIPTION 115
  3522. /**
  3523. * RIL_REQUEST_SET_DATA_SUBSCRIPTION
  3524. *
  3525. * Selects a subscription for data call setup
  3526. * "data" is NULL
  3527. *
  3528. * "response" is NULL
  3529. *
  3530. * Valid errors:
  3531. *
  3532. * SUCCESS
  3533. * RADIO_NOT_AVAILABLE (radio resetting)
  3534. * GENERIC_FAILURE
  3535. * SUBSCRIPTION_NOT_SUPPORTED
  3536. *
  3537. */
  3538. #define RIL_REQUEST_SET_DATA_SUBSCRIPTION 116
  3539. /***********************************************************************/
  3540. #define RIL_UNSOL_RESPONSE_BASE 1000
  3541. /**
  3542. * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
  3543. *
  3544. * Indicate when value of RIL_RadioState has changed.
  3545. *
  3546. * Callee will invoke RIL_RadioStateRequest method on main thread
  3547. *
  3548. * "data" is NULL
  3549. */
  3550. #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
  3551. /**
  3552. * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
  3553. *
  3554. * Indicate when call state has changed
  3555. *
  3556. * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
  3557. *
  3558. * "data" is NULL
  3559. *
  3560. * Response should be invoked on, for example,
  3561. * "RING", "BUSY", "NO CARRIER", and also call state
  3562. * transitions (DIALING->ALERTING ALERTING->ACTIVE)
  3563. *
  3564. * Redundent or extraneous invocations are tolerated
  3565. */
  3566. #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
  3567. /**
  3568. * RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
  3569. *
  3570. * Called when the voice network state changed
  3571. *
  3572. * Callee will invoke the following requests on main thread:
  3573. *
  3574. * RIL_REQUEST_VOICE_REGISTRATION_STATE
  3575. * RIL_REQUEST_OPERATOR
  3576. *
  3577. * "data" is NULL
  3578. *
  3579. * FIXME should this happen when SIM records are loaded? (eg, for
  3580. * EONS)
  3581. */
  3582. #define RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 1002
  3583. /**
  3584. * RIL_UNSOL_RESPONSE_NEW_SMS
  3585. *
  3586. * Called when new SMS is received.
  3587. *
  3588. * "data" is const char *
  3589. * This is a pointer to a string containing the PDU of an SMS-DELIVER
  3590. * as an ascii string of hex digits. The PDU starts with the SMSC address
  3591. * per TS 27.005 (+CMT:)
  3592. *
  3593. * Callee will subsequently confirm the receipt of thei SMS with a
  3594. * RIL_REQUEST_SMS_ACKNOWLEDGE
  3595. *
  3596. * No new RIL_UNSOL_RESPONSE_NEW_SMS
  3597. * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
  3598. * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
  3599. */
  3600. #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
  3601. /**
  3602. * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
  3603. *
  3604. * Called when new SMS Status Report is received.
  3605. *
  3606. * "data" is const char *
  3607. * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
  3608. * as an ascii string of hex digits. The PDU starts with the SMSC address
  3609. * per TS 27.005 (+CDS:).
  3610. *
  3611. * Callee will subsequently confirm the receipt of the SMS with a
  3612. * RIL_REQUEST_SMS_ACKNOWLEDGE
  3613. *
  3614. * No new RIL_UNSOL_RESPONSE_NEW_SMS
  3615. * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
  3616. * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
  3617. */
  3618. #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
  3619. /**
  3620. * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
  3621. *
  3622. * Called when new SMS has been stored on SIM card
  3623. *
  3624. * "data" is const int *
  3625. * ((const int *)data)[0] contains the slot index on the SIM that contains
  3626. * the new message
  3627. */
  3628. #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
  3629. /**
  3630. * RIL_UNSOL_ON_USSD
  3631. *
  3632. * Called when a new USSD message is received.
  3633. *
  3634. * "data" is const char **
  3635. * ((const char **)data)[0] points to a type code, which is
  3636. * one of these string values:
  3637. * "0" USSD-Notify -- text in ((const char **)data)[1]
  3638. * "1" USSD-Request -- text in ((const char **)data)[1]
  3639. * "2" Session terminated by network
  3640. * "3" other local client (eg, SIM Toolkit) has responded
  3641. * "4" Operation not supported
  3642. * "5" Network timeout
  3643. *
  3644. * The USSD session is assumed to persist if the type code is "1", otherwise
  3645. * the current session (if any) is assumed to have terminated.
  3646. *
  3647. * ((const char **)data)[1] points to a message string if applicable, which
  3648. * should always be in UTF-8.
  3649. */
  3650. #define RIL_UNSOL_ON_USSD 1006
  3651. /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006 */
  3652. /**
  3653. * RIL_UNSOL_ON_USSD_REQUEST
  3654. *
  3655. * Obsolete. Send via RIL_UNSOL_ON_USSD
  3656. */
  3657. #define RIL_UNSOL_ON_USSD_REQUEST 1007
  3658. /**
  3659. * RIL_UNSOL_NITZ_TIME_RECEIVED
  3660. *
  3661. * Called when radio has received a NITZ time message
  3662. *
  3663. * "data" is const char * pointing to NITZ time string
  3664. * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
  3665. */
  3666. #define RIL_UNSOL_NITZ_TIME_RECEIVED 1008
  3667. /**
  3668. * RIL_UNSOL_SIGNAL_STRENGTH
  3669. *
  3670. * Radio may report signal strength rather han have it polled.
  3671. *
  3672. * "data" is a const RIL_SignalStrength *
  3673. */
  3674. #define RIL_UNSOL_SIGNAL_STRENGTH 1009
  3675. /**
  3676. * RIL_UNSOL_DATA_CALL_LIST_CHANGED
  3677. *
  3678. * "data" is an array of RIL_Data_Call_Response_v6 identical to that
  3679. * returned by RIL_REQUEST_DATA_CALL_LIST. It is the complete list
  3680. * of current data contexts including new contexts that have been
  3681. * activated. A data call is only removed from this list when the
  3682. * framework sends a RIL_REQUEST_DEACTIVATE_DATA_CALL or the radio
  3683. * is powered off/on.
  3684. *
  3685. * See also: RIL_REQUEST_DATA_CALL_LIST
  3686. */
  3687. #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010
  3688. /**
  3689. * RIL_UNSOL_SUPP_SVC_NOTIFICATION
  3690. *
  3691. * Reports supplementary service related notification from the network.
  3692. *
  3693. * "data" is a const RIL_SuppSvcNotification *
  3694. *
  3695. */
  3696. #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
  3697. /**
  3698. * RIL_UNSOL_STK_SESSION_END
  3699. *
  3700. * Indicate when STK session is terminated by SIM.
  3701. *
  3702. * "data" is NULL
  3703. */
  3704. #define RIL_UNSOL_STK_SESSION_END 1012
  3705. /**
  3706. * RIL_UNSOL_STK_PROACTIVE_COMMAND
  3707. *
  3708. * Indicate when SIM issue a STK proactive command to applications
  3709. *
  3710. * "data" is a const char * containing SAT/USAT proactive command
  3711. * in hexadecimal format string starting with command tag
  3712. *
  3713. */
  3714. #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
  3715. /**
  3716. * RIL_UNSOL_STK_EVENT_NOTIFY
  3717. *
  3718. * Indicate when SIM notifies applcations some event happens.
  3719. * Generally, application does not need to have any feedback to
  3720. * SIM but shall be able to indicate appropriate messages to users.
  3721. *
  3722. * "data" is a const char * containing SAT/USAT commands or responses
  3723. * sent by ME to SIM or commands handled by ME, in hexadecimal format string
  3724. * starting with first byte of response data or command tag
  3725. *
  3726. */
  3727. #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
  3728. /**
  3729. * RIL_UNSOL_STK_CALL_SETUP
  3730. *
  3731. * Indicate when SIM wants application to setup a voice call.
  3732. *
  3733. * "data" is const int *
  3734. * ((const int *)data)[0] contains timeout value (in milliseconds)
  3735. */
  3736. #define RIL_UNSOL_STK_CALL_SETUP 1015
  3737. /**
  3738. * RIL_UNSOL_SIM_SMS_STORAGE_FULL
  3739. *
  3740. * Indicates that SMS storage on the SIM is full. Sent when the network
  3741. * attempts to deliver a new SMS message. Messages cannot be saved on the
  3742. * SIM until space is freed. In particular, incoming Class 2 messages
  3743. * cannot be stored.
  3744. *
  3745. * "data" is null
  3746. *
  3747. */
  3748. #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
  3749. /**
  3750. * RIL_UNSOL_SIM_REFRESH
  3751. *
  3752. * Indicates that file(s) on the SIM have been updated, or the SIM
  3753. * has been reinitialized.
  3754. *
  3755. * In the case where RIL is version 6 or older:
  3756. * "data" is an int *
  3757. * ((int *)data)[0] is a RIL_SimRefreshResult.
  3758. * ((int *)data)[1] is the EFID of the updated file if the result is
  3759. * SIM_FILE_UPDATE or NULL for any other result.
  3760. *
  3761. * In the case where RIL is version 7:
  3762. * "data" is a RIL_SimRefreshResponse_v7 *
  3763. *
  3764. * Note: If the SIM state changes as a result of the SIM refresh (eg,
  3765. * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
  3766. * should be sent.
  3767. */
  3768. #define RIL_UNSOL_SIM_REFRESH 1017
  3769. /**
  3770. * RIL_UNSOL_CALL_RING
  3771. *
  3772. * Ring indication for an incoming call (eg, RING or CRING event).
  3773. * There must be at least one RIL_UNSOL_CALL_RING at the beginning
  3774. * of a call and sending multiple is optional. If the system property
  3775. * ro.telephony.call_ring.multiple is false then the upper layers
  3776. * will generate the multiple events internally. Otherwise the vendor
  3777. * ril must generate multiple RIL_UNSOL_CALL_RING if
  3778. * ro.telephony.call_ring.multiple is true or if it is absent.
  3779. *
  3780. * The rate of these events is controlled by ro.telephony.call_ring.delay
  3781. * and has a default value of 3000 (3 seconds) if absent.
  3782. *
  3783. * "data" is null for GSM
  3784. * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA
  3785. */
  3786. #define RIL_UNSOL_CALL_RING 1018
  3787. /**
  3788. * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
  3789. *
  3790. * Indicates that SIM state changes.
  3791. *
  3792. * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread
  3793. * "data" is null
  3794. */
  3795. #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019
  3796. /**
  3797. * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
  3798. *
  3799. * Called when new CDMA SMS is received
  3800. *
  3801. * "data" is const RIL_CDMA_SMS_Message *
  3802. *
  3803. * Callee will subsequently confirm the receipt of the SMS with
  3804. * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
  3805. *
  3806. * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until
  3807. * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received
  3808. *
  3809. */
  3810. #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020
  3811. /**
  3812. * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS
  3813. *
  3814. * Called when new Broadcast SMS is received
  3815. *
  3816. * "data" can be one of the following:
  3817. * If received from GSM network, "data" is const char of 88 bytes
  3818. * which indicates each page of a CBS Message sent to the MS by the
  3819. * BTS as coded in 3GPP 23.041 Section 9.4.1.2.
  3820. * If received from UMTS network, "data" is const char of 90 up to 1252
  3821. * bytes which contain between 1 and 15 CBS Message pages sent as one
  3822. * packet to the MS by the BTS as coded in 3GPP 23.041 Section 9.4.2.2.
  3823. *
  3824. */
  3825. #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021
  3826. /**
  3827. * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL
  3828. *
  3829. * Indicates that SMS storage on the RUIM is full. Messages
  3830. * cannot be saved on the RUIM until space is freed.
  3831. *
  3832. * "data" is null
  3833. *
  3834. */
  3835. #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022
  3836. /**
  3837. * RIL_UNSOL_RESTRICTED_STATE_CHANGED
  3838. *
  3839. * Indicates a restricted state change (eg, for Domain Specific Access Control).
  3840. *
  3841. * Radio need send this msg after radio off/on cycle no matter it is changed or not.
  3842. *
  3843. * "data" is an int *
  3844. * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values.
  3845. */
  3846. #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023
  3847. /**
  3848. * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE
  3849. *
  3850. * Indicates that the radio system selection module has
  3851. * autonomously entered emergency callback mode.
  3852. *
  3853. * "data" is null
  3854. *
  3855. */
  3856. #define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024
  3857. /**
  3858. * RIL_UNSOL_CDMA_CALL_WAITING
  3859. *
  3860. * Called when CDMA radio receives a call waiting indication.
  3861. *
  3862. * "data" is const RIL_CDMA_CallWaiting *
  3863. *
  3864. */
  3865. #define RIL_UNSOL_CDMA_CALL_WAITING 1025
  3866. /**
  3867. * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS
  3868. *
  3869. * Called when CDMA radio receives an update of the progress of an
  3870. * OTASP/OTAPA call.
  3871. *
  3872. * "data" is const int *
  3873. * For CDMA this is an integer OTASP/OTAPA status listed in
  3874. * RIL_CDMA_OTA_ProvisionStatus.
  3875. *
  3876. */
  3877. #define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026
  3878. /**
  3879. * RIL_UNSOL_CDMA_INFO_REC
  3880. *
  3881. * Called when CDMA radio receives one or more info recs.
  3882. *
  3883. * "data" is const RIL_CDMA_InformationRecords *
  3884. *
  3885. */
  3886. #define RIL_UNSOL_CDMA_INFO_REC 1027
  3887. /**
  3888. * RIL_UNSOL_OEM_HOOK_RAW
  3889. *
  3890. * This is for OEM specific use.
  3891. *
  3892. * "data" is a byte[]
  3893. */
  3894. #define RIL_UNSOL_OEM_HOOK_RAW 1028
  3895. /**
  3896. * RIL_UNSOL_RINGBACK_TONE
  3897. *
  3898. * Indicates that nework doesn't have in-band information, need to
  3899. * play out-band tone.
  3900. *
  3901. * "data" is an int *
  3902. * ((int *)data)[0] == 0 for stop play ringback tone.
  3903. * ((int *)data)[0] == 1 for start play ringback tone.
  3904. */
  3905. #define RIL_UNSOL_RINGBACK_TONE 1029
  3906. /**
  3907. * RIL_UNSOL_RESEND_INCALL_MUTE
  3908. *
  3909. * Indicates that framework/application need reset the uplink mute state.
  3910. *
  3911. * There may be situations where the mute state becomes out of sync
  3912. * between the application and device in some GSM infrastructures.
  3913. *
  3914. * "data" is null
  3915. */
  3916. #define RIL_UNSOL_RESEND_INCALL_MUTE 1030
  3917. /**
  3918. * RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED
  3919. *
  3920. * Called when CDMA subscription source changed.
  3921. *
  3922. * "data" is int *
  3923. * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
  3924. */
  3925. #define RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 1031
  3926. /**
  3927. * RIL_UNSOL_CDMA_PRL_CHANGED
  3928. *
  3929. * Called when PRL (preferred roaming list) changes.
  3930. *
  3931. * "data" is int *
  3932. * ((int *)data)[0] is PRL_VERSION as would be returned by RIL_REQUEST_CDMA_SUBSCRIPTION
  3933. */
  3934. #define RIL_UNSOL_CDMA_PRL_CHANGED 1032
  3935. /**
  3936. * RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE
  3937. *
  3938. * Called when Emergency Callback Mode Ends
  3939. *
  3940. * Indicates that the radio system selection module has
  3941. * proactively exited emergency callback mode.
  3942. *
  3943. * "data" is NULL
  3944. *
  3945. */
  3946. #define RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 1033
  3947. /**
  3948. * RIL_UNSOL_RIL_CONNECTED
  3949. *
  3950. * Called the ril connects and returns the version
  3951. *
  3952. * "data" is int *
  3953. * ((int *)data)[0] is RIL_VERSION
  3954. */
  3955. #define RIL_UNSOL_RIL_CONNECTED 1034
  3956. /**
  3957. * RIL_UNSOL_VOICE_RADIO_TECH_CHANGED
  3958. *
  3959. * Indicates that voice technology has changed. Contains new radio technology
  3960. * as a data in the message.
  3961. *
  3962. * "data" is int *
  3963. * ((int *)data)[0] is of type const RIL_RadioTechnology
  3964. *
  3965. */
  3966. #define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035
  3967. /**
  3968. * RIL_UNSOL_CELL_INFO_LIST
  3969. *
  3970. * Same information as returned by RIL_REQUEST_GET_CELL_INFO_LIST, but returned
  3971. * at the rate no greater than specified by RIL_REQUEST_SET_UNSOL_CELL_INFO_RATE.
  3972. *
  3973. * "data" is NULL
  3974. *
  3975. * "response" is an array of RIL_CellInfo.
  3976. */
  3977. #define RIL_UNSOL_CELL_INFO_LIST 1036
  3978. /**
  3979. * RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED
  3980. *
  3981. * Called when IMS registration state has changed
  3982. *
  3983. * To get IMS registration state and IMS SMS format, callee needs to invoke the
  3984. * following request on main thread:
  3985. *
  3986. * RIL_REQUEST_IMS_REGISTRATION_STATE
  3987. *
  3988. * "data" is NULL
  3989. *
  3990. */
  3991. #define RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED 1037
  3992. /**
  3993. * RIL_UNSOL_ON_SS
  3994. *
  3995. * Called when SS response is received when DIAL/USSD/SS is changed to SS by
  3996. * call control.
  3997. *
  3998. * "data" is const RIL_StkCcUnsolSsResponse *
  3999. *
  4000. */
  4001. #define RIL_UNSOL_ON_SS 1039
  4002. /**
  4003. * RIL_UNSOL_STK_CC_ALPHA_NOTIFY
  4004. *
  4005. * Called when there is an ALPHA from UICC during Call Control.
  4006. *
  4007. * "data" is const char * containing ALPHA string from UICC in UTF-8 format.
  4008. *
  4009. */
  4010. #define RIL_UNSOL_STK_CC_ALPHA_NOTIFY 1040
  4011. /**
  4012. * RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED
  4013. *
  4014. * Indicated when there is a change in subscription status.
  4015. * This event will be sent in the following scenarios
  4016. * - subscription readiness at modem, which was selected by telephony layer
  4017. * - when subscription is deactivated by modem due to UICC card removal
  4018. * - When network invalidates the subscription i.e. attach reject due to authentication reject
  4019. *
  4020. * "data" is const int *
  4021. * ((const int *)data)[0] == 0 for Subscription Deactivated
  4022. * ((const int *)data)[0] == 1 for Subscription Activated
  4023. *
  4024. */
  4025. #define RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED 1041
  4026. /**
  4027. * Custom responses for HTCQualcommRIL.java
  4028. */
  4029. #define RIL_UNSOL_ENTER_LPM 1523
  4030. #define RIL_UNSOL_CDMA_3G_INDICATOR 3009
  4031. #define RIL_UNSOL_CDMA_ENHANCE_ROAMING_INDICATOR 3012
  4032. #define RIL_UNSOL_CDMA_NETWORK_BASE_PLUSCODE_DIAL 3020
  4033. #define RIL_UNSOL_RESPONSE_PHONE_MODE_CHANGE_M7 4802
  4034. #define RIL_UNSOL_RESPONSE_PHONE_MODE_CHANGE 6002
  4035. #define RIL_UNSOL_RESPONSE_VOICE_RADIO_TECH_CHANGED 21004
  4036. #define RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED_HTC 21005
  4037. #define RIL_UNSOL_RESPONSE_DATA_NETWORK_STATE_CHANGED 21007
  4038. #define RIL_UNSOL_RESPONSE_DATA_NETWORK_STATE_CHANGED_M7 5757
  4039. /***********************************************************************/
  4040. /**
  4041. * RIL_Request Function pointer
  4042. *
  4043. * @param request is one of RIL_REQUEST_*
  4044. * @param data is pointer to data defined for that RIL_REQUEST_*
  4045. * data is owned by caller, and should not be modified or freed by callee
  4046. * @param t should be used in subsequent call to RIL_onResponse
  4047. * @param datalen the length of data
  4048. *
  4049. */
  4050. typedef void (*RIL_RequestFunc) (int request, void *data,
  4051. size_t datalen, RIL_Token t);
  4052. /**
  4053. * This function should return the current radio state synchronously
  4054. */
  4055. typedef RIL_RadioState (*RIL_RadioStateRequest)();
  4056. /**
  4057. * This function returns "1" if the specified RIL_REQUEST code is
  4058. * supported and 0 if it is not
  4059. *
  4060. * @param requestCode is one of RIL_REQUEST codes
  4061. */
  4062. typedef int (*RIL_Supports)(int requestCode);
  4063. /**
  4064. * This function is called from a separate thread--not the
  4065. * thread that calls RIL_RequestFunc--and indicates that a pending
  4066. * request should be cancelled.
  4067. *
  4068. * On cancel, the callee should do its best to abandon the request and
  4069. * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
  4070. *
  4071. * Subsequent calls to RIL_onRequestComplete for this request with
  4072. * other results will be tolerated but ignored. (That is, it is valid
  4073. * to ignore the cancellation request)
  4074. *
  4075. * RIL_Cancel calls should return immediately, and not wait for cancellation
  4076. *
  4077. * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007
  4078. * interface
  4079. *
  4080. * @param t token wants to be canceled
  4081. */
  4082. typedef void (*RIL_Cancel)(RIL_Token t);
  4083. typedef void (*RIL_TimedCallback) (void *param);
  4084. /**
  4085. * Return a version string for your RIL implementation
  4086. */
  4087. typedef const char * (*RIL_GetVersion) (void);
  4088. typedef struct {
  4089. int version; /* set to RIL_VERSION */
  4090. RIL_RequestFunc onRequest;
  4091. RIL_RadioStateRequest onStateRequest;
  4092. RIL_Supports supports;
  4093. RIL_Cancel onCancel;
  4094. RIL_GetVersion getVersion;
  4095. } RIL_RadioFunctions;
  4096. typedef struct {
  4097. char *apn;
  4098. char *protocol;
  4099. int authtype;
  4100. char *username;
  4101. char *password;
  4102. } RIL_InitialAttachApn;
  4103. #ifdef RIL_SHLIB
  4104. struct RIL_Env {
  4105. /**
  4106. * "t" is parameter passed in on previous call to RIL_Notification
  4107. * routine.
  4108. *
  4109. * If "e" != SUCCESS, then response can be null/is ignored
  4110. *
  4111. * "response" is owned by caller, and should not be modified or
  4112. * freed by callee
  4113. *
  4114. * RIL_onRequestComplete will return as soon as possible
  4115. */
  4116. void (*OnRequestComplete)(RIL_Token t, RIL_Errno e,
  4117. void *response, size_t responselen);
  4118. /**
  4119. * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
  4120. * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
  4121. *
  4122. * "data" is owned by caller, and should not be modified or freed by callee
  4123. */
  4124. void (*OnUnsolicitedResponse)(int unsolResponse, const void *data,
  4125. size_t datalen);
  4126. /**
  4127. * Call user-specifed "callback" function on on the same thread that
  4128. * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
  4129. * a relative time value at which the callback is invoked. If relativeTime is
  4130. * NULL or points to a 0-filled structure, the callback will be invoked as
  4131. * soon as possible
  4132. */
  4133. void (*RequestTimedCallback) (RIL_TimedCallback callback,
  4134. void *param, const struct timeval *relativeTime);
  4135. };
  4136. /**
  4137. * RIL implementations must defined RIL_Init
  4138. * argc and argv will be command line arguments intended for the RIL implementation
  4139. * Return NULL on error
  4140. *
  4141. * @param env is environment point defined as RIL_Env
  4142. * @param argc number of arguments
  4143. * @param argv list fo arguments
  4144. *
  4145. */
  4146. const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
  4147. #else /* RIL_SHLIB */
  4148. /**
  4149. * Call this once at startup to register notification routine
  4150. *
  4151. * @param callbacks user-specifed callback function
  4152. */
  4153. void RIL_register (const RIL_RadioFunctions *callbacks);
  4154. /**
  4155. *
  4156. * RIL_onRequestComplete will return as soon as possible
  4157. *
  4158. * @param t is parameter passed in on previous call to RIL_Notification
  4159. * routine.
  4160. * @param e error code
  4161. * if "e" != SUCCESS, then response can be null/is ignored
  4162. * @param response is owned by caller, and should not be modified or
  4163. * freed by callee
  4164. * @param responselen the length of response in byte
  4165. */
  4166. void RIL_onRequestComplete(RIL_Token t, RIL_Errno e,
  4167. void *response, size_t responselen);
  4168. /**
  4169. * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
  4170. * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
  4171. * "data" is owned by caller, and should not be modified or freed by callee
  4172. * @param datalen the length of data in byte
  4173. */
  4174. void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
  4175. size_t datalen);
  4176. /**
  4177. * Call user-specifed "callback" function on on the same thread that
  4178. * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
  4179. * a relative time value at which the callback is invoked. If relativeTime is
  4180. * NULL or points to a 0-filled structure, the callback will be invoked as
  4181. * soon as possible
  4182. *
  4183. * @param callback user-specifed callback function
  4184. * @param param parameter list
  4185. * @param relativeTime a relative time value at which the callback is invoked
  4186. */
  4187. void RIL_requestTimedCallback (RIL_TimedCallback callback,
  4188. void *param, const struct timeval *relativeTime);
  4189. #endif /* RIL_SHLIB */
  4190. #ifdef __cplusplus
  4191. }
  4192. #endif
  4193. #endif /*ANDROID_RIL_H*/