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 17 #ifndef ANDROID_RIL_H 18 #define ANDROID_RIL_H 1 19 20 #include <stdlib.h> 21 #include <stdint.h> 22 #ifndef FEATURE_UNIT_TEST 23 #include <sys/time.h> 24 #endif /* !FEATURE_UNIT_TEST */ 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 #define RIL_VERSION 8 /* Current version */ 31 #define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */ 32 33 #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64 34 #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81 35 36 typedef void * RIL_Token; 37 38 typedef enum { 39 RIL_E_SUCCESS = 0, 40 RIL_E_RADIO_NOT_AVAILABLE = 1, /* If radio did not start or is resetting */ 41 RIL_E_GENERIC_FAILURE = 2, 42 RIL_E_PASSWORD_INCORRECT = 3, /* for PIN/PIN2 methods only! */ 43 RIL_E_SIM_PIN2 = 4, /* Operation requires SIM PIN2 to be entered */ 44 RIL_E_SIM_PUK2 = 5, /* Operation requires SIM PIN2 to be entered */ 45 RIL_E_REQUEST_NOT_SUPPORTED = 6, 46 RIL_E_CANCELLED = 7, 47 RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice 48 call on a Class C GPRS device */ 49 RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, /* data ops are not allowed before device 50 registers in network */ 51 RIL_E_SMS_SEND_FAIL_RETRY = 10, /* fail to send sms and need retry */ 52 RIL_E_SIM_ABSENT = 11, /* fail to set the location where CDMA subscription 53 shall be retrieved because of SIM or RUIM 54 card absent */ 55 RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12, /* fail to find CDMA subscription from specified 56 location */ 57 RIL_E_MODE_NOT_SUPPORTED = 13, /* HW does not support preferred network type */ 58 RIL_E_FDN_CHECK_FAILURE = 14, /* command failed because recipient is not on FDN list */ 59 RIL_E_ILLEGAL_SIM_OR_ME = 15 /* network selection failed due to 60 illegal SIM or ME */ 61 } RIL_Errno; 62 63 typedef enum { 64 RIL_CALL_ACTIVE = 0, 65 RIL_CALL_HOLDING = 1, 66 RIL_CALL_DIALING = 2, /* MO call only */ 67 RIL_CALL_ALERTING = 3, /* MO call only */ 68 RIL_CALL_INCOMING = 4, /* MT call only */ 69 RIL_CALL_WAITING = 5 /* MT call only */ 70 } RIL_CallState; 71 72 typedef enum { 73 RADIO_STATE_OFF = 0, /* Radio explictly powered off (eg CFUN=0) */ 74 RADIO_STATE_UNAVAILABLE = 1, /* Radio unavailable (eg, resetting or not booted) */ 75 /* States 2-9 below are deprecated. Just leaving them here for backward compatibility. */ 76 RADIO_STATE_SIM_NOT_READY = 2, /* Radio is on, but the SIM interface is not ready */ 77 RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3, /* SIM PIN locked, PUK required, network 78 personalization locked, or SIM absent */ 79 RADIO_STATE_SIM_READY = 4, /* Radio is on and SIM interface is available */ 80 RADIO_STATE_RUIM_NOT_READY = 5, /* Radio is on, but the RUIM interface is not ready */ 81 RADIO_STATE_RUIM_READY = 6, /* Radio is on and the RUIM interface is available */ 82 RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network 83 personalization locked, or RUIM absent */ 84 RADIO_STATE_NV_NOT_READY = 8, /* Radio is on, but the NV interface is not available */ 85 RADIO_STATE_NV_READY = 9, /* Radio is on and the NV interface is available */ 86 RADIO_STATE_ON = 10 /* Radio is on */ 87 } RIL_RadioState; 88 89 typedef enum { 90 RADIO_TECH_UNKNOWN = 0, 91 RADIO_TECH_GPRS = 1, 92 RADIO_TECH_EDGE = 2, 93 RADIO_TECH_UMTS = 3, 94 RADIO_TECH_IS95A = 4, 95 RADIO_TECH_IS95B = 5, 96 RADIO_TECH_1xRTT = 6, 97 RADIO_TECH_EVDO_0 = 7, 98 RADIO_TECH_EVDO_A = 8, 99 RADIO_TECH_HSDPA = 9, 100 RADIO_TECH_HSUPA = 10, 101 RADIO_TECH_HSPA = 11, 102 RADIO_TECH_EVDO_B = 12, 103 RADIO_TECH_EHRPD = 13, 104 RADIO_TECH_LTE = 14, 105 RADIO_TECH_HSPAP = 15, // HSPA+ 106 RADIO_TECH_GSM = 16 // Only supports voice 107 } RIL_RadioTechnology; 108 109 // Do we want to split Data from Voice and the use 110 // RIL_RadioTechnology for get/setPreferredVoice/Data ? 111 typedef enum { 112 PREF_NET_TYPE_GSM_WCDMA = 0, /* GSM/WCDMA (WCDMA preferred) */ 113 PREF_NET_TYPE_GSM_ONLY = 1, /* GSM only */ 114 PREF_NET_TYPE_WCDMA = 2, /* WCDMA */ 115 PREF_NET_TYPE_GSM_WCDMA_AUTO = 3, /* GSM/WCDMA (auto mode, according to PRL) */ 116 PREF_NET_TYPE_CDMA_EVDO_AUTO = 4, /* CDMA and EvDo (auto mode, according to PRL) */ 117 PREF_NET_TYPE_CDMA_ONLY = 5, /* CDMA only */ 118 PREF_NET_TYPE_EVDO_ONLY = 6, /* EvDo only */ 119 PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */ 120 PREF_NET_TYPE_LTE_CDMA_EVDO = 8, /* LTE, CDMA and EvDo */ 121 PREF_NET_TYPE_LTE_GSM_WCDMA = 9, /* LTE, GSM/WCDMA */ 122 PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */ 123 PREF_NET_TYPE_LTE_ONLY = 11 /* LTE only */ 124 } RIL_PreferredNetworkType; 125 126 /* Source for cdma subscription */ 127 typedef enum { 128 CDMA_SUBSCRIPTION_SOURCE_RUIM_SIM = 0, 129 CDMA_SUBSCRIPTION_SOURCE_NV = 1 130 } RIL_CdmaSubscriptionSource; 131 132 /* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */ 133 typedef enum { 134 RIL_UUS_TYPE1_IMPLICIT = 0, 135 RIL_UUS_TYPE1_REQUIRED = 1, 136 RIL_UUS_TYPE1_NOT_REQUIRED = 2, 137 RIL_UUS_TYPE2_REQUIRED = 3, 138 RIL_UUS_TYPE2_NOT_REQUIRED = 4, 139 RIL_UUS_TYPE3_REQUIRED = 5, 140 RIL_UUS_TYPE3_NOT_REQUIRED = 6 141 } RIL_UUS_Type; 142 143 /* User-to-User Signaling Information data coding schemes. Possible values for 144 * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been 145 * specified in section 10.5.4.25 of 3GPP TS 24.008 */ 146 typedef enum { 147 RIL_UUS_DCS_USP = 0, /* User specified protocol */ 148 RIL_UUS_DCS_OSIHLP = 1, /* OSI higher layer protocol */ 149 RIL_UUS_DCS_X244 = 2, /* X.244 */ 150 RIL_UUS_DCS_RMCF = 3, /* Reserved for system mangement 151 convergence function */ 152 RIL_UUS_DCS_IA5c = 4 /* IA5 characters */ 153 } RIL_UUS_DCS; 154 155 /* User-to-User Signaling Information defined in 3GPP 23.087 v8.0 156 * This data is passed in RIL_ExtensionRecord and rec contains this 157 * structure when type is RIL_UUS_INFO_EXT_REC */ 158 typedef struct { 159 RIL_UUS_Type uusType; /* UUS Type */ 160 RIL_UUS_DCS uusDcs; /* UUS Data Coding Scheme */ 161 int uusLength; /* Length of UUS Data */ 162 char * uusData; /* UUS Data */ 163 } RIL_UUS_Info; 164 165 /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */ 166 typedef struct { 167 char isPresent; /* non-zero if signal information record is present */ 168 char signalType; /* as defined 3.7.5.5-1 */ 169 char alertPitch; /* as defined 3.7.5.5-2 */ 170 char signal; /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */ 171 } RIL_CDMA_SignalInfoRecord; 172 173 typedef struct { 174 RIL_CallState state; 175 int index; /* Connection Index for use with, eg, AT+CHLD */ 176 int toa; /* type of address, eg 145 = intl */ 177 char isMpty; /* nonzero if is mpty call */ 178 char isMT; /* nonzero if call is mobile terminated */ 179 char als; /* ALS line indicator if available 180 (0 = line 1) */ 181 char isVoice; /* nonzero if this is is a voice call */ 182 char isVoicePrivacy; /* nonzero if CDMA voice privacy mode is active */ 183 char * number; /* Remote party number */ 184 int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */ 185 char * name; /* Remote party name */ 186 int namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */ 187 RIL_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */ 188 } RIL_Call; 189 190 /* Deprecated, use RIL_Data_Call_Response_v6 */ 191 typedef struct { 192 int cid; /* Context ID, uniquely identifies this call */ 193 int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */ 194 char * type; /* One of the PDP_type values in TS 27.007 section 10.1.1. 195 For example, "IP", "IPV6", "IPV4V6", or "PPP". */ 196 char * apn; /* ignored */ 197 char * address; /* An address, e.g., "192.0.1.3" or "2001:db8::1". */ 198 } RIL_Data_Call_Response_v4; 199 200 /* 201 * Returned by RIL_REQUEST_SETUP_DATA_CALL, RIL_REQUEST_DATA_CALL_LIST 202 * and RIL_UNSOL_DATA_CALL_LIST_CHANGED, on error status != 0. 203 */ 204 typedef struct { 205 int status; /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */ 206 int suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry 207 back-off timer value RIL wants to override the one 208 pre-configured in FW. 209 The unit is miliseconds. 210 The value < 0 means no value is suggested. 211 The value 0 means retry should be done ASAP. 212 The value of INT_MAX(0x7fffffff) means no retry. */ 213 int cid; /* Context ID, uniquely identifies this call */ 214 int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */ 215 char * type; /* One of the PDP_type values in TS 27.007 section 10.1.1. 216 For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is 217 PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported 218 such as "IP" or "IPV6" */ 219 char * ifname; /* The network interface name */ 220 char * addresses; /* A space-delimited list of addresses with optional "/" prefix length, 221 e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64". 222 May not be empty, typically 1 IPv4 or 1 IPv6 or 223 one of each. If the prefix length is absent the addresses 224 are assumed to be point to point with IPv4 having a prefix 225 length of 32 and IPv6 128. */ 226 char * dnses; /* A space-delimited list of DNS server addresses, 227 e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". 228 May be empty. */ 229 char * gateways; /* A space-delimited list of default gateway addresses, 230 e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". 231 May be empty in which case the addresses represent point 232 to point connections. */ 233 } RIL_Data_Call_Response_v6; 234 235 typedef struct { 236 int messageRef; /* TP-Message-Reference for GSM, 237 and BearerData MessageId for CDMA 238 (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */ 239 char *ackPDU; /* or NULL if n/a */ 240 int errorCode; /* See 3GPP 27.005, 3.2.5 for GSM/UMTS, 241 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA, 242 -1 if unknown or not applicable*/ 243 } RIL_SMS_Response; 244 245 /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */ 246 typedef struct { 247 int status; /* Status of message. See TS 27.005 3.1, "<stat>": */ 248 /* 0 = "REC UNREAD" */ 249 /* 1 = "REC READ" */ 250 /* 2 = "STO UNSENT" */ 251 /* 3 = "STO SENT" */ 252 char * pdu; /* PDU of message to write, as an ASCII hex string less the SMSC address, 253 the TP-layer length is "strlen(pdu)/2". */ 254 char * smsc; /* SMSC address in GSM BCD format prefixed by a length byte 255 (as expected by TS 27.005) or NULL for default SMSC */ 256 } RIL_SMS_WriteArgs; 257 258 /** Used by RIL_REQUEST_DIAL */ 259 typedef struct { 260 char * address; 261 int clir; 262 /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR" 263 * clir == 0 on "use subscription default value" 264 * clir == 1 on "CLIR invocation" (restrict CLI presentation) 265 * clir == 2 on "CLIR suppression" (allow CLI presentation) 266 */ 267 RIL_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */ 268 } RIL_Dial; 269 270 typedef struct { 271 int command; /* one of the commands listed for TS 27.007 +CRSM*/ 272 int fileid; /* EF id */ 273 char *path; /* "pathid" from TS 27.007 +CRSM command. 274 Path is in hex asciii format eg "7f205f70" 275 Path must always be provided. 276 */ 277 int p1; 278 int p2; 279 int p3; 280 char *data; /* May be NULL*/ 281 char *pin2; /* May be NULL*/ 282 } RIL_SIM_IO_v5; 283 284 typedef struct { 285 int command; /* one of the commands listed for TS 27.007 +CRSM*/ 286 int fileid; /* EF id */ 287 char *path; /* "pathid" from TS 27.007 +CRSM command. 288 Path is in hex asciii format eg "7f205f70" 289 Path must always be provided. 290 */ 291 int p1; 292 int p2; 293 int p3; 294 char *data; /* May be NULL*/ 295 char *pin2; /* May be NULL*/ 296 char *aidPtr; /* AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. */ 297 } RIL_SIM_IO_v6; 298 299 typedef struct { 300 int sw1; 301 int sw2; 302 char *simResponse; /* In hex string format ([a-fA-F0-9]*). */ 303 } RIL_SIM_IO_Response; 304 305 /* See also com.android.internal.telephony.gsm.CallForwardInfo */ 306 307 typedef struct { 308 int status; /* 309 * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 310 * status 1 = active, 0 = not active 311 * 312 * For RIL_REQUEST_SET_CALL_FORWARD: 313 * status is: 314 * 0 = disable 315 * 1 = enable 316 * 2 = interrogate 317 * 3 = registeration 318 * 4 = erasure 319 */ 320 321 int reason; /* from TS 27.007 7.11 "reason" */ 322 int serviceClass;/* From 27.007 +CCFC/+CLCK "class" 323 See table for Android mapping from 324 MMI service code 325 0 means user doesn't input class */ 326 int toa; /* "type" from TS 27.007 7.11 */ 327 char * number; /* "number" from TS 27.007 7.11. May be NULL */ 328 int timeSeconds; /* for CF no reply only */ 329 }RIL_CallForwardInfo; 330 331 typedef struct { 332 char * cid; /* Combination of LAC and Cell Id in 32 bits in GSM. 333 * Upper 16 bits is LAC and lower 16 bits 334 * is CID (as described in TS 27.005) 335 * Primary Scrambling Code (as described in TS 25.331) 336 * in 9 bits in UMTS 337 * Valid values are hexadecimal 0x0000 - 0xffffffff. 338 */ 339 int rssi; /* Received RSSI in GSM, 340 * Level index of CPICH Received Signal Code Power in UMTS 341 */ 342 } RIL_NeighboringCell; 343 344 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */ 345 typedef enum { 346 CALL_FAIL_UNOBTAINABLE_NUMBER = 1, 347 CALL_FAIL_NORMAL = 16, 348 CALL_FAIL_BUSY = 17, 349 CALL_FAIL_CONGESTION = 34, 350 CALL_FAIL_ACM_LIMIT_EXCEEDED = 68, 351 CALL_FAIL_CALL_BARRED = 240, 352 CALL_FAIL_FDN_BLOCKED = 241, 353 CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242, 354 CALL_FAIL_IMEI_NOT_ACCEPTED = 243, 355 CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000, 356 CALL_FAIL_CDMA_DROP = 1001, 357 CALL_FAIL_CDMA_INTERCEPT = 1002, 358 CALL_FAIL_CDMA_REORDER = 1003, 359 CALL_FAIL_CDMA_SO_REJECT = 1004, 360 CALL_FAIL_CDMA_RETRY_ORDER = 1005, 361 CALL_FAIL_CDMA_ACCESS_FAILURE = 1006, 362 CALL_FAIL_CDMA_PREEMPTED = 1007, 363 CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed 364 during emergency callback mode */ 365 CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */ 366 CALL_FAIL_ERROR_UNSPECIFIED = 0xffff 367 } RIL_LastCallFailCause; 368 369 /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */ 370 typedef enum { 371 PDP_FAIL_NONE = 0, /* No error, connection ok */ 372 373 /* an integer cause code defined in TS 24.008 374 section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B. 375 If the implementation does not have access to the exact cause codes, 376 then it should return one of the following values, 377 as the UI layer needs to distinguish these 378 cases for error notification and potential retries. */ 379 PDP_FAIL_OPERATOR_BARRED = 0x08, /* no retry */ 380 PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A, 381 PDP_FAIL_MISSING_UKNOWN_APN = 0x1B, /* no retry */ 382 PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C, /* no retry */ 383 PDP_FAIL_USER_AUTHENTICATION = 0x1D, /* no retry */ 384 PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E, /* no retry */ 385 PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F, 386 PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20, /* no retry */ 387 PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */ 388 PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22, 389 PDP_FAIL_NSAPI_IN_USE = 0x23, /* no retry */ 390 PDP_FAIL_REGULAR_DEACTIVATION = 0x24, /* restart radio */ 391 PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32, /* no retry */ 392 PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33, /* no retry */ 393 PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34, 394 PDP_FAIL_PROTOCOL_ERRORS = 0x6F, /* no retry */ 395 396 /* Not mentioned in the specification */ 397 PDP_FAIL_VOICE_REGISTRATION_FAIL = -1, 398 PDP_FAIL_DATA_REGISTRATION_FAIL = -2, 399 400 /* reasons for data call drop - network/modem disconnect */ 401 PDP_FAIL_SIGNAL_LOST = -3, /* no retry */ 402 PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry 403 with parameters appropriate for new technology */ 404 PDP_FAIL_RADIO_POWER_OFF = -5, /* data call was disconnected because radio was resetting, 405 powered off - no retry */ 406 PDP_FAIL_TETHERED_CALL_ACTIVE = -6, /* data call was disconnected by modem because tethered 407 mode was up on same APN/data profile - no retry until 408 tethered call is off */ 409 410 PDP_FAIL_ERROR_UNSPECIFIED = 0xffff, /* retry silently */ 411 } RIL_DataCallFailCause; 412 413 /* See RIL_REQUEST_SETUP_DATA_CALL */ 414 typedef enum { 415 RIL_DATA_PROFILE_DEFAULT = 0, 416 RIL_DATA_PROFILE_TETHERED = 1, 417 RIL_DATA_PROFILE_OEM_BASE = 1000 /* Start of OEM-specific profiles */ 418 } RIL_DataProfile; 419 420 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */ 421 typedef struct { 422 int notificationType; /* 423 * 0 = MO intermediate result code 424 * 1 = MT unsolicited result code 425 */ 426 int code; /* See 27.007 7.17 427 "code1" for MO 428 "code2" for MT. */ 429 int index; /* CUG index. See 27.007 7.17. */ 430 int type; /* "type" from 27.007 7.17 (MT only). */ 431 char * number; /* "number" from 27.007 7.17 432 (MT only, may be NULL). */ 433 } RIL_SuppSvcNotification; 434 435 #define RIL_CARD_MAX_APPS 8 436 437 typedef enum { 438 RIL_CARDSTATE_ABSENT = 0, 439 RIL_CARDSTATE_PRESENT = 1, 440 RIL_CARDSTATE_ERROR = 2 441 } RIL_CardState; 442 443 typedef enum { 444 RIL_PERSOSUBSTATE_UNKNOWN = 0, /* initial state */ 445 RIL_PERSOSUBSTATE_IN_PROGRESS = 1, /* in between each lock transition */ 446 RIL_PERSOSUBSTATE_READY = 2, /* when either SIM or RUIM Perso is finished 447 since each app can only have 1 active perso 448 involved */ 449 RIL_PERSOSUBSTATE_SIM_NETWORK = 3, 450 RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET = 4, 451 RIL_PERSOSUBSTATE_SIM_CORPORATE = 5, 452 RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER = 6, 453 RIL_PERSOSUBSTATE_SIM_SIM = 7, 454 RIL_PERSOSUBSTATE_SIM_NETWORK_PUK = 8, /* The corresponding perso lock is blocked */ 455 RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK = 9, 456 RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK = 10, 457 RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK = 11, 458 RIL_PERSOSUBSTATE_SIM_SIM_PUK = 12, 459 RIL_PERSOSUBSTATE_RUIM_NETWORK1 = 13, 460 RIL_PERSOSUBSTATE_RUIM_NETWORK2 = 14, 461 RIL_PERSOSUBSTATE_RUIM_HRPD = 15, 462 RIL_PERSOSUBSTATE_RUIM_CORPORATE = 16, 463 RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER = 17, 464 RIL_PERSOSUBSTATE_RUIM_RUIM = 18, 465 RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK = 19, /* The corresponding perso lock is blocked */ 466 RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK = 20, 467 RIL_PERSOSUBSTATE_RUIM_HRPD_PUK = 21, 468 RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK = 22, 469 RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23, 470 RIL_PERSOSUBSTATE_RUIM_RUIM_PUK = 24 471 } RIL_PersoSubstate; 472 473 typedef enum { 474 RIL_APPSTATE_UNKNOWN = 0, 475 RIL_APPSTATE_DETECTED = 1, 476 RIL_APPSTATE_PIN = 2, /* If PIN1 or UPin is required */ 477 RIL_APPSTATE_PUK = 3, /* If PUK1 or Puk for UPin is required */ 478 RIL_APPSTATE_SUBSCRIPTION_PERSO = 4, /* perso_substate should be look at 479 when app_state is assigned to this value */ 480 RIL_APPSTATE_READY = 5 481 } RIL_AppState; 482 483 typedef enum { 484 RIL_PINSTATE_UNKNOWN = 0, 485 RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1, 486 RIL_PINSTATE_ENABLED_VERIFIED = 2, 487 RIL_PINSTATE_DISABLED = 3, 488 RIL_PINSTATE_ENABLED_BLOCKED = 4, 489 RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5 490 } RIL_PinState; 491 492 typedef enum { 493 RIL_APPTYPE_UNKNOWN = 0, 494 RIL_APPTYPE_SIM = 1, 495 RIL_APPTYPE_USIM = 2, 496 RIL_APPTYPE_RUIM = 3, 497 RIL_APPTYPE_CSIM = 4, 498 RIL_APPTYPE_ISIM = 5 499 } RIL_AppType; 500 501 typedef struct 502 { 503 RIL_AppType app_type; 504 RIL_AppState app_state; 505 RIL_PersoSubstate perso_substate; /* applicable only if app_state == 506 RIL_APPSTATE_SUBSCRIPTION_PERSO */ 507 char *aid_ptr; /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41, 508 0x30, 0x30, 0x30 */ 509 char *app_label_ptr; /* null terminated string */ 510 int pin1_replaced; /* applicable to USIM, CSIM & ISIM */ 511 RIL_PinState pin1; 512 RIL_PinState pin2; 513 } RIL_AppStatus; 514 515 /* Deprecated, use RIL_CardStatus_v6 */ 516 typedef struct 517 { 518 RIL_CardState card_state; 519 RIL_PinState universal_pin_state; /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */ 520 int gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */ 521 int cdma_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */ 522 int num_applications; /* value <= RIL_CARD_MAX_APPS */ 523 RIL_AppStatus applications[RIL_CARD_MAX_APPS]; 524 } RIL_CardStatus_v5; 525 526 typedef struct 527 { 528 RIL_CardState card_state; 529 RIL_PinState universal_pin_state; /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */ 530 int gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */ 531 int cdma_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */ 532 int ims_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_v6; 536 537 /** The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH 538 * or as part of RIL_SimRefreshResponse_v7 539 */ 540 typedef enum { 541 /* A file on SIM has been updated. data[1] contains the EFID. */ 542 SIM_FILE_UPDATE = 0, 543 /* SIM initialized. All files should be re-read. */ 544 SIM_INIT = 1, 545 /* SIM reset. SIM power required, SIM may be locked and all files should be re-read. */ 546 SIM_RESET = 2 547 } RIL_SimRefreshResult; 548 549 typedef struct { 550 RIL_SimRefreshResult result; 551 int ef_id; /* is the EFID of the updated file if the result is */ 552 /* SIM_FILE_UPDATE or 0 for any other result. */ 553 char * aid; /* is AID(application ID) of the card application */ 554 /* See ETSI 102.221 8.1 and 101.220 4 */ 555 /* For SIM_FILE_UPDATE result it can be set to AID of */ 556 /* application in which updated EF resides or it can be */ 557 /* NULL if EF is outside of an application. */ 558 /* For SIM_INIT result this field is set to AID of */ 559 /* application that caused REFRESH */ 560 /* For SIM_RESET result it is NULL. */ 561 } RIL_SimRefreshResponse_v7; 562 563 /* Deprecated, use RIL_CDMA_CallWaiting_v6 */ 564 typedef struct { 565 char * number; /* Remote party number */ 566 int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */ 567 char * name; /* Remote party name */ 568 RIL_CDMA_SignalInfoRecord signalInfoRecord; 569 } RIL_CDMA_CallWaiting_v5; 570 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 /* Number type/Number plan required to support International Call Waiting */ 577 int number_type; /* 0=Unknown, 1=International, 2=National, 578 3=Network specific, 4=subscriber */ 579 int number_plan; /* 0=Unknown, 1=ISDN, 3=Data, 4=Telex, 8=Nat'l, 9=Private */ 580 } RIL_CDMA_CallWaiting_v6; 581 582 /** 583 * Which types of Cell Broadcast Message (CBM) are to be received by the ME 584 * 585 * uFromServiceID - uToServiceID defines a range of CBM message identifiers 586 * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS 587 * and 9.4.4.2.2 for UMTS. All other values can be treated as empty 588 * CBM message ID. 589 * 590 * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes 591 * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS 592 * and 9.4.4.2.3 for UMTS. 593 * All other values can be treated as empty CBM data coding scheme. 594 * 595 * selected 0 means message types specified in <fromServiceId, toServiceId> 596 * and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted. 597 * 598 * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and 599 * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG. 600 */ 601 typedef struct { 602 int fromServiceId; 603 int toServiceId; 604 int fromCodeScheme; 605 int toCodeScheme; 606 unsigned char selected; 607 } RIL_GSM_BroadcastSmsConfigInfo; 608 609 /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */ 610 #define RIL_RESTRICTED_STATE_NONE 0x00 611 /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */ 612 #define RIL_RESTRICTED_STATE_CS_EMERGENCY 0x01 613 /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */ 614 #define RIL_RESTRICTED_STATE_CS_NORMAL 0x02 615 /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/ 616 #define RIL_RESTRICTED_STATE_CS_ALL 0x04 617 /* Block packet data access due to restriction. */ 618 #define RIL_RESTRICTED_STATE_PS_ALL 0x10 619 620 /* The status for an OTASP/OTAPA session */ 621 typedef enum { 622 CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED, 623 CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED, 624 CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED, 625 CDMA_OTA_PROVISION_STATUS_SSD_UPDATED, 626 CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED, 627 CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED, 628 CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED, 629 CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED, 630 CDMA_OTA_PROVISION_STATUS_COMMITTED, 631 CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED, 632 CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED, 633 CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED 634 } RIL_CDMA_OTA_ProvisionStatus; 635 636 typedef struct { 637 int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */ 638 int bitErrorRate; /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */ 639 } RIL_GW_SignalStrength; 640 641 typedef struct { 642 int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */ 643 int bitErrorRate; /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */ 644 } RIL_SignalStrengthWcdma; 645 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 657 658 typedef struct { 659 int dbm; /* Valid values are positive integers. This value is the actual RSSI value 660 * multiplied by -1. Example: If the actual RSSI is -75, then this response 661 * value will be 75. 662 */ 663 int ecio; /* Valid values are positive integers. This value is the actual Ec/Io multiplied 664 * by -10. Example: If the actual Ec/Io is -12.5 dB, then this response value 665 * will be 125. 666 */ 667 int signalNoiseRatio; /* Valid values are 0-8. 8 is the highest signal to noise ratio. */ 668 } RIL_EVDO_SignalStrength; 669 670 typedef struct { 671 int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */ 672 int rsrp; /* The current Reference Signal Receive Power in dBm multipled by -1. 673 * Range: 44 to 140 dBm 674 * INT_MAX: 0x7FFFFFFF denotes invalid value. 675 * Reference: 3GPP TS 36.133 9.1.4 */ 676 int rsrq; /* The current Reference Signal Receive Quality in dB multiplied by -1. 677 * Range: 20 to 3 dB. 678 * INT_MAX: 0x7FFFFFFF denotes invalid value. 679 * Reference: 3GPP TS 36.133 9.1.7 */ 680 int rssnr; /* The current reference signal signal-to-noise ratio in 0.1 dB units. 681 * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB). 682 * INT_MAX : 0x7FFFFFFF denotes invalid value. 683 * Reference: 3GPP TS 36.101 8.1.1 */ 684 int cqi; /* The current Channel Quality Indicator. 685 * Range: 0 to 15. 686 * INT_MAX : 0x7FFFFFFF denotes invalid value. 687 * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */ 688 } RIL_LTE_SignalStrength; 689 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 716 /* Deprecated, use RIL_SignalStrength_v6 */ 717 typedef struct { 718 RIL_GW_SignalStrength GW_SignalStrength; 719 RIL_CDMA_SignalStrength CDMA_SignalStrength; 720 RIL_EVDO_SignalStrength EVDO_SignalStrength; 721 } RIL_SignalStrength_v5; 722 723 typedef struct { 724 RIL_GW_SignalStrength GW_SignalStrength; 725 RIL_CDMA_SignalStrength CDMA_SignalStrength; 726 RIL_EVDO_SignalStrength EVDO_SignalStrength; 727 RIL_LTE_SignalStrength LTE_SignalStrength; 728 } RIL_SignalStrength_v6; 729 730 typedef struct { 731 RIL_GW_SignalStrength GW_SignalStrength; 732 RIL_CDMA_SignalStrength CDMA_SignalStrength; 733 RIL_EVDO_SignalStrength EVDO_SignalStrength; 734 RIL_LTE_SignalStrength_v8 LTE_SignalStrength; 735 } RIL_SignalStrength_v8; 736 737 /** RIL_CellIdentityGsm */ 738 typedef struct { 739 int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ 740 int mnc; /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */ 741 int lac; /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown */ 742 int cid; /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown */ 743 } RIL_CellIdentityGsm; 744 745 /** RIL_CellIdentityWcdma */ 746 typedef struct { 747 int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ 748 int mnc; /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */ 749 int lac; /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown */ 750 int cid; /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown */ 751 int psc; /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */ 752 } RIL_CellIdentityWcdma; 753 754 /** RIL_CellIdentityCdma */ 755 typedef struct { 756 int networkId; /* Network Id 0..65535, INT_MAX if unknown */ 757 int systemId; /* CDMA System Id 0..32767, INT_MAX if unknown */ 758 int basestationId; /* Base Station Id 0..65535, INT_MAX if unknown */ 759 int longitude; /* Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. 760 * It is represented in units of 0.25 seconds and ranges from -2592000 761 * to 2592000, both values inclusive (corresponding to a range of -180 762 * to +180 degrees). INT_MAX if unknown */ 763 764 int latitude; /* Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. 765 * It is represented in units of 0.25 seconds and ranges from -1296000 766 * to 1296000, both values inclusive (corresponding to a range of -90 767 * to +90 degrees). INT_MAX if unknown */ 768 } RIL_CellIdentityCdma; 769 770 /** RIL_CellIdentityLte */ 771 typedef struct { 772 int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ 773 int mnc; /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */ 774 int ci; /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */ 775 int pci; /* physical cell id 0..503, INT_MAX if unknown */ 776 int tac; /* 16-bit tracking area code, INT_MAX if unknown */ 777 } RIL_CellIdentityLte; 778 779 /** RIL_CellInfoGsm */ 780 typedef struct { 781 RIL_CellIdentityGsm cellIdentityGsm; 782 RIL_GW_SignalStrength signalStrengthGsm; 783 } RIL_CellInfoGsm; 784 785 /** RIL_CellInfoWcdma */ 786 typedef struct { 787 RIL_CellIdentityWcdma cellIdentityWcdma; 788 RIL_SignalStrengthWcdma signalStrengthWcdma; 789 } RIL_CellInfoWcdma; 790 791 /** RIL_CellInfoCdma */ 792 typedef struct { 793 RIL_CellIdentityCdma cellIdentityCdma; 794 RIL_CDMA_SignalStrength signalStrengthCdma; 795 RIL_EVDO_SignalStrength signalStrengthEvdo; 796 } RIL_CellInfoCdma; 797 798 /** RIL_CellInfoLte */ 799 typedef struct { 800 RIL_CellIdentityLte cellIdentityLte; 801 RIL_LTE_SignalStrength_v8 signalStrengthLte; 802 } RIL_CellInfoLte; 803 804 // Must be the same as CellInfo.TYPE_XXX 805 typedef enum { 806 RIL_CELL_INFO_TYPE_GSM = 1, 807 RIL_CELL_INFO_TYPE_CDMA = 2, 808 RIL_CELL_INFO_TYPE_LTE = 3, 809 RIL_CELL_INFO_TYPE_WCDMA = 4, 810 } RIL_CellInfoType; 811 812 // Must be the same as CellInfo.TIMESTAMP_TYPE_XXX 813 typedef enum { 814 RIL_TIMESTAMP_TYPE_UNKNOWN = 0, 815 RIL_TIMESTAMP_TYPE_ANTENNA = 1, 816 RIL_TIMESTAMP_TYPE_MODEM = 2, 817 RIL_TIMESTAMP_TYPE_OEM_RIL = 3, 818 RIL_TIMESTAMP_TYPE_JAVA_RIL = 4, 819 } RIL_TimeStampType; 820 821 typedef struct { 822 RIL_CellInfoType cellInfoType; /* cell type for selecting from union CellInfo */ 823 int registered; /* !0 if this cell is registered 0 if not registered */ 824 RIL_TimeStampType timeStampType; /* type of time stamp represented by timeStamp */ 825 uint64_t timeStamp; /* Time in nanos as returned by ril_nano_time */ 826 union { 827 RIL_CellInfoGsm gsm; 828 RIL_CellInfoCdma cdma; 829 RIL_CellInfoLte lte; 830 RIL_CellInfoWcdma wcdma; 831 } CellInfo; 832 } RIL_CellInfo; 833 834 /* Names of the CDMA info records (C.S0005 section 3.7.5) */ 835 typedef enum { 836 RIL_CDMA_DISPLAY_INFO_REC, 837 RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC, 838 RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC, 839 RIL_CDMA_CONNECTED_NUMBER_INFO_REC, 840 RIL_CDMA_SIGNAL_INFO_REC, 841 RIL_CDMA_REDIRECTING_NUMBER_INFO_REC, 842 RIL_CDMA_LINE_CONTROL_INFO_REC, 843 RIL_CDMA_EXTENDED_DISPLAY_INFO_REC, 844 RIL_CDMA_T53_CLIR_INFO_REC, 845 RIL_CDMA_T53_RELEASE_INFO_REC, 846 RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC 847 } RIL_CDMA_InfoRecName; 848 849 /* Display Info Rec as defined in C.S0005 section 3.7.5.1 850 Extended Display Info Rec as defined in C.S0005 section 3.7.5.16 851 Note: the Extended Display info rec contains multiple records of the 852 form: display_tag, display_len, and display_len occurrences of the 853 chari field if the display_tag is not 10000000 or 10000001. 854 To save space, the records are stored consecutively in a byte buffer. 855 The display_tag, display_len and chari fields are all 1 byte. 856 */ 857 858 typedef struct { 859 char alpha_len; 860 char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH]; 861 } RIL_CDMA_DisplayInfoRecord; 862 863 /* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2 864 Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3 865 Connected Number Info Rec as defined in C.S0005 section 3.7.5.4 866 */ 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 877 /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */ 878 typedef enum { 879 RIL_REDIRECTING_REASON_UNKNOWN = 0, 880 RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1, 881 RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2, 882 RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9, 883 RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10, 884 RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15, 885 RIL_REDIRECTING_REASON_RESERVED 886 } RIL_CDMA_RedirectingReason; 887 888 typedef struct { 889 RIL_CDMA_NumberInfoRecord redirectingNumber; 890 /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */ 891 RIL_CDMA_RedirectingReason redirectingReason; 892 } RIL_CDMA_RedirectingNumberInfoRecord; 893 894 /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */ 895 typedef struct { 896 char lineCtrlPolarityIncluded; 897 char lineCtrlToggle; 898 char lineCtrlReverse; 899 char lineCtrlPowerDenial; 900 } RIL_CDMA_LineControlInfoRecord; 901 902 /* T53 CLIR Information Record */ 903 typedef struct { 904 char cause; 905 } RIL_CDMA_T53_CLIRInfoRecord; 906 907 /* T53 Audio Control Information Record */ 908 typedef struct { 909 char upLink; 910 char downLink; 911 } RIL_CDMA_T53_AudioControlInfoRecord; 912 913 typedef struct { 914 915 RIL_CDMA_InfoRecName name; 916 917 union { 918 /* Display and Extended Display Info Rec */ 919 RIL_CDMA_DisplayInfoRecord display; 920 921 /* Called Party Number, Calling Party Number, Connected Number Info Rec */ 922 RIL_CDMA_NumberInfoRecord number; 923 924 /* Signal Info Rec */ 925 RIL_CDMA_SignalInfoRecord signal; 926 927 /* Redirecting Number Info Rec */ 928 RIL_CDMA_RedirectingNumberInfoRecord redir; 929 930 /* Line Control Info Rec */ 931 RIL_CDMA_LineControlInfoRecord lineCtrl; 932 933 /* T53 CLIR Info Rec */ 934 RIL_CDMA_T53_CLIRInfoRecord clir; 935 936 /* T53 Audio Control Info Rec */ 937 RIL_CDMA_T53_AudioControlInfoRecord audioCtrl; 938 } rec; 939 } RIL_CDMA_InformationRecord; 940 941 #define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10 942 943 typedef struct { 944 char numberOfInfoRecs; 945 RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS]; 946 } RIL_CDMA_InformationRecords; 947 948 /** 949 * RIL_REQUEST_GET_SIM_STATUS 950 * 951 * Requests status of the SIM interface and the SIM card 952 * 953 * "data" is NULL 954 * 955 * "response" is const RIL_CardStatus_v6 * 956 * 957 * Valid errors: 958 * Must never fail 959 */ 960 #define RIL_REQUEST_GET_SIM_STATUS 1 961 962 /** 963 * RIL_REQUEST_ENTER_SIM_PIN 964 * 965 * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state 966 * 967 * "data" is const char ** 968 * ((const char **)data)[0] is PIN value 969 * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. 970 * 971 * "response" is int * 972 * ((int *)response)[0] is the number of retries remaining, or -1 if unknown 973 * 974 * Valid errors: 975 * 976 * SUCCESS 977 * RADIO_NOT_AVAILABLE (radio resetting) 978 * GENERIC_FAILURE 979 * PASSWORD_INCORRECT 980 */ 981 982 #define RIL_REQUEST_ENTER_SIM_PIN 2 983 984 985 /** 986 * RIL_REQUEST_ENTER_SIM_PUK 987 * 988 * Supplies SIM PUK and new PIN. 989 * 990 * "data" is const char ** 991 * ((const char **)data)[0] is PUK value 992 * ((const char **)data)[1] is new PIN value 993 * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. 994 * 995 * "response" is int * 996 * ((int *)response)[0] is the number of retries remaining, or -1 if unknown 997 * 998 * Valid errors: 999 * 1000 * SUCCESS 1001 * RADIO_NOT_AVAILABLE (radio resetting) 1002 * GENERIC_FAILURE 1003 * PASSWORD_INCORRECT 1004 * (PUK is invalid) 1005 */ 1006 1007 #define RIL_REQUEST_ENTER_SIM_PUK 3 1008 1009 /** 1010 * RIL_REQUEST_ENTER_SIM_PIN2 1011 * 1012 * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was 1013 * returned as a a failure from a previous operation. 1014 * 1015 * "data" is const char ** 1016 * ((const char **)data)[0] is PIN2 value 1017 * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. 1018 * 1019 * "response" is int * 1020 * ((int *)response)[0] is the number of retries remaining, or -1 if unknown 1021 * 1022 * Valid errors: 1023 * 1024 * SUCCESS 1025 * RADIO_NOT_AVAILABLE (radio resetting) 1026 * GENERIC_FAILURE 1027 * PASSWORD_INCORRECT 1028 */ 1029 1030 #define RIL_REQUEST_ENTER_SIM_PIN2 4 1031 1032 /** 1033 * RIL_REQUEST_ENTER_SIM_PUK2 1034 * 1035 * Supplies SIM PUK2 and new PIN2. 1036 * 1037 * "data" is const char ** 1038 * ((const char **)data)[0] is PUK2 value 1039 * ((const char **)data)[1] is new PIN2 value 1040 * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. 1041 * 1042 * "response" is int * 1043 * ((int *)response)[0] is the number of retries remaining, or -1 if unknown 1044 * 1045 * Valid errors: 1046 * 1047 * SUCCESS 1048 * RADIO_NOT_AVAILABLE (radio resetting) 1049 * GENERIC_FAILURE 1050 * PASSWORD_INCORRECT 1051 * (PUK2 is invalid) 1052 */ 1053 1054 #define RIL_REQUEST_ENTER_SIM_PUK2 5 1055 1056 /** 1057 * RIL_REQUEST_CHANGE_SIM_PIN 1058 * 1059 * Supplies old SIM PIN and new PIN. 1060 * 1061 * "data" is const char ** 1062 * ((const char **)data)[0] is old PIN value 1063 * ((const char **)data)[1] is new PIN value 1064 * ((const char **)data)[2] 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 * (old PIN is invalid) 1076 * 1077 */ 1078 1079 #define RIL_REQUEST_CHANGE_SIM_PIN 6 1080 1081 1082 /** 1083 * RIL_REQUEST_CHANGE_SIM_PIN2 1084 * 1085 * Supplies old SIM PIN2 and new PIN2. 1086 * 1087 * "data" is const char ** 1088 * ((const char **)data)[0] is old PIN2 value 1089 * ((const char **)data)[1] is new PIN2 value 1090 * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. 1091 * 1092 * "response" is int * 1093 * ((int *)response)[0] is the number of retries remaining, or -1 if unknown 1094 * 1095 * Valid errors: 1096 * 1097 * SUCCESS 1098 * RADIO_NOT_AVAILABLE (radio resetting) 1099 * GENERIC_FAILURE 1100 * PASSWORD_INCORRECT 1101 * (old PIN2 is invalid) 1102 * 1103 */ 1104 1105 #define RIL_REQUEST_CHANGE_SIM_PIN2 7 1106 1107 /** 1108 * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 1109 * 1110 * Requests that network personlization be deactivated 1111 * 1112 * "data" is const char ** 1113 * ((const char **)(data))[0]] is network depersonlization code 1114 * 1115 * "response" is int * 1116 * ((int *)response)[0] is the number of retries remaining, or -1 if unknown 1117 * 1118 * Valid errors: 1119 * 1120 * SUCCESS 1121 * RADIO_NOT_AVAILABLE (radio resetting) 1122 * GENERIC_FAILURE 1123 * PASSWORD_INCORRECT 1124 * (code is invalid) 1125 */ 1126 1127 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8 1128 1129 /** 1130 * RIL_REQUEST_GET_CURRENT_CALLS 1131 * 1132 * Requests current call list 1133 * 1134 * "data" is NULL 1135 * 1136 * "response" must be a "const RIL_Call **" 1137 * 1138 * Valid errors: 1139 * 1140 * SUCCESS 1141 * RADIO_NOT_AVAILABLE (radio resetting) 1142 * GENERIC_FAILURE 1143 * (request will be made again in a few hundred msec) 1144 */ 1145 1146 #define RIL_REQUEST_GET_CURRENT_CALLS 9 1147 1148 1149 /** 1150 * RIL_REQUEST_DIAL 1151 * 1152 * Initiate voice call 1153 * 1154 * "data" is const RIL_Dial * 1155 * "response" is NULL 1156 * 1157 * This method is never used for supplementary service codes 1158 * 1159 * Valid errors: 1160 * SUCCESS 1161 * RADIO_NOT_AVAILABLE (radio resetting) 1162 * GENERIC_FAILURE 1163 */ 1164 #define RIL_REQUEST_DIAL 10 1165 1166 /** 1167 * RIL_REQUEST_GET_IMSI 1168 * 1169 * Get the SIM IMSI 1170 * 1171 * Only valid when radio state is "RADIO_STATE_ON" 1172 * 1173 * "data" is const char ** 1174 * ((const char **)data)[0] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. 1175 * "response" is a const char * containing the IMSI 1176 * 1177 * Valid errors: 1178 * SUCCESS 1179 * RADIO_NOT_AVAILABLE (radio resetting) 1180 * GENERIC_FAILURE 1181 */ 1182 1183 #define RIL_REQUEST_GET_IMSI 11 1184 1185 /** 1186 * RIL_REQUEST_HANGUP 1187 * 1188 * Hang up a specific line (like AT+CHLD=1x) 1189 * 1190 * After this HANGUP request returns, RIL should show the connection is NOT 1191 * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query. 1192 * 1193 * "data" is an int * 1194 * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) 1195 * 1196 * "response" is NULL 1197 * 1198 * Valid errors: 1199 * SUCCESS 1200 * RADIO_NOT_AVAILABLE (radio resetting) 1201 * GENERIC_FAILURE 1202 */ 1203 1204 #define RIL_REQUEST_HANGUP 12 1205 1206 /** 1207 * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 1208 * 1209 * Hang up waiting or held (like AT+CHLD=0) 1210 * 1211 * After this HANGUP request returns, RIL should show the connection is NOT 1212 * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query. 1213 * 1214 * "data" is NULL 1215 * "response" is NULL 1216 * 1217 * Valid errors: 1218 * SUCCESS 1219 * RADIO_NOT_AVAILABLE (radio resetting) 1220 * GENERIC_FAILURE 1221 */ 1222 1223 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13 1224 1225 /** 1226 * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 1227 * 1228 * Hang up waiting or held (like AT+CHLD=1) 1229 * 1230 * After this HANGUP request returns, RIL should show the connection is NOT 1231 * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query. 1232 * 1233 * "data" is NULL 1234 * "response" is NULL 1235 * 1236 * Valid errors: 1237 * SUCCESS 1238 * RADIO_NOT_AVAILABLE (radio resetting) 1239 * GENERIC_FAILURE 1240 */ 1241 1242 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14 1243 1244 /** 1245 * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 1246 * 1247 * Switch waiting or holding call and active call (like AT+CHLD=2) 1248 * 1249 * State transitions should be is follows: 1250 * 1251 * If call 1 is waiting and call 2 is active, then if this re 1252 * 1253 * BEFORE AFTER 1254 * Call 1 Call 2 Call 1 Call 2 1255 * ACTIVE HOLDING HOLDING ACTIVE 1256 * ACTIVE WAITING HOLDING ACTIVE 1257 * HOLDING WAITING HOLDING ACTIVE 1258 * ACTIVE IDLE HOLDING IDLE 1259 * IDLE IDLE IDLE IDLE 1260 * 1261 * "data" is NULL 1262 * "response" is NULL 1263 * 1264 * Valid errors: 1265 * SUCCESS 1266 * RADIO_NOT_AVAILABLE (radio resetting) 1267 * GENERIC_FAILURE 1268 */ 1269 1270 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15 1271 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15 1272 1273 /** 1274 * RIL_REQUEST_CONFERENCE 1275 * 1276 * Conference holding and active (like AT+CHLD=3) 1277 1278 * "data" is NULL 1279 * "response" is NULL 1280 * 1281 * Valid errors: 1282 * SUCCESS 1283 * RADIO_NOT_AVAILABLE (radio resetting) 1284 * GENERIC_FAILURE 1285 */ 1286 #define RIL_REQUEST_CONFERENCE 16 1287 1288 /** 1289 * RIL_REQUEST_UDUB 1290 * 1291 * Send UDUB (user determined used busy) to ringing or 1292 * waiting call answer)(RIL_BasicRequest r); 1293 * 1294 * "data" is NULL 1295 * "response" is NULL 1296 * 1297 * Valid errors: 1298 * SUCCESS 1299 * RADIO_NOT_AVAILABLE (radio resetting) 1300 * GENERIC_FAILURE 1301 */ 1302 #define RIL_REQUEST_UDUB 17 1303 1304 /** 1305 * RIL_REQUEST_LAST_CALL_FAIL_CAUSE 1306 * 1307 * Requests the failure cause code for the most recently terminated call 1308 * 1309 * "data" is NULL 1310 * "response" is a "int *" 1311 * ((int *)response)[0] is RIL_LastCallFailCause. GSM failure reasons are 1312 * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA 1313 * failure reasons are derived from the possible call failure scenarios 1314 * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard. 1315 * 1316 * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked 1317 * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED) 1318 * 1319 * If the implementation does not have access to the exact cause codes, 1320 * then it should return one of the values listed in RIL_LastCallFailCause, 1321 * as the UI layer needs to distinguish these cases for tone generation or 1322 * error notification. 1323 * 1324 * Valid errors: 1325 * SUCCESS 1326 * RADIO_NOT_AVAILABLE 1327 * GENERIC_FAILURE 1328 * 1329 * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 1330 */ 1331 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18 1332 1333 /** 1334 * RIL_REQUEST_SIGNAL_STRENGTH 1335 * 1336 * Requests current signal strength and associated information 1337 * 1338 * Must succeed if radio is on. 1339 * 1340 * "data" is NULL 1341 * 1342 * "response" is a const RIL_SignalStrength * 1343 * 1344 * Valid errors: 1345 * SUCCESS 1346 * RADIO_NOT_AVAILABLE 1347 */ 1348 #define RIL_REQUEST_SIGNAL_STRENGTH 19 1349 1350 /** 1351 * RIL_REQUEST_VOICE_REGISTRATION_STATE 1352 * 1353 * Request current registration state 1354 * 1355 * "data" is NULL 1356 * "response" is a "char **" 1357 * ((const char **)response)[0] is registration state 0-6, 1358 * 0 - Not registered, MT is not currently searching 1359 * a new operator to register 1360 * 1 - Registered, home network 1361 * 2 - Not registered, but MT is currently searching 1362 * a new operator to register 1363 * 3 - Registration denied 1364 * 4 - Unknown 1365 * 5 - Registered, roaming 1366 * 10 - Same as 0, but indicates that emergency calls 1367 * are enabled. 1368 * 12 - Same as 2, but indicates that emergency calls 1369 * are enabled. 1370 * 13 - Same as 3, but indicates that emergency calls 1371 * are enabled. 1372 * 14 - Same as 4, but indicates that emergency calls 1373 * are enabled. 1374 * 1375 * ((const char **)response)[1] is LAC if registered on a GSM/WCDMA system or 1376 * NULL if not.Valid LAC are 0x0000 - 0xffff 1377 * ((const char **)response)[2] is CID if registered on a * GSM/WCDMA or 1378 * NULL if not. 1379 * Valid CID are 0x00000000 - 0xffffffff 1380 * In GSM, CID is Cell ID (see TS 27.007) 1381 * in 16 bits 1382 * In UMTS, CID is UMTS Cell Identity 1383 * (see TS 25.331) in 28 bits 1384 * ((const char **)response)[3] indicates the available voice radio technology, 1385 * valid values as defined by RIL_RadioTechnology. 1386 * ((const char **)response)[4] is Base Station ID if registered on a CDMA 1387 * system or NULL if not. Base Station ID in 1388 * decimal format 1389 * ((const char **)response)[5] is Base Station latitude if registered on a 1390 * CDMA system or NULL if not. Base Station 1391 * latitude is a decimal number as specified in 1392 * 3GPP2 C.S0005-A v6.0. It is represented in 1393 * units of 0.25 seconds and ranges from -1296000 1394 * to 1296000, both values inclusive (corresponding 1395 * to a range of -90 to +90 degrees). 1396 * ((const char **)response)[6] is Base Station longitude if registered on a 1397 * CDMA system or NULL if not. Base Station 1398 * longitude is a decimal number as specified in 1399 * 3GPP2 C.S0005-A v6.0. It is represented in 1400 * units of 0.25 seconds and ranges from -2592000 1401 * to 2592000, both values inclusive (corresponding 1402 * to a range of -180 to +180 degrees). 1403 * ((const char **)response)[7] is concurrent services support indicator if 1404 * registered on a CDMA system 0-1. 1405 * 0 - Concurrent services not supported, 1406 * 1 - Concurrent services supported 1407 * ((const char **)response)[8] is System ID if registered on a CDMA system or 1408 * NULL if not. Valid System ID are 0 - 32767 1409 * ((const char **)response)[9] is Network ID if registered on a CDMA system or 1410 * NULL if not. Valid System ID are 0 - 65535 1411 * ((const char **)response)[10] is the TSB-58 Roaming Indicator if registered 1412 * on a CDMA or EVDO system or NULL if not. Valid values 1413 * are 0-255. 1414 * ((const char **)response)[11] indicates whether the current system is in the 1415 * PRL if registered on a CDMA or EVDO system or NULL if 1416 * not. 0=not in the PRL, 1=in the PRL 1417 * ((const char **)response)[12] is the default Roaming Indicator from the PRL, 1418 * if registered on a CDMA or EVDO system or NULL if not. 1419 * Valid values are 0-255. 1420 * ((const char **)response)[13] if registration state is 3 (Registration 1421 * denied) this is an enumerated reason why 1422 * registration was denied. See 3GPP TS 24.008, 1423 * 10.5.3.6 and Annex G. 1424 * 0 - General 1425 * 1 - Authentication Failure 1426 * 2 - IMSI unknown in HLR 1427 * 3 - Illegal MS 1428 * 4 - Illegal ME 1429 * 5 - PLMN not allowed 1430 * 6 - Location area not allowed 1431 * 7 - Roaming not allowed 1432 * 8 - No Suitable Cells in this Location Area 1433 * 9 - Network failure 1434 * 10 - Persistent location update reject 1435 * 11 - PLMN not allowed 1436 * 12 - Location area not allowed 1437 * 13 - Roaming not allowed in this Location Area 1438 * 15 - No Suitable Cells in this Location Area 1439 * 17 - Network Failure 1440 * 20 - MAC Failure 1441 * 21 - Sync Failure 1442 * 22 - Congestion 1443 * 23 - GSM Authentication unacceptable 1444 * 25 - Not Authorized for this CSG 1445 * 32 - Service option not supported 1446 * 33 - Requested service option not subscribed 1447 * 34 - Service option temporarily out of order 1448 * 38 - Call cannot be identified 1449 * 48-63 - Retry upon entry into a new cell 1450 * 95 - Semantically incorrect message 1451 * 96 - Invalid mandatory information 1452 * 97 - Message type non-existent or not implemented 1453 * 98 - Message not compatible with protocol state 1454 * 99 - Information element non-existent or not implemented 1455 * 100 - Conditional IE error 1456 * 101 - Message not compatible with protocol state 1457 * 111 - Protocol error, unspecified 1458 * ((const char **)response)[14] is the Primary Scrambling Code of the current 1459 * cell as described in TS 25.331, in hexadecimal 1460 * format, or NULL if unknown or not registered 1461 * to a UMTS network. 1462 * 1463 * Please note that registration state 4 ("unknown") is treated 1464 * as "out of service" in the Android telephony system 1465 * 1466 * Registration state 3 can be returned if Location Update Reject 1467 * (with cause 17 - Network Failure) is received repeatedly from the network, 1468 * to facilitate "managed roaming" 1469 * 1470 * Valid errors: 1471 * SUCCESS 1472 * RADIO_NOT_AVAILABLE 1473 * GENERIC_FAILURE 1474 */ 1475 #define RIL_REQUEST_VOICE_REGISTRATION_STATE 20 1476 1477 /** 1478 * RIL_REQUEST_DATA_REGISTRATION_STATE 1479 * 1480 * Request current DATA registration state 1481 * 1482 * "data" is NULL 1483 * "response" is a "char **" 1484 * ((const char **)response)[0] is registration state 0-5 from TS 27.007 10.1.20 AT+CGREG 1485 * ((const char **)response)[1] is LAC if registered or NULL if not 1486 * ((const char **)response)[2] is CID if registered or NULL if not 1487 * ((const char **)response)[3] indicates the available data radio technology, 1488 * valid values as defined by RIL_RadioTechnology. 1489 * ((const char **)response)[4] if registration state is 3 (Registration 1490 * denied) this is an enumerated reason why 1491 * registration was denied. See 3GPP TS 24.008, 1492 * Annex G.6 "Additonal cause codes for GMM". 1493 * 7 == GPRS services not allowed 1494 * 8 == GPRS services and non-GPRS services not allowed 1495 * 9 == MS identity cannot be derived by the network 1496 * 10 == Implicitly detached 1497 * 14 == GPRS services not allowed in this PLMN 1498 * 16 == MSC temporarily not reachable 1499 * 40 == No PDP context activated 1500 * ((const char **)response)[5] The maximum number of simultaneous Data Calls that can be 1501 * established using RIL_REQUEST_SETUP_DATA_CALL. 1502 * 1503 * The values at offsets 6..10 are optional LTE location information in decimal. 1504 * If a value is unknown that value may be NULL. If all values are NULL, 1505 * none need to be present. 1506 * ((const char **)response)[6] is TAC, a 16-bit Tracking Area Code. 1507 * ((const char **)response)[7] is CID, a 0-503 Physical Cell Identifier. 1508 * ((const char **)response)[8] is ECI, a 28-bit E-UTRAN Cell Identifier. 1509 * ((const char **)response)[9] is CSGID, a 27-bit Closed Subscriber Group Identity. 1510 * ((const char **)response)[10] is TADV, a 6-bit timing advance value. 1511 * 1512 * LAC and CID are in hexadecimal format. 1513 * valid LAC are 0x0000 - 0xffff 1514 * valid CID are 0x00000000 - 0x0fffffff 1515 * 1516 * Please note that registration state 4 ("unknown") is treated 1517 * as "out of service" in the Android telephony system 1518 * 1519 * Valid errors: 1520 * SUCCESS 1521 * RADIO_NOT_AVAILABLE 1522 * GENERIC_FAILURE 1523 */ 1524 #define RIL_REQUEST_DATA_REGISTRATION_STATE 21 1525 1526 /** 1527 * RIL_REQUEST_OPERATOR 1528 * 1529 * Request current operator ONS or EONS 1530 * 1531 * "data" is NULL 1532 * "response" is a "const char **" 1533 * ((const char **)response)[0] is long alpha ONS or EONS 1534 * or NULL if unregistered 1535 * 1536 * ((const char **)response)[1] is short alpha ONS or EONS 1537 * or NULL if unregistered 1538 * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC) 1539 * or NULL if unregistered 1540 * 1541 * Valid errors: 1542 * SUCCESS 1543 * RADIO_NOT_AVAILABLE 1544 * GENERIC_FAILURE 1545 */ 1546 #define RIL_REQUEST_OPERATOR 22 1547 1548 /** 1549 * RIL_REQUEST_RADIO_POWER 1550 * 1551 * Toggle radio on and off (for "airplane" mode) 1552 * If the radio is is turned off/on the radio modem subsystem 1553 * is expected return to an initialized state. For instance, 1554 * any voice and data calls will be terminated and all associated 1555 * lists emptied. 1556 * 1557 * "data" is int * 1558 * ((int *)data)[0] is > 0 for "Radio On" 1559 * ((int *)data)[0] is == 0 for "Radio Off" 1560 * 1561 * "response" is NULL 1562 * 1563 * Turn radio on if "on" > 0 1564 * Turn radio off if "on" == 0 1565 * 1566 * Valid errors: 1567 * SUCCESS 1568 * RADIO_NOT_AVAILABLE 1569 * GENERIC_FAILURE 1570 */ 1571 #define RIL_REQUEST_RADIO_POWER 23 1572 1573 /** 1574 * RIL_REQUEST_DTMF 1575 * 1576 * Send a DTMF tone 1577 * 1578 * If the implementation is currently playing a tone requested via 1579 * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone 1580 * should be played instead 1581 * 1582 * "data" is a char * containing a single character with one of 12 values: 0-9,*,# 1583 * "response" is NULL 1584 * 1585 * FIXME should this block/mute microphone? 1586 * How does this interact with local DTMF feedback? 1587 * 1588 * Valid errors: 1589 * SUCCESS 1590 * RADIO_NOT_AVAILABLE 1591 * GENERIC_FAILURE 1592 * 1593 * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START 1594 * 1595 */ 1596 #define RIL_REQUEST_DTMF 24 1597 1598 /** 1599 * RIL_REQUEST_SEND_SMS 1600 * 1601 * Send an SMS message 1602 * 1603 * "data" is const char ** 1604 * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed 1605 * by a length byte (as expected by TS 27.005) or NULL for default SMSC 1606 * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string 1607 * less the SMSC address 1608 * TP-Layer-Length is be "strlen(((const char **)data)[1])/2" 1609 * 1610 * "response" is a const RIL_SMS_Response * 1611 * 1612 * Based on the return error, caller decides to resend if sending sms 1613 * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) 1614 * and GENERIC_FAILURE means no retry (i.e. error cause is 500) 1615 * 1616 * Valid errors: 1617 * SUCCESS 1618 * RADIO_NOT_AVAILABLE 1619 * SMS_SEND_FAIL_RETRY 1620 * FDN_CHECK_FAILURE 1621 * GENERIC_FAILURE 1622 * 1623 * FIXME how do we specify TP-Message-Reference if we need to resend? 1624 */ 1625 #define RIL_REQUEST_SEND_SMS 25 1626 1627 1628 /** 1629 * RIL_REQUEST_SEND_SMS_EXPECT_MORE 1630 * 1631 * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS, 1632 * except that more messages are expected to be sent soon. If possible, 1633 * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command) 1634 * 1635 * "data" is const char ** 1636 * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed 1637 * by a length byte (as expected by TS 27.005) or NULL for default SMSC 1638 * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string 1639 * less the SMSC address 1640 * TP-Layer-Length is be "strlen(((const char **)data)[1])/2" 1641 * 1642 * "response" is a const RIL_SMS_Response * 1643 * 1644 * Based on the return error, caller decides to resend if sending sms 1645 * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) 1646 * and GENERIC_FAILURE means no retry (i.e. error cause is 500) 1647 * 1648 * Valid errors: 1649 * SUCCESS 1650 * RADIO_NOT_AVAILABLE 1651 * SMS_SEND_FAIL_RETRY 1652 * GENERIC_FAILURE 1653 * 1654 */ 1655 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26 1656 1657 1658 /** 1659 * RIL_REQUEST_SETUP_DATA_CALL 1660 * 1661 * Setup a packet data connection. If RIL_Data_Call_Response_v6.status 1662 * return success it is added to the list of data calls and a 1663 * RIL_UNSOL_DATA_CALL_LIST_CHANGED is sent. The call remains in the 1664 * list until RIL_REQUEST_DEACTIVATE_DATA_CALL is issued or the 1665 * radio is powered off/on. This list is returned by RIL_REQUEST_DATA_CALL_LIST 1666 * and RIL_UNSOL_DATA_CALL_LIST_CHANGED. 1667 * 1668 * The RIL is expected to: 1669 * - Create one data call context. 1670 * - Create and configure a dedicated interface for the context 1671 * - The interface must be point to point. 1672 * - The interface is configured with one or more addresses and 1673 * is capable of sending and receiving packets. The prefix length 1674 * of the addresses must be /32 for IPv4 and /128 for IPv6. 1675 * - Must NOT change the linux routing table. 1676 * - Support up to RIL_REQUEST_DATA_REGISTRATION_STATE response[5] 1677 * number of simultaneous data call contexts. 1678 * 1679 * "data" is a const char ** 1680 * ((const char **)data)[0] Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2... 1681 * for values above 2 this is RIL_RadioTechnology + 2. 1682 * ((const char **)data)[1] is a RIL_DataProfile (support is optional) 1683 * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will 1684 * override the one in the profile. NULL indicates no APN overrride. 1685 * ((const char **)data)[3] is the username for APN, or NULL 1686 * ((const char **)data)[4] is the password for APN, or NULL 1687 * ((const char **)data)[5] is the PAP / CHAP auth type. Values: 1688 * 0 => PAP and CHAP is never performed. 1689 * 1 => PAP may be performed; CHAP is never performed. 1690 * 2 => CHAP may be performed; PAP is never performed. 1691 * 3 => PAP / CHAP may be performed - baseband dependent. 1692 * ((const char **)data)[6] is the connection type to request must be one of the 1693 * PDP_type values in TS 27.007 section 10.1.1. 1694 * For example, "IP", "IPV6", "IPV4V6", or "PPP". 1695 * ((const char **)data)[7] Optional connection property parameters, format to be defined. 1696 * 1697 * "response" is a RIL_Data_Call_Response_v6 1698 * 1699 * FIXME may need way to configure QoS settings 1700 * 1701 * Valid errors: 1702 * SUCCESS should be returned on both success and failure of setup with 1703 * the RIL_Data_Call_Response_v6.status containing the actual status. 1704 * For all other errors the RIL_Data_Call_Resonse_v6 is ignored. 1705 * 1706 * Other errors could include: 1707 * RADIO_NOT_AVAILABLE, GENERIC_FAILURE, OP_NOT_ALLOWED_BEFORE_REG_TO_NW, 1708 * OP_NOT_ALLOWED_DURING_VOICE_CALL and REQUEST_NOT_SUPPORTED. 1709 * 1710 * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL 1711 */ 1712 #define RIL_REQUEST_SETUP_DATA_CALL 27 1713 1714 1715 /** 1716 * RIL_REQUEST_SIM_IO 1717 * 1718 * Request SIM I/O operation. 1719 * This is similar to the TS 27.007 "restricted SIM" operation 1720 * where it assumes all of the EF selection will be done by the 1721 * callee. 1722 * 1723 * "data" is a const RIL_SIM_IO_v6 * 1724 * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL, 1725 * or may specify a PIN2 for operations that require a PIN2 (eg 1726 * updating FDN records) 1727 * 1728 * "response" is a const RIL_SIM_IO_Response * 1729 * 1730 * Arguments and responses that are unused for certain 1731 * values of "command" should be ignored or set to NULL 1732 * 1733 * Valid errors: 1734 * SUCCESS 1735 * RADIO_NOT_AVAILABLE 1736 * GENERIC_FAILURE 1737 * SIM_PIN2 1738 * SIM_PUK2 1739 */ 1740 #define RIL_REQUEST_SIM_IO 28 1741 1742 /** 1743 * RIL_REQUEST_SEND_USSD 1744 * 1745 * Send a USSD message 1746 * 1747 * If a USSD session already exists, the message should be sent in the 1748 * context of that session. Otherwise, a new session should be created. 1749 * 1750 * The network reply should be reported via RIL_UNSOL_ON_USSD 1751 * 1752 * Only one USSD session may exist at a time, and the session is assumed 1753 * to exist until: 1754 * a) The android system invokes RIL_REQUEST_CANCEL_USSD 1755 * b) The implementation sends a RIL_UNSOL_ON_USSD with a type code 1756 * of "0" (USSD-Notify/no further action) or "2" (session terminated) 1757 * 1758 * "data" is a const char * containing the USSD request in UTF-8 format 1759 * "response" is NULL 1760 * 1761 * Valid errors: 1762 * SUCCESS 1763 * RADIO_NOT_AVAILABLE 1764 * FDN_CHECK_FAILURE 1765 * GENERIC_FAILURE 1766 * 1767 * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD 1768 */ 1769 1770 #define RIL_REQUEST_SEND_USSD 29 1771 1772 /** 1773 * RIL_REQUEST_CANCEL_USSD 1774 * 1775 * Cancel the current USSD session if one exists 1776 * 1777 * "data" is null 1778 * "response" is NULL 1779 * 1780 * Valid errors: 1781 * SUCCESS 1782 * RADIO_NOT_AVAILABLE 1783 * GENERIC_FAILURE 1784 */ 1785 1786 #define RIL_REQUEST_CANCEL_USSD 30 1787 1788 /** 1789 * RIL_REQUEST_GET_CLIR 1790 * 1791 * Gets current CLIR status 1792 * "data" is NULL 1793 * "response" is int * 1794 * ((int *)data)[0] is "n" parameter from TS 27.007 7.7 1795 * ((int *)data)[1] is "m" parameter from TS 27.007 7.7 1796 * 1797 * Valid errors: 1798 * SUCCESS 1799 * RADIO_NOT_AVAILABLE 1800 * GENERIC_FAILURE 1801 */ 1802 #define RIL_REQUEST_GET_CLIR 31 1803 1804 /** 1805 * RIL_REQUEST_SET_CLIR 1806 * 1807 * "data" is int * 1808 * ((int *)data)[0] is "n" parameter from TS 27.007 7.7 1809 * 1810 * "response" is NULL 1811 * 1812 * Valid errors: 1813 * SUCCESS 1814 * RADIO_NOT_AVAILABLE 1815 * GENERIC_FAILURE 1816 */ 1817 #define RIL_REQUEST_SET_CLIR 32 1818 1819 /** 1820 * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 1821 * 1822 * "data" is const RIL_CallForwardInfo * 1823 * 1824 * "response" is const RIL_CallForwardInfo ** 1825 * "response" points to an array of RIL_CallForwardInfo *'s, one for 1826 * each distinct registered phone number. 1827 * 1828 * For example, if data is forwarded to +18005551212 and voice is forwarded 1829 * to +18005559999, then two separate RIL_CallForwardInfo's should be returned 1830 * 1831 * If, however, both data and voice are forwarded to +18005551212, then 1832 * a single RIL_CallForwardInfo can be returned with the service class 1833 * set to "data + voice = 3") 1834 * 1835 * Valid errors: 1836 * SUCCESS 1837 * RADIO_NOT_AVAILABLE 1838 * GENERIC_FAILURE 1839 */ 1840 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33 1841 1842 1843 /** 1844 * RIL_REQUEST_SET_CALL_FORWARD 1845 * 1846 * Configure call forward rule 1847 * 1848 * "data" is const RIL_CallForwardInfo * 1849 * "response" is NULL 1850 * 1851 * Valid errors: 1852 * SUCCESS 1853 * RADIO_NOT_AVAILABLE 1854 * GENERIC_FAILURE 1855 */ 1856 #define RIL_REQUEST_SET_CALL_FORWARD 34 1857 1858 1859 /** 1860 * RIL_REQUEST_QUERY_CALL_WAITING 1861 * 1862 * Query current call waiting state 1863 * 1864 * "data" is const int * 1865 * ((const int *)data)[0] is the TS 27.007 service class to query. 1866 * "response" is a const int * 1867 * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled" 1868 * 1869 * If ((const int *)response)[0] is = 1, then ((const int *)response)[1] 1870 * must follow, with the TS 27.007 service class bit vector of services 1871 * for which call waiting is enabled. 1872 * 1873 * For example, if ((const int *)response)[0] is 1 and 1874 * ((const int *)response)[1] is 3, then call waiting is enabled for data 1875 * and voice and disabled for everything else 1876 * 1877 * Valid errors: 1878 * SUCCESS 1879 * RADIO_NOT_AVAILABLE 1880 * GENERIC_FAILURE 1881 */ 1882 #define RIL_REQUEST_QUERY_CALL_WAITING 35 1883 1884 1885 /** 1886 * RIL_REQUEST_SET_CALL_WAITING 1887 * 1888 * Configure current call waiting state 1889 * 1890 * "data" is const int * 1891 * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled" 1892 * ((const int *)data)[1] is the TS 27.007 service class bit vector of 1893 * services to modify 1894 * "response" is NULL 1895 * 1896 * Valid errors: 1897 * SUCCESS 1898 * RADIO_NOT_AVAILABLE 1899 * GENERIC_FAILURE 1900 */ 1901 #define RIL_REQUEST_SET_CALL_WAITING 36 1902 1903 /** 1904 * RIL_REQUEST_SMS_ACKNOWLEDGE 1905 * 1906 * Acknowledge successful or failed receipt of SMS previously indicated 1907 * via RIL_UNSOL_RESPONSE_NEW_SMS 1908 * 1909 * "data" is int * 1910 * ((int *)data)[0] is 1 on successful receipt 1911 * (basically, AT+CNMA=1 from TS 27.005 1912 * is 0 on failed receipt 1913 * (basically, AT+CNMA=2 from TS 27.005) 1914 * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined 1915 * in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory 1916 * capacity exceeded) and 0xFF (unspecified error) are 1917 * reported. 1918 * 1919 * "response" is NULL 1920 * 1921 * FIXME would like request that specified RP-ACK/RP-ERROR PDU 1922 * 1923 * Valid errors: 1924 * SUCCESS 1925 * RADIO_NOT_AVAILABLE 1926 * GENERIC_FAILURE 1927 */ 1928 #define RIL_REQUEST_SMS_ACKNOWLEDGE 37 1929 1930 /** 1931 * RIL_REQUEST_GET_IMEI - DEPRECATED 1932 * 1933 * Get the device IMEI, including check digit 1934 * 1935 * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY 1936 * Valid when RadioState is not RADIO_STATE_UNAVAILABLE 1937 * 1938 * "data" is NULL 1939 * "response" is a const char * containing the IMEI 1940 * 1941 * Valid errors: 1942 * SUCCESS 1943 * RADIO_NOT_AVAILABLE (radio resetting) 1944 * GENERIC_FAILURE 1945 */ 1946 1947 #define RIL_REQUEST_GET_IMEI 38 1948 1949 /** 1950 * RIL_REQUEST_GET_IMEISV - DEPRECATED 1951 * 1952 * Get the device IMEISV, which should be two decimal digits 1953 * 1954 * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY 1955 * Valid when RadioState is not RADIO_STATE_UNAVAILABLE 1956 * 1957 * "data" is NULL 1958 * "response" is a const char * containing the IMEISV 1959 * 1960 * Valid errors: 1961 * SUCCESS 1962 * RADIO_NOT_AVAILABLE (radio resetting) 1963 * GENERIC_FAILURE 1964 */ 1965 1966 #define RIL_REQUEST_GET_IMEISV 39 1967 1968 1969 /** 1970 * RIL_REQUEST_ANSWER 1971 * 1972 * Answer incoming call 1973 * 1974 * Will not be called for WAITING calls. 1975 * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case 1976 * instead 1977 * 1978 * "data" is NULL 1979 * "response" is NULL 1980 * 1981 * Valid errors: 1982 * SUCCESS 1983 * RADIO_NOT_AVAILABLE (radio resetting) 1984 * GENERIC_FAILURE 1985 */ 1986 1987 #define RIL_REQUEST_ANSWER 40 1988 1989 /** 1990 * RIL_REQUEST_DEACTIVATE_DATA_CALL 1991 * 1992 * Deactivate packet data connection and remove from the 1993 * data call list if SUCCESS is returned. Any other return 1994 * values should also try to remove the call from the list, 1995 * but that may not be possible. In any event a 1996 * RIL_REQUEST_RADIO_POWER off/on must clear the list. An 1997 * RIL_UNSOL_DATA_CALL_LIST_CHANGED is not expected to be 1998 * issued because of an RIL_REQUEST_DEACTIVATE_DATA_CALL. 1999 * 2000 * "data" is const char ** 2001 * ((char**)data)[0] indicating CID 2002 * ((char**)data)[1] indicating Disconnect Reason 2003 * 0 => No specific reason specified 2004 * 1 => Radio shutdown requested 2005 * 2006 * "response" is NULL 2007 * 2008 * Valid errors: 2009 * SUCCESS 2010 * RADIO_NOT_AVAILABLE 2011 * GENERIC_FAILURE 2012 * 2013 * See also: RIL_REQUEST_SETUP_DATA_CALL 2014 */ 2015 #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41 2016 2017 /** 2018 * RIL_REQUEST_QUERY_FACILITY_LOCK 2019 * 2020 * Query the status of a facility lock state 2021 * 2022 * "data" is const char ** 2023 * ((const char **)data)[0] is the facility string code from TS 27.007 7.4 2024 * (eg "AO" for BAOC, "SC" for SIM lock) 2025 * ((const char **)data)[1] is the password, or "" if not required 2026 * ((const char **)data)[2] is the TS 27.007 service class bit vector of 2027 * services to query 2028 * ((const char **)data)[3] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. 2029 * This is only applicable in the case of Fixed Dialing Numbers 2030 * (FDN) requests. 2031 * 2032 * "response" is an int * 2033 * ((const int *)response) 0 is the TS 27.007 service class bit vector of 2034 * services for which the specified barring facility 2035 * is active. "0" means "disabled for all" 2036 * 2037 * 2038 * Valid errors: 2039 * SUCCESS 2040 * RADIO_NOT_AVAILABLE 2041 * GENERIC_FAILURE 2042 * 2043 */ 2044 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42 2045 2046 /** 2047 * RIL_REQUEST_SET_FACILITY_LOCK 2048 * 2049 * Enable/disable one facility lock 2050 * 2051 * "data" is const char ** 2052 * 2053 * ((const char **)data)[0] = facility string code from TS 27.007 7.4 2054 * (eg "AO" for BAOC) 2055 * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock" 2056 * ((const char **)data)[2] = password 2057 * ((const char **)data)[3] = string representation of decimal TS 27.007 2058 * service class bit vector. Eg, the string 2059 * "1" means "set this facility for voice services" 2060 * ((const char **)data)[4] = AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. 2061 * This is only applicable in the case of Fixed Dialing Numbers 2062 * (FDN) requests. 2063 * 2064 * "response" is int * 2065 * ((int *)response)[0] is the number of retries remaining, or -1 if unknown 2066 * 2067 * Valid errors: 2068 * SUCCESS 2069 * RADIO_NOT_AVAILABLE 2070 * GENERIC_FAILURE 2071 * 2072 */ 2073 #define RIL_REQUEST_SET_FACILITY_LOCK 43 2074 2075 /** 2076 * RIL_REQUEST_CHANGE_BARRING_PASSWORD 2077 * 2078 * Change call barring facility password 2079 * 2080 * "data" is const char ** 2081 * 2082 * ((const char **)data)[0] = facility string code from TS 27.007 7.4 2083 * (eg "AO" for BAOC) 2084 * ((const char **)data)[1] = old password 2085 * ((const char **)data)[2] = new password 2086 * 2087 * "response" is NULL 2088 * 2089 * Valid errors: 2090 * SUCCESS 2091 * RADIO_NOT_AVAILABLE 2092 * GENERIC_FAILURE 2093 * 2094 */ 2095 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44 2096 2097 /** 2098 * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 2099 * 2100 * Query current network selectin mode 2101 * 2102 * "data" is NULL 2103 * 2104 * "response" is int * 2105 * ((const int *)response)[0] is 2106 * 0 for automatic selection 2107 * 1 for manual selection 2108 * 2109 * Valid errors: 2110 * SUCCESS 2111 * RADIO_NOT_AVAILABLE 2112 * GENERIC_FAILURE 2113 * 2114 */ 2115 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45 2116 2117 /** 2118 * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 2119 * 2120 * Specify that the network should be selected automatically 2121 * 2122 * "data" is NULL 2123 * "response" is NULL 2124 * 2125 * This request must not respond until the new operator is selected 2126 * and registered 2127 * 2128 * Valid errors: 2129 * SUCCESS 2130 * RADIO_NOT_AVAILABLE 2131 * ILLEGAL_SIM_OR_ME 2132 * GENERIC_FAILURE 2133 * 2134 * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and 2135 * no retries needed, such as illegal SIM or ME. 2136 * Returns GENERIC_FAILURE for all other causes that might be 2137 * fixed by retries. 2138 * 2139 */ 2140 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46 2141 2142 /** 2143 * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 2144 * 2145 * Manually select a specified network. 2146 * 2147 * "data" is const char * specifying MCCMNC of network to select (eg "310170") 2148 * "response" is NULL 2149 * 2150 * This request must not respond until the new operator is selected 2151 * and registered 2152 * 2153 * Valid errors: 2154 * SUCCESS 2155 * RADIO_NOT_AVAILABLE 2156 * ILLEGAL_SIM_OR_ME 2157 * GENERIC_FAILURE 2158 * 2159 * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and 2160 * no retries needed, such as illegal SIM or ME. 2161 * Returns GENERIC_FAILURE for all other causes that might be 2162 * fixed by retries. 2163 * 2164 */ 2165 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47 2166 2167 /** 2168 * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 2169 * 2170 * Scans for available networks 2171 * 2172 * "data" is NULL 2173 * "response" is const char ** that should be an array of n*4 strings, where 2174 * n is the number of available networks 2175 * For each available network: 2176 * 2177 * ((const char **)response)[n+0] is long alpha ONS or EONS 2178 * ((const char **)response)[n+1] is short alpha ONS or EONS 2179 * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC) 2180 * ((const char **)response)[n+3] is a string value of the status: 2181 * "unknown" 2182 * "available" 2183 * "current" 2184 * "forbidden" 2185 * 2186 * This request must not respond until the new operator is selected 2187 * and registered 2188 * 2189 * Valid errors: 2190 * SUCCESS 2191 * RADIO_NOT_AVAILABLE 2192 * GENERIC_FAILURE 2193 * 2194 */ 2195 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48 2196 2197 /** 2198 * RIL_REQUEST_DTMF_START 2199 * 2200 * Start playing a DTMF tone. Continue playing DTMF tone until 2201 * RIL_REQUEST_DTMF_STOP is received 2202 * 2203 * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing, 2204 * it should cancel the previous tone and play the new one. 2205 * 2206 * "data" is a char * 2207 * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,# 2208 * "response" is NULL 2209 * 2210 * Valid errors: 2211 * SUCCESS 2212 * RADIO_NOT_AVAILABLE 2213 * GENERIC_FAILURE 2214 * 2215 * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP 2216 */ 2217 #define RIL_REQUEST_DTMF_START 49 2218 2219 /** 2220 * RIL_REQUEST_DTMF_STOP 2221 * 2222 * Stop playing a currently playing DTMF tone. 2223 * 2224 * "data" is NULL 2225 * "response" is NULL 2226 * 2227 * Valid errors: 2228 * SUCCESS 2229 * RADIO_NOT_AVAILABLE 2230 * GENERIC_FAILURE 2231 * 2232 * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START 2233 */ 2234 #define RIL_REQUEST_DTMF_STOP 50 2235 2236 /** 2237 * RIL_REQUEST_BASEBAND_VERSION 2238 * 2239 * Return string value indicating baseband version, eg 2240 * response from AT+CGMR 2241 * 2242 * "data" is NULL 2243 * "response" is const char * containing version string for log reporting 2244 * 2245 * Valid errors: 2246 * SUCCESS 2247 * RADIO_NOT_AVAILABLE 2248 * GENERIC_FAILURE 2249 * 2250 */ 2251 #define RIL_REQUEST_BASEBAND_VERSION 51 2252 2253 /** 2254 * RIL_REQUEST_SEPARATE_CONNECTION 2255 * 2256 * Separate a party from a multiparty call placing the multiparty call 2257 * (less the specified party) on hold and leaving the specified party 2258 * as the only other member of the current (active) call 2259 * 2260 * Like AT+CHLD=2x 2261 * 2262 * See TS 22.084 1.3.8.2 (iii) 2263 * TS 22.030 6.5.5 "Entering "2X followed by send" 2264 * TS 27.007 "AT+CHLD=2x" 2265 * 2266 * "data" is an int * 2267 * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL 2268 * 2269 * "response" is NULL 2270 * 2271 * Valid errors: 2272 * SUCCESS 2273 * RADIO_NOT_AVAILABLE (radio resetting) 2274 * GENERIC_FAILURE 2275 */ 2276 #define RIL_REQUEST_SEPARATE_CONNECTION 52 2277 2278 2279 /** 2280 * RIL_REQUEST_SET_MUTE 2281 * 2282 * Turn on or off uplink (microphone) mute. 2283 * 2284 * Will only be sent while voice call is active. 2285 * Will always be reset to "disable mute" when a new voice call is initiated 2286 * 2287 * "data" is an int * 2288 * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute" 2289 * 2290 * "response" is NULL 2291 * 2292 * Valid errors: 2293 * SUCCESS 2294 * RADIO_NOT_AVAILABLE (radio resetting) 2295 * GENERIC_FAILURE 2296 */ 2297 2298 #define RIL_REQUEST_SET_MUTE 53 2299 2300 /** 2301 * RIL_REQUEST_GET_MUTE 2302 * 2303 * Queries the current state of the uplink mute setting 2304 * 2305 * "data" is NULL 2306 * "response" is an int * 2307 * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled" 2308 * 2309 * Valid errors: 2310 * SUCCESS 2311 * RADIO_NOT_AVAILABLE (radio resetting) 2312 * GENERIC_FAILURE 2313 */ 2314 2315 #define RIL_REQUEST_GET_MUTE 54 2316 2317 /** 2318 * RIL_REQUEST_QUERY_CLIP 2319 * 2320 * Queries the status of the CLIP supplementary service 2321 * 2322 * (for MMI code "*#30#") 2323 * 2324 * "data" is NULL 2325 * "response" is an int * 2326 * (int *)response)[0] is 1 for "CLIP provisioned" 2327 * and 0 for "CLIP not provisioned" 2328 * and 2 for "unknown, e.g. no network etc" 2329 * 2330 * Valid errors: 2331 * SUCCESS 2332 * RADIO_NOT_AVAILABLE (radio resetting) 2333 * GENERIC_FAILURE 2334 */ 2335 2336 #define RIL_REQUEST_QUERY_CLIP 55 2337 2338 /** 2339 * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE - Deprecated use the status 2340 * field in RIL_Data_Call_Response_v6. 2341 * 2342 * Requests the failure cause code for the most recently failed PDP 2343 * context or CDMA data connection active 2344 * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE 2345 * 2346 * "data" is NULL 2347 * 2348 * "response" is a "int *" 2349 * ((int *)response)[0] is an integer cause code defined in TS 24.008 2350 * section 6.1.3.1.3 or close approximation 2351 * 2352 * If the implementation does not have access to the exact cause codes, 2353 * then it should return one of the values listed in 2354 * RIL_DataCallFailCause, as the UI layer needs to distinguish these 2355 * cases for error notification 2356 * and potential retries. 2357 * 2358 * Valid errors: 2359 * SUCCESS 2360 * RADIO_NOT_AVAILABLE 2361 * GENERIC_FAILURE 2362 * 2363 * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE 2364 * 2365 * Deprecated use the status field in RIL_Data_Call_Response_v6. 2366 */ 2367 2368 #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56 2369 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 2389 #define RIL_REQUEST_DATA_CALL_LIST 57 2390 2391 /** 2392 * RIL_REQUEST_RESET_RADIO - DEPRECATED 2393 * 2394 * Request a radio reset. The RIL implementation may postpone 2395 * the reset until after this request is responded to if the baseband 2396 * is presently busy. 2397 * 2398 * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER 2399 * 2400 * "data" is NULL 2401 * "response" is NULL 2402 * 2403 * Valid errors: 2404 * SUCCESS 2405 * RADIO_NOT_AVAILABLE (radio resetting) 2406 * GENERIC_FAILURE 2407 * REQUEST_NOT_SUPPORTED 2408 */ 2409 2410 #define RIL_REQUEST_RESET_RADIO 58 2411 2412 /** 2413 * RIL_REQUEST_OEM_HOOK_RAW 2414 * 2415 * This request reserved for OEM-specific uses. It passes raw byte arrays 2416 * back and forth. 2417 * 2418 * It can be invoked on the Java side from 2419 * com.android.internal.telephony.Phone.invokeOemRilRequestRaw() 2420 * 2421 * "data" is a char * of bytes copied from the byte[] data argument in java 2422 * "response" is a char * of bytes that will returned via the 2423 * caller's "response" Message here: 2424 * (byte[])(((AsyncResult)response.obj).result) 2425 * 2426 * An error response here will result in 2427 * (((AsyncResult)response.obj).result) == null and 2428 * (((AsyncResult)response.obj).exception) being an instance of 2429 * com.android.internal.telephony.gsm.CommandException 2430 * 2431 * Valid errors: 2432 * All 2433 */ 2434 2435 #define RIL_REQUEST_OEM_HOOK_RAW 59 2436 2437 /** 2438 * RIL_REQUEST_OEM_HOOK_STRINGS 2439 * 2440 * This request reserved for OEM-specific uses. It passes strings 2441 * back and forth. 2442 * 2443 * It can be invoked on the Java side from 2444 * com.android.internal.telephony.Phone.invokeOemRilRequestStrings() 2445 * 2446 * "data" is a const char **, representing an array of null-terminated UTF-8 2447 * strings copied from the "String[] strings" argument to 2448 * invokeOemRilRequestStrings() 2449 * 2450 * "response" is a const char **, representing an array of null-terminated UTF-8 2451 * stings that will be returned via the caller's response message here: 2452 * 2453 * (String[])(((AsyncResult)response.obj).result) 2454 * 2455 * An error response here will result in 2456 * (((AsyncResult)response.obj).result) == null and 2457 * (((AsyncResult)response.obj).exception) being an instance of 2458 * com.android.internal.telephony.gsm.CommandException 2459 * 2460 * Valid errors: 2461 * All 2462 */ 2463 2464 #define RIL_REQUEST_OEM_HOOK_STRINGS 60 2465 2466 /** 2467 * RIL_REQUEST_SCREEN_STATE 2468 * 2469 * Indicates the current state of the screen. When the screen is off, the 2470 * RIL should notify the baseband to suppress certain notifications (eg, 2471 * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude) 2472 * in an effort to conserve power. These notifications should resume when the 2473 * screen is on. 2474 * 2475 * "data" is int * 2476 * ((int *)data)[0] is == 1 for "Screen On" 2477 * ((int *)data)[0] is == 0 for "Screen Off" 2478 * 2479 * "response" is NULL 2480 * 2481 * Valid errors: 2482 * SUCCESS 2483 * GENERIC_FAILURE 2484 */ 2485 #define RIL_REQUEST_SCREEN_STATE 61 2486 2487 2488 /** 2489 * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 2490 * 2491 * Enables/disables supplementary service related notifications 2492 * from the network. 2493 * 2494 * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION. 2495 * 2496 * "data" is int * 2497 * ((int *)data)[0] is == 1 for notifications enabled 2498 * ((int *)data)[0] is == 0 for notifications disabled 2499 * 2500 * "response" is NULL 2501 * 2502 * Valid errors: 2503 * SUCCESS 2504 * RADIO_NOT_AVAILABLE 2505 * GENERIC_FAILURE 2506 * 2507 * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION. 2508 */ 2509 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62 2510 2511 /** 2512 * RIL_REQUEST_WRITE_SMS_TO_SIM 2513 * 2514 * Stores a SMS message to SIM memory. 2515 * 2516 * "data" is RIL_SMS_WriteArgs * 2517 * 2518 * "response" is int * 2519 * ((const int *)response)[0] is the record index where the message is stored. 2520 * 2521 * Valid errors: 2522 * SUCCESS 2523 * GENERIC_FAILURE 2524 * 2525 */ 2526 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63 2527 2528 /** 2529 * RIL_REQUEST_DELETE_SMS_ON_SIM 2530 * 2531 * Deletes a SMS message from SIM memory. 2532 * 2533 * "data" is int * 2534 * ((int *)data)[0] is the record index of the message to delete. 2535 * 2536 * "response" is NULL 2537 * 2538 * Valid errors: 2539 * SUCCESS 2540 * GENERIC_FAILURE 2541 * 2542 */ 2543 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64 2544 2545 /** 2546 * RIL_REQUEST_SET_BAND_MODE 2547 * 2548 * Assign a specified band for RF configuration. 2549 * 2550 * "data" is int * 2551 * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically) 2552 * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000) 2553 * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900) 2554 * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000) 2555 * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000) 2556 * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850) 2557 * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)" 2558 * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)" 2559 * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)" 2560 * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)" 2561 * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)" 2562 * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)" 2563 * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)" 2564 * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)" 2565 * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)" 2566 * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)" 2567 * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)" 2568 * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)" 2569 * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)" 2570 * 2571 * "response" is NULL 2572 * 2573 * Valid errors: 2574 * SUCCESS 2575 * RADIO_NOT_AVAILABLE 2576 * GENERIC_FAILURE 2577 */ 2578 #define RIL_REQUEST_SET_BAND_MODE 65 2579 2580 /** 2581 * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 2582 * 2583 * Query the list of band mode supported by RF. 2584 * 2585 * "data" is NULL 2586 * 2587 * "response" is int * 2588 * "response" points to an array of int's, the int[0] is the size of array, reset is one for 2589 * each available band mode. 2590 * 2591 * 0 for "unspecified" (selected by baseband automatically) 2592 * 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000) 2593 * 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900) 2594 * 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000) 2595 * 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000) 2596 * 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850) 2597 * 6 for "Cellular (800-MHz Band)" 2598 * 7 for "PCS (1900-MHz Band)" 2599 * 8 for "Band Class 3 (JTACS Band)" 2600 * 9 for "Band Class 4 (Korean PCS Band)" 2601 * 10 for "Band Class 5 (450-MHz Band)" 2602 * 11 for "Band Class 6 (2-GMHz IMT2000 Band)" 2603 * 12 for "Band Class 7 (Upper 700-MHz Band)" 2604 * 13 for "Band Class 8 (1800-MHz Band)" 2605 * 14 for "Band Class 9 (900-MHz Band)" 2606 * 15 for "Band Class 10 (Secondary 800-MHz Band)" 2607 * 16 for "Band Class 11 (400-MHz European PAMR Band)" 2608 * 17 for "Band Class 15 (AWS Band)" 2609 * 18 for "Band Class 16 (US 2.5-GHz Band)" 2610 * 2611 * Valid errors: 2612 * SUCCESS 2613 * RADIO_NOT_AVAILABLE 2614 * GENERIC_FAILURE 2615 * 2616 * See also: RIL_REQUEST_SET_BAND_MODE 2617 */ 2618 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66 2619 2620 /** 2621 * RIL_REQUEST_STK_GET_PROFILE 2622 * 2623 * Requests the profile of SIM tool kit. 2624 * The profile indicates the SAT/USAT features supported by ME. 2625 * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111 2626 * 2627 * "data" is NULL 2628 * 2629 * "response" is a const char * containing SAT/USAT profile 2630 * in hexadecimal format string starting with first byte of terminal profile 2631 * 2632 * Valid errors: 2633 * RIL_E_SUCCESS 2634 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 2635 * RIL_E_GENERIC_FAILURE 2636 */ 2637 #define RIL_REQUEST_STK_GET_PROFILE 67 2638 2639 /** 2640 * RIL_REQUEST_STK_SET_PROFILE 2641 * 2642 * Download the STK terminal profile as part of SIM initialization 2643 * procedure 2644 * 2645 * "data" is a const char * containing SAT/USAT profile 2646 * in hexadecimal format string starting with first byte of terminal profile 2647 * 2648 * "response" is NULL 2649 * 2650 * Valid errors: 2651 * RIL_E_SUCCESS 2652 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 2653 * RIL_E_GENERIC_FAILURE 2654 */ 2655 #define RIL_REQUEST_STK_SET_PROFILE 68 2656 2657 /** 2658 * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 2659 * 2660 * Requests to send a SAT/USAT envelope command to SIM. 2661 * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111 2662 * 2663 * "data" is a const char * containing SAT/USAT command 2664 * in hexadecimal format string starting with command tag 2665 * 2666 * "response" is a const char * containing SAT/USAT response 2667 * in hexadecimal format string starting with first byte of response 2668 * (May be 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_ENVELOPE_COMMAND 69 2676 2677 /** 2678 * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 2679 * 2680 * Requests to send a terminal response to SIM for a received 2681 * proactive command 2682 * 2683 * "data" is a const char * containing SAT/USAT response 2684 * in hexadecimal format string starting with first byte of response data 2685 * 2686 * "response" is NULL 2687 * 2688 * Valid errors: 2689 * RIL_E_SUCCESS 2690 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 2691 * RIL_E_GENERIC_FAILURE 2692 */ 2693 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70 2694 2695 /** 2696 * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 2697 * 2698 * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has 2699 * been initialized by ME already. (We could see the call has been in the 'call 2700 * list') So, STK application needs to accept/reject the call according as user 2701 * operations. 2702 * 2703 * "data" is int * 2704 * ((int *)data)[0] is > 0 for "accept" the call setup 2705 * ((int *)data)[0] is == 0 for "reject" the call setup 2706 * 2707 * "response" is NULL 2708 * 2709 * Valid errors: 2710 * RIL_E_SUCCESS 2711 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 2712 * RIL_E_GENERIC_FAILURE 2713 */ 2714 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71 2715 2716 /** 2717 * RIL_REQUEST_EXPLICIT_CALL_TRANSFER 2718 * 2719 * Connects the two calls and disconnects the subscriber from both calls. 2720 * 2721 * "data" is NULL 2722 * "response" is NULL 2723 * 2724 * Valid errors: 2725 * SUCCESS 2726 * RADIO_NOT_AVAILABLE (radio resetting) 2727 * GENERIC_FAILURE 2728 */ 2729 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72 2730 2731 /** 2732 * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 2733 * 2734 * Requests to set the preferred network type for searching and registering 2735 * (CS/PS domain, RAT, and operation mode) 2736 * 2737 * "data" is int * which is RIL_PreferredNetworkType 2738 * 2739 * "response" is NULL 2740 * 2741 * Valid errors: 2742 * SUCCESS 2743 * RADIO_NOT_AVAILABLE (radio resetting) 2744 * GENERIC_FAILURE 2745 * MODE_NOT_SUPPORTED 2746 */ 2747 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73 2748 2749 /** 2750 * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 2751 * 2752 * Query the preferred network type (CS/PS domain, RAT, and operation mode) 2753 * for searching and registering 2754 * 2755 * "data" is NULL 2756 * 2757 * "response" is int * 2758 * ((int *)reponse)[0] is == RIL_PreferredNetworkType 2759 * 2760 * Valid errors: 2761 * SUCCESS 2762 * RADIO_NOT_AVAILABLE 2763 * GENERIC_FAILURE 2764 * 2765 * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 2766 */ 2767 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74 2768 2769 /** 2770 * RIL_REQUEST_NEIGHBORING_CELL_IDS 2771 * 2772 * Request neighboring cell id in GSM network 2773 * 2774 * "data" is NULL 2775 * "response" must be a " const RIL_NeighboringCell** " 2776 * 2777 * Valid errors: 2778 * SUCCESS 2779 * RADIO_NOT_AVAILABLE 2780 * GENERIC_FAILURE 2781 */ 2782 #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75 2783 2784 /** 2785 * RIL_REQUEST_SET_LOCATION_UPDATES 2786 * 2787 * Enables/disables network state change notifications due to changes in 2788 * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA). 2789 * Basically +CREG=2 vs. +CREG=1 (TS 27.007). 2790 * 2791 * Note: The RIL implementation should default to "updates enabled" 2792 * when the screen is on and "updates disabled" when the screen is off. 2793 * 2794 * "data" is int * 2795 * ((int *)data)[0] is == 1 for updates enabled (+CREG=2) 2796 * ((int *)data)[0] is == 0 for updates disabled (+CREG=1) 2797 * 2798 * "response" is NULL 2799 * 2800 * Valid errors: 2801 * SUCCESS 2802 * RADIO_NOT_AVAILABLE 2803 * GENERIC_FAILURE 2804 * 2805 * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED 2806 */ 2807 #define RIL_REQUEST_SET_LOCATION_UPDATES 76 2808 2809 /** 2810 * RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 2811 * 2812 * Request to set the location where the CDMA subscription shall 2813 * be retrieved 2814 * 2815 * "data" is int * 2816 * ((int *)data)[0] is == RIL_CdmaSubscriptionSource 2817 * 2818 * "response" is NULL 2819 * 2820 * Valid errors: 2821 * SUCCESS 2822 * RADIO_NOT_AVAILABLE 2823 * GENERIC_FAILURE 2824 * SIM_ABSENT 2825 * SUBSCRIPTION_NOT_AVAILABLE 2826 * 2827 * See also: RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 2828 */ 2829 #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 77 2830 2831 /** 2832 * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 2833 * 2834 * Request to set the roaming preferences in CDMA 2835 * 2836 * "data" is int * 2837 * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL 2838 * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL 2839 * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL 2840 * 2841 * "response" is NULL 2842 * 2843 * Valid errors: 2844 * SUCCESS 2845 * RADIO_NOT_AVAILABLE 2846 * GENERIC_FAILURE 2847 */ 2848 #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78 2849 2850 /** 2851 * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 2852 * 2853 * Request the actual setting of the roaming preferences in CDMA in the modem 2854 * 2855 * "data" is NULL 2856 * 2857 * "response" is int * 2858 * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL 2859 * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL 2860 * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL 2861 * 2862 * "response" is NULL 2863 * 2864 * Valid errors: 2865 * SUCCESS 2866 * RADIO_NOT_AVAILABLE 2867 * GENERIC_FAILURE 2868 */ 2869 #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79 2870 2871 /** 2872 * RIL_REQUEST_SET_TTY_MODE 2873 * 2874 * Request to set the TTY mode 2875 * 2876 * "data" is int * 2877 * ((int *)data)[0] is == 0 for TTY off 2878 * ((int *)data)[0] is == 1 for TTY Full 2879 * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover) 2880 * ((int *)data)[0] is == 3 for TTY VCO (voice carryover) 2881 * 2882 * "response" is NULL 2883 * 2884 * Valid errors: 2885 * SUCCESS 2886 * RADIO_NOT_AVAILABLE 2887 * GENERIC_FAILURE 2888 */ 2889 #define RIL_REQUEST_SET_TTY_MODE 80 2890 2891 /** 2892 * RIL_REQUEST_QUERY_TTY_MODE 2893 * 2894 * Request the setting of TTY mode 2895 * 2896 * "data" is NULL 2897 * 2898 * "response" is int * 2899 * ((int *)response)[0] is == 0 for TTY off 2900 * ((int *)response)[0] is == 1 for TTY Full 2901 * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover) 2902 * ((int *)response)[0] is == 3 for TTY VCO (voice carryover) 2903 * 2904 * "response" is NULL 2905 * 2906 * Valid errors: 2907 * SUCCESS 2908 * RADIO_NOT_AVAILABLE 2909 * GENERIC_FAILURE 2910 */ 2911 #define RIL_REQUEST_QUERY_TTY_MODE 81 2912 2913 /** 2914 * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 2915 * 2916 * Request to set the preferred voice privacy mode used in voice 2917 * scrambling 2918 * 2919 * "data" is int * 2920 * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask) 2921 * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask) 2922 * 2923 * "response" is NULL 2924 * 2925 * Valid errors: 2926 * SUCCESS 2927 * RADIO_NOT_AVAILABLE 2928 * GENERIC_FAILURE 2929 */ 2930 #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82 2931 2932 /** 2933 * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 2934 * 2935 * Request the setting of preferred voice privacy mode 2936 * 2937 * "data" is NULL 2938 * 2939 * "response" is int * 2940 * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask) 2941 * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask) 2942 * 2943 * "response" is NULL 2944 * 2945 * Valid errors: 2946 * SUCCESS 2947 * RADIO_NOT_AVAILABLE 2948 * GENERIC_FAILURE 2949 */ 2950 #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83 2951 2952 /** 2953 * RIL_REQUEST_CDMA_FLASH 2954 * 2955 * Send FLASH 2956 * 2957 * "data" is const char * 2958 * ((const char *)data)[0] is a FLASH string 2959 * 2960 * "response" is NULL 2961 * 2962 * Valid errors: 2963 * SUCCESS 2964 * RADIO_NOT_AVAILABLE 2965 * GENERIC_FAILURE 2966 * 2967 */ 2968 #define RIL_REQUEST_CDMA_FLASH 84 2969 2970 /** 2971 * RIL_REQUEST_CDMA_BURST_DTMF 2972 * 2973 * Send DTMF string 2974 * 2975 * "data" is const char ** 2976 * ((const char **)data)[0] is a DTMF string 2977 * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use 2978 * default 2979 * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use 2980 * default 2981 * 2982 * "response" is NULL 2983 * 2984 * Valid errors: 2985 * SUCCESS 2986 * RADIO_NOT_AVAILABLE 2987 * GENERIC_FAILURE 2988 * 2989 */ 2990 #define RIL_REQUEST_CDMA_BURST_DTMF 85 2991 2992 /** 2993 * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 2994 * 2995 * Takes a 26 digit string (20 digit AKEY + 6 digit checksum). 2996 * If the checksum is valid the 20 digit AKEY is written to NV, 2997 * replacing the existing AKEY no matter what it was before. 2998 * 2999 * "data" is const char * 3000 * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9') 3001 * where the last 6 digits are a checksum of the 3002 * first 20, as specified in TR45.AHAG 3003 * "Common Cryptographic Algorithms, Revision D.1 3004 * Section 2.2" 3005 * 3006 * "response" is NULL 3007 * 3008 * Valid errors: 3009 * SUCCESS 3010 * RADIO_NOT_AVAILABLE 3011 * GENERIC_FAILURE 3012 * 3013 */ 3014 #define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86 3015 3016 /** 3017 * RIL_REQUEST_CDMA_SEND_SMS 3018 * 3019 * Send a CDMA SMS message 3020 * 3021 * "data" is const RIL_CDMA_SMS_Message * 3022 * 3023 * "response" is a const RIL_SMS_Response * 3024 * 3025 * Based on the return error, caller decides to resend if sending sms 3026 * fails. The CDMA error class is derived as follows, 3027 * SUCCESS is error class 0 (no error) 3028 * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure) 3029 * and GENERIC_FAILURE is error class 3 (permanent and no retry) 3030 * 3031 * Valid errors: 3032 * SUCCESS 3033 * RADIO_NOT_AVAILABLE 3034 * SMS_SEND_FAIL_RETRY 3035 * GENERIC_FAILURE 3036 * 3037 */ 3038 #define RIL_REQUEST_CDMA_SEND_SMS 87 3039 3040 /** 3041 * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 3042 * 3043 * Acknowledge the success or failure in the receipt of SMS 3044 * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 3045 * 3046 * "data" is const RIL_CDMA_SMS_Ack * 3047 * 3048 * "response" is NULL 3049 * 3050 * Valid errors: 3051 * SUCCESS 3052 * RADIO_NOT_AVAILABLE 3053 * GENERIC_FAILURE 3054 * 3055 */ 3056 #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88 3057 3058 /** 3059 * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 3060 * 3061 * Request the setting of GSM/WCDMA Cell Broadcast SMS config. 3062 * 3063 * "data" is NULL 3064 * 3065 * "response" is a const RIL_GSM_BroadcastSmsConfigInfo ** 3066 * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *) 3067 * 3068 * Valid errors: 3069 * SUCCESS 3070 * RADIO_NOT_AVAILABLE 3071 * GENERIC_FAILURE 3072 * 3073 */ 3074 #define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89 3075 3076 /** 3077 * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 3078 * 3079 * Set GSM/WCDMA Cell Broadcast SMS config 3080 * 3081 * "data" is a const RIL_GSM_BroadcastSmsConfigInfo ** 3082 * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *) 3083 * 3084 * "response" is NULL 3085 * 3086 * Valid errors: 3087 * SUCCESS 3088 * RADIO_NOT_AVAILABLE 3089 * GENERIC_FAILURE 3090 * 3091 */ 3092 #define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90 3093 3094 /** 3095 * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 3096 * 3097 * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS 3098 * 3099 * "data" is const int * 3100 * (const int *)data[0] indicates to activate or turn off the 3101 * reception of GSM/WCDMA Cell Broadcast SMS, 0-1, 3102 * 0 - Activate, 1 - Turn off 3103 * 3104 * "response" is NULL 3105 * 3106 * Valid errors: 3107 * SUCCESS 3108 * RADIO_NOT_AVAILABLE 3109 * GENERIC_FAILURE 3110 * 3111 */ 3112 #define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91 3113 3114 /** 3115 * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 3116 * 3117 * Request the setting of CDMA Broadcast SMS config 3118 * 3119 * "data" is NULL 3120 * 3121 * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo ** 3122 * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *) 3123 * 3124 * Valid errors: 3125 * SUCCESS 3126 * RADIO_NOT_AVAILABLE 3127 * GENERIC_FAILURE 3128 * 3129 */ 3130 #define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92 3131 3132 /** 3133 * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 3134 * 3135 * Set CDMA Broadcast SMS config 3136 * 3137 * "data" is an const RIL_CDMA_BroadcastSmsConfigInfo ** 3138 * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *) 3139 * 3140 * "response" is NULL 3141 * 3142 * Valid errors: 3143 * SUCCESS 3144 * RADIO_NOT_AVAILABLE 3145 * GENERIC_FAILURE 3146 * 3147 */ 3148 #define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93 3149 3150 /** 3151 * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 3152 * 3153 * Enable or disable the reception of CDMA Broadcast SMS 3154 * 3155 * "data" is const int * 3156 * (const int *)data[0] indicates to activate or turn off the 3157 * reception of CDMA Broadcast SMS, 0-1, 3158 * 0 - Activate, 1 - Turn off 3159 * 3160 * "response" is NULL 3161 * 3162 * Valid errors: 3163 * SUCCESS 3164 * RADIO_NOT_AVAILABLE 3165 * GENERIC_FAILURE 3166 * 3167 */ 3168 #define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94 3169 3170 /** 3171 * RIL_REQUEST_CDMA_SUBSCRIPTION 3172 * 3173 * Request the device MDN / H_SID / H_NID. 3174 * 3175 * The request is only allowed when CDMA subscription is available. When CDMA 3176 * subscription is changed, application layer should re-issue the request to 3177 * update the subscription information. 3178 * 3179 * If a NULL value is returned for any of the device id, it means that error 3180 * accessing the device. 3181 * 3182 * "response" is const char ** 3183 * ((const char **)response)[0] is MDN if CDMA subscription is available 3184 * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if 3185 * CDMA subscription is available, in decimal format 3186 * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if 3187 * CDMA subscription is available, in decimal format 3188 * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available 3189 * ((const char **)response)[4] is PRL version if CDMA subscription is available 3190 * 3191 * Valid errors: 3192 * SUCCESS 3193 * RIL_E_SUBSCRIPTION_NOT_AVAILABLE 3194 */ 3195 3196 #define RIL_REQUEST_CDMA_SUBSCRIPTION 95 3197 3198 /** 3199 * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 3200 * 3201 * Stores a CDMA SMS message to RUIM memory. 3202 * 3203 * "data" is RIL_CDMA_SMS_WriteArgs * 3204 * 3205 * "response" is int * 3206 * ((const int *)response)[0] is the record index where the message is stored. 3207 * 3208 * Valid errors: 3209 * SUCCESS 3210 * RADIO_NOT_AVAILABLE 3211 * GENERIC_FAILURE 3212 * 3213 */ 3214 #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96 3215 3216 /** 3217 * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 3218 * 3219 * Deletes a CDMA SMS message from RUIM memory. 3220 * 3221 * "data" is int * 3222 * ((int *)data)[0] is the record index of the message to delete. 3223 * 3224 * "response" is NULL 3225 * 3226 * Valid errors: 3227 * SUCCESS 3228 * RADIO_NOT_AVAILABLE 3229 * GENERIC_FAILURE 3230 * 3231 */ 3232 #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97 3233 3234 /** 3235 * RIL_REQUEST_DEVICE_IDENTITY 3236 * 3237 * Request the device ESN / MEID / IMEI / IMEISV. 3238 * 3239 * The request is always allowed and contains GSM and CDMA device identity; 3240 * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and 3241 * RIL_REQUEST_GET_IMEISV. 3242 * 3243 * If a NULL value is returned for any of the device id, it means that error 3244 * accessing the device. 3245 * 3246 * When CDMA subscription is changed the ESN/MEID may change. The application 3247 * layer should re-issue the request to update the device identity in this case. 3248 * 3249 * "response" is const char ** 3250 * ((const char **)response)[0] is IMEI if GSM subscription is available 3251 * ((const char **)response)[1] is IMEISV if GSM subscription is available 3252 * ((const char **)response)[2] is ESN if CDMA subscription is available 3253 * ((const char **)response)[3] is MEID if CDMA subscription is available 3254 * 3255 * Valid errors: 3256 * SUCCESS 3257 * RADIO_NOT_AVAILABLE 3258 * GENERIC_FAILURE 3259 */ 3260 #define RIL_REQUEST_DEVICE_IDENTITY 98 3261 3262 /** 3263 * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 3264 * 3265 * Request the radio's system selection module to exit emergency 3266 * callback mode. RIL will not respond with SUCCESS until the modem has 3267 * completely exited from Emergency Callback Mode. 3268 * 3269 * "data" is NULL 3270 * 3271 * "response" is NULL 3272 * 3273 * Valid errors: 3274 * SUCCESS 3275 * RADIO_NOT_AVAILABLE 3276 * GENERIC_FAILURE 3277 * 3278 */ 3279 #define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99 3280 3281 /** 3282 * RIL_REQUEST_GET_SMSC_ADDRESS 3283 * 3284 * Queries the default Short Message Service Center address on the device. 3285 * 3286 * "data" is NULL 3287 * 3288 * "response" is const char * containing the SMSC address. 3289 * 3290 * Valid errors: 3291 * SUCCESS 3292 * RADIO_NOT_AVAILABLE 3293 * GENERIC_FAILURE 3294 * 3295 */ 3296 #define RIL_REQUEST_GET_SMSC_ADDRESS 100 3297 3298 /** 3299 * RIL_REQUEST_SET_SMSC_ADDRESS 3300 * 3301 * Sets the default Short Message Service Center address on the device. 3302 * 3303 * "data" is const char * containing the SMSC address. 3304 * 3305 * "response" is NULL 3306 * 3307 * Valid errors: 3308 * SUCCESS 3309 * RADIO_NOT_AVAILABLE 3310 * GENERIC_FAILURE 3311 * 3312 */ 3313 #define RIL_REQUEST_SET_SMSC_ADDRESS 101 3314 3315 /** 3316 * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 3317 * 3318 * Indicates whether there is storage available for new SMS messages. 3319 * 3320 * "data" is int * 3321 * ((int *)data)[0] is 1 if memory is available for storing new messages 3322 * is 0 if memory capacity is exceeded 3323 * 3324 * "response" is NULL 3325 * 3326 * Valid errors: 3327 * SUCCESS 3328 * RADIO_NOT_AVAILABLE 3329 * GENERIC_FAILURE 3330 * 3331 */ 3332 #define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102 3333 3334 /** 3335 * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 3336 * 3337 * Indicates that the StkSerivce is running and is 3338 * ready to receive RIL_UNSOL_STK_XXXXX commands. 3339 * 3340 * "data" is NULL 3341 * "response" is NULL 3342 * 3343 * Valid errors: 3344 * SUCCESS 3345 * RADIO_NOT_AVAILABLE 3346 * GENERIC_FAILURE 3347 * 3348 */ 3349 #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103 3350 3351 /** 3352 * RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 3353 * 3354 * Request to query the location where the CDMA subscription shall 3355 * be retrieved 3356 * 3357 * "data" is NULL 3358 * 3359 * "response" is int * 3360 * ((int *)data)[0] is == RIL_CdmaSubscriptionSource 3361 * 3362 * Valid errors: 3363 * SUCCESS 3364 * RADIO_NOT_AVAILABLE 3365 * GENERIC_FAILURE 3366 * SUBSCRIPTION_NOT_AVAILABLE 3367 * 3368 * See also: RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 3369 */ 3370 #define RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 104 3371 3372 /** 3373 * RIL_REQUEST_ISIM_AUTHENTICATION 3374 * 3375 * Request the ISIM application on the UICC to perform AKA 3376 * challenge/response algorithm for IMS authentication 3377 * 3378 * "data" is a const char * containing the challenge string in Base64 format 3379 * "response" is a const char * containing the response in Base64 format 3380 * 3381 * Valid errors: 3382 * SUCCESS 3383 * RADIO_NOT_AVAILABLE 3384 * GENERIC_FAILURE 3385 */ 3386 #define RIL_REQUEST_ISIM_AUTHENTICATION 105 3387 3388 /** 3389 * RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 3390 * 3391 * Acknowledge successful or failed receipt of SMS previously indicated 3392 * via RIL_UNSOL_RESPONSE_NEW_SMS, including acknowledgement TPDU to send 3393 * as the RP-User-Data element of the RP-ACK or RP-ERROR PDU. 3394 * 3395 * "data" is const char ** 3396 * ((const char **)data)[0] is "1" on successful receipt (send RP-ACK) 3397 * is "0" on failed receipt (send RP-ERROR) 3398 * ((const char **)data)[1] is the acknowledgement TPDU in hexadecimal format 3399 * 3400 * "response" is NULL 3401 * 3402 * Valid errors: 3403 * SUCCESS 3404 * RADIO_NOT_AVAILABLE 3405 * GENERIC_FAILURE 3406 */ 3407 #define RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 106 3408 3409 /** 3410 * RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 3411 * 3412 * Requests to send a SAT/USAT envelope command to SIM. 3413 * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111. 3414 * 3415 * This request has one difference from RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND: 3416 * the SW1 and SW2 status bytes from the UICC response are returned along with 3417 * the response data, using the same structure as RIL_REQUEST_SIM_IO. 3418 * 3419 * The RIL implementation shall perform the normal processing of a '91XX' 3420 * response in SW1/SW2 to retrieve the pending proactive command and send it 3421 * as an unsolicited response, as RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND does. 3422 * 3423 * "data" is a const char * containing the SAT/USAT command 3424 * in hexadecimal format starting with command tag 3425 * 3426 * "response" is a const RIL_SIM_IO_Response * 3427 * 3428 * Valid errors: 3429 * RIL_E_SUCCESS 3430 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 3431 * RIL_E_GENERIC_FAILURE 3432 */ 3433 #define RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 107 3434 3435 /** 3436 * RIL_REQUEST_VOICE_RADIO_TECH 3437 * 3438 * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only 3439 * when radio state is RADIO_STATE_ON 3440 * 3441 * "data" is NULL 3442 * "response" is int * 3443 * ((int *) response)[0] is of type const RIL_RadioTechnology 3444 * 3445 * Valid errors: 3446 * SUCCESS 3447 * RADIO_NOT_AVAILABLE 3448 * GENERIC_FAILURE 3449 */ 3450 #define RIL_REQUEST_VOICE_RADIO_TECH 108 3451 3452 /** 3453 * RIL_REQUEST_GET_CELL_INFO_LIST 3454 * 3455 * Request all of the current cell information known to the radio. The radio 3456 * must a list of all current cells, including the neighboring cells. If for a particular 3457 * cell information isn't known then the appropriate unknown value will be returned. 3458 * This does not cause or change the rate of RIL_UNSOL_CELL_INFO_LIST. 3459 * 3460 * "data" is NULL 3461 * 3462 * "response" is an array of RIL_CellInfo. 3463 */ 3464 #define RIL_REQUEST_GET_CELL_INFO_LIST 109 3465 3466 /** 3467 * RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 3468 * 3469 * Sets the minimum time between when RIL_UNSOL_CELL_INFO_LIST should be invoked. 3470 * A value of 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported 3471 * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue 3472 * a RIL_UNSOL_CELL_INFO_LIST. 3473 * 3474 * "data" is int * 3475 * ((int *)data)[0] is minimum time in milliseconds 3476 * 3477 * "response" is NULL 3478 * 3479 * Valid errors: 3480 * SUCCESS 3481 * RADIO_NOT_AVAILABLE 3482 * GENERIC_FAILURE 3483 */ 3484 #define RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 110 3485 3486 /***********************************************************************/ 3487 3488 3489 #define RIL_UNSOL_RESPONSE_BASE 1000 3490 3491 /** 3492 * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 3493 * 3494 * Indicate when value of RIL_RadioState has changed. 3495 * 3496 * Callee will invoke RIL_RadioStateRequest method on main thread 3497 * 3498 * "data" is NULL 3499 */ 3500 3501 #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000 3502 3503 3504 /** 3505 * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 3506 * 3507 * Indicate when call state has changed 3508 * 3509 * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread 3510 * 3511 * "data" is NULL 3512 * 3513 * Response should be invoked on, for example, 3514 * "RING", "BUSY", "NO CARRIER", and also call state 3515 * transitions (DIALING->ALERTING ALERTING->ACTIVE) 3516 * 3517 * Redundent or extraneous invocations are tolerated 3518 */ 3519 #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001 3520 3521 3522 /** 3523 * RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 3524 * 3525 * Called when the voice network state changed 3526 * 3527 * Callee will invoke the following requests on main thread: 3528 * 3529 * RIL_REQUEST_VOICE_REGISTRATION_STATE 3530 * RIL_REQUEST_OPERATOR 3531 * 3532 * "data" is NULL 3533 * 3534 * FIXME should this happen when SIM records are loaded? (eg, for 3535 * EONS) 3536 */ 3537 #define RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 1002 3538 3539 /** 3540 * RIL_UNSOL_RESPONSE_NEW_SMS 3541 * 3542 * Called when new SMS is received. 3543 * 3544 * "data" is const char * 3545 * This is a pointer to a string containing the PDU of an SMS-DELIVER 3546 * as an ascii string of hex digits. The PDU starts with the SMSC address 3547 * per TS 27.005 (+CMT:) 3548 * 3549 * Callee will subsequently confirm the receipt of thei SMS with a 3550 * RIL_REQUEST_SMS_ACKNOWLEDGE 3551 * 3552 * No new RIL_UNSOL_RESPONSE_NEW_SMS 3553 * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a 3554 * RIL_REQUEST_SMS_ACKNOWLEDGE has been received 3555 */ 3556 3557 #define RIL_UNSOL_RESPONSE_NEW_SMS 1003 3558 3559 /** 3560 * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 3561 * 3562 * Called when new SMS Status Report is received. 3563 * 3564 * "data" is const char * 3565 * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT 3566 * as an ascii string of hex digits. The PDU starts with the SMSC address 3567 * per TS 27.005 (+CDS:). 3568 * 3569 * Callee will subsequently confirm the receipt of the SMS with a 3570 * RIL_REQUEST_SMS_ACKNOWLEDGE 3571 * 3572 * No new RIL_UNSOL_RESPONSE_NEW_SMS 3573 * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a 3574 * RIL_REQUEST_SMS_ACKNOWLEDGE has been received 3575 */ 3576 3577 #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004 3578 3579 /** 3580 * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 3581 * 3582 * Called when new SMS has been stored on SIM card 3583 * 3584 * "data" is const int * 3585 * ((const int *)data)[0] contains the slot index on the SIM that contains 3586 * the new message 3587 */ 3588 3589 #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005 3590 3591 /** 3592 * RIL_UNSOL_ON_USSD 3593 * 3594 * Called when a new USSD message is received. 3595 * 3596 * "data" is const char ** 3597 * ((const char **)data)[0] points to a type code, which is 3598 * one of these string values: 3599 * "0" USSD-Notify -- text in ((const char **)data)[1] 3600 * "1" USSD-Request -- text in ((const char **)data)[1] 3601 * "2" Session terminated by network 3602 * "3" other local client (eg, SIM Toolkit) has responded 3603 * "4" Operation not supported 3604 * "5" Network timeout 3605 * 3606 * The USSD session is assumed to persist if the type code is "1", otherwise 3607 * the current session (if any) is assumed to have terminated. 3608 * 3609 * ((const char **)data)[1] points to a message string if applicable, which 3610 * should always be in UTF-8. 3611 */ 3612 #define RIL_UNSOL_ON_USSD 1006 3613 /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006 */ 3614 3615 /** 3616 * RIL_UNSOL_ON_USSD_REQUEST 3617 * 3618 * Obsolete. Send via RIL_UNSOL_ON_USSD 3619 */ 3620 #define RIL_UNSOL_ON_USSD_REQUEST 1007 3621 3622 3623 /** 3624 * RIL_UNSOL_NITZ_TIME_RECEIVED 3625 * 3626 * Called when radio has received a NITZ time message 3627 * 3628 * "data" is const char * pointing to NITZ time string 3629 * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt" 3630 */ 3631 #define RIL_UNSOL_NITZ_TIME_RECEIVED 1008 3632 3633 /** 3634 * RIL_UNSOL_SIGNAL_STRENGTH 3635 * 3636 * Radio may report signal strength rather han have it polled. 3637 * 3638 * "data" is a const RIL_SignalStrength * 3639 */ 3640 #define RIL_UNSOL_SIGNAL_STRENGTH 1009 3641 3642 3643 /** 3644 * RIL_UNSOL_DATA_CALL_LIST_CHANGED 3645 * 3646 * "data" is an array of RIL_Data_Call_Response_v6 identical to that 3647 * returned by RIL_REQUEST_DATA_CALL_LIST. It is the complete list 3648 * of current data contexts including new contexts that have been 3649 * activated. A data call is only removed from this list when the 3650 * framework sends a RIL_REQUEST_DEACTIVATE_DATA_CALL or the radio 3651 * is powered off/on. 3652 * 3653 * See also: RIL_REQUEST_DATA_CALL_LIST 3654 */ 3655 3656 #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010 3657 3658 /** 3659 * RIL_UNSOL_SUPP_SVC_NOTIFICATION 3660 * 3661 * Reports supplementary service related notification from the network. 3662 * 3663 * "data" is a const RIL_SuppSvcNotification * 3664 * 3665 */ 3666 3667 #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011 3668 3669 /** 3670 * RIL_UNSOL_STK_SESSION_END 3671 * 3672 * Indicate when STK session is terminated by SIM. 3673 * 3674 * "data" is NULL 3675 */ 3676 #define RIL_UNSOL_STK_SESSION_END 1012 3677 3678 /** 3679 * RIL_UNSOL_STK_PROACTIVE_COMMAND 3680 * 3681 * Indicate when SIM issue a STK proactive command to applications 3682 * 3683 * "data" is a const char * containing SAT/USAT proactive command 3684 * in hexadecimal format string starting with command tag 3685 * 3686 */ 3687 #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013 3688 3689 /** 3690 * RIL_UNSOL_STK_EVENT_NOTIFY 3691 * 3692 * Indicate when SIM notifies applcations some event happens. 3693 * Generally, application does not need to have any feedback to 3694 * SIM but shall be able to indicate appropriate messages to users. 3695 * 3696 * "data" is a const char * containing SAT/USAT commands or responses 3697 * sent by ME to SIM or commands handled by ME, in hexadecimal format string 3698 * starting with first byte of response data or command tag 3699 * 3700 */ 3701 #define RIL_UNSOL_STK_EVENT_NOTIFY 1014 3702 3703 /** 3704 * RIL_UNSOL_STK_CALL_SETUP 3705 * 3706 * Indicate when SIM wants application to setup a voice call. 3707 * 3708 * "data" is const int * 3709 * ((const int *)data)[0] contains timeout value (in milliseconds) 3710 */ 3711 #define RIL_UNSOL_STK_CALL_SETUP 1015 3712 3713 /** 3714 * RIL_UNSOL_SIM_SMS_STORAGE_FULL 3715 * 3716 * Indicates that SMS storage on the SIM is full. Sent when the network 3717 * attempts to deliver a new SMS message. Messages cannot be saved on the 3718 * SIM until space is freed. In particular, incoming Class 2 messages 3719 * cannot be stored. 3720 * 3721 * "data" is null 3722 * 3723 */ 3724 #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016 3725 3726 /** 3727 * RIL_UNSOL_SIM_REFRESH 3728 * 3729 * Indicates that file(s) on the SIM have been updated, or the SIM 3730 * has been reinitialized. 3731 * 3732 * In the case where RIL is version 6 or older: 3733 * "data" is an int * 3734 * ((int *)data)[0] is a RIL_SimRefreshResult. 3735 * ((int *)data)[1] is the EFID of the updated file if the result is 3736 * SIM_FILE_UPDATE or NULL for any other result. 3737 * 3738 * In the case where RIL is version 7: 3739 * "data" is a RIL_SimRefreshResponse_v7 * 3740 * 3741 * Note: If the SIM state changes as a result of the SIM refresh (eg, 3742 * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 3743 * should be sent. 3744 */ 3745 #define RIL_UNSOL_SIM_REFRESH 1017 3746 3747 /** 3748 * RIL_UNSOL_CALL_RING 3749 * 3750 * Ring indication for an incoming call (eg, RING or CRING event). 3751 * There must be at least one RIL_UNSOL_CALL_RING at the beginning 3752 * of a call and sending multiple is optional. If the system property 3753 * ro.telephony.call_ring.multiple is false then the upper layers 3754 * will generate the multiple events internally. Otherwise the vendor 3755 * ril must generate multiple RIL_UNSOL_CALL_RING if 3756 * ro.telephony.call_ring.multiple is true or if it is absent. 3757 * 3758 * The rate of these events is controlled by ro.telephony.call_ring.delay 3759 * and has a default value of 3000 (3 seconds) if absent. 3760 * 3761 * "data" is null for GSM 3762 * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA 3763 */ 3764 #define RIL_UNSOL_CALL_RING 1018 3765 3766 /** 3767 * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 3768 * 3769 * Indicates that SIM state changes. 3770 * 3771 * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread 3772 3773 * "data" is null 3774 */ 3775 #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019 3776 3777 /** 3778 * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 3779 * 3780 * Called when new CDMA SMS is received 3781 * 3782 * "data" is const RIL_CDMA_SMS_Message * 3783 * 3784 * Callee will subsequently confirm the receipt of the SMS with 3785 * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 3786 * 3787 * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until 3788 * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received 3789 * 3790 */ 3791 #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020 3792 3793 /** 3794 * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 3795 * 3796 * Called when new Broadcast SMS is received 3797 * 3798 * "data" can be one of the following: 3799 * If received from GSM network, "data" is const char of 88 bytes 3800 * which indicates each page of a CBS Message sent to the MS by the 3801 * BTS as coded in 3GPP 23.041 Section 9.4.1.2. 3802 * If received from UMTS network, "data" is const char of 90 up to 1252 3803 * bytes which contain between 1 and 15 CBS Message pages sent as one 3804 * packet to the MS by the BTS as coded in 3GPP 23.041 Section 9.4.2.2. 3805 * 3806 */ 3807 #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021 3808 3809 /** 3810 * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 3811 * 3812 * Indicates that SMS storage on the RUIM is full. Messages 3813 * cannot be saved on the RUIM until space is freed. 3814 * 3815 * "data" is null 3816 * 3817 */ 3818 #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022 3819 3820 /** 3821 * RIL_UNSOL_RESTRICTED_STATE_CHANGED 3822 * 3823 * Indicates a restricted state change (eg, for Domain Specific Access Control). 3824 * 3825 * Radio need send this msg after radio off/on cycle no matter it is changed or not. 3826 * 3827 * "data" is an int * 3828 * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values. 3829 */ 3830 #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023 3831 3832 /** 3833 * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 3834 * 3835 * Indicates that the radio system selection module has 3836 * autonomously entered emergency callback mode. 3837 * 3838 * "data" is null 3839 * 3840 */ 3841 #define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024 3842 3843 /** 3844 * RIL_UNSOL_CDMA_CALL_WAITING 3845 * 3846 * Called when CDMA radio receives a call waiting indication. 3847 * 3848 * "data" is const RIL_CDMA_CallWaiting * 3849 * 3850 */ 3851 #define RIL_UNSOL_CDMA_CALL_WAITING 1025 3852 3853 /** 3854 * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 3855 * 3856 * Called when CDMA radio receives an update of the progress of an 3857 * OTASP/OTAPA call. 3858 * 3859 * "data" is const int * 3860 * For CDMA this is an integer OTASP/OTAPA status listed in 3861 * RIL_CDMA_OTA_ProvisionStatus. 3862 * 3863 */ 3864 #define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026 3865 3866 /** 3867 * RIL_UNSOL_CDMA_INFO_REC 3868 * 3869 * Called when CDMA radio receives one or more info recs. 3870 * 3871 * "data" is const RIL_CDMA_InformationRecords * 3872 * 3873 */ 3874 #define RIL_UNSOL_CDMA_INFO_REC 1027 3875 3876 /** 3877 * RIL_UNSOL_OEM_HOOK_RAW 3878 * 3879 * This is for OEM specific use. 3880 * 3881 * "data" is a byte[] 3882 */ 3883 #define RIL_UNSOL_OEM_HOOK_RAW 1028 3884 3885 /** 3886 * RIL_UNSOL_RINGBACK_TONE 3887 * 3888 * Indicates that nework doesn't have in-band information, need to 3889 * play out-band tone. 3890 * 3891 * "data" is an int * 3892 * ((int *)data)[0] == 0 for stop play ringback tone. 3893 * ((int *)data)[0] == 1 for start play ringback tone. 3894 */ 3895 #define RIL_UNSOL_RINGBACK_TONE 1029 3896 3897 /** 3898 * RIL_UNSOL_RESEND_INCALL_MUTE 3899 * 3900 * Indicates that framework/application need reset the uplink mute state. 3901 * 3902 * There may be situations where the mute state becomes out of sync 3903 * between the application and device in some GSM infrastructures. 3904 * 3905 * "data" is null 3906 */ 3907 #define RIL_UNSOL_RESEND_INCALL_MUTE 1030 3908 3909 /** 3910 * RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 3911 * 3912 * Called when CDMA subscription source changed. 3913 * 3914 * "data" is int * 3915 * ((int *)data)[0] is == RIL_CdmaSubscriptionSource 3916 */ 3917 #define RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 1031 3918 3919 /** 3920 * RIL_UNSOL_CDMA_PRL_CHANGED 3921 * 3922 * Called when PRL (preferred roaming list) changes. 3923 * 3924 * "data" is int * 3925 * ((int *)data)[0] is PRL_VERSION as would be returned by RIL_REQUEST_CDMA_SUBSCRIPTION 3926 */ 3927 #define RIL_UNSOL_CDMA_PRL_CHANGED 1032 3928 3929 /** 3930 * RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 3931 * 3932 * Called when Emergency Callback Mode Ends 3933 * 3934 * Indicates that the radio system selection module has 3935 * proactively exited emergency callback mode. 3936 * 3937 * "data" is NULL 3938 * 3939 */ 3940 #define RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 1033 3941 3942 /** 3943 * RIL_UNSOL_RIL_CONNECTED 3944 * 3945 * Called the ril connects and returns the version 3946 * 3947 * "data" is int * 3948 * ((int *)data)[0] is RIL_VERSION 3949 */ 3950 #define RIL_UNSOL_RIL_CONNECTED 1034 3951 3952 /** 3953 * RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 3954 * 3955 * Indicates that voice technology has changed. Contains new radio technology 3956 * as a data in the message. 3957 * 3958 * "data" is int * 3959 * ((int *)data)[0] is of type const RIL_RadioTechnology 3960 * 3961 */ 3962 #define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035 3963 3964 /** 3965 * RIL_UNSOL_CELL_INFO_LIST 3966 * 3967 * Same information as returned by RIL_REQUEST_GET_CELL_INFO_LIST, but returned 3968 * at the rate no greater than specified by RIL_REQUEST_SET_UNSOL_CELL_INFO_RATE. 3969 * 3970 * "data" is NULL 3971 * 3972 * "response" is an array of RIL_CellInfo. 3973 */ 3974 #define RIL_UNSOL_CELL_INFO_LIST 1036 3975 3976 /***********************************************************************/ 3977 3978 3979 /** 3980 * RIL_Request Function pointer 3981 * 3982 * @param request is one of RIL_REQUEST_* 3983 * @param data is pointer to data defined for that RIL_REQUEST_* 3984 * data is owned by caller, and should not be modified or freed by callee 3985 * @param t should be used in subsequent call to RIL_onResponse 3986 * @param datalen the length of data 3987 * 3988 */ 3989 typedef void (*RIL_RequestFunc) (int request, void *data, 3990 size_t datalen, RIL_Token t); 3991 3992 /** 3993 * This function should return the current radio state synchronously 3994 */ 3995 typedef RIL_RadioState (*RIL_RadioStateRequest)(); 3996 3997 /** 3998 * This function returns "1" if the specified RIL_REQUEST code is 3999 * supported and 0 if it is not 4000 * 4001 * @param requestCode is one of RIL_REQUEST codes 4002 */ 4003 4004 typedef int (*RIL_Supports)(int requestCode); 4005 4006 /** 4007 * This function is called from a separate thread--not the 4008 * thread that calls RIL_RequestFunc--and indicates that a pending 4009 * request should be cancelled. 4010 * 4011 * On cancel, the callee should do its best to abandon the request and 4012 * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point. 4013 * 4014 * Subsequent calls to RIL_onRequestComplete for this request with 4015 * other results will be tolerated but ignored. (That is, it is valid 4016 * to ignore the cancellation request) 4017 * 4018 * RIL_Cancel calls should return immediately, and not wait for cancellation 4019 * 4020 * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007 4021 * interface 4022 * 4023 * @param t token wants to be canceled 4024 */ 4025 4026 typedef void (*RIL_Cancel)(RIL_Token t); 4027 4028 typedef void (*RIL_TimedCallback) (void *param); 4029 4030 /** 4031 * Return a version string for your RIL implementation 4032 */ 4033 typedef const char * (*RIL_GetVersion) (void); 4034 4035 typedef struct { 4036 int version; /* set to RIL_VERSION */ 4037 RIL_RequestFunc onRequest; 4038 RIL_RadioStateRequest onStateRequest; 4039 RIL_Supports supports; 4040 RIL_Cancel onCancel; 4041 RIL_GetVersion getVersion; 4042 } RIL_RadioFunctions; 4043 4044 #ifdef RIL_SHLIB 4045 struct RIL_Env { 4046 /** 4047 * "t" is parameter passed in on previous call to RIL_Notification 4048 * routine. 4049 * 4050 * If "e" != SUCCESS, then response can be null/is ignored 4051 * 4052 * "response" is owned by caller, and should not be modified or 4053 * freed by callee 4054 * 4055 * RIL_onRequestComplete will return as soon as possible 4056 */ 4057 void (*OnRequestComplete)(RIL_Token t, RIL_Errno e, 4058 void *response, size_t responselen); 4059 4060 /** 4061 * "unsolResponse" is one of RIL_UNSOL_RESPONSE_* 4062 * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_* 4063 * 4064 * "data" is owned by caller, and should not be modified or freed by callee 4065 */ 4066 4067 void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, 4068 size_t datalen); 4069 4070 /** 4071 * Call user-specifed "callback" function on on the same thread that 4072 * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies 4073 * a relative time value at which the callback is invoked. If relativeTime is 4074 * NULL or points to a 0-filled structure, the callback will be invoked as 4075 * soon as possible 4076 */ 4077 4078 void (*RequestTimedCallback) (RIL_TimedCallback callback, 4079 void *param, const struct timeval *relativeTime); 4080 }; 4081 4082 4083 /** 4084 * RIL implementations must defined RIL_Init 4085 * argc and argv will be command line arguments intended for the RIL implementation 4086 * Return NULL on error 4087 * 4088 * @param env is environment point defined as RIL_Env 4089 * @param argc number of arguments 4090 * @param argv list fo arguments 4091 * 4092 */ 4093 const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv); 4094 4095 #else /* RIL_SHLIB */ 4096 4097 /** 4098 * Call this once at startup to register notification routine 4099 * 4100 * @param callbacks user-specifed callback function 4101 */ 4102 void RIL_register (const RIL_RadioFunctions *callbacks); 4103 4104 4105 /** 4106 * 4107 * RIL_onRequestComplete will return as soon as possible 4108 * 4109 * @param t is parameter passed in on previous call to RIL_Notification 4110 * routine. 4111 * @param e error code 4112 * if "e" != SUCCESS, then response can be null/is ignored 4113 * @param response is owned by caller, and should not be modified or 4114 * freed by callee 4115 * @param responselen the length of response in byte 4116 */ 4117 void RIL_onRequestComplete(RIL_Token t, RIL_Errno e, 4118 void *response, size_t responselen); 4119 4120 /** 4121 * @param unsolResponse is one of RIL_UNSOL_RESPONSE_* 4122 * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_* 4123 * "data" is owned by caller, and should not be modified or freed by callee 4124 * @param datalen the length of data in byte 4125 */ 4126 4127 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data, 4128 size_t datalen); 4129 4130 4131 /** 4132 * Call user-specifed "callback" function on on the same thread that 4133 * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies 4134 * a relative time value at which the callback is invoked. If relativeTime is 4135 * NULL or points to a 0-filled structure, the callback will be invoked as 4136 * soon as possible 4137 * 4138 * @param callback user-specifed callback function 4139 * @param param parameter list 4140 * @param relativeTime a relative time value at which the callback is invoked 4141 */ 4142 4143 void RIL_requestTimedCallback (RIL_TimedCallback callback, 4144 void *param, const struct timeval *relativeTime); 4145 4146 4147 #endif /* RIL_SHLIB */ 4148 4149 #ifdef __cplusplus 4150 } 4151 #endif 4152 4153 #endif /*ANDROID_RIL_H*/ 4154