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