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