ril.h revision 34a5108969fbfc6cf8140513b7246da805902b7a
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/* 18 * ISSUES: 19 * - SMS retransmit (specifying TP-Message-ID) 20 * 21 */ 22 23/** 24 * TODO 25 * 26 * Supp Service Notification (+CSSN) 27 * GPRS PDP context deactivate notification 28 * 29 */ 30 31 32#ifndef ANDROID_RIL_H 33#define ANDROID_RIL_H 1 34 35#include <stdlib.h> 36#include <sys/time.h> 37 38#ifdef __cplusplus 39extern "C" { 40#endif 41 42#define RIL_VERSION 2 43 44typedef void * RIL_Token; 45 46typedef enum { 47 RIL_E_SUCCESS = 0, 48 RIL_E_RADIO_NOT_AVAILABLE = 1, /* If radio did not start or is resetting */ 49 RIL_E_GENERIC_FAILURE = 2, 50 RIL_E_PASSWORD_INCORRECT = 3, /* for PIN/PIN2 methods only! */ 51 RIL_E_SIM_PIN2 = 4, /* Operation requires SIM PIN2 to be entered */ 52 RIL_E_SIM_PUK2 = 5, /* Operation requires SIM PIN2 to be entered */ 53 RIL_E_REQUEST_NOT_SUPPORTED = 6, 54 RIL_E_CANCELLED = 7, 55 RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice 56 call on a Class C GPRS device */ 57 RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, /* data ops are not allowed before device 58 registers in network */ 59 RIL_E_SMS_SEND_FAIL_RETRY = 10 /* fail to send sms and need retry */ 60} RIL_Errno; 61 62typedef enum { 63 RIL_CALL_ACTIVE = 0, 64 RIL_CALL_HOLDING = 1, 65 RIL_CALL_DIALING = 2, /* MO call only */ 66 RIL_CALL_ALERTING = 3, /* MO call only */ 67 RIL_CALL_INCOMING = 4, /* MT call only */ 68 RIL_CALL_WAITING = 5 /* MT call only */ 69} RIL_CallState; 70 71typedef enum { 72 RADIO_STATE_OFF = 0, /* Radio explictly powered off (eg CFUN=0) */ 73 RADIO_STATE_UNAVAILABLE = 1, /* Radio unavailable (eg, resetting or not booted) */ 74 RADIO_STATE_SIM_NOT_READY = 2, /* Radio is on, but the SIM interface is not ready */ 75 RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3, /* SIM PIN locked, PUK required, network 76 personalization locked, or SIM absent */ 77 RADIO_STATE_SIM_READY = 4 /* Radio is on and SIM interface is available */ 78} RIL_RadioState; 79 80typedef struct { 81 RIL_CallState state; 82 int index; /* GSM Index for use with, eg, AT+CHLD */ 83 int toa; /* type of address, eg 145 = intl */ 84 char isMpty; /* nonzero if is mpty call */ 85 char isMT; /* nonzero if call is mobile terminated */ 86 char als; /* ALS line indicator if available 87 (0 = line 1) */ 88 char isVoice; /* nonzero if this is is a voice call */ 89 90 char * number; /* phone number */ 91} RIL_Call; 92 93typedef struct { 94 int cid; /* Context ID */ 95 int active; /* nonzero if context is active */ 96 char * type; /* X.25, IP, IPV6, etc. */ 97 char * apn; 98 char * address; 99} RIL_PDP_Context_Response; 100 101typedef struct { 102 int messageRef; /*TP-Message-Reference*/ 103 char *ackPDU; /* or NULL if n/a */ 104} RIL_SMS_Response; 105 106/** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */ 107typedef struct { 108 int status; /* Status of message. See TS 27.005 3.1, "<stat>": */ 109 /* 0 = "REC UNREAD" */ 110 /* 1 = "REC READ" */ 111 /* 2 = "STO UNSENT" */ 112 /* 3 = "STO SENT" */ 113 char * pdu; /* PDU of message to write, as a hex string. */ 114 char * smsc; /* SMSC address in GSM BCD format prefixed by a length byte 115 (as expected by TS 27.005) or NULL for default SMSC */ 116} RIL_SMS_WriteArgs; 117 118/** Used by RIL_REQUEST_DIAL */ 119typedef struct { 120 char * address; 121 int clir; 122 /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR" 123 * clir == 0 on "use subscription default value" 124 * clir == 1 on "CLIR invocation" (restrict CLI presentation) 125 * clir == 2 on "CLIR suppression" (allow CLI presentation) 126 */ 127 128} RIL_Dial; 129 130typedef struct { 131 int command; /* one of the commands listed for TS 27.007 +CRSM*/ 132 int fileid; /* EF id */ 133 char *path; /* "pathid" from TS 27.007 +CRSM command. 134 Path is in hex asciii format eg "7f205f70" 135 */ 136 int p1; 137 int p2; 138 int p3; 139 char *data; /* May be NULL*/ 140 char *pin2; /* May be NULL*/ 141} RIL_SIM_IO; 142 143typedef struct { 144 int sw1; 145 int sw2; 146 char *simResponse; /* In hex string format ([a-fA-F0-9]*). */ 147} RIL_SIM_IO_Response; 148 149/* See also com.android.internal.telephony.gsm.CallForwardInfo */ 150 151typedef struct { 152 int status; /* 153 * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 154 * status 1 = active, 0 = not active 155 * 156 * For RIL_REQUEST_SET_CALL_FORWARD: 157 * status is: 158 * 0 = disable 159 * 1 = enable 160 * 2 = interrogate 161 * 3 = registeration 162 * 4 = erasure 163 */ 164 165 int reason; /* from TS 27.007 7.11 "reason" */ 166 int serviceClass;/* From 27.007 +CCFC/+CLCK "class" 167 See table for Android mapping from 168 MMI service code 169 0 means user doesn't input class */ 170 int toa; /* "type" from TS 27.007 7.11 */ 171 char * number; /* "number" from TS 27.007 7.11. May be NULL */ 172 int timeSeconds; /* for CF no reply only */ 173}RIL_CallForwardInfo; 174 175typedef struct { 176 char * cid; /* Cell Id (as described in TS 27.005) in 16 bits in GSM 177 * Primary Scrambling Code (as described in TS 25.331) 178 * in 9 bits in UMTS 179 * Valid values are hexadecimal 0x0000 - 0xffff. 180 */ 181 int rssi; /* Received RSSI in 2G, 182 * Level index of CPICH Received Signal Code Power in 3G 183 */ 184} RIL_NeighboringCell; 185 186/* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */ 187typedef enum { 188 CALL_FAIL_NORMAL = 16, 189 CALL_FAIL_BUSY = 17, 190 CALL_FAIL_CONGESTION = 34, 191 CALL_FAIL_ACM_LIMIT_EXCEEDED = 68, 192 CALL_FAIL_CALL_BARRED = 240, 193 CALL_FAIL_FDN_BLOCKED = 241, 194 CALL_FAIL_ERROR_UNSPECIFIED = 0xffff 195} RIL_LastCallFailCause; 196 197/* See RIL_REQUEST_LAST_PDP_FAIL_CAUSE */ 198typedef enum { 199 PDP_FAIL_BARRED = 8, /* no retry; prompt user */ 200 PDP_FAIL_BAD_APN = 27, /* no retry; prompt user */ 201 PDP_FAIL_USER_AUTHENTICATION = 29, /* no retry; prompt user */ 202 PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 32, /*no retry; prompt user */ 203 PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 33, /*no retry; prompt user */ 204 PDP_FAIL_ERROR_UNSPECIFIED = 0xffff /* This and all other cases: retry silently */ 205} RIL_LastPDPActivateFailCause; 206 207/* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */ 208typedef struct { 209 int notificationType; /* 210 * 0 = MO intermediate result code 211 * 1 = MT unsolicited result code 212 */ 213 int code; /* See 27.007 7.17 214 "code1" for MO 215 "code2" for MT. */ 216 int index; /* CUG index. See 27.007 7.17. */ 217 int type; /* "type" from 27.007 7.17 (MT only). */ 218 char * number; /* "number" from 27.007 7.17 219 (MT only, may be NULL). */ 220} RIL_SuppSvcNotification; 221 222/* see RIL_REQUEST_GET_SIM_STATUS */ 223#define RIL_SIM_ABSENT 0 224#define RIL_SIM_NOT_READY 1 225/* RIL_SIM_READY means that the radio state is RADIO_STATE_SIM_READY. 226 * This is more 227 * than "+CPIN: READY". It also means the radio is ready for SIM I/O 228 */ 229#define RIL_SIM_READY 2 230#define RIL_SIM_PIN 3 231#define RIL_SIM_PUK 4 232#define RIL_SIM_NETWORK_PERSONALIZATION 5 233 234/* The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH */ 235typedef enum { 236 /* A file on SIM has been updated. data[1] contains the EFID. */ 237 SIM_FILE_UPDATE = 0, 238 /* SIM initialized. All files should be re-read. */ 239 SIM_INIT = 1, 240 /* SIM reset. SIM power required, SIM may be locked and all files should be re-read. */ 241 SIM_RESET = 2 242} RIL_SimRefreshResult; 243 244/* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */ 245#define RIL_RESTRICTED_STATE_NONE 0x00 246/* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */ 247#define RIL_RESTRICTED_STATE_CS_EMERGENCY 0x01 248/* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */ 249#define RIL_RESTRICTED_STATE_CS_NORMAL 0x02 250/* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/ 251#define RIL_RESTRICTED_STATE_CS_ALL 0x04 252/* Block packet data access due to restriction. */ 253#define RIL_RESTRICTED_STATE_PS_ALL 0x10 254 255/** 256 * RIL_REQUEST_GET_SIM_STATUS 257 * 258 * Requests status of the SIM interface and the SIM card 259 * 260 * "data" is NULL 261 * 262 * "response" must be an int * pointing to RIL_SIM_* constant 263 * This should always succeed (RIL_SUCCESS) 264 * 265 * If the radio is off or unavailable, return RIL_SIM_NOT_READY 266 * 267 * Please note: RIL_SIM_READY means that the radio state 268 * is RADIO_STATE_SIM_READY. This is more than "+CPIN: READY". 269 * It also means the radio is ready for SIM I/O 270 * 271 * Valid errors: 272 * Must never fail 273 */ 274#define RIL_REQUEST_GET_SIM_STATUS 1 275 276/** 277 * RIL_REQUEST_ENTER_SIM_PIN 278 * 279 * Supplies SIM PIN. Only called if SIM status is RIL_SIM_PIN 280 * 281 * "data" is const char ** 282 * ((const char **)data)[0] is PIN value 283 * 284 * "response" must be NULL 285 * 286 * Valid errors: 287 * 288 * SUCCESS 289 * RADIO_NOT_AVAILABLE (radio resetting) 290 * GENERIC_FAILURE 291 * PASSWORD_INCORRECT 292 */ 293 294#define RIL_REQUEST_ENTER_SIM_PIN 2 295 296 297/** 298 * RIL_REQUEST_ENTER_SIM_PUK 299 * 300 * Supplies SIM PUK and new PIN. 301 * 302 * "data" is const char ** 303 * ((const char **)data)[0] is PUK value 304 * ((const char **)data)[1] is new PIN value 305 * 306 * "response" must be NULL 307 * 308 * Valid errors: 309 * 310 * SUCCESS 311 * RADIO_NOT_AVAILABLE (radio resetting) 312 * GENERIC_FAILURE 313 * PASSWORD_INCORRECT 314 * (PUK is invalid) 315 */ 316 317#define RIL_REQUEST_ENTER_SIM_PUK 3 318 319/** 320 * RIL_REQUEST_ENTER_SIM_PIN2 321 * 322 * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was 323 * returned as a a failure from a previous operation. 324 * 325 * "data" is const char ** 326 * ((const char **)data)[0] is PIN2 value 327 * 328 * "response" must be NULL 329 * 330 * Valid errors: 331 * 332 * SUCCESS 333 * RADIO_NOT_AVAILABLE (radio resetting) 334 * GENERIC_FAILURE 335 * PASSWORD_INCORRECT 336 */ 337 338#define RIL_REQUEST_ENTER_SIM_PIN2 4 339 340/** 341 * RIL_REQUEST_ENTER_SIM_PUK2 342 * 343 * Supplies SIM PUK2 and new PIN2. 344 * 345 * "data" is const char ** 346 * ((const char **)data)[0] is PUK2 value 347 * ((const char **)data)[1] is new PIN2 value 348 * 349 * "response" must be NULL 350 * 351 * Valid errors: 352 * 353 * SUCCESS 354 * RADIO_NOT_AVAILABLE (radio resetting) 355 * GENERIC_FAILURE 356 * PASSWORD_INCORRECT 357 * (PUK2 is invalid) 358 */ 359 360#define RIL_REQUEST_ENTER_SIM_PUK2 5 361 362/** 363 * RIL_REQUEST_CHANGE_SIM_PIN 364 * 365 * Supplies old SIM PIN and new PIN. 366 * 367 * "data" is const char ** 368 * ((const char **)data)[0] is old PIN value 369 * ((const char **)data)[1] is new PIN value 370 * 371 * "response" must be NULL 372 * 373 * Valid errors: 374 * 375 * SUCCESS 376 * RADIO_NOT_AVAILABLE (radio resetting) 377 * GENERIC_FAILURE 378 * PASSWORD_INCORRECT 379 * (old PIN is invalid) 380 * 381 */ 382 383#define RIL_REQUEST_CHANGE_SIM_PIN 6 384 385 386/** 387 * RIL_REQUEST_CHANGE_SIM_PIN2 388 * 389 * Supplies old SIM PIN2 and new PIN2. 390 * 391 * "data" is const char ** 392 * ((const char **)data)[0] is old PIN2 value 393 * ((const char **)data)[1] is new PIN2 value 394 * 395 * "response" must be NULL 396 * 397 * Valid errors: 398 * 399 * SUCCESS 400 * RADIO_NOT_AVAILABLE (radio resetting) 401 * GENERIC_FAILURE 402 * PASSWORD_INCORRECT 403 * (old PIN2 is invalid) 404 * 405 */ 406 407#define RIL_REQUEST_CHANGE_SIM_PIN2 7 408 409/** 410 * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 411 * 412 * Requests that network personlization be deactivated 413 * 414 * "data" is const char ** 415 * ((const char **)(data))[0]] is network depersonlization code 416 * 417 * "response" must be NULL 418 * 419 * Valid errors: 420 * 421 * SUCCESS 422 * RADIO_NOT_AVAILABLE (radio resetting) 423 * GENERIC_FAILURE 424 * PASSWORD_INCORRECT 425 * (code is invalid) 426 */ 427 428#define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8 429 430/** 431 * RIL_REQUEST_GET_CURRENT_CALLS 432 * 433 * Requests current call list 434 * 435 * "data" is NULL 436 * 437 * "response" must be a "const RIL_Call **" 438 * 439 * Valid errors: 440 * 441 * SUCCESS 442 * RADIO_NOT_AVAILABLE (radio resetting) 443 * GENERIC_FAILURE 444 * (request will be made again in a few hundred msec) 445 */ 446 447#define RIL_REQUEST_GET_CURRENT_CALLS 9 448 449 450/** 451 * RIL_REQUEST_DIAL 452 * 453 * Initiate voice call 454 * 455 * "data" is const RIL_Dial * 456 * "response" is NULL 457 * 458 * This method is never used for supplementary service codes 459 * 460 * Valid errors: 461 * SUCCESS 462 * RADIO_NOT_AVAILABLE (radio resetting) 463 * GENERIC_FAILURE 464 */ 465#define RIL_REQUEST_DIAL 10 466 467/** 468 * RIL_REQUEST_GET_IMSI 469 * 470 * Get the SIM IMSI 471 * 472 * Only valid when radio state is "RADIO_STATE_SIM_READY" 473 * 474 * "data" is NULL 475 * "response" is a const char * containing the IMSI 476 * 477 * Valid errors: 478 * SUCCESS 479 * RADIO_NOT_AVAILABLE (radio resetting) 480 * GENERIC_FAILURE 481 */ 482 483#define RIL_REQUEST_GET_IMSI 11 484 485/** 486 * RIL_REQUEST_HANGUP 487 * 488 * Hang up a specific line (like AT+CHLD=1x) 489 * 490 * "data" is an int * 491 * (int *)data)[0] contains GSM call index (value of 'x' in CHLD above) 492 * 493 * "response" is NULL 494 * 495 * Valid errors: 496 * SUCCESS 497 * RADIO_NOT_AVAILABLE (radio resetting) 498 * GENERIC_FAILURE 499 */ 500 501#define RIL_REQUEST_HANGUP 12 502 503/** 504 * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 505 * 506 * Hang up waiting or held (like AT+CHLD=0) 507 * 508 * "data" is NULL 509 * "response" is NULL 510 * 511 * Valid errors: 512 * SUCCESS 513 * RADIO_NOT_AVAILABLE (radio resetting) 514 * GENERIC_FAILURE 515 */ 516 517#define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13 518 519/** 520 * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 521 * 522 * Hang up waiting or held (like AT+CHLD=1) 523 * 524 * "data" is NULL 525 * "response" is NULL 526 * 527 * Valid errors: 528 * SUCCESS 529 * RADIO_NOT_AVAILABLE (radio resetting) 530 * GENERIC_FAILURE 531 */ 532 533#define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14 534 535/** 536 * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 537 * 538 * Switch waiting or holding call and active call (like AT+CHLD=2) 539 * 540 * State transitions should be is follows: 541 * 542 * If call 1 is waiting and call 2 is active, then if this re 543 * 544 * BEFORE AFTER 545 * Call 1 Call 2 Call 1 Call 2 546 * ACTIVE HOLDING HOLDING ACTIVE 547 * ACTIVE WAITING HOLDING ACTIVE 548 * HOLDING WAITING HOLDING ACTIVE 549 * ACTIVE IDLE HOLDING IDLE 550 * IDLE IDLE IDLE IDLE 551 * 552 * "data" is NULL 553 * "response" is NULL 554 * 555 * Valid errors: 556 * SUCCESS 557 * RADIO_NOT_AVAILABLE (radio resetting) 558 * GENERIC_FAILURE 559 */ 560 561#define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15 562#define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15 563 564/** 565 * RIL_REQUEST_CONFERENCE 566 * 567 * Conference holding and active (like AT+CHLD=3) 568 569 * "data" is NULL 570 * "response" is NULL 571 * 572 * Valid errors: 573 * SUCCESS 574 * RADIO_NOT_AVAILABLE (radio resetting) 575 * GENERIC_FAILURE 576 */ 577#define RIL_REQUEST_CONFERENCE 16 578 579/** 580 * RIL_REQUEST_UDUB 581 * 582 * Send UDUB (user determined used busy) to ringing or 583 * waiting call answer)(RIL_BasicRequest r); 584 * 585 * "data" is NULL 586 * "response" is NULL 587 * 588 * Valid errors: 589 * SUCCESS 590 * RADIO_NOT_AVAILABLE (radio resetting) 591 * GENERIC_FAILURE 592 */ 593#define RIL_REQUEST_UDUB 17 594 595/** 596 * RIL_REQUEST_LAST_CALL_FAIL_CAUSE 597 * 598 * Requests the failure cause code for the most recently terminated call 599 * 600 * "data" is NULL 601 * "response" is a "int *" 602 * ((int *)response)[0] is an integer cause code defined in TS 24.008 603 * Annex H or close approximation 604 * 605 * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked 606 * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED) 607 * 608 * If the implementation does not have access to the exact cause codes, 609 * then it should return one of the values listed in RIL_LastCallFailCause, 610 * as the UI layer needs to distinguish these cases for tone generation or 611 * error notification. 612 * 613 * Valid errors: 614 * SUCCESS 615 * RADIO_NOT_AVAILABLE 616 * GENERIC_FAILURE 617 * 618 * See also: RIL_REQUEST_LAST_PDP_FAIL_CAUSE 619 */ 620#define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18 621 622/** 623 * RIL_REQUEST_SIGNAL_STRENGTH 624 * 625 * Requests current signal strength and bit error rate 626 * 627 * Must succeed if radio is on. 628 * 629 * "data" is NULL 630 * "response" is an "int *" 631 * ((int *)response)[0] is received signal strength (0-31, 99) 632 * ((int *)response)[1] is bit error rate (0-7, 99) 633 * as defined in TS 27.007 8.5 634 * Other values (eg -1) are not legal 635 * 636 * Valid errors: 637 * SUCCESS 638 * RADIO_NOT_AVAILABLE 639 */ 640 641#define RIL_REQUEST_SIGNAL_STRENGTH 19 642/** 643 * RIL_REQUEST_REGISTRATION_STATE 644 * 645 * Request current registration state 646 * 647 * "data" is NULL 648 * "response" is a "char **" 649 * ((const char **)response)[0] is registration state 0-5 from TS 27.007 7.2 650 * ((const char **)response)[1] is LAC if registered or NULL if not 651 * ((const char **)response)[2] is CID if registered or NULL if not 652 * 653 * LAC and CID are in hexadecimal format. 654 * valid LAC are 0x0000 - 0xffff 655 * valid CID are 0x00000000 - 0x0fffffff 656 * In GSM, CID is Cell ID (as described in TS 27.007) in 16 bits 657 * In UMTS, CID is UMTS Cell Identity (as described in TS 25.331) in 28 bits 658 * 659 * Please note that registration state 4 ("unknown") is treated 660 * as "out of service" in the Android telephony system 661 * 662 * Valid errors: 663 * SUCCESS 664 * RADIO_NOT_AVAILABLE 665 * GENERIC_FAILURE 666 */ 667#define RIL_REQUEST_REGISTRATION_STATE 20 668 669/** 670 * RIL_REQUEST_GPRS_REGISTRATION_STATE 671 * 672 * Request current GPRS registration state 673 * 674 * "data" is NULL 675 * "response" is a "char **" 676 * ((const char **)response)[0] is registration state 0-5 from TS 27.007 7.2 677 * ((const char **)response)[1] is LAC if registered or NULL if not 678 * ((const char **)response)[2] is CID if registered or NULL if not 679 * ((const char **)response)[3] indicates the available radio technology, where: 680 * 0 == unknown 681 * 1 == GPRS only 682 * 2 == EDGE 683 * 3 == UMTS 684 * 685 * LAC and CID are in hexadecimal format. 686 * valid LAC are 0x0000 - 0xffff 687 * valid CID are 0x00000000 - 0x0fffffff 688 * 689 * Please note that registration state 4 ("unknown") is treated 690 * as "out of service" in the Android telephony system 691 * 692 * Valid errors: 693 * SUCCESS 694 * RADIO_NOT_AVAILABLE 695 * GENERIC_FAILURE 696 */ 697#define RIL_REQUEST_GPRS_REGISTRATION_STATE 21 698 699/** 700 * RIL_REQUEST_OPERATOR 701 * 702 * Request current operator ONS or EONS 703 * 704 * "data" is NULL 705 * "response" is a "const char **" 706 * ((const char **)response)[0] is long alpha ONS or EONS 707 * or NULL if unregistered 708 * 709 * ((const char **)response)[1] is short alpha ONS or EONS 710 * or NULL if unregistered 711 * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC) 712 * or NULL if unregistered 713 * 714 * Valid errors: 715 * SUCCESS 716 * RADIO_NOT_AVAILABLE 717 * GENERIC_FAILURE 718 */ 719#define RIL_REQUEST_OPERATOR 22 720 721/** 722 * RIL_REQUEST_RADIO_POWER 723 * 724 * Toggle radio on and off (for "airplane" mode) 725 * "data" is int * 726 * ((int *)data)[0] is > 0 for "Radio On" 727 * ((int *)data)[0] is == 0 for "Radio Off" 728 * 729 * "response" is NULL 730 * 731 * Turn radio on if "on" > 0 732 * Turn radio off if "on" == 0 733 * 734 * Valid errors: 735 * SUCCESS 736 * RADIO_NOT_AVAILABLE 737 * GENERIC_FAILURE 738 */ 739#define RIL_REQUEST_RADIO_POWER 23 740 741/** 742 * RIL_REQUEST_DTMF 743 * 744 * Send a DTMF tone 745 * 746 * If the implementation is currently playing a tone requested via 747 * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone 748 * should be played instead 749 * 750 * "data" is a char * 751 * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,# 752 * ((char *)data)[1] is a single character with one of 3 values: 753 * 'S' -- tone should be played for a short time 754 * 'L' -- tone should be played for a long time 755 * "response" is NULL 756 * 757 * FIXME should this block/mute microphone? 758 * How does this interact with local DTMF feedback? 759 * 760 * Valid errors: 761 * SUCCESS 762 * RADIO_NOT_AVAILABLE 763 * GENERIC_FAILURE 764 * 765 * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START 766 * 767 */ 768#define RIL_REQUEST_DTMF 24 769 770/** 771 * RIL_REQUEST_SEND_SMS 772 * 773 * Send an SMS message 774 * 775 * "data" is const char ** 776 * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed 777 * by a length byte (as expected by TS 27.005) or NULL for default SMSC 778 * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string 779 * less the SMSC address 780 * TP-Layer-Length is be "strlen(((const char **)data)[1])/2" 781 * 782 * "response" is a const RIL_SMS_Response * 783 * 784 * Based on the return error, caller decides to resend if sending sms 785 * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) 786 * and GENERIC_FAILURE means no retry (i.e. error cause is 500) 787 * 788 * Valid errors: 789 * SUCCESS 790 * RADIO_NOT_AVAILABLE 791 * SMS_SEND_FAIL_RETRY 792 * GENERIC_FAILURE 793 * 794 * FIXME how do we specify TP-Message-Reference if we need to resend? 795 */ 796#define RIL_REQUEST_SEND_SMS 25 797 798 799/** 800 * RIL_REQUEST_SEND_SMS_EXPECT_MORE 801 * 802 * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS, 803 * except that more messages are expected to be sent soon. If possible, 804 * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command) 805 * 806 * "data" is const char ** 807 * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed 808 * by a length byte (as expected by TS 27.005) or NULL for default SMSC 809 * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string 810 * less the SMSC address 811 * TP-Layer-Length is be "strlen(((const char **)data)[1])/2" 812 * 813 * "response" is a const RIL_SMS_Response * 814 * 815 * Based on the return error, caller decides to resend if sending sms 816 * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) 817 * and GENERIC_FAILURE means no retry (i.e. error cause is 500) 818 * 819 * Valid errors: 820 * SUCCESS 821 * RADIO_NOT_AVAILABLE 822 * SMS_SEND_FAIL_RETRY 823 * GENERIC_FAILURE 824 * 825 */ 826#define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26 827 828 829/** 830 * RIL_REQUEST_SETUP_DEFAULT_PDP 831 * 832 * Configure and activate PDP context (CID 1) for default IP connection 833 * 834 * Android Telephony layer will start up pppd process on specified 835 * tty when this request responded to. 836 * 837 * "data" is a const char ** 838 * ((const char **)data)[0] is the APN to connect to 839 * ((const char **)data)[1] is the username, or NULL 840 * ((const char **)data)[2] is the password, or NULL 841 * 842 * "response" is a char ** 843 * ((char **)response)[0] indicating PDP CID, which is generated by RIL 844 * ((char **)response)[1] indicating the network interface name 845 * ((char **)response)[2] indicating the IP address for this interface 846 * 847 * FIXME may need way to configure QoS settings 848 * 849 * Valid errors: 850 * SUCCESS 851 * RADIO_NOT_AVAILABLE 852 * GENERIC_FAILURE 853 * 854 * See also: RIL_REQUEST_DEACTIVATE_DEFAULT_PDP 855 */ 856 857#define RIL_REQUEST_SETUP_DEFAULT_PDP 27 858 859 860 861/** 862 * RIL_REQUEST_SIM_IO 863 * 864 * Request SIM I/O operation. 865 * This is similar to the TS 27.007 "restricted SIM" operation 866 * where it assumes all of the EF selection will be done by the 867 * callee. 868 * 869 * "data" is a const RIL_SIM_IO * 870 * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL, 871 * or may specify a PIN2 for operations that require a PIN2 (eg 872 * updating FDN records) 873 * 874 * "response" is a const RIL_SIM_IO_Response * 875 * 876 * Arguments and responses that are unused for certain 877 * values of "command" should be ignored or set to NULL 878 * 879 * Valid errors: 880 * SUCCESS 881 * RADIO_NOT_AVAILABLE 882 * GENERIC_FAILURE 883 * SIM_PIN2 884 * SIM_PUK2 885 */ 886#define RIL_REQUEST_SIM_IO 28 887 888/** 889 * RIL_REQUEST_SEND_USSD 890 * 891 * Send a USSD message 892 * 893 * If a USSD session already exists, the message should be sent in the 894 * context of that session. Otherwise, a new session should be created. 895 * 896 * The network reply should be reported via RIL_UNSOL_ON_USSD 897 * 898 * Only one USSD session may exist at a time, and the session is assumed 899 * to exist until: 900 * a) The android system invokes RIL_REQUEST_CANCEL_USSD 901 * b) The implementation sends a RIL_UNSOL_ON_USSD with a type code 902 * of "0" (USSD-Notify/no further action) or "2" (session terminated) 903 * 904 * "data" is a const char * containing the USSD request in UTF-8 format 905 * "response" is NULL 906 * 907 * Valid errors: 908 * SUCCESS 909 * RADIO_NOT_AVAILABLE 910 * GENERIC_FAILURE 911 * 912 * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD 913 */ 914 915#define RIL_REQUEST_SEND_USSD 29 916 917/** 918 * RIL_REQUEST_CANCEL_USSD 919 * 920 * Cancel the current USSD session if one exists 921 * 922 * "data" is null 923 * "response" is NULL 924 * 925 * Valid errors: 926 * SUCCESS 927 * RADIO_NOT_AVAILABLE 928 * GENERIC_FAILURE 929 */ 930 931#define RIL_REQUEST_CANCEL_USSD 30 932 933/** 934 * RIL_REQUEST_GET_CLIR 935 * 936 * Gets current CLIR status 937 * "data" is NULL 938 * "response" is int * 939 * ((int *)data)[0] is "n" parameter from TS 27.007 7.7 940 * ((int *)data)[1] is "m" parameter from TS 27.007 7.7 941 * 942 * Valid errors: 943 * SUCCESS 944 * RADIO_NOT_AVAILABLE 945 * GENERIC_FAILURE 946 */ 947#define RIL_REQUEST_GET_CLIR 31 948 949/** 950 * RIL_REQUEST_SET_CLIR 951 * 952 * "data" is int * 953 * ((int *)data)[0] is "n" parameter from TS 27.007 7.7 954 * 955 * "response" is NULL 956 * 957 * Valid errors: 958 * SUCCESS 959 * RADIO_NOT_AVAILABLE 960 * GENERIC_FAILURE 961 */ 962#define RIL_REQUEST_SET_CLIR 32 963 964/** 965 * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 966 * 967 * "data" is const RIL_CallForwardInfo * 968 * 969 * "response" is const RIL_CallForwardInfo ** 970 * "response" points to an array of RIL_CallForwardInfo *'s, one for 971 * each distinct registered phone number. 972 * 973 * For example, if data is forwarded to +18005551212 and voice is forwarded 974 * to +18005559999, then two separate RIL_CallForwardInfo's should be returned 975 * 976 * If, however, both data and voice are forwarded to +18005551212, then 977 * a single RIL_CallForwardInfo can be returned with the service class 978 * set to "data + voice = 3") 979 * 980 * Valid errors: 981 * SUCCESS 982 * RADIO_NOT_AVAILABLE 983 * GENERIC_FAILURE 984 */ 985#define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33 986 987 988/** 989 * RIL_REQUEST_SET_CALL_FORWARD 990 * 991 * Configure call forward rule 992 * 993 * "data" is const RIL_CallForwardInfo * 994 * "response" is NULL 995 * 996 * Valid errors: 997 * SUCCESS 998 * RADIO_NOT_AVAILABLE 999 * GENERIC_FAILURE 1000 */ 1001#define RIL_REQUEST_SET_CALL_FORWARD 34 1002 1003 1004/** 1005 * RIL_REQUEST_QUERY_CALL_WAITING 1006 * 1007 * Query current call waiting state 1008 * 1009 * "data" is const int * 1010 * ((const int *)data)[0] is the TS 27.007 service class to query. 1011 * "response" is a const int * 1012 * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled" 1013 * 1014 * If ((const int *)response)[0] is = 1, then ((const int *)response)[1] 1015 * must follow, with the TS 27.007 service class bit vector of services 1016 * for which call waiting is enabled. 1017 * 1018 * For example, if ((const int *)response)[0] is 1 and 1019 * ((const int *)response)[1] is 3, then call waiting is enabled for data 1020 * and voice and disabled for everything else 1021 * 1022 * Valid errors: 1023 * SUCCESS 1024 * RADIO_NOT_AVAILABLE 1025 * GENERIC_FAILURE 1026 */ 1027#define RIL_REQUEST_QUERY_CALL_WAITING 35 1028 1029 1030/** 1031 * RIL_REQUEST_SET_CALL_WAITING 1032 * 1033 * Configure current call waiting state 1034 * 1035 * "data" is const int * 1036 * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled" 1037 * ((const int *)data)[1] is the TS 27.007 service class bit vector of 1038 * services to modify 1039 * "response" is NULL 1040 * 1041 * Valid errors: 1042 * SUCCESS 1043 * RADIO_NOT_AVAILABLE 1044 * GENERIC_FAILURE 1045 */ 1046#define RIL_REQUEST_SET_CALL_WAITING 36 1047 1048/** 1049 * RIL_REQUEST_SMS_ACKNOWLEDGE 1050 * 1051 * Acknowledge successful or failed receipt of SMS previously indicated 1052 * via RIL_UNSOL_RESPONSE_NEW_SMS 1053 * 1054 * "data" is int * 1055 * ((int *)data)[0] is "1" on successful receipt 1056 * (basically, AT+CNMA=1 from TS 27.005 1057 * ((int *)data)[0] is "0" on failed receipt 1058 * (basically, AT+CNMA=2 from TS 27.005) 1059 * 1060 * "response" is NULL 1061 * 1062 * FIXME would like request that specified RP-ACK/RP-ERROR PDU 1063 * 1064 * Valid errors: 1065 * SUCCESS 1066 * RADIO_NOT_AVAILABLE 1067 * GENERIC_FAILURE 1068 */ 1069#define RIL_REQUEST_SMS_ACKNOWLEDGE 37 1070 1071/** 1072 * RIL_REQUEST_GET_IMEI 1073 * 1074 * Get the device IMEI, including check digit 1075 * 1076 * Valid when RadioState is not RADIO_STATE_UNAVAILABLE 1077 * 1078 * "data" is NULL 1079 * "response" is a const char * containing the IMEI 1080 * 1081 * Valid errors: 1082 * SUCCESS 1083 * RADIO_NOT_AVAILABLE (radio resetting) 1084 * GENERIC_FAILURE 1085 */ 1086 1087#define RIL_REQUEST_GET_IMEI 38 1088 1089/** 1090 * RIL_REQUEST_GET_IMEISV 1091 * 1092 * Get the device IMEISV, which should be two decimal digits 1093 * 1094 * Valid when RadioState is not RADIO_STATE_UNAVAILABLE 1095 * 1096 * "data" is NULL 1097 * "response" is a const char * containing the IMEISV 1098 * 1099 * Valid errors: 1100 * SUCCESS 1101 * RADIO_NOT_AVAILABLE (radio resetting) 1102 * GENERIC_FAILURE 1103 */ 1104 1105#define RIL_REQUEST_GET_IMEISV 39 1106 1107 1108/** 1109 * RIL_REQUEST_ANSWER 1110 * 1111 * Answer incoming call 1112 * 1113 * Will not be called for WAITING calls. 1114 * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case 1115 * instead 1116 * 1117 * "data" is NULL 1118 * "response" is NULL 1119 * 1120 * Valid errors: 1121 * SUCCESS 1122 * RADIO_NOT_AVAILABLE (radio resetting) 1123 * GENERIC_FAILURE 1124 */ 1125 1126#define RIL_REQUEST_ANSWER 40 1127 1128/** 1129 * RIL_REQUEST_DEACTIVATE_DEFAULT_PDP 1130 * 1131 * Deactivate PDP context created by RIL_REQUEST_SETUP_DEFAULT_PDP 1132 * 1133 * "data" is const char ** 1134 * ((char**)data)[0] indicating PDP CID 1135 * "response" is NULL 1136 * 1137 * Valid errors: 1138 * SUCCESS 1139 * RADIO_NOT_AVAILABLE 1140 * GENERIC_FAILURE 1141 * 1142 * See also: RIL_REQUEST_SETUP_DEFAULT_PDP 1143 */ 1144 1145#define RIL_REQUEST_DEACTIVATE_DEFAULT_PDP 41 1146 1147/** 1148 * RIL_REQUEST_QUERY_FACILITY_LOCK 1149 * 1150 * Query the status of a facility lock state 1151 * 1152 * "data" is const char ** 1153 * ((const char **)data)[0] is the facility string code from TS 27.007 7.4 1154 * (eg "AO" for BAOC, "SC" for SIM lock) 1155 * ((const char **)data)[1] is the password, or "" if not required 1156 * ((const char **)data)[2] is the TS 27.007 service class bit vector of 1157 * services to query 1158 * 1159 * "response" is an int * 1160 * ((const int *)response) 0 is the TS 27.007 service class bit vector of 1161 * services for which the specified barring facility 1162 * is active. "0" means "disabled for all" 1163 * 1164 * 1165 * Valid errors: 1166 * SUCCESS 1167 * RADIO_NOT_AVAILABLE 1168 * GENERIC_FAILURE 1169 * 1170 */ 1171#define RIL_REQUEST_QUERY_FACILITY_LOCK 42 1172 1173/** 1174 * RIL_REQUEST_SET_FACILITY_LOCK 1175 * 1176 * Enable/disable one facility lock 1177 * 1178 * "data" is const char ** 1179 * 1180 * ((const char **)data)[0] = facility string code from TS 27.007 7.4 1181 * (eg "AO" for BAOC) 1182 * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock" 1183 * ((const char **)data)[2] = password 1184 * ((const char **)data)[3] = string representation of decimal TS 27.007 1185 * service class bit vector. Eg, the string 1186 * "1" means "set this facility for voice services" 1187 * 1188 * "response" is NULL 1189 * 1190 * Valid errors: 1191 * SUCCESS 1192 * RADIO_NOT_AVAILABLE 1193 * GENERIC_FAILURE 1194 * 1195 */ 1196#define RIL_REQUEST_SET_FACILITY_LOCK 43 1197 1198/** 1199 * RIL_REQUEST_CHANGE_BARRING_PASSWORD 1200 * 1201 * Change call barring facility password 1202 * 1203 * "data" is const char ** 1204 * 1205 * ((const char **)data)[0] = facility string code from TS 27.007 7.4 1206 * (eg "AO" for BAOC) 1207 * ((const char **)data)[1] = old password 1208 * ((const char **)data)[2] = new password 1209 * 1210 * "response" is NULL 1211 * 1212 * Valid errors: 1213 * SUCCESS 1214 * RADIO_NOT_AVAILABLE 1215 * GENERIC_FAILURE 1216 * 1217 */ 1218#define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44 1219 1220/** 1221 * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 1222 * 1223 * Query current network selectin mode 1224 * 1225 * "data" is NULL 1226 * 1227 * "response" is int * 1228 * ((const int *)response)[0] is 1229 * 0 for automatic selection 1230 * 1 for manual selection 1231 * 1232 * Valid errors: 1233 * SUCCESS 1234 * RADIO_NOT_AVAILABLE 1235 * GENERIC_FAILURE 1236 * 1237 */ 1238#define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45 1239 1240/** 1241 * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 1242 * 1243 * Specify that the network should be selected automatically 1244 * 1245 * "data" is NULL 1246 * "response" is NULL 1247 * 1248 * This request must not respond until the new operator is selected 1249 * and registered 1250 * 1251 * Valid errors: 1252 * SUCCESS 1253 * RADIO_NOT_AVAILABLE 1254 * GENERIC_FAILURE 1255 * 1256 */ 1257#define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46 1258 1259/** 1260 * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 1261 * 1262 * Manually select a specified network. 1263 * 1264 * The radio baseband/RIL implementation is expected to fall back to 1265 * automatic selection mode if the manually selected network should go 1266 * out of range in the future. 1267 * 1268 * "data" is const char * specifying MCCMNC of network to select (eg "310170") 1269 * "response" is NULL 1270 * 1271 * This request must not respond until the new operator is selected 1272 * and registered 1273 * 1274 * Valid errors: 1275 * SUCCESS 1276 * RADIO_NOT_AVAILABLE 1277 * GENERIC_FAILURE 1278 * 1279 */ 1280#define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47 1281 1282/** 1283 * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 1284 * 1285 * Scans for available networks 1286 * 1287 * "data" is NULL 1288 * "response" is const char ** that should be an array of n*4 strings, where 1289 * n is the number of available networks 1290 * For each available network: 1291 * 1292 * ((const char **)response)[n+0] is long alpha ONS or EONS 1293 * ((const char **)response)[n+1] is short alpha ONS or EONS 1294 * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC) 1295 * ((const char **)response)[n+3] is a string value of the status: 1296 * "unknown" 1297 * "available" 1298 * "current" 1299 * "forbidden" 1300 * 1301 * This request must not respond until the new operator is selected 1302 * and registered 1303 * 1304 * Valid errors: 1305 * SUCCESS 1306 * RADIO_NOT_AVAILABLE 1307 * GENERIC_FAILURE 1308 * 1309 */ 1310#define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48 1311 1312/** 1313 * RIL_REQUEST_DTMF_START 1314 * 1315 * Start playing a DTMF tone. Continue playing DTMF tone until 1316 * RIL_REQUEST_DTMF_STOP is received 1317 * 1318 * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing, 1319 * it should cancel the previous tone and play the new one. 1320 * 1321 * "data" is a char * 1322 * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,# 1323 * "response" is NULL 1324 * 1325 * Valid errors: 1326 * SUCCESS 1327 * RADIO_NOT_AVAILABLE 1328 * GENERIC_FAILURE 1329 * 1330 * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP 1331 */ 1332#define RIL_REQUEST_DTMF_START 49 1333 1334/** 1335 * RIL_REQUEST_DTMF_STOP 1336 * 1337 * Stop playing a currently playing DTMF tone. 1338 * 1339 * "data" is NULL 1340 * "response" is NULL 1341 * 1342 * Valid errors: 1343 * SUCCESS 1344 * RADIO_NOT_AVAILABLE 1345 * GENERIC_FAILURE 1346 * 1347 * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START 1348 */ 1349#define RIL_REQUEST_DTMF_STOP 50 1350 1351/** 1352 * RIL_REQUEST_BASEBAND_VERSION 1353 * 1354 * Return string value indicating baseband version, eg 1355 * response from AT+CGMR 1356 * 1357 * "data" is NULL 1358 * "response" is const char * containing version string for log reporting 1359 * 1360 * Valid errors: 1361 * SUCCESS 1362 * RADIO_NOT_AVAILABLE 1363 * GENERIC_FAILURE 1364 * 1365 */ 1366#define RIL_REQUEST_BASEBAND_VERSION 51 1367 1368/** 1369 * RIL_REQUEST_SEPARATE_CONNECTION 1370 * 1371 * Separate a party from a multiparty call placing the multiparty call 1372 * (less the specified party) on hold and leaving the specified party 1373 * as the only other member of the current (active) call 1374 * 1375 * Like AT+CHLD=2x 1376 * 1377 * See TS 22.084 1.3.8.2 (iii) 1378 * TS 22.030 6.5.5 "Entering "2X followed by send" 1379 * TS 27.007 "AT+CHLD=2x" 1380 * 1381 * "data" is an int * 1382 * (int *)data)[0] contains GSM call index (value of 'x' in CHLD above) 1383 * "response" is NULL 1384 * 1385 * Valid errors: 1386 * SUCCESS 1387 * RADIO_NOT_AVAILABLE (radio resetting) 1388 * GENERIC_FAILURE 1389 */ 1390#define RIL_REQUEST_SEPARATE_CONNECTION 52 1391 1392 1393/** 1394 * RIL_REQUEST_SET_MUTE 1395 * 1396 * Turn on or off uplink (microphone) mute. 1397 * 1398 * Will only be sent while voice call is active. 1399 * Will always be reset to "disable mute" when a new voice call is initiated 1400 * 1401 * "data" is an int * 1402 * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute" 1403 * 1404 * "response" is NULL 1405 * 1406 * Valid errors: 1407 * SUCCESS 1408 * RADIO_NOT_AVAILABLE (radio resetting) 1409 * GENERIC_FAILURE 1410 */ 1411 1412#define RIL_REQUEST_SET_MUTE 53 1413 1414/** 1415 * RIL_REQUEST_GET_MUTE 1416 * 1417 * Queries the current state of the uplink mute setting 1418 * 1419 * "data" is NULL 1420 * "response" is an int * 1421 * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled" 1422 * 1423 * Valid errors: 1424 * SUCCESS 1425 * RADIO_NOT_AVAILABLE (radio resetting) 1426 * GENERIC_FAILURE 1427 */ 1428 1429#define RIL_REQUEST_GET_MUTE 54 1430 1431/** 1432 * RIL_REQUEST_QUERY_CLIP 1433 * 1434 * Queries the status of the CLIP supplementary service 1435 * 1436 * (for MMI code "*#30#") 1437 * 1438 * "data" is NULL 1439 * "response" is an int * 1440 * (int *)response)[0] is 1 for "CLIP provisioned" 1441 * and 0 for "CLIP not provisioned" 1442 * and 2 for "unknown, e.g. no network etc" 1443 * 1444 * Valid errors: 1445 * SUCCESS 1446 * RADIO_NOT_AVAILABLE (radio resetting) 1447 * GENERIC_FAILURE 1448 */ 1449 1450#define RIL_REQUEST_QUERY_CLIP 55 1451 1452/** 1453 * RIL_REQUEST_LAST_PDP_FAIL_CAUSE 1454 * 1455 * Requests the failure cause code for the most recently failed PDP 1456 * context activate 1457 * 1458 * "data" is NULL 1459 * 1460 * "response" is a "int *" 1461 * ((int *)response)[0] is an integer cause code defined in TS 24.008 1462 * section 6.1.3.1.3 or close approximation 1463 * 1464 * If the implementation does not have access to the exact cause codes, 1465 * then it should return one of the values listed in 1466 * RIL_LastPDPActivateFailCause, as the UI layer needs to distinguish these 1467 * cases for error notification 1468 * and potential retries. 1469 * 1470 * Valid errors: 1471 * SUCCESS 1472 * RADIO_NOT_AVAILABLE 1473 * GENERIC_FAILURE 1474 * 1475 * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE 1476 * 1477 */ 1478 1479#define RIL_REQUEST_LAST_PDP_FAIL_CAUSE 56 1480 1481/** 1482 * RIL_REQUEST_PDP_CONTEXT_LIST 1483 * 1484 * Queries the status of PDP contexts, returning for each 1485 * its CID, whether or not it is active, and its PDP type, 1486 * APN, and PDP adddress. 1487 * 1488 * "data" is NULL 1489 * "response" is an array of RIL_PDP_Context_Response 1490 * 1491 * Valid errors: 1492 * SUCCESS 1493 * RADIO_NOT_AVAILABLE (radio resetting) 1494 * GENERIC_FAILURE 1495 */ 1496 1497#define RIL_REQUEST_PDP_CONTEXT_LIST 57 1498 1499/** 1500 * RIL_REQUEST_RESET_RADIO 1501 * 1502 * Request a radio reset. The RIL implementation may postpone 1503 * the reset until after this request is responded to if the baseband 1504 * is presently busy. 1505 * 1506 * "data" is NULL 1507 * "response" is NULL 1508 * 1509 * The reset action could be delayed for a while 1510 * in case baseband modem is just busy. 1511 * 1512 * Valid errors: 1513 * SUCCESS 1514 * RADIO_NOT_AVAILABLE (radio resetting) 1515 * GENERIC_FAILURE 1516 */ 1517 1518#define RIL_REQUEST_RESET_RADIO 58 1519 1520/** 1521 * RIL_REQUEST_OEM_HOOK_RAW 1522 * 1523 * This request reserved for OEM-specific uses. It passes raw byte arrays 1524 * back and forth. 1525 * 1526 * It can be invoked on the Java side from 1527 * com.android.internal.telephony.Phone.invokeOemRilRequestRaw() 1528 * 1529 * "data" is a char * of bytes copied from the byte[] data argument in java 1530 * "response" is a char * of bytes that will returned via the 1531 * caller's "response" Message here: 1532 * (byte[])(((AsyncResult)response.obj).result) 1533 * 1534 * An error response here will result in 1535 * (((AsyncResult)response.obj).result) == null and 1536 * (((AsyncResult)response.obj).exception) being an instance of 1537 * com.android.internal.telephony.gsm.CommandException 1538 * 1539 * Valid errors: 1540 * All 1541 */ 1542 1543#define RIL_REQUEST_OEM_HOOK_RAW 59 1544 1545/** 1546 * RIL_REQUEST_OEM_HOOK_STRINGS 1547 * 1548 * This request reserved for OEM-specific uses. It passes strings 1549 * back and forth. 1550 * 1551 * It can be invoked on the Java side from 1552 * com.android.internal.telephony.Phone.invokeOemRilRequestStrings() 1553 * 1554 * "data" is a const char **, representing an array of null-terminated UTF-8 1555 * strings copied from the "String[] strings" argument to 1556 * invokeOemRilRequestStrings() 1557 * 1558 * "response" is a const char **, representing an array of null-terminated UTF-8 1559 * stings that will be returned via the caller's response message here: 1560 * 1561 * (String[])(((AsyncResult)response.obj).result) 1562 * 1563 * An error response here will result in 1564 * (((AsyncResult)response.obj).result) == null and 1565 * (((AsyncResult)response.obj).exception) being an instance of 1566 * com.android.internal.telephony.gsm.CommandException 1567 * 1568 * Valid errors: 1569 * All 1570 */ 1571 1572#define RIL_REQUEST_OEM_HOOK_STRINGS 60 1573 1574/** 1575 * RIL_REQUEST_SCREEN_STATE 1576 * 1577 * Indicates the current state of the screen. When the screen is off, the 1578 * RIL should notify the baseband to suppress certain notifications (eg, 1579 * signal strength and changes in LAC or CID) in an effort to conserve power. 1580 * These notifications should resume when the screen is on. 1581 * 1582 * "data" is int * 1583 * ((int *)data)[0] is == 1 for "Screen On" 1584 * ((int *)data)[0] is == 0 for "Screen Off" 1585 * 1586 * "response" is NULL 1587 * 1588 * Valid errors: 1589 * SUCCESS 1590 * GENERIC_FAILURE 1591 */ 1592#define RIL_REQUEST_SCREEN_STATE 61 1593 1594 1595/** 1596 * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 1597 * 1598 * Enables/disables supplementary service related notifications 1599 * from the network. 1600 * 1601 * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION. 1602 * 1603 * "data" is int * 1604 * ((int *)data)[0] is == 1 for notifications enabled 1605 * ((int *)data)[0] is == 0 for notifications disabled 1606 * 1607 * "response" is NULL 1608 * 1609 * Valid errors: 1610 * SUCCESS 1611 * RADIO_NOT_AVAILABLE 1612 * GENERIC_FAILURE 1613 * 1614 * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION. 1615 */ 1616#define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62 1617 1618/** 1619 * RIL_REQUEST_WRITE_SMS_TO_SIM 1620 * 1621 * Stores a SMS message to SIM memory. 1622 * 1623 * "data" is RIL_SMS_WriteArgs * 1624 * 1625 * "response" is int * 1626 * ((const int *)response)[0] is the record index where the message is stored. 1627 * 1628 * Valid errors: 1629 * SUCCESS 1630 * GENERIC_FAILURE 1631 * 1632 */ 1633#define RIL_REQUEST_WRITE_SMS_TO_SIM 63 1634 1635/** 1636 * RIL_REQUEST_DELETE_SMS_ON_SIM 1637 * 1638 * Deletes a SMS message from SIM memory. 1639 * 1640 * "data" is int * 1641 * ((int *)data)[0] is the record index of the message to delete. 1642 * 1643 * "response" is NULL 1644 * 1645 * Valid errors: 1646 * SUCCESS 1647 * GENERIC_FAILURE 1648 * 1649 */ 1650#define RIL_REQUEST_DELETE_SMS_ON_SIM 64 1651 1652/** 1653 * RIL_REQUEST_SET_BAND_MODE 1654 * 1655 * Assign a specified band for RF configuration. 1656 * 1657 * "data" is int * 1658 * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically) 1659 * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000) 1660 * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900) 1661 * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000) 1662 * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000) 1663 * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850) 1664 * 1665 * "response" is NULL 1666 * 1667 * Valid errors: 1668 * SUCCESS 1669 * RADIO_NOT_AVAILABLE 1670 * GENERIC_FAILURE 1671 */ 1672#define RIL_REQUEST_SET_BAND_MODE 65 1673 1674/** 1675 * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 1676 * 1677 * Query the list of band mode supported by RF. 1678 * 1679 * "data" is NULL 1680 * 1681 * "response" is int * 1682 * "response" points to an array of int's, the int[0] is the size of array, reset is one for 1683 * each available band mode. 1684 * 1685 * 0 for "unspecified" (selected by baseband automatically) 1686 * 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000) 1687 * 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900) 1688 * 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000) 1689 * 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000) 1690 * 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850) 1691 * 1692 * Valid errors: 1693 * SUCCESS 1694 * RADIO_NOT_AVAILABLE 1695 * GENERIC_FAILURE 1696 * 1697 * See also: RIL_REQUEST_SET_BAND_MODE 1698 */ 1699#define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66 1700 1701/** 1702 * RIL_REQUEST_STK_GET_PROFILE 1703 * 1704 * Requests the profile of SIM tool kit. 1705 * The profile indicates the SAT/USAT features supported by ME. 1706 * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111 1707 * 1708 * "data" is NULL 1709 * 1710 * "response" is a const char * containing SAT/USAT profile 1711 * in hexadecimal format string starting with first byte of terminal profile 1712 * 1713 * Valid errors: 1714 * RIL_E_SUCCESS 1715 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 1716 * RIL_E_GENERIC_FAILURE 1717 */ 1718#define RIL_REQUEST_STK_GET_PROFILE 67 1719 1720/** 1721 * RIL_REQUEST_STK_SET_PROFILE 1722 * 1723 * Download the STK terminal profile as part of SIM initialization 1724 * procedure 1725 * 1726 * "data" is a const char * containing SAT/USAT profile 1727 * in hexadecimal format string starting with first byte of terminal profile 1728 * 1729 * "response" is NULL 1730 * 1731 * Valid errors: 1732 * RIL_E_SUCCESS 1733 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 1734 * RIL_E_GENERIC_FAILURE 1735 */ 1736#define RIL_REQUEST_STK_SET_PROFILE 68 1737 1738/** 1739 * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 1740 * 1741 * Requests to send a SAT/USAT envelope command to SIM. 1742 * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111 1743 * 1744 * "data" is a const char * containing SAT/USAT command 1745 * in hexadecimal format string starting with command tag 1746 * 1747 * "response" is a const char * containing SAT/USAT response 1748 * in hexadecimal format string starting with first byte of response 1749 * (May be NULL) 1750 * 1751 * Valid errors: 1752 * RIL_E_SUCCESS 1753 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 1754 * RIL_E_GENERIC_FAILURE 1755 */ 1756#define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69 1757 1758/** 1759 * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 1760 * 1761 * Requests to send a terminal response to SIM for a received 1762 * proactive command 1763 * 1764 * "data" is a const char * containing SAT/USAT response 1765 * in hexadecimal format string starting with first byte of response data 1766 * 1767 * "response" is NULL 1768 * 1769 * Valid errors: 1770 * RIL_E_SUCCESS 1771 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 1772 * RIL_E_GENERIC_FAILURE 1773 */ 1774#define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70 1775 1776/** 1777 * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 1778 * 1779 * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has 1780 * been initialized by ME already. (We could see the call has been in the 'call 1781 * list') So, STK application needs to accept/reject the call according as user 1782 * operations. 1783 * 1784 * "data" is int * 1785 * ((int *)data)[0] is > 0 for "accept" the call setup 1786 * ((int *)data)[0] is == 0 for "reject" the call setup 1787 * 1788 * "response" is NULL 1789 * 1790 * Valid errors: 1791 * RIL_E_SUCCESS 1792 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 1793 * RIL_E_GENERIC_FAILURE 1794 */ 1795#define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71 1796 1797/** 1798 * RIL_REQUEST_EXPLICIT_CALL_TRANSFER 1799 * 1800 * Connects the two calls and disconnects the subscriber from both calls. 1801 * 1802 * "data" is NULL 1803 * "response" is NULL 1804 * 1805 * Valid errors: 1806 * SUCCESS 1807 * RADIO_NOT_AVAILABLE (radio resetting) 1808 * GENERIC_FAILURE 1809 */ 1810#define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72 1811 1812/** 1813 * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 1814 * 1815 * Requests to set the preferred network type for searching and registering 1816 * (CS/PS domain, RAT, and operation mode) 1817 * 1818 * "data" is int * 1819 * ((int *)data)[0] is == 0 for WCDMA preferred (auto mode) 1820 * ((int *)data)[0] is == 1 for GSM only 1821 * ((int *)data)[0] is == 2 for WCDMA only 1822 * 1823 * "response" is NULL 1824 * 1825 * Valid errors: 1826 * RIL_E_SUCCESS 1827 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) 1828 * RIL_E_GENERIC_FAILURE 1829 */ 1830#define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73 1831 1832/** 1833 * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 1834 * 1835 * Query the preferred network type (CS/PS domain, RAT, and operation mode) 1836 * for searching and registering 1837 * 1838 * "data" is NULL 1839 * 1840 * "response" is int * 1841 * ((int *)response)[0] is == 0 for WCDMA preferred (auto mode) 1842 * ((int *)response)[0] is == 1 for GSM only 1843 * ((int *)response)[0] is == 2 for WCDMA only 1844 * 1845 * Valid errors: 1846 * SUCCESS 1847 * RADIO_NOT_AVAILABLE 1848 * GENERIC_FAILURE 1849 * 1850 * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 1851 */ 1852#define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74 1853 1854/** 1855 * RIL_REQUEST_NEIGHBORING_CELL_IDS 1856 * 1857 * Request neighboring cell id in GSM network 1858 * 1859 * "data" is NULL 1860 * "response" must be a " const RIL_NeighboringCell** " 1861 * 1862 * Valid errors: 1863 * SUCCESS 1864 * RADIO_NOT_AVAILABLE 1865 * GENERIC_FAILURE 1866 */ 1867#define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75 1868 1869/** 1870 * RIL_REQUEST_SET_LOCATION_UPDATES 1871 * 1872 * Enables/disables network state change notifications due to changes in 1873 * LAC and/or CID (basically, +CREG=2 vs. +CREG=1). 1874 * 1875 * Note: The RIL implementation should default to "updates enabled" 1876 * when the screen is on and "updates disabled" when the screen is off. 1877 * 1878 * "data" is int * 1879 * ((int *)data)[0] is == 1 for updates enabled (+CREG=2) 1880 * ((int *)data)[0] is == 0 for updates disabled (+CREG=1) 1881 * 1882 * "response" is NULL 1883 * 1884 * Valid errors: 1885 * SUCCESS 1886 * RADIO_NOT_AVAILABLE 1887 * GENERIC_FAILURE 1888 * 1889 * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED 1890 */ 1891#define RIL_REQUEST_SET_LOCATION_UPDATES 76 1892 1893/***********************************************************************/ 1894 1895#define RIL_UNSOL_RESPONSE_BASE 1000 1896 1897/** 1898 * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1899 * 1900 * Indicate when value of RIL_RadioState has changed. 1901 * 1902 * Callee will invoke RIL_RadioStateRequest method on main thread 1903 * 1904 * "data" is NULL 1905 */ 1906 1907#define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000 1908 1909 1910/** 1911 * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1912 * 1913 * Indicate when call state has changed 1914 * 1915 * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread 1916 * 1917 * "data" is NULL 1918 * 1919 * Response should be invoked on, for example, 1920 * "RING", "BUSY", "NO CARRIER", and also call state 1921 * transitions (DIALING->ALERTING ALERTING->ACTIVE) 1922 * 1923 * Redundent or extraneous invocations are tolerated 1924 */ 1925#define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001 1926 1927 1928/** 1929 * RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED 1930 * 1931 * Called when network state, operator name, or GPRS state has changed 1932 * Basically on, +CREG and +CGREG 1933 * 1934 * Callee will invoke the following requests on main thread: 1935 * 1936 * RIL_REQUEST_REGISTRATION_STATE 1937 * RIL_REQUEST_GPRS_REGISTRATION_STATE 1938 * RIL_REQUEST_OPERATOR 1939 * 1940 * "data" is NULL 1941 * 1942 * FIXME should this happen when SIM records are loaded? (eg, for 1943 * EONS) 1944 */ 1945#define RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED 1002 1946 1947/** 1948 * RIL_UNSOL_RESPONSE_NEW_SMS 1949 * 1950 * Called when new SMS is received. 1951 * 1952 * "data" is const char * 1953 * This is a pointer to a string containing the PDU of an SMS-DELIVER 1954 * as an ascii string of hex digits. The PDU starts with the SMSC address 1955 * per TS 27.005 (+CMT:) 1956 * 1957 * Callee will subsequently confirm the receipt of thei SMS with a 1958 * RIL_REQUEST_SMS_ACKNOWLEDGE 1959 * 1960 * No new RIL_UNSOL_RESPONSE_NEW_SMS 1961 * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a 1962 * RIL_REQUEST_SMS_ACKNOWLEDGE has been received 1963 */ 1964 1965#define RIL_UNSOL_RESPONSE_NEW_SMS 1003 1966 1967/** 1968 * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1969 * 1970 * Called when new SMS Status Report is received. 1971 * 1972 * "data" is const char * 1973 * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT 1974 * as an ascii string of hex digits. The PDU starts with the SMSC address 1975 * per TS 27.005 (+CDS:). 1976 * 1977 * Callee will subsequently confirm the receipt of the SMS with a 1978 * RIL_REQUEST_SMS_ACKNOWLEDGE 1979 * 1980 * No new RIL_UNSOL_RESPONSE_NEW_SMS 1981 * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a 1982 * RIL_REQUEST_SMS_ACKNOWLEDGE has been received 1983 */ 1984 1985#define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004 1986 1987/** 1988 * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1989 * 1990 * Called when new SMS has been stored on SIM card 1991 * 1992 * "data" is const int * 1993 * ((const int *)data)[0] contains the slot index on the SIM that contains 1994 * the new message 1995 */ 1996 1997#define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005 1998 1999/** 2000 * RIL_UNSOL_ON_USSD 2001 * 2002 * Called when a new USSD message is received. 2003 * 2004 * "data" is const char ** 2005 * ((const char **)data)[0] points to a type code, which is 2006 * one of these string values: 2007 * "0" USSD-Notify -- text in ((const char **)data)[1] 2008 * "1" USSD-Request -- text in ((const char **)data)[1] 2009 * "2" Session terminated by network 2010 * "3" other local client (eg, SIM Toolkit) has responded 2011 * "4" Operation not supported 2012 * "5" Network timeout 2013 * 2014 * The USSD session is assumed to persist if the type code is "1", otherwise 2015 * the current session (if any) is assumed to have terminated. 2016 * 2017 * ((const char **)data)[1] points to a message string if applicable, which 2018 * should always be in UTF-8. 2019 */ 2020#define RIL_UNSOL_ON_USSD 1006 2021/* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006 */ 2022 2023/** 2024 * RIL_UNSOL_ON_USSD_REQUEST 2025 * 2026 * Obsolete. Send via RIL_UNSOL_ON_USSD 2027 */ 2028#define RIL_UNSOL_ON_USSD_REQUEST 1007 2029 2030 2031/** 2032 * RIL_UNSOL_NITZ_TIME_RECEIVED 2033 * 2034 * Called when radio has received a NITZ time message 2035 * 2036 * "data" is const char * pointing to NITZ time string 2037 * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt" 2038 */ 2039#define RIL_UNSOL_NITZ_TIME_RECEIVED 1008 2040 2041/** 2042 * RIL_UNSOL_SIGNAL_STRENGTH 2043 * 2044 * Radio may report signal strength rather han have it polled. 2045 * 2046 * "data" is an "int *" 2047 * ((int *)response)[0] is received signal strength (0-31, 99) 2048 * ((int *)response)[1] is bit error rate (0-7, 99) 2049 * as defined in TS 27.007 8.5 2050 * Other values (eg -1) are not legal 2051 */ 2052#define RIL_UNSOL_SIGNAL_STRENGTH 1009 2053 2054 2055/** 2056 * RIL_UNSOL_PDP_CONTEXT_LIST_CHANGED 2057 * 2058 * Indicate a PDP context state has changed, or a new context 2059 * has been activated or deactivated 2060 * 2061 * "data" is an array of RIL_PDP_Context_Response identical to that 2062 * returned by RIL_REQUEST_PDP_CONTEXT_LIST 2063 * 2064 * See also: RIL_REQUEST_PDP_CONTEXT_LIST 2065 */ 2066 2067#define RIL_UNSOL_PDP_CONTEXT_LIST_CHANGED 1010 2068 2069/** 2070 * RIL_UNSOL_SUPP_SVC_NOTIFICATION 2071 * 2072 * Reports supplementary service related notification from the network. 2073 * 2074 * "data" is a const RIL_SuppSvcNotification * 2075 * 2076 */ 2077 2078#define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011 2079 2080/** 2081 * RIL_UNSOL_STK_SESSION_END 2082 * 2083 * Indicate when STK session is terminated by SIM. 2084 * 2085 * "data" is NULL 2086 */ 2087#define RIL_UNSOL_STK_SESSION_END 1012 2088 2089/** 2090 * RIL_UNSOL_STK_PROACTIVE_COMMAND 2091 * 2092 * Indicate when SIM issue a STK proactive command to applications 2093 * 2094 * "data" is a const char * containing SAT/USAT proactive command 2095 * in hexadecimal format string starting with command tag 2096 * 2097 */ 2098#define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013 2099 2100/** 2101 * RIL_UNSOL_STK_EVENT_NOTIFY 2102 * 2103 * Indicate when SIM notifies applcations some event happens. 2104 * Generally, application does not need to have any feedback to 2105 * SIM but shall be able to indicate appropriate messages to users. 2106 * 2107 * "data" is a const char * containing SAT/USAT commands or responses 2108 * sent by ME to SIM or commands handled by ME, in hexadecimal format string 2109 * starting with first byte of response data or command tag 2110 * 2111 */ 2112#define RIL_UNSOL_STK_EVENT_NOTIFY 1014 2113 2114/** 2115 * RIL_UNSOL_STK_CALL_SETUP 2116 * 2117 * Indicate when SIM wants application to setup a voice call. 2118 * 2119 * "data" is const int * 2120 * ((const int *)data)[0] contains timeout value (in milliseconds) 2121 */ 2122#define RIL_UNSOL_STK_CALL_SETUP 1015 2123 2124/** 2125 * RIL_UNSOL_SIM_SMS_STORAGE_FULL 2126 * 2127 * Indicates that SMS storage on the SIM is full. Sent when the network 2128 * attempts to deliver a new SMS message. Messages cannot be saved on the 2129 * SIM until space is freed. In particular, incoming Class 2 messages 2130 * cannot be stored. 2131 * 2132 * "data" is null 2133 * 2134 */ 2135#define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016 2136 2137/** 2138 * RIL_UNSOL_SIM_REFRESH 2139 * 2140 * Indicates that file(s) on the SIM have been updated, or the SIM 2141 * has been reinitialized. 2142 * 2143 * "data" is an int * 2144 * ((int *)data)[0] is a RIL_SimRefreshResult. 2145 * ((int *)data)[1] is the EFID of the updated file if the result is 2146 * SIM_FILE_UPDATE or NULL for any other result. 2147 * 2148 * Note: If the radio state changes as a result of the SIM refresh (eg, 2149 * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 2150 * should be sent. 2151 */ 2152#define RIL_UNSOL_SIM_REFRESH 1017 2153 2154/** 2155 * RIL_UNSOL_CALL_RING 2156 * 2157 * Ring indication for an incoming call (eg, RING or CRING event). 2158 * 2159 * "data" is null 2160 */ 2161#define RIL_UNSOL_CALL_RING 1018 2162 2163 2164/* 2165 * Import four CDMA notifications 1019 - 1022. Need fix when do real CDMA merge. 2166 */ 2167 2168/** 2169 * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 2170 * 2171 * Indicates that SIM state changes. 2172 * 2173 * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread 2174 * "data" is null 2175 */ 2176#define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019 2177 2178/** 2179 * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 2180 * 2181 * Called when new CDMA SMS is received 2182 * 2183 * "data" is const RIL_CDMA_SMS_Message * 2184 * 2185 * Callee will subsequently confirm the receipt of the SMS with 2186 * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 2187 * 2188 * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until 2189 * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received 2190 */ 2191#define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020 2192 2193/** 2194 * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 2195 * 2196 * Called when new Broadcast SMS is received 2197 * 2198 * "data" is const char * of 88 bytes which indicates each page 2199 * of a CBS Message sent to the MS by the BTS as coded in 3GPP 2200 * 23.041 Section 9.4.1.1 2201 */ 2202#define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021 2203 2204/** 2205 * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 2206 * 2207 * Indicates that SMS storage on the RUIM is full. Messages 2208 * cannot be saved on the RUIM until space is freed. 2209 * 2210 * "data" is null 2211 */ 2212#define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022 2213 2214/** 2215 * RIL_UNSOL_RESTRICTED_STATE_CHANGED 2216 * 2217 * Indicates a restricted state change (eg, for Domain Specific Access Control). 2218 * 2219 * Radio need send this msg after radio off/on cycle no matter it is changed or not. 2220 * 2221 * "data" is an int * 2222 * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values. 2223 */ 2224#define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023 2225 2226 2227 2228/***********************************************************************/ 2229 2230 2231/** 2232 * RIL_Request Function pointer 2233 * 2234 * @param request is one of RIL_REQUEST_* 2235 * @param data is pointer to data defined for that RIL_REQUEST_* 2236 * data is owned by caller, and should not be modified or freed by callee 2237 * @param t should be used in subsequent call to RIL_onResponse 2238 * @param datalen the length of data 2239 * 2240 */ 2241typedef void (*RIL_RequestFunc) (int request, void *data, 2242 size_t datalen, RIL_Token t); 2243 2244/** 2245 * This function should return the current radio state synchronously 2246 */ 2247typedef RIL_RadioState (*RIL_RadioStateRequest)(); 2248 2249/** 2250 * This function returns "1" if the specified RIL_REQUEST code is 2251 * supported and 0 if it is not 2252 * 2253 * @param requestCode is one of RIL_REQUEST codes 2254 */ 2255 2256typedef int (*RIL_Supports)(int requestCode); 2257 2258/** 2259 * This function is called from a separate thread--not the 2260 * thread that calls RIL_RequestFunc--and indicates that a pending 2261 * request should be cancelled. 2262 * 2263 * On cancel, the callee should do its best to abandon the request and 2264 * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point. 2265 * 2266 * Subsequent calls to RIL_onRequestComplete for this request with 2267 * other results will be tolerated but ignored. (That is, it is valid 2268 * to ignore the cancellation request) 2269 * 2270 * RIL_Cancel calls should return immediately, and not wait for cancellation 2271 * 2272 * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007 2273 * interface 2274 * 2275 * @param t token wants to be canceled 2276 */ 2277 2278typedef void (*RIL_Cancel)(RIL_Token t); 2279 2280typedef void (*RIL_TimedCallback) (void *param); 2281 2282/** 2283 * Return a version string for your RIL implementation 2284 */ 2285typedef const char * (*RIL_GetVersion) (void); 2286 2287typedef struct { 2288 int version; /* set to RIL_VERSION */ 2289 RIL_RequestFunc onRequest; 2290 RIL_RadioStateRequest onStateRequest; 2291 RIL_Supports supports; 2292 RIL_Cancel onCancel; 2293 RIL_GetVersion getVersion; 2294} RIL_RadioFunctions; 2295 2296#ifdef RIL_SHLIB 2297struct RIL_Env { 2298 /** 2299 * "t" is parameter passed in on previous call to RIL_Notification 2300 * routine. 2301 * 2302 * If "e" != SUCCESS, then response can be null/is ignored 2303 * 2304 * "response" is owned by caller, and should not be modified or 2305 * freed by callee 2306 * 2307 * RIL_onRequestComplete will return as soon as possible 2308 */ 2309 void (*OnRequestComplete)(RIL_Token t, RIL_Errno e, 2310 void *response, size_t responselen); 2311 2312 /** 2313 * "unsolResponse" is one of RIL_UNSOL_RESPONSE_* 2314 * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_* 2315 * 2316 * "data" is owned by caller, and should not be modified or freed by callee 2317 */ 2318 2319 void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, 2320 size_t datalen); 2321 2322 /** 2323 * Call user-specifed "callback" function on on the same thread that 2324 * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies 2325 * a relative time value at which the callback is invoked. If relativeTime is 2326 * NULL or points to a 0-filled structure, the callback will be invoked as 2327 * soon as possible 2328 */ 2329 2330 void (*RequestTimedCallback) (RIL_TimedCallback callback, 2331 void *param, const struct timeval *relativeTime); 2332}; 2333 2334 2335/** 2336 * RIL implementations must defined RIL_Init 2337 * argc and argv will be command line arguments intended for the RIL implementation 2338 * Return NULL on error 2339 * 2340 * @param env is environment point defined as RIL_Env 2341 * @param argc number of arguments 2342 * @param argv list fo arguments 2343 * 2344 */ 2345const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv); 2346 2347#else /* RIL_SHLIB */ 2348 2349/** 2350 * Call this once at startup to register notification routine 2351 * 2352 * @param callbacks user-specifed callback function 2353 */ 2354void RIL_register (const RIL_RadioFunctions *callbacks); 2355 2356 2357/** 2358 * 2359 * RIL_onRequestComplete will return as soon as possible 2360 * 2361 * @param t is parameter passed in on previous call to RIL_Notification 2362 * routine. 2363 * @param e error code 2364 * if "e" != SUCCESS, then response can be null/is ignored 2365 * @param response is owned by caller, and should not be modified or 2366 * freed by callee 2367 * @param responselen the length of response in byte 2368 */ 2369void RIL_onRequestComplete(RIL_Token t, RIL_Errno e, 2370 void *response, size_t responselen); 2371 2372/** 2373 * @param unsolResponse is one of RIL_UNSOL_RESPONSE_* 2374 * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_* 2375 * "data" is owned by caller, and should not be modified or freed by callee 2376 * @param datalen the length of data in byte 2377 */ 2378 2379void RIL_onUnsolicitedResponse(int unsolResponse, const void *data, 2380 size_t datalen); 2381 2382 2383/** 2384 * Call user-specifed "callback" function on on the same thread that 2385 * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies 2386 * a relative time value at which the callback is invoked. If relativeTime is 2387 * NULL or points to a 0-filled structure, the callback will be invoked as 2388 * soon as possible 2389 * 2390 * @param callback user-specifed callback function 2391 * @param param parameter list 2392 * @param relativeTime a relative time value at which the callback is invoked 2393 */ 2394 2395void RIL_requestTimedCallback (RIL_TimedCallback callback, 2396 void *param, const struct timeval *relativeTime); 2397 2398 2399#endif /* RIL_SHLIB */ 2400 2401#ifdef __cplusplus 2402} 2403#endif 2404 2405#endif /*ANDROID_RIL_H*/ 2406 2407