2 * Copyright (C) 2006 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * - SMS retransmit (specifying TP-Message-ID)
26 * Supp Service Notification (+CSSN)
27 * GPRS PDP context deactivate notification
33 #define ANDROID_RIL_H 1
36 #ifndef FEATURE_UNIT_TEST
38 #endif /* !FEATURE_UNIT_TEST */
46 typedef void * RIL_Token;
50 RIL_E_RADIO_NOT_AVAILABLE = 1, /* If radio did not start or is resetting */
51 RIL_E_GENERIC_FAILURE = 2,
52 RIL_E_PASSWORD_INCORRECT = 3, /* for PIN/PIN2 methods only! */
53 RIL_E_SIM_PIN2 = 4, /* Operation requires SIM PIN2 to be entered */
54 RIL_E_SIM_PUK2 = 5, /* Operation requires SIM PIN2 to be entered */
55 RIL_E_REQUEST_NOT_SUPPORTED = 6,
57 RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
58 call on a Class C GPRS device */
59 RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, /* data ops are not allowed before device
60 registers in network */
61 RIL_E_SMS_SEND_FAIL_RETRY = 10, /* fail to send sms and need retry */
62 RIL_E_SIM_ABSENT = 11, /* fail to set the location where CDMA subscription
63 shall be retrieved because of SIM or RUIM
65 #ifdef FEATURE_MULTIMODE_ANDROID
66 RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12, /* fail to find CDMA subscription from specified
68 RIL_E_MODE_NOT_SUPPORTED = 13 /* HW does not support preferred network type */
75 RIL_CALL_DIALING = 2, /* MO call only */
76 RIL_CALL_ALERTING = 3, /* MO call only */
77 RIL_CALL_INCOMING = 4, /* MT call only */
78 RIL_CALL_WAITING = 5 /* MT call only */
82 RADIO_STATE_OFF = 0, /* Radio explictly powered off (eg CFUN=0) */
83 RADIO_STATE_UNAVAILABLE = 1, /* Radio unavailable (eg, resetting or not booted) */
84 RADIO_STATE_SIM_NOT_READY = 2, /* Radio is on, but the SIM interface is not ready */
85 RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3, /* SIM PIN locked, PUK required, network
86 personalization locked, or SIM absent */
87 RADIO_STATE_SIM_READY = 4, /* Radio is on and SIM interface is available */
88 RADIO_STATE_RUIM_NOT_READY = 5, /* Radio is on, but the RUIM interface is not ready */
89 RADIO_STATE_RUIM_READY = 6, /* Radio is on and the RUIM interface is available */
90 RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network
91 personalization locked, or RUIM absent */
92 RADIO_STATE_NV_NOT_READY = 8, /* Radio is on, but the NV interface is not available */
93 RADIO_STATE_NV_READY = 9 /* Radio is on and the NV interface is available */
98 int index; /* Connection Index for use with, eg, AT+CHLD */
99 int toa; /* type of address, eg 145 = intl */
100 char isMpty; /* nonzero if is mpty call */
101 char isMT; /* nonzero if call is mobile terminated */
102 char als; /* ALS line indicator if available
104 char isVoice; /* nonzero if this is is a voice call
105 "p" if the CDMA voice privacy mode is active */
107 char * number; /* phone number */
108 char numberPresentation; /* 0 = Allowed,
110 2 = Not Specified/Unknown,
115 int cid; /* Context ID */
116 int active; /* nonzero if context is active */
117 char * type; /* X.25, IP, IPV6, etc. */
120 } RIL_Data_Call_Response;
123 int messageRef; /*TP-Message-Reference*/
124 char *ackPDU; /* or NULL if n/a */
127 /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
129 int status; /* Status of message. See TS 27.005 3.1, "<stat>": */
130 /* 0 = "REC UNREAD" */
132 /* 2 = "STO UNSENT" */
134 char * pdu; /* PDU of message to write, as a hex string. */
135 char * smsc; /* SMSC address in GSM BCD format prefixed by a length byte
136 (as expected by TS 27.005) or NULL for default SMSC */
139 /** Used by RIL_REQUEST_DIAL */
143 /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
144 * clir == 0 on "use subscription default value"
145 * clir == 1 on "CLIR invocation" (restrict CLI presentation)
146 * clir == 2 on "CLIR suppression" (allow CLI presentation)
152 int command; /* one of the commands listed for TS 27.007 +CRSM*/
153 int fileid; /* EF id */
154 char *path; /* "pathid" from TS 27.007 +CRSM command.
155 Path is in hex asciii format eg "7f205f70"
160 char *data; /* May be NULL*/
161 char *pin2; /* May be NULL*/
167 char *simResponse; /* In hex string format ([a-fA-F0-9]*). */
168 } RIL_SIM_IO_Response;
170 /* See also com.android.internal.telephony.gsm.CallForwardInfo */
174 * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
175 * status 1 = active, 0 = not active
177 * For RIL_REQUEST_SET_CALL_FORWARD:
186 int reason; /* from TS 27.007 7.11 "reason" */
187 int serviceClass; /* From 27.007 +CCFC/+CLCK "class"
188 See table for Android mapping from
190 0 means user doesn't input class */
191 int toa; /* "type" from TS 27.007 7.11 */
192 char * number; /* "number" from TS 27.007 7.11. May be NULL */
193 int timeSeconds; /* for CF no reply only */
194 }RIL_CallForwardInfo;
197 char * cid; /* Cell Id (as described in TS 27.005) in 16 bits in GSM
198 * Primary Scrambling Code (as described in TS 25.331)
200 * Valid values are hexadecimal 0x0000 - 0xffff.
202 int rssi; /* Received RSSI in 2G,
203 * Level index of CPICH Received Signal Code Power in 3G
205 } RIL_NeighboringCell;
207 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
209 CALL_FAIL_NORMAL = 16,
211 CALL_FAIL_CONGESTION = 34,
212 CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
213 CALL_FAIL_CALL_BARRED = 240,
214 CALL_FAIL_FDN_BLOCKED = 241,
215 CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
216 } RIL_LastCallFailCause;
218 /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
220 PDP_FAIL_BARRED = 8, /* no retry; prompt user */
221 PDP_FAIL_BAD_APN = 27, /* no retry; prompt user */
222 PDP_FAIL_USER_AUTHENTICATION = 29, /* no retry; prompt user */
223 PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 32, /*no retry; prompt user */
224 PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 33, /*no retry; prompt user */
225 PDP_FAIL_ERROR_UNSPECIFIED = 0xffff /* This and all other cases: retry silently */
226 } RIL_LastDataCallActivateFailCause;
228 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
230 int notificationType; /*
231 * 0 = MO intermediate result code
232 * 1 = MT unsolicited result code
234 int code; /* See 27.007 7.17
237 int index; /* CUG index. See 27.007 7.17. */
238 int type; /* "type" from 27.007 7.17 (MT only). */
239 char * number; /* "number" from 27.007 7.17
240 (MT only, may be NULL). */
241 } RIL_SuppSvcNotification;
243 #define RIL_SIM_ABSENT 0
244 #define RIL_SIM_NOT_READY 1
245 /* RIL_SIM_READY means that the radio state is RADIO_STATE_SIM_READY.
247 * than "+CPIN: READY". It also means the radio is ready for SIM I/O
249 #define RIL_SIM_READY 2
250 #define RIL_SIM_PIN 3
251 #define RIL_SIM_PUK 4
252 #define RIL_SIM_NETWORK_PERSONALIZATION 5
254 /* see RIL_REQUEST_GET_SIM_STATUS */
256 #define RIL_CARD_MAX_APPS 8
259 RIL_CARDSTATE_ABSENT = 0,
260 RIL_CARDSTATE_PRESENT = 1,
261 RIL_CARDSTATE_ERROR = 2
265 RIL_PERSOSUBSTATE_UNKNOWN = 0, /* initial state */
266 RIL_PERSOSUBSTATE_IN_PROGRESS = 1, /* in between each lock transition */
267 RIL_PERSOSUBSTATE_READY = 2, /* when either SIM or RUIM Perso is finished
268 since each app can only have 1 active perso
270 RIL_PERSOSUBSTATE_SIM_NETWORK = 3,
271 RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET = 4,
272 RIL_PERSOSUBSTATE_SIM_CORPORATE = 5,
273 RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER = 6,
274 RIL_PERSOSUBSTATE_SIM_SIM = 7,
275 RIL_PERSOSUBSTATE_SIM_NETWORK_PUK = 8, /* The corresponding perso lock is blocked */
276 RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK = 9,
277 RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK = 10,
278 RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK = 11,
279 RIL_PERSOSUBSTATE_SIM_SIM_PUK = 12,
280 RIL_PERSOSUBSTATE_RUIM_NETWORK1 = 13,
281 RIL_PERSOSUBSTATE_RUIM_NETWORK2 = 14,
282 RIL_PERSOSUBSTATE_RUIM_HRPD = 15,
283 RIL_PERSOSUBSTATE_RUIM_CORPORATE = 16,
284 RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER = 17,
285 RIL_PERSOSUBSTATE_RUIM_RUIM = 18,
286 RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK = 19, /* The corresponding perso lock is blocked */
287 RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK = 20,
288 RIL_PERSOSUBSTATE_RUIM_HRPD_PUK = 21,
289 RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK = 22,
290 RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
291 RIL_PERSOSUBSTATE_RUIM_RUIM_PUK = 24
295 RIL_APPSTATE_UNKNOWN = 0,
296 RIL_APPSTATE_DETECTED = 1,
297 RIL_APPSTATE_PIN = 2, /* If PIN1 or UPin is required */
298 RIL_APPSTATE_PUK = 3, /* If PUK1 or Puk for UPin is required */
299 RIL_APPSTATE_SUBSCRIPTION_PERSO = 4, /* perso_substate should be look at
300 when app_state is assigned to this value */
301 RIL_APPSTATE_READY = 5
305 RIL_PINSTATE_UNKNOWN = 0,
306 RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
307 RIL_PINSTATE_ENABLED_VERIFIED = 2,
308 RIL_PINSTATE_DISABLED = 3,
309 RIL_PINSTATE_ENABLED_BLOCKED = 4,
310 RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
314 RIL_APPTYPE_UNKNOWN = 0,
316 RIL_APPTYPE_USIM = 2,
317 RIL_APPTYPE_RUIM = 3,
323 RIL_AppType app_type;
324 RIL_AppState app_state;
325 RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
326 RIL_APPSTATE_SUBSCRIPTION_PERSO */
327 char *aid_ptr; /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
329 char *app_label_ptr; /* null terminated string */
330 int pin1_replaced; /* applicable to USIM and CSIM */
337 RIL_CardState card_state;
338 RIL_PinState universal_pin_state; /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
339 int gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS */
340 int cdma_subscription_app_index; /* value < RIL_CARD_MAX_APPS */
341 int num_applications; /* value <= RIL_CARD_MAX_APPS */
342 RIL_AppStatus applications[RIL_CARD_MAX_APPS];
345 /* The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH */
347 /* A file on SIM has been updated. data[1] contains the EFID. */
349 /* SIM initialized. All files should be re-read. */
351 /* SIM reset. SIM power required, SIM may be locked and all files should be re-read. */
353 } RIL_SimRefreshResult;
355 /* Used by RIL_REQUEST_GET_BROADCAST_CONFIG and RIL_REQUEST_SET_BROADCAST_CONFIG */
360 unsigned char bSelected;
361 } RIL_BroadcastServiceInfo;
365 RIL_BroadcastServiceInfo *entries;
366 } RIL_BroadcastSMSConfig;
369 /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
370 #define RIL_RESTRICTED_STATE_NONE 0x00
371 /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
372 #define RIL_RESTRICTED_STATE_CS_EMERGENCY 0x01
373 /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
374 #define RIL_RESTRICTED_STATE_CS_NORMAL 0x02
375 /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
376 #define RIL_RESTRICTED_STATE_CS_ALL 0x04
377 /* Block packet data access due to restriction. */
378 #define RIL_RESTRICTED_STATE_PS_ALL 0x10
381 * RIL_REQUEST_GET_SIM_STATUS
383 * Requests status of the SIM interface and the SIM card
387 * "response" is const RIL_CardStatus *
390 * If the radio is off or unavailable, return RIL_SIM_NOT_READY
392 * Please note: RIL_SIM_READY means that the radio state
393 * is RADIO_STATE_SIM_READY. This is more than "+CPIN: READY".
394 * It also means the radio is ready for SIM I/O
399 #define RIL_REQUEST_GET_SIM_STATUS 1
402 * RIL_REQUEST_ENTER_SIM_PIN
404 * Supplies SIM PIN. Only called if SIM status is RIL_SIM_PIN
406 * "data" is const char **
407 * ((const char **)data)[0] is PIN value
409 * "response" must be NULL
414 * RADIO_NOT_AVAILABLE (radio resetting)
419 #define RIL_REQUEST_ENTER_SIM_PIN 2
423 * RIL_REQUEST_ENTER_SIM_PUK
425 * Supplies SIM PUK and new PIN.
427 * "data" is const char **
428 * ((const char **)data)[0] is PUK value
429 * ((const char **)data)[1] is new PIN value
431 * "response" must be NULL
436 * RADIO_NOT_AVAILABLE (radio resetting)
442 #define RIL_REQUEST_ENTER_SIM_PUK 3
445 * RIL_REQUEST_ENTER_SIM_PIN2
447 * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
448 * returned as a a failure from a previous operation.
450 * "data" is const char **
451 * ((const char **)data)[0] is PIN2 value
453 * "response" must be NULL
458 * RADIO_NOT_AVAILABLE (radio resetting)
463 #define RIL_REQUEST_ENTER_SIM_PIN2 4
466 * RIL_REQUEST_ENTER_SIM_PUK2
468 * Supplies SIM PUK2 and new PIN2.
470 * "data" is const char **
471 * ((const char **)data)[0] is PUK2 value
472 * ((const char **)data)[1] is new PIN2 value
474 * "response" must be NULL
479 * RADIO_NOT_AVAILABLE (radio resetting)
485 #define RIL_REQUEST_ENTER_SIM_PUK2 5
488 * RIL_REQUEST_CHANGE_SIM_PIN
490 * Supplies old SIM PIN and new PIN.
492 * "data" is const char **
493 * ((const char **)data)[0] is old PIN value
494 * ((const char **)data)[1] is new PIN value
496 * "response" must be NULL
501 * RADIO_NOT_AVAILABLE (radio resetting)
504 * (old PIN is invalid)
508 #define RIL_REQUEST_CHANGE_SIM_PIN 6
512 * RIL_REQUEST_CHANGE_SIM_PIN2
514 * Supplies old SIM PIN2 and new PIN2.
516 * "data" is const char **
517 * ((const char **)data)[0] is old PIN2 value
518 * ((const char **)data)[1] is new PIN2 value
520 * "response" must be NULL
525 * RADIO_NOT_AVAILABLE (radio resetting)
528 * (old PIN2 is invalid)
532 #define RIL_REQUEST_CHANGE_SIM_PIN2 7
535 * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
537 * Requests that network personlization be deactivated
539 * "data" is const char **
540 * ((const char **)(data))[0]] is network depersonlization code
542 * "response" must be NULL
547 * RADIO_NOT_AVAILABLE (radio resetting)
553 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
556 * RIL_REQUEST_GET_CURRENT_CALLS
558 * Requests current call list
562 * "response" must be a "const RIL_Call **"
567 * RADIO_NOT_AVAILABLE (radio resetting)
569 * (request will be made again in a few hundred msec)
572 #define RIL_REQUEST_GET_CURRENT_CALLS 9
578 * Initiate voice call
580 * "data" is const RIL_Dial *
583 * This method is never used for supplementary service codes
587 * RADIO_NOT_AVAILABLE (radio resetting)
590 #define RIL_REQUEST_DIAL 10
593 * RIL_REQUEST_GET_IMSI
597 * Only valid when radio state is "RADIO_STATE_SIM_READY"
600 * "response" is a const char * containing the IMSI
604 * RADIO_NOT_AVAILABLE (radio resetting)
608 #define RIL_REQUEST_GET_IMSI 11
613 * Hang up a specific line (like AT+CHLD=1x)
616 * (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
622 * RADIO_NOT_AVAILABLE (radio resetting)
626 #define RIL_REQUEST_HANGUP 12
629 * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
631 * Hang up waiting or held (like AT+CHLD=0)
638 * RADIO_NOT_AVAILABLE (radio resetting)
642 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
645 * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
647 * Hang up waiting or held (like AT+CHLD=1)
654 * RADIO_NOT_AVAILABLE (radio resetting)
658 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
661 * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
663 * Switch waiting or holding call and active call (like AT+CHLD=2)
665 * State transitions should be is follows:
667 * If call 1 is waiting and call 2 is active, then if this re
670 * Call 1 Call 2 Call 1 Call 2
671 * ACTIVE HOLDING HOLDING ACTIVE
672 * ACTIVE WAITING HOLDING ACTIVE
673 * HOLDING WAITING HOLDING ACTIVE
674 * ACTIVE IDLE HOLDING IDLE
675 * IDLE IDLE IDLE IDLE
682 * RADIO_NOT_AVAILABLE (radio resetting)
686 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
687 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
690 * RIL_REQUEST_CONFERENCE
692 * Conference holding and active (like AT+CHLD=3)
699 * RADIO_NOT_AVAILABLE (radio resetting)
702 #define RIL_REQUEST_CONFERENCE 16
707 * Send UDUB (user determined used busy) to ringing or
708 * waiting call answer)(RIL_BasicRequest r);
715 * RADIO_NOT_AVAILABLE (radio resetting)
718 #define RIL_REQUEST_UDUB 17
721 * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
723 * Requests the failure cause code for the most recently terminated call
726 * "response" is a "int *"
727 * ((int *)response)[0] is an integer cause code defined in TS 24.008
728 * Annex H or close approximation
730 * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
731 * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
733 * If the implementation does not have access to the exact cause codes,
734 * then it should return one of the values listed in RIL_LastCallFailCause,
735 * as the UI layer needs to distinguish these cases for tone generation or
736 * error notification.
740 * RADIO_NOT_AVAILABLE
743 * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
745 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
748 * RIL_REQUEST_SIGNAL_STRENGTH
750 * Requests current signal strength and bit error rate
752 * Must succeed if radio is on.
755 * "response" is an "int *"
756 * ((int *)response)[0] is received signal strength (0-31, 99)
757 * ((int *)response)[1] is bit error rate (0-7, 99)
758 * as defined in TS 27.007 8.5
759 * Other values (eg -1) are not legal
763 * RADIO_NOT_AVAILABLE
766 #define RIL_REQUEST_SIGNAL_STRENGTH 19
768 * RIL_REQUEST_REGISTRATION_STATE
770 * Request current registration state
773 * "response" is a "char **"
774 * ((const char **)response)[0] is registration state 0-6,
775 * 0 - Not registered, MT is not currently searching a new operator to register
776 * 1 - Registered, home network
777 * 2 - Not registered, but MT is currently searching a new operator to register
778 * 3 - Registration denied
780 * 5 - Registered, roaming
781 * 6 - Registered, roaming affiliates
782 * ((const char **)response)[1] is LAC if registered on a GSM/WCDMA system or NULL if not.
783 * Valid LAC are 0x0000 - 0xffff
784 * ((const char **)response)[2] is CID if registered on a * GSM/WCDMA or NULL if not.
785 * Valid CID are 0x00000000 - 0xffffffff
786 * ((const char **)response)[3] indicates the available radio technology 0-7,
787 * 0 - Unknown, 1 - GPRS, 2 - EDGE, 3 - UMTS, 4 - IS95A,
788 * 5 - IS95B, 6 - 1xRTT, 7 - EvDo Rev. 0, 8 - EvDo Rev. A
789 * ((const char **)response)[4] is Base Station ID if registered on a CDMA system or NULL if not.
790 * Base Station ID in hexadecimal format
791 * ((const char **)response)[5] is Base Station latitude if registered on a CDMA system or NULL
792 * if not. Base Station latitude in hexadecimal format
793 * ((const char **)response)[6] is Base Station longitude if registered on a CDMA system or NULL
794 * if not. Base Station longitude in hexadecimal format
795 * ((const char **)response)[7] is concurrent services support indicator if registered on a CDMA
796 * system 0-1, 0 - Concurrent services not supported,
797 * 1 - Concurrent services supported
798 * ((const char **)response)[8] is System ID if registered on a CDMA system or NULL if not.
799 * Valid System ID are 0 - 32767
800 * ((const char **)response)[9] is Network ID if registered on a CDMA system or NULL if not.
801 * Valid System ID are 0 - 65535
803 * Please note that registration state 4 ("unknown") is treated
804 * as "out of service" in the Android telephony system
808 * RADIO_NOT_AVAILABLE
811 #define RIL_REQUEST_REGISTRATION_STATE 20
814 * RIL_REQUEST_GPRS_REGISTRATION_STATE
816 * Request current GPRS registration state
819 * "response" is a "char **"
820 * ((const char **)response)[0] is registration state 0-5 from TS 27.007 7.2
821 * ((const char **)response)[1] is LAC if registered or NULL if not
822 * ((const char **)response)[2] is CID if registered or NULL if not
823 * ((const char **)response)[3] indicates the available radio technology, where:
829 * LAC and CID are in hexadecimal format.
830 * valid LAC are 0x0000 - 0xffff
831 * valid CID are 0x00000000 - 0x0fffffff
833 * Please note that registration state 4 ("unknown") is treated
834 * as "out of service" in the Android telephony system
838 * RADIO_NOT_AVAILABLE
841 #define RIL_REQUEST_GPRS_REGISTRATION_STATE 21
844 * RIL_REQUEST_OPERATOR
846 * Request current operator ONS or EONS
849 * "response" is a "const char **"
850 * ((const char **)response)[0] is long alpha ONS or EONS
851 * or NULL if unregistered
853 * ((const char **)response)[1] is short alpha ONS or EONS
854 * or NULL if unregistered
855 * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
856 * or NULL if unregistered
857 * ((const char **)response)[3] is system type, range from 0 to 3 or NULL if unregistered,
865 * RADIO_NOT_AVAILABLE
868 #define RIL_REQUEST_OPERATOR 22
871 * RIL_REQUEST_RADIO_POWER
873 * Toggle radio on and off (for "airplane" mode)
875 * ((int *)data)[0] is > 0 for "Radio On"
876 * ((int *)data)[0] is == 0 for "Radio Off"
880 * Turn radio on if "on" > 0
881 * Turn radio off if "on" == 0
885 * RADIO_NOT_AVAILABLE
888 #define RIL_REQUEST_RADIO_POWER 23
895 * If the implementation is currently playing a tone requested via
896 * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
897 * should be played instead
900 * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
901 * ((char *)data)[1] is a single character with one of 3 values:
902 * 'S' -- tone should be played for a short time
903 * 'L' -- tone should be played for a long time
906 * FIXME should this block/mute microphone?
907 * How does this interact with local DTMF feedback?
911 * RADIO_NOT_AVAILABLE
914 * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
917 #define RIL_REQUEST_DTMF 24
920 * RIL_REQUEST_SEND_SMS
922 * Send an SMS message
924 * "data" is const char **
925 * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
926 * by a length byte (as expected by TS 27.005) or NULL for default SMSC
927 * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
928 * less the SMSC address
929 * TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
931 * "response" is a const RIL_SMS_Response *
933 * Based on the return error, caller decides to resend if sending sms
934 * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
935 * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
939 * RADIO_NOT_AVAILABLE
940 * SMS_SEND_FAIL_RETRY
943 * FIXME how do we specify TP-Message-Reference if we need to resend?
945 #define RIL_REQUEST_SEND_SMS 25
949 * RIL_REQUEST_SEND_SMS_EXPECT_MORE
951 * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
952 * except that more messages are expected to be sent soon. If possible,
953 * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
955 * "data" is const char **
956 * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
957 * by a length byte (as expected by TS 27.005) or NULL for default SMSC
958 * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
959 * less the SMSC address
960 * TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
962 * "response" is a const RIL_SMS_Response *
964 * Based on the return error, caller decides to resend if sending sms
965 * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
966 * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
970 * RADIO_NOT_AVAILABLE
971 * SMS_SEND_FAIL_RETRY
975 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
979 * RIL_REQUEST_SETUP_DATA_CALL
981 * Setup a packet data connection
983 * "data" is a const char **
984 * ((const char **)data)[0] indicates whether to setup connection on radio technology CDMA
985 * or GSM/UMTS, 0-1. 0 - CDMA, 1-GSM/UMTS
987 * ((const char **)data)[1] Profile Number or NULL to indicate default profile
988 * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will
989 * override the one in the profile. NULL indicates no APN overrride.
990 * ((const char **)data)[3] is the username for APN, or NULL
991 * ((const char **)data)[4] is the password for APN, or NULL
993 * "response" is a char **
994 * ((char **)response)[0] indicating PDP CID, which is generated by RIL. This Connection ID is
995 * used in GSM/UMTS and CDMA
996 * ((char **)response)[1] indicating the network interface name for GSM/UMTS or CDMA
997 * ((char **)response)[2] indicating the IP address for this interface for GSM/UMTS
1000 * FIXME may need way to configure QoS settings
1002 * replaces RIL_REQUEST_SETUP_DEFAULT_PDP
1006 * RADIO_NOT_AVAILABLE
1009 * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL
1011 #define RIL_REQUEST_SETUP_DATA_CALL 27
1016 * RIL_REQUEST_SIM_IO
1018 * Request SIM I/O operation.
1019 * This is similar to the TS 27.007 "restricted SIM" operation
1020 * where it assumes all of the EF selection will be done by the
1023 * "data" is a const RIL_SIM_IO *
1024 * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
1025 * or may specify a PIN2 for operations that require a PIN2 (eg
1026 * updating FDN records)
1028 * "response" is a const RIL_SIM_IO_Response *
1030 * Arguments and responses that are unused for certain
1031 * values of "command" should be ignored or set to NULL
1035 * RADIO_NOT_AVAILABLE
1040 #define RIL_REQUEST_SIM_IO 28
1043 * RIL_REQUEST_SEND_USSD
1045 * Send a USSD message
1047 * If a USSD session already exists, the message should be sent in the
1048 * context of that session. Otherwise, a new session should be created.
1050 * The network reply should be reported via RIL_UNSOL_ON_USSD
1052 * Only one USSD session may exist at a time, and the session is assumed
1054 * a) The android system invokes RIL_REQUEST_CANCEL_USSD
1055 * b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
1056 * of "0" (USSD-Notify/no further action) or "2" (session terminated)
1058 * "data" is a const char * containing the USSD request in UTF-8 format
1059 * "response" is NULL
1063 * RADIO_NOT_AVAILABLE
1066 * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
1069 #define RIL_REQUEST_SEND_USSD 29
1072 * RIL_REQUEST_CANCEL_USSD
1074 * Cancel the current USSD session if one exists
1077 * "response" is NULL
1081 * RADIO_NOT_AVAILABLE
1085 #define RIL_REQUEST_CANCEL_USSD 30
1088 * RIL_REQUEST_GET_CLIR
1090 * Gets current CLIR status
1092 * "response" is int *
1093 * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
1094 * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
1098 * RADIO_NOT_AVAILABLE
1101 #define RIL_REQUEST_GET_CLIR 31
1104 * RIL_REQUEST_SET_CLIR
1107 * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
1109 * "response" is NULL
1113 * RADIO_NOT_AVAILABLE
1116 #define RIL_REQUEST_SET_CLIR 32
1119 * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
1121 * "data" is const RIL_CallForwardInfo *
1123 * "response" is const RIL_CallForwardInfo **
1124 * "response" points to an array of RIL_CallForwardInfo *'s, one for
1125 * each distinct registered phone number.
1127 * For example, if data is forwarded to +18005551212 and voice is forwarded
1128 * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
1130 * If, however, both data and voice are forwarded to +18005551212, then
1131 * a single RIL_CallForwardInfo can be returned with the service class
1132 * set to "data + voice = 3")
1136 * RADIO_NOT_AVAILABLE
1139 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
1143 * RIL_REQUEST_SET_CALL_FORWARD
1145 * Configure call forward rule
1147 * "data" is const RIL_CallForwardInfo *
1148 * "response" is NULL
1152 * RADIO_NOT_AVAILABLE
1155 #define RIL_REQUEST_SET_CALL_FORWARD 34
1159 * RIL_REQUEST_QUERY_CALL_WAITING
1161 * Query current call waiting state
1163 * "data" is const int *
1164 * ((const int *)data)[0] is the TS 27.007 service class to query.
1165 * "response" is a const int *
1166 * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
1168 * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
1169 * must follow, with the TS 27.007 service class bit vector of services
1170 * for which call waiting is enabled.
1172 * For example, if ((const int *)response)[0] is 1 and
1173 * ((const int *)response)[1] is 3, then call waiting is enabled for data
1174 * and voice and disabled for everything else
1178 * RADIO_NOT_AVAILABLE
1181 #define RIL_REQUEST_QUERY_CALL_WAITING 35
1185 * RIL_REQUEST_SET_CALL_WAITING
1187 * Configure current call waiting state
1189 * "data" is const int *
1190 * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
1191 * ((const int *)data)[1] is the TS 27.007 service class bit vector of
1192 * services to modify
1193 * "response" is NULL
1197 * RADIO_NOT_AVAILABLE
1200 #define RIL_REQUEST_SET_CALL_WAITING 36
1203 * RIL_REQUEST_SMS_ACKNOWLEDGE
1205 * Acknowledge successful or failed receipt of SMS previously indicated
1206 * via RIL_UNSOL_RESPONSE_NEW_SMS
1209 * ((int *)data)[0] is "1" on successful receipt
1210 * (basically, AT+CNMA=1 from TS 27.005
1211 * ((int *)data)[0] is "0" on failed receipt
1212 * (basically, AT+CNMA=2 from TS 27.005)
1214 * "response" is NULL
1216 * FIXME would like request that specified RP-ACK/RP-ERROR PDU
1220 * RADIO_NOT_AVAILABLE
1223 #define RIL_REQUEST_SMS_ACKNOWLEDGE 37
1226 * RIL_REQUEST_GET_IMEI - DEPRECATED
1228 * Get the device IMEI, including check digit
1230 * The request is DECRECATED, use RIL_REQUEST_DEVICE_IDENTITY
1231 * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
1234 * "response" is a const char * containing the IMEI
1238 * RADIO_NOT_AVAILABLE (radio resetting)
1242 #define RIL_REQUEST_GET_IMEI 38
1245 * RIL_REQUEST_GET_IMEISV - DEPRECATED
1247 * Get the device IMEISV, which should be two decimal digits
1249 * The request is DECRECATED, use RIL_REQUEST_DEVICE_IDENTITY
1250 * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
1253 * "response" is a const char * containing the IMEISV
1257 * RADIO_NOT_AVAILABLE (radio resetting)
1261 #define RIL_REQUEST_GET_IMEISV 39
1265 * RIL_REQUEST_ANSWER
1267 * Answer incoming call
1269 * Will not be called for WAITING calls.
1270 * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
1274 * "response" is NULL
1278 * RADIO_NOT_AVAILABLE (radio resetting)
1282 #define RIL_REQUEST_ANSWER 40
1285 * RIL_REQUEST_DEACTIVATE_DATA_CALL
1287 * Deactivate packet data connection
1288 * replaces RIL_REQUEST_DEACTIVATE_DEFAULT_PDP
1290 * "data" is const char **
1291 * ((char**)data)[0] indicating CID
1293 * "response" is NULL
1297 * RADIO_NOT_AVAILABLE
1300 * See also: RIL_REQUEST_SETUP_DATA_CALL
1302 #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41
1305 * RIL_REQUEST_QUERY_FACILITY_LOCK
1307 * Query the status of a facility lock state
1309 * "data" is const char **
1310 * ((const char **)data)[0] is the facility string code from TS 27.007 7.4
1311 * (eg "AO" for BAOC, "SC" for SIM lock)
1312 * ((const char **)data)[1] is the password, or "" if not required
1313 * ((const char **)data)[2] is the TS 27.007 service class bit vector of
1316 * "response" is an int *
1317 * ((const int *)response) 0 is the TS 27.007 service class bit vector of
1318 * services for which the specified barring facility
1319 * is active. "0" means "disabled for all"
1324 * RADIO_NOT_AVAILABLE
1328 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
1331 * RIL_REQUEST_SET_FACILITY_LOCK
1333 * Enable/disable one facility lock
1335 * "data" is const char **
1337 * ((const char **)data)[0] = facility string code from TS 27.007 7.4
1338 * (eg "AO" for BAOC)
1339 * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
1340 * ((const char **)data)[2] = password
1341 * ((const char **)data)[3] = string representation of decimal TS 27.007
1342 * service class bit vector. Eg, the string
1343 * "1" means "set this facility for voice services"
1345 * "response" is NULL
1349 * RADIO_NOT_AVAILABLE
1353 #define RIL_REQUEST_SET_FACILITY_LOCK 43
1356 * RIL_REQUEST_CHANGE_BARRING_PASSWORD
1358 * Change call barring facility password
1360 * "data" is const char **
1362 * ((const char **)data)[0] = facility string code from TS 27.007 7.4
1363 * (eg "AO" for BAOC)
1364 * ((const char **)data)[1] = old password
1365 * ((const char **)data)[2] = new password
1367 * "response" is NULL
1371 * RADIO_NOT_AVAILABLE
1375 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
1378 * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
1380 * Query current network selectin mode
1384 * "response" is int *
1385 * ((const int *)response)[0] is
1386 * 0 for automatic selection
1387 * 1 for manual selection
1391 * RADIO_NOT_AVAILABLE
1395 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
1398 * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
1400 * Specify that the network should be selected automatically
1403 * "response" is NULL
1405 * This request must not respond until the new operator is selected
1410 * RADIO_NOT_AVAILABLE
1414 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
1417 * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
1419 * Manually select a specified network.
1421 * The radio baseband/RIL implementation is expected to fall back to
1422 * automatic selection mode if the manually selected network should go
1423 * out of range in the future.
1425 * "data" is const char * specifying MCCMNC of network to select (eg "310170")
1426 * "response" is NULL
1428 * This request must not respond until the new operator is selected
1433 * RADIO_NOT_AVAILABLE
1437 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
1440 * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
1442 * Scans for available networks
1445 * "response" is const char ** that should be an array of n*4 strings, where
1446 * n is the number of available networks
1447 * For each available network:
1449 * ((const char **)response)[n+0] is long alpha ONS or EONS
1450 * ((const char **)response)[n+1] is short alpha ONS or EONS
1451 * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
1452 * ((const char **)response)[n+3] is a string value of the status:
1458 * This request must not respond until the new operator is selected
1463 * RADIO_NOT_AVAILABLE
1467 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
1470 * RIL_REQUEST_DTMF_START
1472 * Start playing a DTMF tone. Continue playing DTMF tone until
1473 * RIL_REQUEST_DTMF_STOP is received
1475 * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
1476 * it should cancel the previous tone and play the new one.
1478 * "data" is a char *
1479 * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
1480 * "response" is NULL
1484 * RADIO_NOT_AVAILABLE
1487 * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
1489 #define RIL_REQUEST_DTMF_START 49
1492 * RIL_REQUEST_DTMF_STOP
1494 * Stop playing a currently playing DTMF tone.
1497 * "response" is NULL
1501 * RADIO_NOT_AVAILABLE
1504 * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
1506 #define RIL_REQUEST_DTMF_STOP 50
1509 * RIL_REQUEST_BASEBAND_VERSION
1511 * Return string value indicating baseband version, eg
1512 * response from AT+CGMR
1515 * "response" is const char * containing version string for log reporting
1519 * RADIO_NOT_AVAILABLE
1523 #define RIL_REQUEST_BASEBAND_VERSION 51
1526 * RIL_REQUEST_SEPARATE_CONNECTION
1528 * Separate a party from a multiparty call placing the multiparty call
1529 * (less the specified party) on hold and leaving the specified party
1530 * as the only other member of the current (active) call
1534 * See TS 22.084 1.3.8.2 (iii)
1535 * TS 22.030 6.5.5 "Entering "2X followed by send"
1536 * TS 27.007 "AT+CHLD=2x"
1538 * "data" is an int *
1539 * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL
1541 * "response" is NULL
1545 * RADIO_NOT_AVAILABLE (radio resetting)
1548 #define RIL_REQUEST_SEPARATE_CONNECTION 52
1552 * RIL_REQUEST_SET_MUTE
1554 * Turn on or off uplink (microphone) mute.
1556 * Will only be sent while voice call is active.
1557 * Will always be reset to "disable mute" when a new voice call is initiated
1559 * "data" is an int *
1560 * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
1562 * "response" is NULL
1566 * RADIO_NOT_AVAILABLE (radio resetting)
1570 #define RIL_REQUEST_SET_MUTE 53
1573 * RIL_REQUEST_GET_MUTE
1575 * Queries the current state of the uplink mute setting
1578 * "response" is an int *
1579 * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
1583 * RADIO_NOT_AVAILABLE (radio resetting)
1587 #define RIL_REQUEST_GET_MUTE 54
1590 * RIL_REQUEST_QUERY_CLIP
1592 * Queries the status of the CLIP supplementary service
1594 * (for MMI code "*#30#")
1597 * "response" is an int *
1598 * (int *)response)[0] is 1 for "CLIP provisioned"
1599 * and 0 for "CLIP not provisioned"
1600 * and 2 for "unknown, e.g. no network etc"
1604 * RADIO_NOT_AVAILABLE (radio resetting)
1608 #define RIL_REQUEST_QUERY_CLIP 55
1611 * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
1613 * Requests the failure cause code for the most recently failed PDP
1614 * context or CDMA data connection active
1615 * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE
1619 * "response" is a "int *"
1620 * ((int *)response)[0] is an integer cause code defined in TS 24.008
1621 * section 6.1.3.1.3 or close approximation
1623 * If the implementation does not have access to the exact cause codes,
1624 * then it should return one of the values listed in
1625 * RIL_LastDataCallActivateFailCause, as the UI layer needs to distinguish these
1626 * cases for error notification
1627 * and potential retries.
1631 * RADIO_NOT_AVAILABLE
1634 * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
1638 #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56
1641 * RIL_REQUEST_DATA_CALL_LIST
1643 * Queries the status of PDP contexts, returning for each
1644 * its CID, whether or not it is active, and its PDP type,
1645 * APN, and PDP adddress.
1646 * replaces RIL_REQUEST_PDP_CONTEXT_LIST
1649 * "response" is an array of RIL_Data_Call_Response
1653 * RADIO_NOT_AVAILABLE (radio resetting)
1657 #define RIL_REQUEST_DATA_CALL_LIST 57
1660 * RIL_REQUEST_RESET_RADIO
1662 * Request a radio reset. The RIL implementation may postpone
1663 * the reset until after this request is responded to if the baseband
1664 * is presently busy.
1667 * "response" is NULL
1669 * The reset action could be delayed for a while
1670 * in case baseband modem is just busy.
1674 * RADIO_NOT_AVAILABLE (radio resetting)
1678 #define RIL_REQUEST_RESET_RADIO 58
1681 * RIL_REQUEST_OEM_HOOK_RAW
1683 * This request reserved for OEM-specific uses. It passes raw byte arrays
1686 * It can be invoked on the Java side from
1687 * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
1689 * "data" is a char * of bytes copied from the byte[] data argument in java
1690 * "response" is a char * of bytes that will returned via the
1691 * caller's "response" Message here:
1692 * (byte[])(((AsyncResult)response.obj).result)
1694 * An error response here will result in
1695 * (((AsyncResult)response.obj).result) == null and
1696 * (((AsyncResult)response.obj).exception) being an instance of
1697 * com.android.internal.telephony.gsm.CommandException
1703 #define RIL_REQUEST_OEM_HOOK_RAW 59
1706 * RIL_REQUEST_OEM_HOOK_STRINGS
1708 * This request reserved for OEM-specific uses. It passes strings
1711 * It can be invoked on the Java side from
1712 * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
1714 * "data" is a const char **, representing an array of null-terminated UTF-8
1715 * strings copied from the "String[] strings" argument to
1716 * invokeOemRilRequestStrings()
1718 * "response" is a const char **, representing an array of null-terminated UTF-8
1719 * stings that will be returned via the caller's response message here:
1721 * (String[])(((AsyncResult)response.obj).result)
1723 * An error response here will result in
1724 * (((AsyncResult)response.obj).result) == null and
1725 * (((AsyncResult)response.obj).exception) being an instance of
1726 * com.android.internal.telephony.gsm.CommandException
1732 #define RIL_REQUEST_OEM_HOOK_STRINGS 60
1735 * RIL_REQUEST_SCREEN_STATE
1737 * Indicates the current state of the screen. When the screen is off, the
1738 * RIL should notify the baseband to suppress certain notifications (eg,
1739 * signal strength and changes in LAC or CID) in an effort to conserve power.
1740 * These notifications should resume when the screen is on.
1743 * ((int *)data)[0] is == 1 for "Screen On"
1744 * ((int *)data)[0] is == 0 for "Screen Off"
1746 * "response" is NULL
1752 #define RIL_REQUEST_SCREEN_STATE 61
1756 * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
1758 * Enables/disables supplementary service related notifications
1761 * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
1764 * ((int *)data)[0] is == 1 for notifications enabled
1765 * ((int *)data)[0] is == 0 for notifications disabled
1767 * "response" is NULL
1771 * RADIO_NOT_AVAILABLE
1774 * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
1776 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
1779 * RIL_REQUEST_WRITE_SMS_TO_SIM
1781 * Stores a SMS message to SIM memory.
1783 * "data" is RIL_SMS_WriteArgs *
1785 * "response" is int *
1786 * ((const int *)response)[0] is the record index where the message is stored.
1793 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
1796 * RIL_REQUEST_DELETE_SMS_ON_SIM
1798 * Deletes a SMS message from SIM memory.
1801 * ((int *)data)[0] is the record index of the message to delete.
1803 * "response" is NULL
1810 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
1813 * RIL_REQUEST_SET_BAND_MODE
1815 * Assign a specified band for RF configuration.
1818 * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
1819 * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
1820 * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
1821 * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
1822 * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
1823 * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
1824 * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
1825 * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
1826 * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
1827 * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
1828 * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
1829 * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
1830 * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
1831 * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
1832 * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
1833 * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
1834 * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
1835 * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
1836 * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
1838 * "response" is NULL
1842 * RADIO_NOT_AVAILABLE
1845 #define RIL_REQUEST_SET_BAND_MODE 65
1848 * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
1850 * Query the list of band mode supported by RF.
1854 * "response" is int *
1855 * "response" points to an array of int's, the int[0] is the size of array, reset is one for
1856 * each available band mode.
1858 * 0 for "unspecified" (selected by baseband automatically)
1859 * 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
1860 * 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
1861 * 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
1862 * 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
1863 * 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
1864 * 6 for "Cellular (800-MHz Band)"
1865 * 7 for "PCS (1900-MHz Band)"
1866 * 8 for "Band Class 3 (JTACS Band)"
1867 * 9 for "Band Class 4 (Korean PCS Band)"
1868 * 10 for "Band Class 5 (450-MHz Band)"
1869 * 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
1870 * 12 for "Band Class 7 (Upper 700-MHz Band)"
1871 * 13 for "Band Class 8 (1800-MHz Band)"
1872 * 14 for "Band Class 9 (900-MHz Band)"
1873 * 15 for "Band Class 10 (Secondary 800-MHz Band)"
1874 * 16 for "Band Class 11 (400-MHz European PAMR Band)"
1875 * 17 for "Band Class 15 (AWS Band)"
1876 * 18 for "Band Class 16 (US 2.5-GHz Band)"
1880 * RADIO_NOT_AVAILABLE
1883 * See also: RIL_REQUEST_SET_BAND_MODE
1885 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
1888 * RIL_REQUEST_STK_GET_PROFILE
1890 * Requests the profile of SIM tool kit.
1891 * The profile indicates the SAT/USAT features supported by ME.
1892 * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
1896 * "response" is a const char * containing SAT/USAT profile
1897 * in hexadecimal format string starting with first byte of terminal profile
1901 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1902 * RIL_E_GENERIC_FAILURE
1904 #define RIL_REQUEST_STK_GET_PROFILE 67
1907 * RIL_REQUEST_STK_SET_PROFILE
1909 * Download the STK terminal profile as part of SIM initialization
1912 * "data" is a const char * containing SAT/USAT profile
1913 * in hexadecimal format string starting with first byte of terminal profile
1915 * "response" is NULL
1919 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1920 * RIL_E_GENERIC_FAILURE
1922 #define RIL_REQUEST_STK_SET_PROFILE 68
1925 * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
1927 * Requests to send a SAT/USAT envelope command to SIM.
1928 * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
1930 * "data" is a const char * containing SAT/USAT command
1931 * in hexadecimal format string starting with command tag
1933 * "response" is a const char * containing SAT/USAT response
1934 * in hexadecimal format string starting with first byte of response
1939 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1940 * RIL_E_GENERIC_FAILURE
1942 #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
1945 * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
1947 * Requests to send a terminal response to SIM for a received
1950 * "data" is a const char * containing SAT/USAT response
1951 * in hexadecimal format string starting with first byte of response data
1953 * "response" is NULL
1957 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1958 * RIL_E_GENERIC_FAILURE
1960 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
1963 * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
1965 * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
1966 * been initialized by ME already. (We could see the call has been in the 'call
1967 * list') So, STK application needs to accept/reject the call according as user
1971 * ((int *)data)[0] is > 0 for "accept" the call setup
1972 * ((int *)data)[0] is == 0 for "reject" the call setup
1974 * "response" is NULL
1978 * RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1979 * RIL_E_GENERIC_FAILURE
1981 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
1984 * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
1986 * Connects the two calls and disconnects the subscriber from both calls.
1989 * "response" is NULL
1993 * RADIO_NOT_AVAILABLE (radio resetting)
1996 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
1999 * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
2001 * Requests to set the preferred network type for searching and registering
2002 * (CS/PS domain, RAT, and operation mode)
2006 * ((int *)data)[0] is == 0 for GSM/WCDMA (WCDMA preferred)
2007 * ((int *)data)[0] is == 1 for GSM only
2008 * ((int *)data)[0] is == 2 for WCDMA only
2009 * ((int *)data)[0] is == 3 for GSM/WCDMA (auto mode)
2010 * ((int *)data)[0] is == 4 for CDMA and EvDo (auto mode, according to PRL)
2011 * ((int *)data)[0] is == 5 for CDMA only
2012 * ((int *)data)[0] is == 6 for EvDo only
2013 * ((int *)data)[0] is == 7 for GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL)
2015 * "response" is NULL
2019 * RADIO_NOT_AVAILABLE (radio resetting)
2021 * MODE_NOT_SUPPORTED
2023 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
2026 * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
2028 * Query the preferred network type (CS/PS domain, RAT, and operation mode)
2029 * for searching and registering
2033 * "response" is int *
2034 * ((int *)response)[0] is == 0 for GSM/WCDMA (WCDMA preferred)
2035 * ((int *)response)[0] is == 1 for GSM only
2036 * ((int *)response)[0] is == 2 for WCDMA only
2037 * ((int *)response)[0] is == 3 for GSM/WCDMA (auto mode, according to PRL)
2038 * ((int *)response)[0] is == 4 for CDMA and EvDo (auto mode, according to PRL)
2039 * ((int *)response)[0] is == 5 for CDMA only
2040 * ((int *)response)[0] is == 6 for EvDo only
2041 * ((int *)response)[0] is == 7 for GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL)
2045 * RADIO_NOT_AVAILABLE
2048 * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
2050 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
2053 * RIL_REQUEST_NEIGHBORING_CELL_IDS
2055 * Request neighboring cell id in GSM network
2058 * "response" must be a " const RIL_NeighboringCell** "
2062 * RADIO_NOT_AVAILABLE
2065 #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
2068 * RIL_REQUEST_SET_LOCATION_UPDATES
2070 * Enables/disables network state change notifications due to changes in
2071 * LAC and/or CID (basically, +CREG=2 vs. +CREG=1).
2073 * Note: The RIL implementation should default to "updates enabled"
2074 * when the screen is on and "updates disabled" when the screen is off.
2077 * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
2078 * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
2080 * "response" is NULL
2084 * RADIO_NOT_AVAILABLE
2087 * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
2089 #define RIL_REQUEST_SET_LOCATION_UPDATES 76
2092 * RIL_REQUEST_CDMA_SET_SUBSCRIPTION
2094 * Request to set the location where the CDMA subscription shall
2098 * ((int *)data)[0] is == 0 from RUIM/SIM (default)
2099 * ((int *)data)[0] is == 1 from NV
2101 * "response" is NULL
2105 * RADIO_NOT_AVAILABLE
2108 * SUBSCRIPTION_NOT_AVAILABLE
2110 #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION 77
2113 * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE
2115 * Request to set the roaming preferences in CDMA
2118 * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL
2119 * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
2120 * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL
2122 * "response" is NULL
2126 * RADIO_NOT_AVAILABLE
2129 #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78
2132 * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE
2134 * Request the actual setting of the roaming preferences in CDMA in the modem
2138 * "response" is int *
2139 * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL
2140 * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
2141 * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL
2143 * "response" is NULL
2147 * RADIO_NOT_AVAILABLE
2150 #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79
2153 * RIL_REQUEST_SET_TTY_MODE
2155 * Request to set the TTY mode
2158 * ((int *)data)[0] is == 0 for TTY off
2159 * ((int *)data)[0] is == 1 for TTY on
2161 * "response" is NULL
2165 * RADIO_NOT_AVAILABLE
2168 #define RIL_REQUEST_SET_TTY_MODE 80
2171 * RIL_REQUEST_QUERY_TTY_MODE
2173 * Request the setting of TTY mode
2177 * "response" is int *
2178 * ((int *)response)[0] is == 0 for TTY off
2179 * ((int *)response)[0] is == 1 for TTY on
2181 * "response" is NULL
2185 * RADIO_NOT_AVAILABLE
2188 #define RIL_REQUEST_QUERY_TTY_MODE 81
2191 * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE
2193 * Request to set the preferred voice privacy mode used in voice
2197 * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
2198 * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
2200 * "response" is NULL
2204 * RADIO_NOT_AVAILABLE
2207 #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82
2210 * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE
2212 * Request the setting of preferred voice privacy mode
2216 * "response" is int *
2217 * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
2218 * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
2220 * "response" is NULL
2224 * RADIO_NOT_AVAILABLE
2227 #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83
2230 * RIL_REQUEST_CDMA_FLASH
2234 * "data" is const char *
2235 * ((const char *)data)[0] is a FLASH string
2237 * "response" is NULL
2241 * RADIO_NOT_AVAILABLE
2245 #define RIL_REQUEST_CDMA_FLASH 84
2248 * RIL_REQUEST_CDMA_BURST_DTMF
2252 * "data" is const char *
2253 * ((const char *)data)[0] is a DTMF string
2255 * "response" is NULL
2259 * RADIO_NOT_AVAILABLE
2263 #define RIL_REQUEST_CDMA_BURST_DTMF 85
2266 * RIL_REQUEST_CDMA_VALIDATE_AKEY
2270 * "data" is const char *
2271 * ((const char *)data)[0] is a AKey string
2273 * "response" is NULL
2277 * RADIO_NOT_AVAILABLE
2281 #define RIL_REQUEST_CDMA_VALIDATE_AKEY 86
2284 * RIL_REQUEST_CDMA_SEND_SMS
2286 * Send a CDMA SMS message
2288 * "data" is const RIL_CDMA_SMS_Message *
2290 * "response" is a const RIL_SMS_Response *
2294 * RADIO_NOT_AVAILABLE
2298 #define RIL_REQUEST_CDMA_SEND_SMS 87
2301 * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
2303 * Acknowledge the success or failure in the receipt of SMS
2304 * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
2306 * "data" is const RIL_CDMA_SMS_Ack *
2308 * "response" is NULL
2312 * RADIO_NOT_AVAILABLE
2316 #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88
2319 * RIL_REQUEST_GET_BROADCAST_CONFIG
2321 * Request the setting of GSM/WCDMA Cell Broadcast SMS config
2325 * "response" is const RIL_BroadcastSMSConfig *
2329 * RADIO_NOT_AVAILABLE
2333 #define RIL_REQUEST_GET_BROADCAST_CONFIG 89
2336 * RIL_REQUEST_SET_BROADCAST_CONFIG
2338 * Set GSM/WCDMA Cell Broadcast SMS config
2340 * "data" is const RIL_BroadcastSMSConfig *
2342 * "response" is NULL
2346 * RADIO_NOT_AVAILABLE
2350 #define RIL_REQUEST_SET_BROADCAST_CONFIG 90
2353 * RIL_REQUEST_BROADCAST_ACTIVATION
2355 * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
2357 * "data" is const int *
2358 * (const int *)data[0] indicates to activate or turn off the
2359 * reception of GSM/WCDMA Cell Broadcast SMS, 0-1,
2360 * 0 - Activate, 1 - Turn off
2362 * "response" is NULL
2366 * RADIO_NOT_AVAILABLE
2370 #define RIL_REQUEST_BROADCAST_ACTIVATION 91
2373 * RIL_REQUEST_CDMA_GET_BROADCAST_CONFIG
2375 * Request the setting of CDMA Broadcast SMS config
2379 * "response" is const RIL_CDMA_BroadcastSMSConfig *
2383 * RADIO_NOT_AVAILABLE
2387 #define RIL_REQUEST_CDMA_GET_BROADCAST_CONFIG 92
2390 * RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG
2392 * Set CDMA Broadcast SMS config
2394 * "data" is const RIL_CDMA_BroadcastSMSConfig *
2396 * "response" is NULL
2400 * RADIO_NOT_AVAILABLE
2404 #define RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG 93
2407 * RIL_REQUEST_CDMA_BROADCAST_ACTIVATION
2409 * Enable or disable the reception of CDMA Broadcast SMS
2411 * "data" is const int *
2412 * (const int *)data[0] indicates to activate or turn off the
2413 * reception of CDMA Broadcast SMS, 0-1,
2414 * 0 - Activate, 1 - Turn off
2416 * "response" is NULL
2420 * RADIO_NOT_AVAILABLE
2424 #define RIL_REQUEST_CDMA_BROADCAST_ACTIVATION 94
2427 * RIL_REQUEST_CDMA_SUBSCRIPTION
2429 * Request the device MDN / H_SID / H_NID.
2431 * The request is only allowed when CDMA subscription is available. When CDMA
2432 * subscription is changed, application layer should re-issue the request to
2433 * update the subscription information.
2435 * If a NULL value is returned for any of the device id, it means that error
2436 * accessing the device.
2438 * "response" is const char **
2439 * ((const char **)response)[0] is MDN if CDMA subscription is available
2440 * ((const char **)response)[1] is H_SID (Home SID) if CDMA subscription is available
2441 * ((const char **)response)[2] is H_NID (Home SID) if CDMA subscription is available
2445 * RIL_E_SUBSCRIPTION_NOT_AVAILABLE
2448 #define RIL_REQUEST_CDMA_SUBSCRIPTION 99
2451 * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
2453 * Stores a CDMA SMS message to RUIM memory.
2455 * "data" is RIL_CDMA_SMS_WriteArgs *
2457 * "response" is int *
2458 * ((const int *)response)[0] is the record index where the message is stored.
2462 * RADIO_NOT_AVAILABLE
2466 #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 100
2469 * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
2471 * Deletes a CDMA SMS message from RUIM memory.
2474 * ((int *)data)[0] is the record index of the message to delete.
2476 * "response" is NULL
2480 * RADIO_NOT_AVAILABLE
2484 #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 101
2487 * RIL_REQUEST_DEVICE_IDENTITY
2489 * Request the device ESN / MEID / IMEI / IMEISV.
2491 * The request is always allowed and contains GSM and CDMA device identity;
2492 * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and
2493 * RIL_REQUEST_GET_IMEISV.
2495 * If a NULL value is returned for any of the device id, it means that error
2496 * accessing the device.
2498 * When CDMA subscription is changed the ESN/MEID may change. The application
2499 * layer should re-issue the request to update the device identity in this case.
2501 * "response" is const char **
2502 * ((const char **)response)[0] is IMEI if GSM subscription is available
2503 * ((const char **)response)[1] is IMEISV if GSM subscription is available
2504 * ((const char **)response)[2] is ESN if CDMA subscription is available
2505 * ((const char **)response)[3] is MEID if CDMA subscription is available
2509 * RADIO_NOT_AVAILABLE
2512 #define RIL_REQUEST_DEVICE_IDENTITY 102
2516 /***********************************************************************/
2519 #define RIL_UNSOL_RESPONSE_BASE 1000
2522 * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
2524 * Indicate when value of RIL_RadioState has changed.
2526 * Callee will invoke RIL_RadioStateRequest method on main thread
2531 #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
2535 * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
2537 * Indicate when call state has changed
2539 * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
2543 * Response should be invoked on, for example,
2544 * "RING", "BUSY", "NO CARRIER", and also call state
2545 * transitions (DIALING->ALERTING ALERTING->ACTIVE)
2547 * Redundent or extraneous invocations are tolerated
2549 #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
2553 * RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
2555 * Called when network state, operator name, or GPRS state has changed
2556 * Basically on, +CREG and +CGREG
2558 * Callee will invoke the following requests on main thread:
2560 * RIL_REQUEST_REGISTRATION_STATE
2561 * RIL_REQUEST_GPRS_REGISTRATION_STATE
2562 * RIL_REQUEST_OPERATOR
2566 * FIXME should this happen when SIM records are loaded? (eg, for
2569 #define RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED 1002
2572 * RIL_UNSOL_RESPONSE_NEW_SMS
2574 * Called when new SMS is received.
2576 * "data" is const char *
2577 * This is a pointer to a string containing the PDU of an SMS-DELIVER
2578 * as an ascii string of hex digits. The PDU starts with the SMSC address
2579 * per TS 27.005 (+CMT:)
2581 * Callee will subsequently confirm the receipt of thei SMS with a
2582 * RIL_REQUEST_SMS_ACKNOWLEDGE
2584 * No new RIL_UNSOL_RESPONSE_NEW_SMS
2585 * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
2586 * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
2589 #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
2592 * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
2594 * Called when new SMS Status Report is received.
2596 * "data" is const char *
2597 * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
2598 * as an ascii string of hex digits. The PDU starts with the SMSC address
2599 * per TS 27.005 (+CDS:).
2601 * Callee will subsequently confirm the receipt of the SMS with a
2602 * RIL_REQUEST_SMS_ACKNOWLEDGE
2604 * No new RIL_UNSOL_RESPONSE_NEW_SMS
2605 * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
2606 * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
2609 #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
2612 * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
2614 * Called when new SMS has been stored on SIM card
2616 * "data" is const int *
2617 * ((const int *)data)[0] contains the slot index on the SIM that contains
2621 #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
2626 * Called when a new USSD message is received.
2628 * "data" is const char **
2629 * ((const char **)data)[0] points to a type code, which is
2630 * one of these string values:
2631 * "0" USSD-Notify -- text in ((const char **)data)[1]
2632 * "1" USSD-Request -- text in ((const char **)data)[1]
2633 * "2" Session terminated by network
2634 * "3" other local client (eg, SIM Toolkit) has responded
2635 * "4" Operation not supported
2636 * "5" Network timeout
2638 * The USSD session is assumed to persist if the type code is "1", otherwise
2639 * the current session (if any) is assumed to have terminated.
2641 * ((const char **)data)[1] points to a message string if applicable, which
2642 * should always be in UTF-8.
2644 #define RIL_UNSOL_ON_USSD 1006
2645 /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006 */
2648 * RIL_UNSOL_ON_USSD_REQUEST
2650 * Obsolete. Send via RIL_UNSOL_ON_USSD
2652 #define RIL_UNSOL_ON_USSD_REQUEST 1007
2656 * RIL_UNSOL_NITZ_TIME_RECEIVED
2658 * Called when radio has received a NITZ time message
2660 * "data" is const char * pointing to NITZ time string
2661 * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
2663 #define RIL_UNSOL_NITZ_TIME_RECEIVED 1008
2666 * RIL_UNSOL_SIGNAL_STRENGTH
2668 * Radio may report signal strength rather han have it polled.
2670 * "data" is an "int *"
2671 * ((int *)response)[0] is received signal strength (0-31, 99)
2672 * ((int *)response)[1] is bit error rate (0-7, 99)
2673 * as defined in TS 27.007 8.5
2674 * Other values (eg -1) are not legal
2676 #define RIL_UNSOL_SIGNAL_STRENGTH 1009
2680 * RIL_UNSOL_DATA_CALL_LIST_CHANGED
2682 * Indicate a PDP context state has changed, or a new context
2683 * has been activated or deactivated
2684 * replaces RIL_UNSOL_PDP_CONTEXT_LIST_CHANGED
2686 * "data" is an array of RIL_Data_Call_Response identical to that
2687 * returned by RIL_REQUEST_DATA_CALL_LIST
2689 * See also: RIL_REQUEST_DATA_CALL_LIST
2692 #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010
2695 * RIL_UNSOL_SUPP_SVC_NOTIFICATION
2697 * Reports supplementary service related notification from the network.
2699 * "data" is a const RIL_SuppSvcNotification *
2703 #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
2706 * RIL_UNSOL_STK_SESSION_END
2708 * Indicate when STK session is terminated by SIM.
2712 #define RIL_UNSOL_STK_SESSION_END 1012
2715 * RIL_UNSOL_STK_PROACTIVE_COMMAND
2717 * Indicate when SIM issue a STK proactive command to applications
2719 * "data" is a const char * containing SAT/USAT proactive command
2720 * in hexadecimal format string starting with command tag
2723 #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
2726 * RIL_UNSOL_STK_EVENT_NOTIFY
2728 * Indicate when SIM notifies applcations some event happens.
2729 * Generally, application does not need to have any feedback to
2730 * SIM but shall be able to indicate appropriate messages to users.
2732 * "data" is a const char * containing SAT/USAT commands or responses
2733 * sent by ME to SIM or commands handled by ME, in hexadecimal format string
2734 * starting with first byte of response data or command tag
2737 #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
2740 * RIL_UNSOL_STK_CALL_SETUP
2742 * Indicate when SIM wants application to setup a voice call.
2744 * "data" is const int *
2745 * ((const int *)data)[0] contains timeout value (in milliseconds)
2747 #define RIL_UNSOL_STK_CALL_SETUP 1015
2750 * RIL_UNSOL_SIM_SMS_STORAGE_FULL
2752 * Indicates that SMS storage on the SIM is full. Sent when the network
2753 * attempts to deliver a new SMS message. Messages cannot be saved on the
2754 * SIM until space is freed. In particular, incoming Class 2 messages
2760 #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
2763 * RIL_UNSOL_SIM_REFRESH
2765 * Indicates that file(s) on the SIM have been updated, or the SIM
2766 * has been reinitialized.
2768 * "data" is an int *
2769 * ((int *)data)[0] is a RIL_SimRefreshResult.
2770 * ((int *)data)[1] is the EFID of the updated file if the result is
2771 * SIM_FILE_UPDATE or NULL for any other result.
2773 * Note: If the radio state changes as a result of the SIM refresh (eg,
2774 * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
2777 #define RIL_UNSOL_SIM_REFRESH 1017
2780 * RIL_UNSOL_CALL_RING
2782 * Ring indication for an incoming call (eg, RING or CRING event).
2786 #define RIL_UNSOL_CALL_RING 1018
2789 * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
2791 * Indicates that SIM state changes.
2793 * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread
2797 #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019
2800 * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
2802 * Called when new CDMA SMS is received
2804 * "data" is const RIL_CDMA_SMS_Message *
2806 * Callee will subsequently confirm the receipt of the SMS with
2807 * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
2809 * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until
2810 * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received
2813 #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020
2816 * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS
2818 * Called when new Broadcast SMS is received
2820 * "data" is const char * of 88 bytes which indicates each page
2821 * of a CBS Message sent to the MS by the BTS as coded in 3GPP
2822 * 23.041 Section 9.4.1.1
2825 #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021
2828 * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL
2830 * Indicates that SMS storage on the RUIM is full. Messages
2831 * cannot be saved on the RUIM until space is freed.
2836 #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022
2839 * RIL_UNSOL_RESTRICTED_STATE_CHANGED
2841 * Indicates a restricted state change (eg, for Domain Specific Access Control).
2843 * Radio need send this msg after radio off/on cycle no matter it is changed or not.
2845 * "data" is an int *
2846 * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values.
2848 #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023
2852 /***********************************************************************/
2856 * RIL_Request Function pointer
2858 * @param request is one of RIL_REQUEST_*
2859 * @param data is pointer to data defined for that RIL_REQUEST_*
2860 * data is owned by caller, and should not be modified or freed by callee
2861 * @param t should be used in subsequent call to RIL_onResponse
2862 * @param datalen the length of data
2865 typedef void (*RIL_RequestFunc) (int request, void *data,
2866 size_t datalen, RIL_Token t);
2869 * This function should return the current radio state synchronously
2871 typedef RIL_RadioState (*RIL_RadioStateRequest)();
2874 * This function returns "1" if the specified RIL_REQUEST code is
2875 * supported and 0 if it is not
2877 * @param requestCode is one of RIL_REQUEST codes
2880 typedef int (*RIL_Supports)(int requestCode);
2883 * This function is called from a separate thread--not the
2884 * thread that calls RIL_RequestFunc--and indicates that a pending
2885 * request should be cancelled.
2887 * On cancel, the callee should do its best to abandon the request and
2888 * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
2890 * Subsequent calls to RIL_onRequestComplete for this request with
2891 * other results will be tolerated but ignored. (That is, it is valid
2892 * to ignore the cancellation request)
2894 * RIL_Cancel calls should return immediately, and not wait for cancellation
2896 * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007
2899 * @param t token wants to be canceled
2902 typedef void (*RIL_Cancel)(RIL_Token t);
2904 typedef void (*RIL_TimedCallback) (void *param);
2907 * Return a version string for your RIL implementation
2909 typedef const char * (*RIL_GetVersion) (void);
2912 int version; /* set to RIL_VERSION */
2913 RIL_RequestFunc onRequest;
2914 RIL_RadioStateRequest onStateRequest;
2915 RIL_Supports supports;
2916 RIL_Cancel onCancel;
2917 RIL_GetVersion getVersion;
2918 } RIL_RadioFunctions;
2923 * "t" is parameter passed in on previous call to RIL_Notification
2926 * If "e" != SUCCESS, then response can be null/is ignored
2928 * "response" is owned by caller, and should not be modified or
2931 * RIL_onRequestComplete will return as soon as possible
2933 void (*OnRequestComplete)(RIL_Token t, RIL_Errno e,
2934 void *response, size_t responselen);
2937 * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
2938 * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
2940 * "data" is owned by caller, and should not be modified or freed by callee
2943 void (*OnUnsolicitedResponse)(int unsolResponse, const void *data,
2947 * Call user-specifed "callback" function on on the same thread that
2948 * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
2949 * a relative time value at which the callback is invoked. If relativeTime is
2950 * NULL or points to a 0-filled structure, the callback will be invoked as
2954 void (*RequestTimedCallback) (RIL_TimedCallback callback,
2955 void *param, const struct timeval *relativeTime);
2960 * RIL implementations must defined RIL_Init
2961 * argc and argv will be command line arguments intended for the RIL implementation
2962 * Return NULL on error
2964 * @param env is environment point defined as RIL_Env
2965 * @param argc number of arguments
2966 * @param argv list fo arguments
2969 const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
2971 #else /* RIL_SHLIB */
2974 * Call this once at startup to register notification routine
2976 * @param callbacks user-specifed callback function
2978 void RIL_register (const RIL_RadioFunctions *callbacks);
2983 * RIL_onRequestComplete will return as soon as possible
2985 * @param t is parameter passed in on previous call to RIL_Notification
2987 * @param e error code
2988 * if "e" != SUCCESS, then response can be null/is ignored
2989 * @param response is owned by caller, and should not be modified or
2991 * @param responselen the length of response in byte
2993 void RIL_onRequestComplete(RIL_Token t, RIL_Errno e,
2994 void *response, size_t responselen);
2997 * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
2998 * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
2999 * "data" is owned by caller, and should not be modified or freed by callee
3000 * @param datalen the length of data in byte
3003 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
3008 * Call user-specifed "callback" function on on the same thread that
3009 * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
3010 * a relative time value at which the callback is invoked. If relativeTime is
3011 * NULL or points to a 0-filled structure, the callback will be invoked as
3014 * @param callback user-specifed callback function
3015 * @param param parameter list
3016 * @param relativeTime a relative time value at which the callback is invoked
3019 void RIL_requestTimedCallback (RIL_TimedCallback callback,
3020 void *param, const struct timeval *relativeTime);
3023 #endif /* RIL_SHLIB */
3029 #endif /*ANDROID_RIL_H*/